Web Analytics

agents

⭐ 11952 stars Simplified 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 ---