deep-debug by jezweb/claude-skills
npx skills add https://github.com/jezweb/claude-skills --skill deep-debug状态:生产就绪 最后更新:2026-02-03 依赖项:Chrome MCP 工具(可选)、调试器智能体、代码审查智能体
| 命令 | 用途 |
|---|---|
/debug | 引导式调试工作流,包含证据收集和并行调查 |
/debug [错误描述]
或自然调用:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
对于浏览器相关错误,使用 Chrome MCP 工具:
// 获取网络请求(查找重复、失败、时序问题)
mcp__claude-in-chrome__read_network_requests
// 获取控制台日志(错误、警告、调试输出)
mcp__claude-in-chrome__read_console_messages
// 获取页面状态
mcp__claude-in-chrome__read_page
对于后端错误,收集:
使用收集到的证据同时启动这些智能体:
Task(subagent_type="debugger", prompt="""
证据:[粘贴网络/控制台证据]
追踪导致此错误的执行路径。找出:
1. 错误起源位置
2. 触发因素
3. 导致问题的确切行/函数
专注于追踪,而非猜测。
""")
Task(subagent_type="code-reviewer", prompt="""
证据:[粘贴证据]
审查相关代码中的常见错误模式:
- React useCallback/useMemo 依赖问题
- 过时闭包
- 竞态条件
- 状态更新顺序
- 缺少错误处理
找出能解释证据的模式。
""")
Task(subagent_type="Explore", prompt="""
证据:[粘贴证据]
映射所有可能触发此行为的入口点:
- 调用 [函数] 的所有位置
- 涉及的所有事件处理器
- 影响此处的所有状态更新
查找是否有内容被多次调用或从未预期位置调用。
""")
智能体完成后,查找:
| 信号 | 含义 |
|---|---|
| 3 个智能体均同意根本原因 | 高置信度 - 修复它 |
| 2 个同意,1 个不同 | 调查差异 |
| 3 个均不同 | 需要更多证据 |
实施修复后,重新收集相同证据以确认:
网络面板显示对同一消息有 2 次 fetch 请求。
| 智能体 | 发现 |
|---|---|
| 调试器 | state.messages 在 useCallback 依赖项中导致回调函数重新创建 |
| 代码审查器 | 相同发现 + 解释了导致此问题的 React 模式 |
| 探索 | 验证 UI 层未进行双重调用(排除此原因) |
sendMessage 的 useCallback 在依赖数组中包含了 state.messages。每次状态更新都会重新创建回调函数,导致在 React 重新渲染期间发生重复调用。
使用 stateRef 访问当前状态而无需包含在依赖项中:
const stateRef = useRef(state);
stateRef.current = state;
const sendMessage = useCallback(async (text) => {
// 使用 stateRef.current 代替 state
const messages = stateRef.current.messages;
// ...
}, [/* state.messages 已移除 */]);
state 在 useCallback 依赖项中导致重新创建| 工具 | 用途 |
|---|---|
read_network_requests | 查看所有 fetch/XHR 调用、重复项、失败 |
read_console_messages | 错误、警告、调试日志 |
read_page | 当前 DOM 状态 |
javascript_tool | 在页面上下文中执行调试代码 |
每周安装量
162
代码仓库
GitHub 星标数
650
首次出现
2026年2月2日
安全审计
安装于
claude-code130
opencode110
gemini-cli103
replit98
codex97
cursor95
Status : Production Ready Last Updated : 2026-02-03 Dependencies : Chrome MCP tools (optional), debugger agent, code-reviewer agent
| Command | Purpose |
|---|---|
/debug | Guided debugging workflow with evidence gathering and parallel investigation |
/debug [description of the bug]
Or invoke naturally:
For browser-related bugs , use Chrome MCP tools:
// 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
For backend bugs , gather:
Launch these agents simultaneously with the gathered evidence:
Task(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="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="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.
""")
After agents complete, look for:
| 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 |
After implementing the fix, re-gather the same evidence to confirm:
Network tab showed 2 fetch requests for the same message.
| Agent | Finding |
|---|---|
| debugger | state.messages in useCallback deps causes callback recreation |
| code-reviewer | Same finding + explained React pattern causing it |
| Explore | Verified UI layer wasn't double-calling (ruled out) |
sendMessage useCallback had state.messages in dependency array. Every state update recreated the callback, causing duplicate calls during React re-renders.
Use stateRef to access current state without including in dependencies:
const 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 */]);
state in useCallback dependencies causing recreation| Tool | Use For |
|---|---|
read_network_requests | See all fetch/XHR calls, duplicates, failures |
read_console_messages | Errors, warnings, debug logs |
read_page | Current DOM state |
javascript_tool | Execute debug code in page context |
Weekly Installs
162
Repository
GitHub Stars
650
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
claude-code130
opencode110
gemini-cli103
replit98
codex97
cursor95
pua-ja AI助手:日本职场“詰め”文化驱动的主动式问题解决与任务执行方法论
531 周安装