Web Analytics

agents

⭐ 11952 stars Traditional Chinese by wshobson

🌐 語言

Claude Code 子代理集合

一套專為 Claude Code 設計的 AI 專業子代理全面集合,提升開發流程並注入領域專業知識。

概覽

本倉庫包含 76 個專業子代理,擴展了 Claude Code 的功能。每個子代理均為特定領域專家,可依據情境自動啟用或根據需求明確呼叫。所有代理均根據任務複雜度配置專屬 Claude 模型,兼顧效能與成本效益。

可用子代理

開發與架構

語言專家

基礎建設與運維

品質與安全

數據與人工智慧

專業領域

文件化

商業與行銷

SEO 與內容優化

模型分配

所有 76 個子代理皆依任務複雜度配置專屬 Claude 模型:

🚀 Haiku(快速且具成本效益)- 15 個代理

模型: haiku

⚡ Sonnet(平衡效能)- 45 個代理

模型: sonnet

開發與語言:

基礎設施與運維: 品質與支援:

🧠 Opus(最高能力)- 15 個代理

模型: opus

安裝

這些子代理只需放置於 ~/.claude/agents/ 目錄下即可自動使用。

cd ~/.claude
git clone https://github.com/wshobson/agents.git

使用方法

自動調用

Claude Code 會根據任務情境和子代理的描述,自動委派給適當的子代理。

明確調用

在您的請求中提及子代理的名稱:
"Use the code-reviewer to check my recent changes"
"Have the security-auditor scan for vulnerabilities"
"Get the performance-engineer to optimize this bottleneck"

使用範例

單一代理任務

# Code quality and review
"Use code-reviewer to analyze this component for best practices"
"Have code-reviewer scrutinize these configuration changes"
"Have security-auditor check for OWASP compliance issues"

Development tasks

"Get backend-architect to design a user authentication API" "Use frontend-developer to create a responsive dashboard layout"

Infrastructure and operations

"Have devops-troubleshooter analyze these production logs" "Use cloud-architect to design a scalable AWS architecture" "Get network-engineer to debug SSL certificate issues" "Use database-admin to set up backup and replication"

Data and AI

"Get data-scientist to analyze this customer behavior dataset" "Use ai-engineer to build a RAG system for document search" "Have mlops-engineer set up MLflow experiment tracking"

Business and marketing

"Have business-analyst create investor deck with growth metrics" "Use content-marketer to write SEO-optimized blog post" "Get sales-automator to create cold email sequence" "Have customer-support draft FAQ documentation"

多代理工作流程

這些子代理可以無縫協作,若需更複雜的協調作業,您可以使用 Claude Code Commands 集合,該集合提供 52 個預先建構的斜線命令,可在高級工作流程中運用這些子代理。

# Feature development workflow
"Implement user authentication feature"

Automatically uses: backend-architect → frontend-developer → test-automator → security-auditor

Performance optimization workflow

"Optimize the checkout process performance"

Automatically uses: performance-engineer → database-optimizer → frontend-developer

Production incident workflow

"Debug high memory usage in production"

Automatically uses: incident-responder → devops-troubleshooter → error-detective → performance-engineer

Network connectivity workflow

"Fix intermittent API timeouts"

Automatically uses: network-engineer → devops-troubleshooter → performance-engineer

Database maintenance workflow

"Set up disaster recovery for production database"

Automatically uses: database-admin → database-optimizer → incident-responder

ML pipeline workflow

"Build end-to-end ML pipeline with monitoring"

Automatically uses: mlops-engineer → ml-engineer → data-engineer → performance-engineer

Product launch workflow

"Launch new feature with marketing campaign"

Automatically uses: business-analyst → content-marketer → sales-automator → customer-support

使用斜線指令的進階工作流程

若需更複雜的多子代理協作,請使用配套的 Commands 儲存庫

# Complex feature development (8+ subagents)
/full-stack-feature Build user dashboard with real-time analytics

Production incident response (5+ subagents)

/incident-response Database connection pool exhausted

ML infrastructure setup (6+ subagents)

/ml-pipeline Create recommendation engine with A/B testing

Security-focused implementation (7+ subagents)

/security-hardening Implement OAuth2 with zero-trust architecture

子代理格式

每個子代理都遵循以下結構:

---
name: subagent-name
description: When this subagent should be invoked
model: haiku  # Optional - specify which model to use (haiku/sonnet/opus)
tools: tool1, tool2  # Optional - defaults to all tools

System prompt defining the subagent's role and capabilities

模型配置

自 Claude Code v1.0.64 起,子代理可以指定應使用哪個 Claude 模型。這使得根據任務複雜度進行具成本效益的委派成為可能:

可用模型(依 Claude Code v1.0.64 的簡化命名): 若未指定模型,子代理將使用系統預設模型。

代理協作模式

Claude Code 會自動以以下常見模式協調代理:

序列工作流程

User Request → Agent A → Agent B → Agent C → Result

Example: "Build a new API feature" backend-architect → frontend-developer → test-automator → security-auditor

Parallel Execution

User Request → Agent A + Agent B (simultaneously) → Merge Results

Example: "Optimize application performance" performance-engineer + database-optimizer → Combined recommendations

條件分支

User Request → Analysis → Route to appropriate specialist

Example: "Fix this bug" debugger (analyzes) → Routes to: backend-architect OR frontend-developer OR devops-troubleshooter

審查與驗證

Primary Agent → Review Agent → Final Result

Example: "Implement payment processing" payment-integration → security-auditor → Validated implementation

何時使用哪個代理

🏗️ 規劃與架構

🔧 實作與開發

🛠️ 運維與維護

📊 分析與優化

🧪 品質保證

📚 文件化

💼 商業與策略

最佳實踐

🎯 任務分派

🔄 多代理工作流程

🎛️ 明確控制

📈 最佳化

貢獻方式

要新增一個子代理:

疑難排解

常見問題

代理未自動執行:

代理選擇不如預期: 多個代理給予相互衝突的建議: 代理似乎缺乏上下文:

尋求協助

若代理未如預期運作:

授權

本專案採用 MIT 授權條款 - 詳情請參閱 LICENSE 檔案。

進一步瞭解

--- Tranlated By Open Ai Tx | Last indexed: 2025-09-04 ---