Loading...
Loading...
Compare original and translation side by side
| Command | Purpose |
|---|---|
| Guided debugging workflow with evidence gathering and parallel investigation |
| 命令 | 用途 |
|---|---|
| 带证据收集和并行调查功能的引导式调试工作流 |
/debug [description of the bug]/debug [Bug描述]// Get network requests (look for duplicates, failures, timing)
mcp__claude-in-chrome__read_network_requests
// Get console logs (errors, warnings, debug output)
mcp__claude-in-chrome__read_console_messages
// Get page state
mcp__claude-in-chrome__read_page// 获取网络请求(检查重复请求、失败请求、请求时序)
mcp__claude-in-chrome__read_network_requests
// 获取控制台日志(错误、警告、调试输出)
mcp__claude-in-chrome__read_console_messages
// 获取页面状态
mcp__claude-in-chrome__read_pageTask(subagent_type="debugger", prompt="""
EVIDENCE: [paste network/console evidence]
Trace the execution path that leads to this bug. Find:
1. Where the bug originates
2. What triggers it
3. The exact line/function causing the issue
Focus on TRACING, not guessing.
""")Task(subagent_type="debugger", prompt="""
EVIDENCE: [粘贴网络/控制台证据]
追踪导致该Bug的执行路径。需找出:
1. Bug的起源位置
2. Bug的触发条件
3. 引发问题的具体代码行/函数
专注于追踪,而非猜测。
""")Task(subagent_type="code-reviewer", prompt="""
EVIDENCE: [paste evidence]
Review the relevant code for common bug patterns:
- React useCallback/useMemo dependency issues
- Stale closures
- Race conditions
- State update ordering
- Missing error handling
Find patterns that EXPLAIN the evidence.
""")Task(subagent_type="code-reviewer", prompt="""
EVIDENCE: [粘贴证据]
检查相关代码中常见的Bug模式:
- React useCallback/useMemo依赖项问题
- 过期闭包
- 竞态条件
- 状态更新顺序问题
- 缺失错误处理
找出能够解释证据的模式。
""")Task(subagent_type="Explore", prompt="""
EVIDENCE: [paste evidence]
Map all entry points that could trigger this behavior:
- All places [function] is called
- All event handlers involved
- All state updates that affect this
Find if something is being called MULTIPLE TIMES or from UNEXPECTED places.
""")Task(subagent_type="Explore", prompt="""
EVIDENCE: [粘贴证据]
映射所有可能触发该行为的入口点:
- [函数]的所有调用位置
- 涉及的所有事件处理器
- 影响该行为的所有状态更新
检查是否存在函数被多次调用或从意外位置调用的情况。
""")| Signal | Meaning |
|---|---|
| All 3 agree on root cause | High confidence - fix it |
| 2 agree, 1 different | Investigate the difference |
| All 3 different | Need more evidence |
| 信号 | 含义 |
|---|---|
| 3个Agent均认同根因 | 可信度高 - 直接修复 |
| 2个Agent认同,1个持不同结论 | 深入调查分歧点 |
| 3个Agent结论均不同 | 需要收集更多证据 |
| Agent | Finding |
|---|---|
| debugger | |
| code-reviewer | Same finding + explained React pattern causing it |
| Explore | Verified UI layer wasn't double-calling (ruled out) |
| Agent | 调查结果 |
|---|---|
| debugger | |
| code-reviewer | 与上述结论一致,并解释了引发该问题的React模式 |
| Explore | 验证UI层未触发重复调用(排除该可能性) |
sendMessagestate.messagessendMessagestate.messagesstateRefconst stateRef = useRef(state);
stateRef.current = state;
const sendMessage = useCallback(async (text) => {
// Use stateRef.current instead of state
const messages = stateRef.current.messages;
// ...
}, [/* state.messages removed */]);stateRefconst stateRef = useRef(state);
stateRef.current = state;
const sendMessage = useCallback(async (text) => {
// 使用stateRef.current替代state
const messages = stateRef.current.messages;
// ...
}, [/* 移除state.messages */]);statestate| Tool | Use For |
|---|---|
| See all fetch/XHR calls, duplicates, failures |
| Errors, warnings, debug logs |
| Current DOM state |
| Execute debug code in page context |
| 工具 | 用途 |
|---|---|
| 查看所有fetch/XHR调用、重复请求、失败请求 |
| 查看错误、警告、调试日志 |
| 查看当前DOM状态 |
| 在页面上下文执行调试代码 |