A phased protocol for coding agents: reproduce a bug with failing tests, rank root causes, then fix the top hypotheses in parallel sub-agents on separate worktrees.
Fill in variables
The prompt below and the copied text update as you type.
Bug report: {{bug}}. Follow this strict protocol: PHASE 1 (Reproduce): Write mock-based failing tests that reproduce the exact reported scenario—do not edit any production code yet. Show me the failing test output. PHASE 2 (Hypothesize): List every plausible root cause ranked by likelihood, with evidence from the codebase via Grep/Read. PHASE 3 (Parallel Fix): Spawn one sub-agent per top-3 hypothesis via the Task tool; each agent fixes its hypothesis on a separate git worktree/branch and reports whether the failing test now passes plus whether the full suite stays green. PHASE 4 (Synthesize): Recommend which fix to merge and why, then commit. Refuse to skip phases.Bug report: {{bug}}. 严格遵循以下协议:第 1 阶段(复现):编写基于模拟的失败测试,复现所报告的确切场景——此时不得修改任何生产代码。向我展示失败测试的输出结果。第 2 阶段(假设):列出所有可能的根本原因,按可能性排序,并通过 Grep/Read 提供来自代码库的证据。第 3 阶段(并行修复):使用 Task 工具为前三大假设中的每一个生成一个子代理;每个代理在独立的 git worktree/分支上修复其对应的假设,并报告原先失败的测试是否现在通过,以及完整测试套件是否仍保持绿色。第 4 阶段(综合):推荐应合并哪一个修复及其原因,然后提交。拒绝跳过任何阶段。