Skip to content
Back to skills

Systematic Debugging

ASecurity

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

  • 32 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added February 10, 2026
developmentdebuggingrefactoringapiperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add joshmanders/dotfiles --skill systematic-debugging --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Systematic Debugging?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Systematic Debugging
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/joshmanders-systematic-debugging/badge)](https://www.skillsdirectory.com/skills/joshmanders-systematic-debugging)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: systematic-debugging
description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
user-invocable: false
---

# Systematic Debugging

```
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
```

Applies to every technical issue (tests, production bugs, build, performance, integration), especially under time pressure, when a quick fix looks obvious, or after a fix already failed. Complete each phase before the next.

## Phase 1: Root cause

1. **Read errors fully**: whole stack trace, line numbers, paths, codes, warnings.
2. **Reproduce reliably.** Not reproducible → gather more data, don't guess.
3. **Check recent changes**: diff, commits, dependencies, config, environment.
4. **Multi-component systems** (CI → build → signing, API → service → DB): before proposing fixes, log what enters and exits each boundary and whether env/config propagates (e.g. is the secret set in the workflow, present in the build script's environment, visible to the signing step). Run once to find the failing layer, then investigate that layer.

5. **Error deep in the call stack**: trace the bad value backward to its source and fix there. See `root-cause-tracing.md`.

## Phase 2: Pattern

- Find similar working code in the codebase.
- When following a reference implementation, read it completely.
- List every difference between working and broken, however small.
- Identify the dependencies, config, and assumptions it relies on.

## Phase 3: Hypothesis

- State one: "X is the root cause because Y."
- Test it with the smallest change, one variable at a time.
- Failed → new hypothesis; don't stack fixes.
- Don't know → say "I don't understand X" and research or ask.

## Phase 4: Fix

1. Write a failing test (or one-off script) reproducing it before fixing.
2. One fix for the root cause. No bundled refactors or "while I'm here" changes.
3. Verify: test passes, nothing else broke, issue resolved.
4. Fix failed: under 3 attempts → back to Phase 1 with the new information. **3+ failed → stop and question the architecture** with Josh before a 4th. Signs: each fix exposes new coupling elsewhere, fixes need massive refactoring, fixes create symptoms elsewhere. That's a wrong architecture, not a failed hypothesis.

## Stop and return to Phase 1 when

- Thinking "quick fix now, investigate later", "just try X", "it's probably X", "skip the test, I'll verify manually", "I'll adapt the pattern differently", or listing fixes before investigating.
- Making multiple changes before a test run.
- Proposing solutions before tracing data flow.
- About to try "one more fix" after 2+ failures.
- Josh says "Is that not happening?" (you assumed), "Will it show us...?" (add evidence gathering), "Stop guessing", "Ultrathink this" (question fundamentals), or "We're stuck?"

## No root cause found

If investigation shows it's truly environmental, timing-dependent, or external: document what you investigated, add handling (retry, timeout, error message) and logging. Most "no root cause" cases are incomplete investigation.

## Supporting files

- `root-cause-tracing.md`: trace backward through the call stack; `find-polluter.sh` for test pollution
- `defense-in-depth.md`: validate at every layer after finding the cause
- `condition-based-waiting.md`: replace sleeps with condition polling

Files in this skill

  • SKILL.md10 KB
  • condition-based-waiting.md4.4 KB
  • defense-in-depth.md5.3 KB
  • find-polluter.sh1.6 KB
  • root-cause-tracing.md5.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.