Skip to content
Development
Skill

/systematic-debugging

Four-phase debugging framework for any technical issue. Use when encountering bugs, errors, or unexpected behavior. Prevents random fix attempts.

From plugin
spellbook
289111 skills7 agents2 commands

Claude Code

$ npx -y skills add majiayu000/spellbook --skill systematic-debugging --agent claude-code

SKILL.md

systematic-debugging.SKILL.md
name: systematic-debugging
description: Four-phase debugging framework for any technical issue. Use when encountering bugs, errors, or unexpected behavior. Prevents random fix attempts.

Systematic Debugging

> From [obra/superpowers](https://github.com/obra/superpowers)

Core Principle

**NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST**

Random fixes create new bugs. Understanding must precede solutions.

The Four Phases

Phase 1: Root Cause Investigation

Before ANY fix attempt:

1. **Read error messages carefully**

  • Full stack traces
  • Error codes and descriptions
  • Timestamps and context

2. **Reproduce consistently**

  • Document exact steps
  • Identify triggers
  • Note environmental factors

3. **Check recent changes**

  • Recent commits
  • Dependency updates
  • Configuration changes

4. **Gather diagnostic evidence**

  • Add logging at component boundaries
  • Check input/output at each step
  • Trace data flow backward to source

Phase 2: Pattern Analysis

1. **Find similar working code**

  • Search codebase for related functionality
  • Look for existing patterns

2. **Read reference implementations completely**

  • Don't skim
  • Understand the full context

3. **Compare working vs broken**

  • What's different?
  • What assumptions changed?

4. **Understand dependencies**

  • What does this code rely on?
  • What relies on this code?

Phase 3: Hypothesis and Testing

1. **Form a SINGLE, SPECIFIC hypothesis**

  • "The error occurs because X"
  • Not "maybe it's A or B or C"

2. **Test with minimal changes**

  • One variable at a time
  • Don't combine fixes

3. **Accept results**

  • If hypothesis is wrong, form new one
  • Don't force-fit evidence

4. **Ask for help when stuck**

  • After genuine investigation
  • With evidence gathered

Phase 4: Implementation

1. **Create a failing test case FIRST**

  • Reproduces the bug
  • Will pass when fixed

2. **Implement SINGLE fix**

  • Address root cause only
  • Don't fix "nearby" issues

3. **Verify the fix**

  • Test case passes
  • No regressions
  • Issue is resolved

The 3-Fix Rule

**If ≥3 fixes fail: STOP and question the architecture**

Three consecutive failed fixes signal:

  • Architectural problem, not implementation bug
  • Wrong mental model of the system
  • Need to step back and reassess

Do NOT attempt more fixes. Reassess the approach.

Critical Red Flags

STOP and restart investigation if you:

  • Propose fixes before understanding the problem
  • Add multiple changes simultaneously
  • Skip investigation for "quick fixes"
  • Make 3+ failed fix attempts
  • Say "let's just try this"

Debugging Checklist

## Investigation
- [ ] Read full error message/stack trace
- [ ] Reproduced issue consistently
- [ ] Checked recent changes
- [ ] Added diagnostic logging
- [ ] Traced data flow

## Analysis
- [ ] Found similar working code
- [ ] Compared working vs broken
- [ ] Understood all dependencies

## Hypothesis
- [ ] Formed single specific hypothesis
- [ ] Tested with minimal change
- [ ] Accepted results honestly

## Fix
- [ ] Created failing test case
- [ ] Implemented single fix
- [ ] Verified fix works
- [ ] No regressions

Example Workflow

Issue: User login fails silently

Phase 1 - Investigation:
- Error: "null reference at AuthService.validate()"
- Reproduced: happens with specific user emails
- Recent change: added email normalization

Phase 2 - Analysis:
- Working logins use lowercase emails
- Failing logins have mixed case
- Normalization strips @ symbol incorrectly

Phase 3 - Hypothesis:
- "Email normalization regex is wrong"
- Test: log email before/after normalization
- Result: "Test@Example.com" → "testexample.com"
- Confirmed!

Phase 4 - Fix:
- Write test: normalize("Test@Example.com") == "test@example.com"
- Fix regex to preserve @
- Verify: test passes, logins work
Read more
@majiayu000
Ships withspellbook

Cross-runtime skills for Claude Code, Codex, and multi-agent workflows.

289111 skills7 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
289
Star history of majiayu000/spellbook on GitHub, a chart by star-history.com

Other skills on spellbook.

idea-analogist

idea-analogist

想法群聊室 — 类比者角色。被 idea-team 主编排器调用,或用户单独说"类比一下"、"别的行业有没有"、"yes-and 扩展"、"X 让你想到什么"、"跨界启示"时触发。**专门做跨界类比 + yes-and…

idea-devils-advocate

idea-devils-advocate

想法群聊室 — 反方角色。被 idea-team 主编排器调用,或用户单独说"反方意见"、"挑这个想法的刺"、"为什么会失败"、"找漏洞 / 反例"、"devil's…

idea-research

idea-research

想法群聊室 — 调研员角色。被 idea-team 主编排器调用,或用户单独说"调研一下 X"、"X 的现状/竞品/数据"、"找 2026 数据"、"事实底"时触发。**用 WebSearch 拉真实 2026…

idea-team

idea-team

想法群聊室主持人 — 把一句话想法丢给多角色 AI 团队(调研员/反方/类比者)做查漏补缺。每个角色有自己的 voice,他们互相 @ 接话;你随时插话。**这是创意扩展工具,不打分、不否决、不堵路**。Use when…

idea-to-product

idea-to-product

端到端产品教练 — 把一句话想法走到 PRD + 可点击 HTML 原型。会顶嘴、强制砍功能、用 Nielsen + Norman 做友好性硬检。Use when user 说"我有一个想法"、"想做一个产品"、"做 MVP"、"写…

app-ui-design

app-ui-design

Mobile app UI design expert for iOS and Android. Use when designing app interfaces, creating design systems, ensuring…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc11d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about systematic-debugging.

Which coding agents can use systematic-debugging?
systematic-debugging installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.