skills/systematic-debugging/SKILL.md
Use when encountering any bug, test failure, or unexpected behavior. Iron Law: no fixes without root cause investigation first. Four phases: Investigate → Analyze → Hypothesize → Implement. Triggers: any error, test failure, "it's broken", "why isn't X working".
npx skillsauth add Wilder1222/superomni systematic-debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Status protocol — end every session with one of: DONE (evidence provided) · DONE_WITH_CONCERNS (list each) · BLOCKED (state what blocks you) · NEEDS_CONTEXT (state what you need).
Auto-advance — pipeline: THINK → PLAN → REVIEW → BUILD → VERIFY → RELEASE. Only human gate is spec approval at THINK. On DONE at other stages, print [STAGE] DONE -> advancing to [NEXT-STAGE] and invoke the next skill. On any non-DONE status at any stage, STOP.
Output directory — all artifacts go in docs/superomni/<kind>/<kind>-[branch]-[session]-[date].md. See CLAUDE.md for the full directory map.
TACIT-DENSE — before high-tacit decisions, classify D1 (domain expertise) · D2 (user-facing UX) · D3 (team culture) · D4 (novel pattern). On hit, output TACIT-DENSE [D#]: [question] — My default: [recommendation]. See reference for actions.
Anti-sycophancy — take a position on every significant question. Name flaws directly. No filler ("that's interesting", "you might consider", "that could work").
Telemetry (local only) — at session end, log bin/analytics-log. Nothing leaves the machine.
See preamble-ref.md for detailed protocols.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
If you haven't completed Phase 1, you cannot propose fixes. "I think it might be X" is not a root cause. A root cause is a specific, testable claim about what is wrong.
User reports: Button click has no response
Agent:
1. Check event listener bindings -> confirmed bound correctly
2. Check if handler function is called -> found it is NOT called
3. Check for event propagation blockers -> found parent element has e.stopPropagation()
4. Root cause identified: parent stopPropagation() prevents click from reaching button
5. Fix: remove incorrect stopPropagation() call
User reports: Button click has no response
Agent:
Guesses it might be CSS pointer-events: none
-> Adds pointer-events: auto
-> Still broken
-> Guesses it might be z-index
-> Adjusts z-index
-> Still broken
[VIOLATED: Started fixing without root cause investigation]
| Excuse | Rebuttal | |--------|----------| | "The problem is obvious, root cause is X" | "Obvious" is not evidence — spend 2 minutes verifying | | "Similar bug was fixed this way before" | Similar is not identical — verify root cause before applying fix | | "User described the cause already" | User describes symptoms, not causes — investigate anyway |
Before investigating, lock the edit scope to the affected area to prevent accidental changes elsewhere:
FREEZE_DIR=$(cd "<affected-directory>" 2>/dev/null && pwd || echo "")
if [ -n "$FREEZE_DIR" ]; then
mkdir -p "${HOME}/.omni-skills"
echo "${FREEZE_DIR%/}/" > "${HOME}/.omni-skills/debug-scope.txt"
echo "Debug scope locked to: ${FREEZE_DIR%/}/"
fi
While scope lock is active, do NOT edit files outside the locked directory. Flag out-of-scope fixes as follow-up tasks. Say "unfreeze" or remove ~/.omni-skills/debug-scope.txt when done debugging.
git log --oneline -20 -- <affected-files>root-cause-tracing.md for backward tracing technique# Check recent changes to affected area
git log --oneline -20 -- <file-or-directory>
# Search for related error patterns
grep -r "<error-string>" . --include="*.log" -l 2>/dev/null | head -5
# Check for recent changes across the codebase
git diff HEAD~5 HEAD -- <affected-area>
Required output: "Root cause hypothesis: ..." — a specific, testable claim.
Example: "Root cause hypothesis: The authenticate() function returns null when the JWT is expired, but the caller doesn't handle null and passes it directly to getUserData(), causing a NullPointerException at line 47."
explorer Agent (Evidence Gathering)After completing Phase 1 (scope locked, initial evidence gathered), dispatch the explorer agent with:
git log outputThe explorer agent surveys the scope-locked area in isolated context, returns a DEBUG EVIDENCE REPORT (execution path trace, candidate hypothesis list, and pointers to the likely failure site). This skill's Phases 2-4 then pick up with the agent's evidence to form and verify hypotheses. (Debugging protocol content was consolidated from the retired debugger agent into this skill; explorer provides the isolated-context survey.)
Handoff protocol:
DONE → incorporate evidence into Phase 2 pattern analysis; run Phases 3-4 (hypothesis + fix) in main context; proceed to Phase 5 Debug ReportDONE_WITH_CONCERNS → note concerns, continue to Phase 3, flag to user before closingBLOCKED (3 failed hypotheses) → apply the 3-Strike Rule in Phase 3 and escalate with full evidenceThe skill's Phases 2–4 may also run inline as a fallback when the debugging session is simple.
After forming a hypothesis, lock edits to the affected module to prevent scope creep:
STATE_DIR="${HOME}/.omni-skills"
mkdir -p "$STATE_DIR"
AFFECTED_DIR="<detected-directory>"
echo "${AFFECTED_DIR}/" > "$STATE_DIR/debug-scope.txt"
echo "Debug scope locked to: ${AFFECTED_DIR}/"
echo "Run 'rm ~/.omni-skills/debug-scope.txt' to unlock scope."
You may only edit files within the locked scope during debugging. If the fix requires touching files outside scope → flag to user and unlock explicitly.
Match the symptom to known patterns:
| Pattern | Signature | Where to look | |---------|-----------|---------------| | Race condition | Intermittent, timing-dependent failures | Shared mutable state, async code | | Nil/null propagation | NullPointerError, TypeError on access | Missing null guards, unexpected returns | | State corruption | Inconsistent data after operations | DB transactions, event hooks, caches | | Integration failure | Timeout, unexpected response format | Service boundaries, API contracts | | Configuration drift | Works locally, fails in CI/staging | Env vars, feature flags, secrets | | Stale cache | Old data returned, fixes on cache clear | Redis, CDN, browser cache, memoize | | Off-by-one | Wrong count, missing last element | Loop bounds, array indexing |
Also: Find a working example → compare with broken case → list every difference.
See root-cause-tracing.md for systematic backward tracing techniques.
After 3 failed hypotheses, STOP. Do not guess further. Choose:
A) Form a completely different hypothesis (change your mental model, not just the details) B) Add more logging/instrumentation and gather more data before hypothesizing C) Escalate: report BLOCKED with your 3 hypotheses and evidence gathered D) Other — describe your own next step: ___________
test-driven-development skillSee defense-in-depth.md for multi-layer validation after finding root cause.
See condition-based-waiting.md for async/timing issues.
DEBUG REPORT
════════════════════════════════════════
Symptom: [what the user observed]
Root cause: [what was actually wrong — specific, verified]
Fix: [what changed, with file:line references]
Evidence: [test output or command + result proving fix works]
Regression test: [file:line of new test added]
Scope unlocked: [yes/no — was debug-scope.txt removed?]
Status: DONE | DONE_WITH_CONCERNS | BLOCKED
════════════════════════════════════════
root-cause-tracing.md — backward tracing through call stackdefense-in-depth.md — multi-layer validation after finding root causecondition-based-waiting.md — replace fragile timeouts with condition pollingdevelopment
Systematic, behavior-preserving code refactoring with safety gates. Dispatches refactoring-agent. Triggers: "refactor", "clean up code", "reduce tech debt", "extract method", "rename". NOT for reactive PR feedback — use code-review for that.
development
Meta-skill: create, install, list, and manage skills and agents within the superomni framework. Merges writing-skills + agent-management into one unified workflow. Triggers: "create skill", "write a skill", "install skill", "list skills", "create agent", "write an agent", "install agent", "list agents", "new skill", "new agent", "add skill", "add agent", "manage framework".
testing
Dependency security, license, and freshness audit. Dispatches dependency-auditor agent to scan all package managers. Triggers: "dependency audit", "check dependencies", "npm audit", "security scan", "check for vulnerabilities", "outdated packages", "license check".
development
Meta-skill: use when creating a new skill for the superomni framework. Guides through the process of designing and writing a well-structured skill. Triggers: "create a new skill", "write a skill for", "add a skill that".