原生并行智能体
通过 Claude Code 内置 Agent 工具实现编排
概述
本技能通过 Claude Code 原生智能体系统协调多个专业智能体。与外部脚本不同,这种方式将所有编排保持在 Claude 的控制范围内。
何时使用编排
✅ 适合场景:
- 需要多个专业领域知识的复杂任务
- 从安全、性能和质量角度分析代码
- 综合审查(架构 + 安全 + 测试)
- 需要后端 + 前端 + 数据库协作的功能实现
❌ 不适合场景:
- 简单的单领域任务
- 快速修复或小改动
- 一个智能体就能搞定的任务
原生智能体调用
单个智能体
Use the security-auditor agent to review authentication
顺序链
First, use the explorer-agent to discover project structure.
Then, use the backend-specialist to review API endpoints.
Finally, use the test-engineer to identify test gaps.
带上下文传递
Use the frontend-specialist to analyze React components.
Based on those findings, have the test-engineer generate component tests.
恢复之前的工作
Resume agent [agentId] and continue with additional requirements.
编排模式
模式 1:综合分析
Agents: explorer-agent → [domain-agents] → synthesis
1. explorer-agent: Map codebase structure
2. security-auditor: Security posture
3. backend-specialist: API quality
4. frontend-specialist: UI/UX patterns
5. test-engineer: Test coverage
6. Synthesize all findings
模式 2:功能审查
Agents: affected-domain-agents → test-engineer
1. Identify affected domains (backend? frontend? both?)
2. Invoke relevant domain agents
3. test-engineer verifies changes
4. Synthesize recommendations
模式 3:安全审计
Agents: security-auditor → penetration-tester → synthesis
1. security-auditor: Configuration and code review
2. penetration-tester: Active vulnerability testing
3. Synthesize with prioritized remediation
可用智能体
| 智能体 |
专业领域 |
触发短语 |
orchestrator |
协调 |
"comprehensive", "multi-perspective" |
security-auditor |
安全 |
"security", "auth", "vulnerabilities" |
penetration-tester |
安全测试 |
"pentest", "red team", "exploit" |
backend-specialist |
后端 |
"API", "server", "Node.js", "Express" |
frontend-specialist |
前端 |
"React", "UI", "components", "Next.js" |
test-engineer |
测试 |
"tests", "coverage", "TDD" |
devops-engineer |
DevOps |
"deploy", "CI/CD", "infrastructure" |
database-architect |
数据库 |
"schema", "Prisma", "migrations" |
mobile-developer |
移动端 |
"React Native", "Flutter", "mobile" |
api-designer |
API 设计 |
"REST", "GraphQL", "OpenAPI" |
debugger |
调试 |
"bug", "error", "not working" |
explorer-agent |
发现 |
"explore", "map", "structure" |
documentation-writer |
文档 |
"write docs", "create README", "generate API docs" |
performance-optimizer |
性能 |
"slow", "optimize", "profiling" |
project-planner |
规划 |
"plan", "roadmap", "milestones" |
seo-specialist |
SEO |
"SEO", "meta tags", "search ranking" |
game-developer |
游戏开发 |
"game", "Unity", "Godot", "Phaser" |
Claude Code 内置智能体
这些与自定义智能体配合使用:
| 智能体 |
模型 |
用途 |
| Explore |
Haiku |
快速只读代码库搜索 |
| Plan |
Sonnet |
规划模式下的研究 |
| General-purpose |
Sonnet |
复杂的多步骤修改 |
使用 Explore 进行快速搜索,使用自定义智能体处理领域专业知识。
综合协议
所有智能体完成后,进行综合:
## Orchestration Synthesis
### Task Summary
[What was accomplished]
### Agent Contributions
| Agent | Finding |
|-------|---------|
| security-auditor | Found X |
| backend-specialist | Identified Y |
### Consolidated Recommendations
1. **Critical**: [Issue from Agent A]
2. **Important**: [Issue from Agent B]
3. **Nice-to-have**: [Enhancement from Agent C]
### Action Items
- [ ] Fix critical security issue
- [ ] Refactor API endpoint
- [ ] Add missing tests
最佳实践
- 可用智能体 - 可编排 17 个专业智能体
- 逻辑顺序 - 发现 → 分析 → 实现 → 测试
- 共享上下文 - 将相关发现传递给后续智能体
- 单一综合 - 一份统一报告,而非各自独立的输出
- 验证变更 - 代码修改始终包含 test-engineer
核心优势
- ✅ 单会话 - 所有智能体共享上下文
- ✅ AI 控制 - Claude 自主编排
- ✅ 原生集成 - 与内置 Explore、Plan 智能体配合
- ✅ 恢复支持 - 可继续之前的智能体工作
- ✅ 上下文传递 - 发现在智能体间流转
限制
- 仅在任务明确匹配上述范围时使用本技能。
- 不要将输出替代特定环境的验证、测试或专家审查。
- 如果缺少必需的输入、权限、安全边界或成功标准,停下来请求澄清。
1---2name: parallel-agents3description: 多智能体编排模式。当多个独立任务可以使用不同领域专业知识运行,或当综合分析需要多个视角时使用。当用户要求'并行智能体编排'时使用。4---56# 原生并行智能体78> 通过 Claude Code 内置 Agent 工具实现编排910## 概述1112本技能通过 Claude Code 原生智能体系统协调多个专业智能体。与外部脚本不同,这种方式将所有编排保持在 Claude 的控制范围内。1314## 何时使用编排1516✅ **适合场景**:17- 需要多个专业领域知识的复杂任务18- 从安全、性能和质量角度分析代码19- 综合审查(架构 + 安全 + 测试)20- 需要后端 + 前端 + 数据库协作的功能实现2122❌ **不适合场景**:23- 简单的单领域任务24- 快速修复或小改动25- 一个智能体就能搞定的任务2627---2829## 原生智能体调用3031### 单个智能体32```33Use the security-auditor agent to review authentication34```3536### 顺序链37```38First, use the explorer-agent to discover project structure.39Then, use the backend-specialist to review API endpoints.40Finally, use the test-engineer to identify test gaps.41```4243### 带上下文传递44```45Use the frontend-specialist to analyze React components.46Based on those findings, have the test-engineer generate component tests.47```4849### 恢复之前的工作50```51Resume agent [agentId] and continue with additional requirements.52```5354---5556## 编排模式5758### 模式 1:综合分析59```60Agents: explorer-agent → [domain-agents] → synthesis61621. explorer-agent: Map codebase structure632. security-auditor: Security posture643. backend-specialist: API quality654. frontend-specialist: UI/UX patterns665. test-engineer: Test coverage676. Synthesize all findings68```6970### 模式 2:功能审查71```72Agents: affected-domain-agents → test-engineer73741. Identify affected domains (backend? frontend? both?)752. Invoke relevant domain agents763. test-engineer verifies changes774. Synthesize recommendations78```7980### 模式 3:安全审计81```82Agents: security-auditor → penetration-tester → synthesis83841. security-auditor: Configuration and code review852. penetration-tester: Active vulnerability testing863. Synthesize with prioritized remediation87```8889---9091## 可用智能体9293| 智能体 | 专业领域 | 触发短语 |94|-------|-----------|-----------------|95| `orchestrator` | 协调 | "comprehensive", "multi-perspective" |96| `security-auditor` | 安全 | "security", "auth", "vulnerabilities" |97| `penetration-tester` | 安全测试 | "pentest", "red team", "exploit" |98| `backend-specialist` | 后端 | "API", "server", "Node.js", "Express" |99| `frontend-specialist` | 前端 | "React", "UI", "components", "Next.js" |100| `test-engineer` | 测试 | "tests", "coverage", "TDD" |101| `devops-engineer` | DevOps | "deploy", "CI/CD", "infrastructure" |102| `database-architect` | 数据库 | "schema", "Prisma", "migrations" |103| `mobile-developer` | 移动端 | "React Native", "Flutter", "mobile" |104| `api-designer` | API 设计 | "REST", "GraphQL", "OpenAPI" |105| `debugger` | 调试 | "bug", "error", "not working" |106| `explorer-agent` | 发现 | "explore", "map", "structure" |107| `documentation-writer` | 文档 | "write docs", "create README", "generate API docs" |108| `performance-optimizer` | 性能 | "slow", "optimize", "profiling" |109| `project-planner` | 规划 | "plan", "roadmap", "milestones" |110| `seo-specialist` | SEO | "SEO", "meta tags", "search ranking" |111| `game-developer` | 游戏开发 | "game", "Unity", "Godot", "Phaser" |112113---114115## Claude Code 内置智能体116117这些与自定义智能体配合使用:118119| 智能体 | 模型 | 用途 |120|-------|-------|---------|121| **Explore** | Haiku | 快速只读代码库搜索 |122| **Plan** | Sonnet | 规划模式下的研究 |123| **General-purpose** | Sonnet | 复杂的多步骤修改 |124125使用 **Explore** 进行快速搜索,使用**自定义智能体**处理领域专业知识。126127---128129## 综合协议130131所有智能体完成后,进行综合:132133```markdown134## Orchestration Synthesis135136### Task Summary137[What was accomplished]138139### Agent Contributions140| Agent | Finding |141|-------|---------|142| security-auditor | Found X |143| backend-specialist | Identified Y |144145### Consolidated Recommendations1461. **Critical**: [Issue from Agent A]1472. **Important**: [Issue from Agent B]1483. **Nice-to-have**: [Enhancement from Agent C]149150### Action Items151- [ ] Fix critical security issue152- [ ] Refactor API endpoint153- [ ] Add missing tests154```155156---157158## 最佳实践1591601. **可用智能体** - 可编排 17 个专业智能体1612. **逻辑顺序** - 发现 → 分析 → 实现 → 测试1623. **共享上下文** - 将相关发现传递给后续智能体1634. **单一综合** - 一份统一报告,而非各自独立的输出1645. **验证变更** - 代码修改始终包含 test-engineer165166---167168## 核心优势169170- ✅ **单会话** - 所有智能体共享上下文171- ✅ **AI 控制** - Claude 自主编排172- ✅ **原生集成** - 与内置 Explore、Plan 智能体配合173- ✅ **恢复支持** - 可继续之前的智能体工作174- ✅ **上下文传递** - 发现在智能体间流转175176## 限制177- 仅在任务明确匹配上述范围时使用本技能。178- 不要将输出替代特定环境的验证、测试或专家审查。179- 如果缺少必需的输入、权限、安全边界或成功标准,停下来请求澄清。