debugging

Use when fixing bugs, investigating errors, debugging failures, or diagnosing unexpected behavior.

Best use case

debugging is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when fixing bugs, investigating errors, debugging failures, or diagnosing unexpected behavior.

Teams using debugging should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/debugging/SKILL.md --create-dirs "https://raw.githubusercontent.com/reidemeister94/development-skills/main/skills/debugging/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/debugging/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How debugging Compares

Feature / AgentdebuggingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when fixing bugs, investigating errors, debugging failures, or diagnosing unexpected behavior.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Systematic Debugging

Apply [Iron Rules](../../shared/iron-rules.md) — Principle 0 (be critical, don't pander to a wrong hypothesis), Principle 8 (no claim without fresh evidence — every hypothesis tested), Principle 9 (root cause, not symptoms), and the meta-rule (spirit beats letter — *"I'll add logging"* is not investigation) govern every step.

## THE IRON LAW

**NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.**

Random fixes waste time and create new bugs. Systematic debugging fixes correctly on the first attempt 95% of the time.

---

## Phase 0: ESTABLISH BASELINE

**Run existing test suite first.** Record pass/fail counts. Pre-existing failures are NOT your regressions.

## Phase 1: ROOT CAUSE INVESTIGATION

1. **Read error messages completely** — every line, every stack frame
2. **Reproduce consistently** — exact steps, every time
3. **Check recent changes** — `git diff`, `git log`, new deps, config
4. **Trace data flow backward** — from error to source through call stack
5. **Gather evidence at boundaries** — log at each component boundary

## Phase 2: PATTERN ANALYSIS

1. **Find working examples** — similar code in this codebase that works
2. **Compare completely** — diff against reference implementation
3. **Identify ALL differences**
4. **Understand dependencies** — what assumptions does the working code make?

## Phase 3: HYPOTHESIS & TEST

1. **Form ONE hypothesis:** "X is root cause because Y"
2. **Test minimally** — change one variable at a time
3. **Verify** — does evidence support it?
4. **If wrong:** New hypothesis based on what you learned. No guess-and-check.

## Phase 4: IMPLEMENT FIX

1. **Write failing test** reproducing the bug
2. **Implement single fix** for root cause
3. **Run all tests** — fix works AND nothing else broke
4. **If 3+ attempts failed:** STOP. Question the architecture, not symptoms.

---

## Red Flags — return to Phase 1:

- "Quick fix for now, investigate later"
- "Just try changing X and see"
- "Skip the test, I'll manually verify"
- "It's probably X, let me fix that"
- "One more fix attempt" (after 2+ failed)
- Each fix reveals a new problem elsewhere

## Anti-Rationalization

| Your thought | Reality |
|---|---|
| "I know what's wrong" | If you knew, you wouldn't be debugging. Investigate. |
| "Simple bug" | Simple bugs have simple root causes. Find it first. |
| "Obvious from the error" | Errors describe symptoms, not causes. Trace the data. |
| "I'll add more logging" | That's Step 5 of Phase 1. Do Steps 1-4 first. |

## Integration with Development Workflow

Enhances Phase 1 (Research + Plan) for debugging tasks. After root cause found, continue with the locked plan into Phase 2 (Chronicle) and remaining phases normally.

Standalone (`/debugging`): announce root cause and proposed fix, ask if user wants to proceed with dev workflow.

**Language context:** If a language skill is active, read its `patterns.md` during Phase 1 for team-specific patterns.

Related Skills

using-development-skills

8
from reidemeister94/development-skills

Use when starting any conversation - establishes how the development-skills plugin works and how to invoke its components on each platform (Claude Code, Codex). Read first.

update-reqs

8
from reidemeister94/development-skills

Use when user wants to update requirements.in with latest PyPI versions while preserving version patterns

update-reqs-dev

8
from reidemeister94/development-skills

Use when user wants to update requirements-dev.in with latest PyPI versions while preserving version patterns

update-precommit

8
from reidemeister94/development-skills

Use when user wants to update .pre-commit-config.yaml hooks to their latest versions from GitHub

typescript-dev

8
from reidemeister94/development-skills

TypeScript development. Use for TypeScript, Node.js, Express, Fastify, Zod, vitest, jest. Backend, CLI, libraries only — no frontend frameworks.

swift-dev

8
from reidemeister94/development-skills

Swift development. Use for Swift, SwiftUI, UIKit, Vapor, SPM, XCTest, Combine.

staff-review

8
from reidemeister94/development-skills

Use when user wants a code review, deep code review, or staff-level code review of a local branch, repo, directory, or file. Use when user says code review, deep code review, review this branch, review the branch X, review my code, staff review, review locally, or /staff-review.

roast-my-code

8
from reidemeister94/development-skills

Use when user wants a brutally honest code roast, quality critique, or AI-readiness audit. Use when user says roast, roast my code, critique my code, tear apart my code, review quality, or AI-readiness check. Supports --fix flag to auto-fix CRITICAL and HIGH issues via core-dev workflow.

resolve-merge

8
from reidemeister94/development-skills

Use when the user asks to resolve merge conflicts, fix a failed merge, rebase conflict, or run /resolve-merge. Use when git status shows UU/AA/DD conflicts, when there are <<<<<<< conflict markers, when git merge or git pull failed with CONFLICT, or when numbered docs/plans need renumbering after merge. Triggers on: merge conflict, conflict markers, both modified, git merge failed, rebase conflict, resolve conflicts.

python-dev

8
from reidemeister94/development-skills

Python development. Use for Python, FastAPI, Pydantic, asyncpg, pytest, pandas, SQLAlchemy.

produce-feedback

8
from reidemeister94/development-skills

Use when user wants to produce a factual chronicle of development-skills plugin interactions in the current conversation for later ingestion, or runs /produce-feedback. Pure record, no judgment.

java-dev

8
from reidemeister94/development-skills

Java development. Use for Java, Spring Boot, Maven, Gradle, JPA, Hibernate.