architect
Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with…
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.
Claude Code
$ npx -y skills add SethGammon/Citadel --skill systematic-debugging --agent claude-code
Codex
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a codex -y
Cursor
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a cursor -y
Gemini CLI
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a gemini-cli -y
GitHub Copilot
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a github-copilot -y
OpenCode
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a opencode -y
Windsurf
$ npx skills add SethGammon/Citadel --skill systematic-debugging -a windsurf -y
name: systematic-debugging license: MIT 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. user-invocable: true auto-trigger: false trigger_keywords: - debug - root cause - diagnose - why is - investigate bug last-updated: 2026-06-24
**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).
1. Read the error message, stack trace, or bug description 2. Reproduce the issue:
3. Isolate the failing component/function:
**Output**: A clear problem statement: "{Component} does {X} when it should do {Y}, triggered by {condition}"
1. Formulate up to 3 hypotheses for WHY the bug exists:
2. For each hypothesis, define a verification step:
3. Run the verification:
**CRITICAL**: Do not skip this phase. Do not "just try" a fix. Verify first.
Once a hypothesis is confirmed:
1. Explain WHY the bug happens, not just WHERE:
"A calls B with X, B assumes X > 0, but A passes -1 when {condition}"
2. Check for related occurrences:
**Output**: Root cause statement: "The bug occurs because {cause}. This happens when {trigger}."
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:
4. If the root cause analysis revealed related occurrences, fix those too
**If a fix fails TWICE: STOP.**
Do not try a third guess. The root cause analysis was wrong. Either:
Three failed fixes in a row means you're guessing, not debugging.
**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:**
**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.
---HANDOFF---
- Bug: {problem statement}
- Root cause: {one-line cause}
- Fix: {what was changed}
- Verified: {typecheck + tests passing}
- Related: {any similar patterns found and fixed}
---An open-source operating layer for Claude Code and OpenAI Codex. Citadel routes requests, preserves repository state between sessions, coordinates parallel work, applies repository safeguards, and records evidence and handoffs around the coding agent you
Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with…
Autonomous multi-session campaign agent. Decomposes large work into phases, delegates to sub-agents, reviews output, and…
Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid…
Intake-to-delivery pipeline. Processes pending items from .planning/intake/: briefs new ideas, executes approved work through…
Deep cost exploration and transparency. Shows real token usage, session costs, campaign spend, burn rates, and model breakdown.…
End-to-end app creation from a single description. Five tiers: blank project, guided, templated, fully generated, or feature…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.