Debugging
БесплатноБез исполняемых скриптовНе проверенUse when encountering any bug, test failure, or unexpected behavior, BEFORE proposing fixes. Enforces a four-phase root-cause investigation (root cause…
от carolz1455 установок в других каталогахОб этом скилле
Systematic Debugging / 系统化调试
A four-phase discipline for finding the root cause of any bug before attempting fixes. / 在尝试修复前,用四阶段纪律找到任何 Bug 的根因。
The Iron Law / 铁律
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
没有根因调查,就不能修复。
If you haven't completed Phase 1, you cannot propose fixes. Symptom fixes are failure. / 如果没完成 Phase 1,就不能提修复。症状修复 = 失败。
Violating the letter of this process is violating the spirit of debugging. / 违反字面也违反精神。
When to use / 何时使用
Use for ANY technical issue: / 任何技术问题都用:
- Test failures / 测试失败
- Bugs in production / 生产 Bug
- Unexpected behavior / 意外行为
- Performance problems / 性能问题
- Build failures / 构建失败
- Integration issues / 集成问题
- User says "bug", "broken", "not working", "why", "出错", "挂了", "失败", "有问题" / 用户说 "bug"、"broken"、"not working"、"why"、"出错"、"挂了"、"失败"、"有问题"
Use this ESPECIALLY when / 尤其在这些情况:
- Under time pressure (emergencies make guessing tempting) / 时间压力(紧急让人想猜)
- "Just one quick fix" seems obvious / 「就一个小修复」看起来明显
- You've already tried multiple fixes / 已试过多个修复
- Previous fix didn't work / 上次修复没生效
- You don't fully understand the issue / 没完全理解问题
Don't skip when / 不要跳过:
- Issue seems simple (simple bugs have root causes too) / 问题看起来简单(简单 Bug 也有根因)
- You're in a hurry (rushing guarantees rework) / 你赶时间(赶时间保证返工)
- Manager wants it fixed NOW (systematic is faster than thrashing) / 经理要立刻修(系统化比瞎试更快)
The Four Phases / 四阶段
You MUST complete each phase before proceeding to the next. / 必须按顺序完成每个阶段。
Phase 1: Root Cause Investigation / 根因调查
BEFORE attempting ANY fix / 尝试任何修复之前:
1.1 Read error messages carefully / 仔细读错误信息
- Don't skip past errors or warnings / 不要跳过错误或警告
- They often contain the exact solution / 它们常常包含精确解法
- Read stack traces completely / 完整读 stack trace
- Note line numbers, file paths, error codes / 注意行号、文件路径、错误码
1.2 Reproduce consistently / 稳定复现
- Can you trigger it reliably? / 能稳定触发吗?
- What are the exact steps? / 精确步骤是什么?
- Does it happen every time? / 每次都发生吗?
- If not reproducible → gather more data, don't guess / 如果不能复现 → 收集更多数据,别猜
1.3 Check recent changes / 检查最近变更
- What changed that could cause this? / 什么变更可能引发?
git log --since="2 weeks ago" --oneline/ git loggit diff HEAD~10 -- path/to/file/ git diff- New dependencies, config changes / 新依赖、配置变更
- Environmental differences / 环境差异
1.4 Gather evidence in multi-component systems / 多组件系统收集证据
WHEN system has multiple components (CI → build → signing, API → service → database) / 当系统有多组件:
BEFORE proposing fixes, add diagnostic instrumentation / 提修复之前,加诊断埋点:
For EACH component boundary:
- Log what data enters component
- Log what data exits component
- Verify environment/config propagation
- Check state at each layer
Run once to gather evidence showing WHERE it breaks
THEN analyze evidence to identify failing component
THEN investigate that specific component
Example (CI → build → signing pipeline) / 示例(CI → 构建 → 签名流水线):
# Layer 1: Workflow / 工作流
echo "=== Secrets available in workflow: ==="
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
# Layer 2: Build script / 构建脚本
echo "=== Env vars in build script: ==="
env | grep IDENTITY || echo "IDENTITY not in environment"
# Layer 3a: macOS keychain / macOS 钥匙串
echo "=== macOS keychain state: ==="
security list-keychains
security find-identity -v
# Layer 3b: Windows certificate store / Windows 证书存储
echo "=== Windows certificate store: ==="
certutil -store My
# Layer 3c: Linux GPG / Linux GPG
echo "=== Linux GPG keys: ==="
gpg --list-secret-keys
# Layer 4: Actual signing / 实际签名
codesign --sign "$IDENTITY" --verbose=4 "$APP" # macOS
signtool sign /fd SHA256 /a "$APP.exe" # Windows
gpg --detach-sign --armor "$APP.tar.gz" # Linux
This reveals: which layer fails. / 这揭示:哪一层挂了。
1.5 Trace data flow / 追踪数据流
WHEN error is deep in call stack / 当错误在调用栈深处:
Backward trace technique: / 反向追踪技术:
- Where does bad value originate? / 错误值从何而来?
- What called this with bad value? / 谁用错误值调用了它?
- Keep tracing up until you find the source / 继续往上追直到找到源
- Fix at source, not at symptom / 在源头修,不要在症状
Phase 2: Pattern Analysis / 模式分析
Find the pattern before fixing / 修复前先找模式:
2.1 Find working examples / 找到工作中的例子
- Locate similar working code in same codebase / 在同一代码库找相似工作中代码
- What works that's similar to what's broken? / 什么工作中代码和坏掉的相似?
2.2 Compare against references / 与参考实现对比
- If implementing pattern, read reference implementation COMPLETELY / 如果实现模式,完整读参考实现
- Don't skim — read every line / 不要略读——每行都读
- Understand the pattern fully before applying / 完整理解模式再应用
2.3 Identify differences / 识别差异
- What's different between working and broken? / 工作中 vs坏的不同
- List every difference, however small / 列出每个差异,无论多小
- Don't assume "that can't matter" / 不要假设「那不重要」
2.4 Understand dependencies / 理解依赖
- What other components does this need? / 需要哪些其他组件?
Установить Debugging в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobBashFAQ
Что делает скилл Debugging?
Use when encountering any bug, test failure, or unexpected behavior, BEFORE proposing fixes. Enforces a four-phase root-cause investigation (root cause investigation, pattern analysis, hypothesis testing, implementation) before any code change. Iron law: no fixes without root cause investigation first.
Как установить скилл Debugging?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Debugging запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic