首页 全部提示词 Coding

用复现代理进行测试驱动缺陷排查

Test-Driven Bug Hunting With Reproduction Agents

文本 @ilker 278 字符 在 prompts.chat 查看 译文有问题?

中文译文

Bug 报告:${bug}。遵循以下严格流程:阶段 1(复现):编写基于 mock 的失败测试,精确复现所报告的场景——此时不要编辑任何生产代码。向我展示失败的测试输出。阶段 2(假设):列出所有可能的根本原因,按可能性排序,并通过 Grep/Read 从代码库中给出证据。阶段 3(并行修复):通过 Task 工具为排名前 3 的每个假设各派生一个子代理;每个代理在单独的 git worktree/分支上修复其假设,并报告失败的测试现在是否通过,以及完整测试套件是否保持绿色。阶段 4(综合):推荐合并哪个修复以及为什么,然后提交。拒绝跳过任何阶段。

English original

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.