关于 parallel-agents
Native Parallel Agents 是通过 Claude Code 内置 Agent Tool 协调专门 Agent 的技能,支持分阶段分析、上下文传递和结果综合,适用于跨领域复杂任务。
主要功能
- 01在 Claude Code 中协调专门 Agent
- 02按顺序运行并传递上下文
- 03恢复先前的 Agent 工作
- 04将发现综合为一份报告
- 05使用内置及自定义 Agent 角色
适用场景
- 01从安全和质量角度审查代码
- 02在领域分析前梳理代码库
- 03协调前后端功能开发
- 04汇总审计结果并整理修复优先级
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ davila7/ claude-code-templates --skill parallel-agents安装后在 Claude Code 中输入/parallel-agents确认已加载。
详细介绍
原生并行 Agent
通过 Claude Code 内置的 Agent 工具进行编排
概述
此技能支持通过 Claude Code 的原生 Agent 系统协调多个专精 Agent。与外部脚本不同,这种方式将所有编排工作都交由 Claude 控制。
何时使用编排
✅ 适用场景:
- 需要多个专业领域知识的复杂任务
- 从安全性、性能和质量等角度分析代码
- 全面审查(架构 + 安全 + 测试)
- 需要后端 + 前端 + 数据库协作的功能实现
❌ 不适用场景:
- 简单的单领域任务
- 快速修复或小幅修改
- 一个 Agent 就能胜任的任务
原生 Agent 调用
单个 Agent
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
可用的 Agent
| Agent | 专长 | 触发短语 |
|---|---|---|
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 内置 Agent
这些 Agent 可与自定义 Agent 协同工作:
| Agent | 模型 | 用途 |
|---|---|---|
| Explore | Haiku | 快速只读代码库搜索 |
| Plan | Sonnet | 在计划模式下进行研究 |
| General-purpose | Sonnet | 执行复杂的多步骤修改 |
快速搜索时使用 Explore,需要领域专业知识时使用 自定义 Agent。
综合整理流程
所有 Agent 完成后,综合整理结果:
## 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
最佳实践
- 可用 Agent - 可编排 17 个专精 Agent
- 合理排序 - 探索 → 分析 → 实施 → 测试
- 共享上下文 - 将相关发现传递给后续 Agent
- 统一综合 - 输出一份统一报告,而非多份独立结果
- 验证修改 - 修改代码时,务必包含 test-engineer
主要优势
- ✅ 单一会话 - 所有 Agent 共享上下文
- ✅ AI 控制 - Claude 可自主进行编排
- ✅ 原生集成 - 可与内置的 Explore、Plan Agent 协同工作
- ✅ 支持恢复 - 可继续之前 Agent 的工作
- ✅ 传递上下文 - 各 Agent 之间可传递发现
评论
支持 Markdown