Agent skill

Systematic Debugging

by SethGammon in SethGammon/Citadel

4-phase root cause analysis: observe, hypothesize, verify, fix.

MITAuto-check passedDevelopment

Install Systematic Debugging

skills CLI
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SethGammon/Citadel systematic-debugging --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SethGammon/Citadel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/systematic-debugging .claude/skills/systematic-debugging && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
systematic-debugging
GitHub stars
922
Token cost
~1.4k tokens
SKILL.md length
717 words
Files
3
Skills in repo
48
Repo updated
First seen
Licence
MIT

At a glance

4-phase root cause analysis: observe, hypothesize, verify, fix.

  • Works in 4 steps: OBSERVATION & REPRODUCTION → HYPOTHESIS & VERIFICATION → ROOT CAUSE ANALYSIS → …
  • Tasks that involve Debugging
  • SKILL.md covers Orientation, Protocol, Emergency Stop Rule and What This Skill Prevents, plus 4 more sections
  • Calls git

What it does

Systematic Debugging is an agent skill from SethGammon/Citadel. 4-phase root cause analysis: observe, hypothesize, verify, fix. Enforces investigation before any code changes. Emergency stop after 2 failed fixes. Prevents shotgun debugging and fix cascades.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `__benchmarks__/no-error-info.md` and `__benchmarks__/with-error.md`).

It sits in Development, covering Debugging and Root cause analysis. The repository describes itself as: The operating layer for Claude Code + OpenAI Codex: persistent project memory, intent routing, safety hooks, cost telemetry, and parallel agent fleets. The licence is MIT.

When your agent uses it

  • Tasks that involve Debugging
  • Tasks that involve Root cause analysis

Example prompts

  • “/systematic-debugging”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. OBSERVATION & REPRODUCTION
  2. HYPOTHESIS & VERIFICATION
  3. ROOT CAUSE ANALYSIS
  4. IMPLEMENTATION

What it can do on your machine

Read from SKILL.md and the folder at commit e41ff1d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Systematic Debugging loads about 1.4k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 717 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SethGammon/Citadel at commit e41ff1d, republished under its MIT licence (© SethGammon). 717 words, ~1,357 tokens.

Download SKILL.mdSave it as .claude/skills/systematic-debugging/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
systematic-debugging
description
4-phase root cause analysis: observe, hypothesize, verify, fix. Enforces investigation before any code changes. Emergency stop after 2 failed fixes. Prevents shotgun debugging and fix cascades.
license
MIT
user-invocable
true
auto-trigger
false
trigger_keywords
debug, root cause, diagnose, why is, investigate bug
last-updated
2026-06-24

/systematic-debugging — Root Cause Before Fix

Orientation

Use when: root cause is unknown and premature fixes keep failing -- enforces observe -> hypothesize -> verify before touching code. Don't use when: root cause is already known (use /marshal to implement the fix); the bug is shallow and the stack trace is enough (use /do).

Protocol

Phase 1: OBSERVATION & REPRODUCTION
  1. Read the error message, stack trace, or bug description
  2. Reproduce the issue:
    • If it's a type error: run typecheck and read the full error
    • If it's a runtime error: identify the triggering conditions
    • If it's a behavioral bug: document expected vs actual behavior
  3. Isolate the failing component/function:
    • What file? What function? What line?
    • What are the inputs when it fails?
    • Does it fail consistently or intermittently?

Output: A clear problem statement: "{Component} does {X} when it should do {Y}, triggered by {condition}"

Phase 2: HYPOTHESIS & VERIFICATION
  1. Formulate up to 3 hypotheses for WHY the bug exists:

    • H1: {most likely cause} — because {evidence}
    • H2: {second candidate} — because {evidence}
    • H3: {third candidate} — because {evidence}
  2. For each hypothesis, define a verification step:

    • Add a console.log / diagnostic read / breakpoint
    • Check a specific value at a specific point
    • DO NOT change any logic yet — only observe
  3. Run the verification:

    • Which hypothesis was confirmed?
    • Which were eliminated?
    • If none confirmed: formulate new hypotheses with the new information

CRITICAL: Do not skip this phase. Do not "just try" a fix. Verify first.

Phase 3: ROOT CAUSE ANALYSIS

Once a hypothesis is confirmed:

  1. Explain WHY the bug happens, not just WHERE:

    • Trace the data flow backward from the symptom to the source
    • Identify the specific incorrect assumption or logic error
    • Document the causal chain: "A calls B with X, B assumes X > 0, but A passes -1 when {condition}"
  2. Check for related occurrences:

    • Is this pattern used elsewhere? Could the same bug exist in similar code?
    • Is there a systemic issue (e.g., missing validation at a boundary)?

Output: Root cause statement: "The bug occurs because {cause}. This happens when {trigger}."

Phase 4: IMPLEMENTATION
  1. Write a failing test case that reproduces the bug (if test framework exists)
  2. Apply the minimal fix — change only what's necessary to resolve the root cause
  3. Verify the fix:
    • Test case now passes
    • Typecheck passes
    • No regressions in related functionality
  4. If the root cause analysis revealed related occurrences, fix those too

Emergency Stop Rule

If a fix fails TWICE: STOP.

Do not try a third guess. The root cause analysis was wrong. Either:

  • Go back to Phase 2 with new hypotheses
  • Ask the user for more context about the system's intended behavior
  • Check if there's a higher-level architectural issue

Three failed fixes in a row means you're guessing, not debugging.

Show full SKILL.md (265 more words)Show less

What This Skill Prevents

  • Shotgun debugging — changing random things until the error goes away
  • Symptom fixing — patching the output without understanding the cause
  • Fix cascades — one bad fix creating three new bugs
  • Silent regressions — fixing one path while breaking another

Contextual Gates

Disclosure: "Debugging [symptom]. Phases 1-3 read-only; will confirm before applying fixes in Phase 4." Reversibility: amber — Phase 4 applies targeted fixes to source files; undo with git checkout on modified files. Phases 1-3 are read-only. Trust gates:

  • Any: investigation (Phases 1-3).
  • Familiar (5+ sessions): applying fixes (Phase 4).

Quality Gates

  • A clear problem statement exists before any hypothesis is formed
  • At least one hypothesis was verified (not assumed) before the fix was written
  • The fix addresses the root cause, not just the symptom
  • Typecheck passes after the fix with no new errors
  • If related occurrences were found, they were fixed or documented

Fringe Cases

Bug is intermittent: Document the triggering conditions as precisely as possible. Reproduce it at least once before forming hypotheses. If it can't be reproduced, stop at Phase 1 and ask for more context.

Two fix attempts have already failed: Invoke the Emergency Stop Rule. Return to Phase 2 with new hypotheses. Do not try a third guess without re-reading the relevant code.

No test framework exists: Skip the "write a failing test" step in Phase 4. Verify the fix manually and document how to reproduce the original bug for future reference.

Error is in a dependency or generated file: Document the root cause but do not modify the dependency. Propose a workaround in the consuming code instead.

Exit Protocol

---HANDOFF---
- Bug: {problem statement}
- Root cause: {one-line cause}
- Fix: {what was changed}
- Verified: {typecheck + tests passing}
- Related: {any similar patterns found and fixed}
---

© SethGammon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/systematic-debugging of SethGammon/Citadel.

  • SKILL.md
  • __benchmarks__/no-error-info.md
  • __benchmarks__/with-error.md

Open the folder on GitHubat commit e41ff1d

Compare with similar skills

Systematic Debugging next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Systematic Debugging compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Systematic Debugging this skillSethGammon/Citadel922—~1.4kAutomated safety check: PassMIT
OpenLogi macOS Permissions TriageAprilNEA/OpenLogi23k—~2.5kAutomated safety check: NotesApache-2.0
Bug Finder for daisyUIsaadeghi/daisyui43k—~2.3kAutomated safety check: PassMIT
Root Cause Debugginggarrytan/gstack136k—~1.4kAutomated safety check: PassMIT
Graph-Based Bug Tracingtirth8205/code-review-graph32k1 repos~287Automated safety check: PassMIT
Systematic DebuggingChrisWiles/claude-code-showcase6.1k3 repos~1.2kAutomated safety check: PassNone

Similar skills

  • Decides whether an OpenLogi device problem on macOS is a privacy-permission (TCC) problem, using agent log lines, and says which identity needs which grant.

    23k GitHub stars~2.5k tokensUpdated 4 days ago
    DevelopmentAuto-check: notes
  • Bug Finder for daisyUI

    saadeghi/daisyui

    Investigates suspected bugs in the daisyUI monorepo through read-only analysis, then writes a decision-ready fix plan in tmp/bugs without changing any product code.

    43k GitHub stars~2.3k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Root Cause Debugging

    garrytan/gstack

    Investigates bugs, errors and stack traces in phases and requires a root-cause hypothesis to be confirmed before any fix is written.

    136k GitHub stars~1.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Graph-Based Bug Tracing

    tirth8205/code-review-graph

    Traces a bug through a code knowledge graph, following callers, callees and execution flow before opening source files, within a small token budget.

    32k GitHub starsUsed in 1 repo~287 tokens
    DevelopmentAuto-check passed
  • Systematic Debugging

    ChrisWiles/claude-code-showcase

    Applies a four-phase debugging routine that finds the root cause of a bug or failing test before any fix is written.

    6.1k GitHub starsUsed in 3 repos~1.2k tokens
    DevelopmentAuto-check passed
  • Debugging and Error Recovery

    addyosmani/agent-skills

    Applies a stop-the-line rule and a step-by-step triage when tests fail, builds break or something stops working, aiming at the root cause instead of guesses.

    102k GitHub starsUsed in 1 repo~2.6k tokens
    DevelopmentAuto-check passed

More from SethGammon/Citadel

All 48 skills in this repo
  • Create Skill

    SethGammon/Citadel

    Creates new skills from the user's repeating patterns. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.9k tokensUpdated 6 days ago
    Auto-check passed
  • Houseclean

    SethGammon/Citadel

    Cross-drive storage audit and cleanup. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.2k tokensUpdated 6 days ago
    Auto-check passed
  • Loop

    SethGammon/Citadel

    Bounded foreground repetition for the current session. An agent skill from SethGammon/Citadel.

    922 GitHub stars~1.4k tokensUpdated 6 days ago
    Auto-check passed
  • Triage

    SethGammon/Citadel

    GitHub issue and PR investigator. An agent skill from SethGammon/Citadel.

    922 GitHub stars~2.7k tokensUpdated 6 days ago
    Auto-check passed
  • Watch

    SethGammon/Citadel

    File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills.

    922 GitHub stars~2.9k tokensUpdated 6 days ago
    Auto-check passed
  • Archon

    SethGammon/Citadel

    Autonomous multi-session campaign agent. An agent skill from SethGammon/Citadel.

    922 GitHub stars~5.4k tokensUpdated 6 days ago
    Auto-check passed

Categories

Questions about Systematic Debugging

What does Systematic Debugging do?

4-phase root cause analysis: observe, hypothesize, verify, fix. Systematic Debugging is an agent skill from SethGammon/Citadel. 4-phase root cause analysis: observe, hypothesize, verify, fix.

When should I use Systematic Debugging?

Systematic Debugging fits situations like: tasks that involve Debugging; tasks that involve Root cause analysis.

How do I install Systematic Debugging in Claude Code?

Run `npx skills add SethGammon/Citadel --skill systematic-debugging -a claude-code`. Or copy the skill folder (skills/systematic-debugging in SethGammon/Citadel) into .claude/skills/systematic-debugging in your project. Claude Code loads it when a task matches its description.

How do I install Systematic Debugging in Codex?

Run `npx skills add SethGammon/Citadel --skill systematic-debugging -a codex`. Or copy the skill folder (skills/systematic-debugging in SethGammon/Citadel) into .agents/skills/systematic-debugging in your project. Codex loads it when a task matches its description.

Can I use Systematic Debugging in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SethGammon/Citadel --skill systematic-debugging -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/systematic-debugging, .gemini/skills/systematic-debugging, .github/skills/systematic-debugging and .opencode/skills/systematic-debugging in your project.

What does Systematic Debugging need to run?

Going by SKILL.md and its folder, Systematic Debugging needs the command-line tools its instructions call (git).

Does Systematic Debugging access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Systematic Debugging safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Systematic Debugging use?

Systematic Debugging is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Systematic Debugging use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Systematic Debugging?

Skills that share tags, products or a category with Systematic Debugging: OpenLogi macOS Permissions Triage (AprilNEA/OpenLogi, 23k stars), Bug Finder for daisyUI (saadeghi/daisyui, 43k stars), Root Cause Debugging (garrytan/gstack, 136k stars) and Graph-Based Bug Tracing (tirth8205/code-review-graph, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Systematic Debugging?

SethGammon (a GitHub user) maintains it in SethGammon/Citadel, which has 922 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 1, 2026.

Source: SethGammon/Citadel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.