How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-zh:dispatching-parallel-agentsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
你将任务委托给拥有隔离上下文的专门代理。通过精心构造它们的指令和上下文,你确保它们保持专注并成功完成任务。它们绝不应继承你会话的上下文或历史——你构造它们所需的全部内容。这也为你自己的协调工作保留了上下文。
你将任务委托给拥有隔离上下文的专门代理。通过精心构造它们的指令和上下文,你确保它们保持专注并成功完成任务。它们绝不应继承你会话的上下文或历史——你构造它们所需的全部内容。这也为你自己的协调工作保留了上下文。
当你有多个不相关的失败(不同的测试文件、不同的子系统、不同的 bug)时,依次调查会浪费时间。每个调查都是独立的,可以并行进行。
核心原则: 每个独立的问题域分派一个代理。让它们并发工作。
digraph when_to_use {
"多个失败?" [shape=diamond];
"它们独立吗?" [shape=diamond];
"单个代理调查全部" [shape=box];
"每个问题域一个代理" [shape=box];
"能并行工作吗?" [shape=diamond];
"顺序代理" [shape=box];
"并行分派" [shape=box];
"多个失败?" -> "它们独立吗?" [label="是"];
"它们独立吗?" -> "单个代理调查全部" [label="否 - 相互关联"];
"它们独立吗?" -> "能并行工作吗?" [label="是"];
"能并行工作吗?" -> "并行分派" [label="是"];
"能并行工作吗?" -> "顺序代理" [label="否 - 共享状态"];
}
使用条件:
不要使用当:
按损坏的内容对失败分组:
每个域都是独立的——修复工具审批不会影响中止测试。
每个代理获得:
在同一次响应中发出所有三个子代理分派——它们并行运行:
Subagent (general-purpose): "Fix agent-tool-abort.test.ts failures"
Subagent (general-purpose): "Fix batch-completion-behavior.test.ts failures"
Subagent (general-purpose): "Fix tool-approval-race-conditions.test.ts failures"
# 三者并发运行。
一次响应中的多个分派调用 = 并行执行。每次响应一个 = 顺序执行。
当代理返回时:
好的代理提示是:
Fix the 3 failing tests in src/agents/agent-tool-abort.test.ts:
1. "should abort tool with partial output capture" - expects 'interrupted at' in message
2. "should handle mixed completed and aborted tools" - fast tool aborted instead of completed
3. "should properly track pendingToolCount" - expects 3 results but gets 0
These are timing/race condition issues. Your task:
1. Read the test file and understand what each test verifies
2. Identify root cause - timing issues or actual bugs?
3. Fix by:
- Replacing arbitrary timeouts with event-based waiting
- Fixing bugs in abort implementation if found
- Adjusting test expectations if testing changed behavior
Do NOT just increase timeouts - find the real issue.
Return: Summary of what you found and what you fixed.
❌ 太宽泛: "修复所有测试" - 代理会迷失 ✅ 具体: "修复 agent-tool-abort.test.ts" - 聚焦范围
❌ 无上下文: "修复竞态条件" - 代理不知道在哪里 ✅ 有上下文: 粘贴错误消息和测试名称
❌ 无约束: 代理可能重构一切 ✅ 有约束: "不要修改生产代码" 或 "只修复测试"
❌ 输出模糊: "修好它" - 你不知道改了什么 ✅ 具体: "返回根因和变更总结"
相关失败: 修复一个可能修复其他 - 先一起调查 需要完整上下文: 理解需要看整个系统 探索性调试: 你还不知道什么坏了 共享状态: 代理会互相干扰(编辑相同文件、使用相同资源)
场景: 重大重构后 3 个文件中 6 个测试失败
失败:
决策: 独立域——中止逻辑与批处理完成与竞态条件相互独立
分派:
Agent 1 → Fix agent-tool-abort.test.ts
Agent 2 → Fix batch-completion-behavior.test.ts
Agent 3 → Fix tool-approval-race-conditions.test.ts
结果:
集成: 所有修复独立,无冲突,完整套件通过
节省时间: 3 个问题并行解决 vs 顺序解决
代理返回后:
来自调试会话(2025-10-03):
npx claudepluginhub sametrouble/superpowers-zh --plugin superpowers-zhCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.