name: 重现bug description: 使用日志、控制台检查和浏览器截图重现和调查bug
参数
[GitHub issue 编号]
重现 Bug 命令
查看 github issue #$参数 并阅读问题描述和评论。
第一阶段:日志调查
并行运行以下代理来调查bug:
- 任务 rails-console-explorer(issue_description)
- 任务 appsignal-log-investigator(issue_description)
思考代码库中可能出错的地方。寻找可以查看的日志输出。
再次运行这些代理以查找任何有助于重现bug的日志。
持续运行这些代理,直到对情况有清晰了解。
第二阶段:使用 Playwright 可视化重现
如果bug与UI相关或涉及用户流程,使用Playwright进行可视化重现:
步骤1:验证服务器是否正在运行
mcp__plugin_compound-engineering_pw__browser_navigate({ url: "http://localhost:3000" })
mcp__plugin_compound-engineering_pw__browser_snapshot({})
如果服务器未运行,通知用户启动 bin/dev。
步骤2:导航到受影响区域
根据问题描述,导航到相关页面:
mcp__plugin_compound-engineering_pw__browser_navigate({ url: "http://localhost:3000/[affected_route]" })
mcp__plugin_compound-engineering_pw__browser_snapshot({})
步骤3:捕获截图
在重现bug的每个步骤中截图:
mcp__plugin_compound-engineering_pw__browser_take_screenshot({ filename: "bug-[issue]-step-1.png" })
步骤4:遵循用户流程
从问题中精确重现步骤:
-
阅读问题的重现步骤
-
使用Playwright执行每个步骤:
browser_click用于点击元素browser_type用于填写表单browser_snapshot查看当前状态browser_take_screenshot捕获证据
-
检查控制台错误:
mcp__plugin_compound-engineering_pw__browser_console_messages({ level: "error" })
步骤5:捕获bug状态
当重现bug时:
- 截图bug状态
- 捕获控制台错误
- 记录触发bug的精确步骤
mcp__plugin_compound-engineering_pw__browser_take_screenshot({ filename: "bug-[issue]-reproduced.png" })
第三阶段:记录发现
参考收集:
- [ ] 使用具体文件路径记录所有研究发现(例如,
app/services/example_service.rb:42) - [ ] 包括显示bug重现的截图
- [ ] 列出任何控制台错误
- [ ] 记录精确的重现步骤
第四阶段:报告
在问题中添加评论,包括:
- 发现 - 你发现的关于原因的信息
- 重现步骤 - 已验证的精确重现步骤
- 截图 - bug的视觉证据(上传捕获的截图)
- 相关代码 - 文件路径和行号
- 建议修复 - 如果你有一个