jnmetacode avatar

Systematic Debugging

This is a disciplined framework for debugging that forces you to find root causes before attempting fixes. It's built around four mandatory stages: root cause investigation, pattern analysis, hypothesis testing, and implementation. The iron rule is simple: no fix proposals until you complete stage one. It includes specific guardrails like adding diagnostic logging at component boundaries in multi-layer systems, tracing data flow backwards to find where bad values originate, and a hard stop after three failed fix attempts to question whether you have an architecture problem instead of a bug. The approach is opinionated about common shortcuts developers take under pressure, like skipping error messages or trying "just one quick fix" when time is tight.

skills.sh installs
1.2K
GitHub stars
8.5K
last updated
Aug 21, 2026

Install

$ npx -y skills add jnmetacode/superpowers-zh --skill systematic-debugging --agent claude-code

Installs into .claude/skills of the current project.

Files

系统化调试

概述

核心原则: 在尝试修复之前,务必先找到根本原因。只修症状就是失败。

敷衍走流程等于违背调试的精神。

铁律

不做根因调查,不许提修复方案

如果你还没完成第一阶段,就不能提出修复方案。

何时使用

用于任何技术问题:

  • 测试失败
  • 生产环境 bug
  • 异常行为
  • 性能问题
  • 构建失败
  • 集成问题

尤其在以下情况必须使用:

  • 时间紧迫(紧急情况最容易让人猜测式修复)
  • 觉得"一个小修改"就能搞定
  • 已经尝试了多种修复
  • 上一次修复没有生效
  • 你没有完全理解问题

以下情况也不要跳过:

  • 问题看起来很简单(简单的 bug 也有根本原因)
  • 你很赶时间(越急越容易返工)
  • 领导要求立刻修好(系统化调试比反复尝试更快)

四个阶段

你必须完成每个阶段后才能进入下一个。

第一阶段:根因调查

在尝试任何修复之前:

  1. 仔细阅读错误信息

    • 不要跳过错误或警告
    • 它们往往直接包含解决方案
    • 完整阅读堆栈跟踪
    • 记下行号、文件路径、错误码
  2. 稳定复现

    • 你能可靠地触发它吗?
    • 具体的复现步骤是什么?
    • 每次都能复现吗?
    • 如果无法复现 → 收集更多数据,不要猜测
  3. 检查近期变更

    • 什么变更可能导致了这个问题?
    • git diff、最近的提交
    • 新依赖、配置变更
    • 环境差异
  4. 在多组件系统中收集证据

    当系统有多个组件时(CI → 构建 → 签名,API → 服务 → 数据库):

    在提出修复方案之前,先添加诊断埋点:

    对每个组件边界:
      - 记录进入组件的数据
      - 记录离开组件的数据
      - 验证环境/配置的传递
      - 检查每一层的状态
    
    执行一次以收集证据,确定断裂点在哪里
    然后分析证据,定位故障组件
    然后针对该组件深入调查
    

    示例(多层系统):

    # 第 1 层:工作流
    echo "=== Secrets available in workflow: ==="
    echo "IDENTITY: $([ -n "${IDENTITY:-}" ] && echo SET || echo UNSET)"
    

Sponsors

Details

Repository
github.com/jnmetacode/superpowers-zh
Category
Debugging
First seen
Jun 3, 2026

More from jnmetacode/superpowers-zh

All 20

Recommended

More Debugging
1heygen-com avatarliveavatar-debugheygen-com/liveavatar-agent-skillsTroubleshoot and debug LiveAvatar integration issues. Use when the user's LiveAvatar integration isn't working, the avatar is silent, audio is garbled, sessions1.1Kskills.sh installs
2daymade avatarclaude-skills-troubleshootingdaymade/claude-code-skillsDiagnose and resolve Claude Code plugin and skill issues. This skill should be used when plugins are installed but not showing in available skills list, skills 960skills.sh installs
3new-silvermoon avatargradle-build-performancenew-silvermoon/awesome-android-agent-skillsDebug and optimize Android/Gradle build performance. Use when builds are slow, investigating CI/CD performance, analyzing build scans, or identifying compilatio809skills.sh installs
4daymade avatardebugging-network-issuesdaymade/claude-code-skillsEvidence-driven investigation for network, streaming, and protocol-layer bugs where symptoms don't match the obvious cause. Use when debugging connection resets710skills.sh installs
5yeachan-heo avatardebugyeachan-heo/oh-my-claudecodeDiagnose the current OMC session or repo state using logs, traces, state, and focused reproduction683skills.sh installs
6mohitmishra786 avatarrust-profilingmohitmishra786/low-level-dev-skillsRust profiling skill for performance analysis. Use when generating flamegraphs from Rust binaries, measuring monomorphization bloat with cargo-llvm-lines, analy673skills.sh installs