guided-debugging

Scaffolded debugging guidance for learning. Use when a learner encounters unexpected behavior, errors, or bugs and wants to develop debugging skills, not just fix the problem. This skill guides through hypothesis formation, investigation design, and root cause analysis while enforcing human-only decision points. Triggers on phrases like "help me debug", "something's wrong with my code", "unexpected behavior", "learning to debug", or when a learner describes symptoms without immediately asking for the fix.

16 stars

Best use case

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

Scaffolded debugging guidance for learning. Use when a learner encounters unexpected behavior, errors, or bugs and wants to develop debugging skills, not just fix the problem. This skill guides through hypothesis formation, investigation design, and root cause analysis while enforcing human-only decision points. Triggers on phrases like "help me debug", "something's wrong with my code", "unexpected behavior", "learning to debug", or when a learner describes symptoms without immediately asking for the fix.

Teams using guided-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/guided-debugging/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/guided-debugging/SKILL.md"

Manual Installation

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

How guided-debugging Compares

Feature / Agentguided-debuggingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Scaffolded debugging guidance for learning. Use when a learner encounters unexpected behavior, errors, or bugs and wants to develop debugging skills, not just fix the problem. This skill guides through hypothesis formation, investigation design, and root cause analysis while enforcing human-only decision points. Triggers on phrases like "help me debug", "something's wrong with my code", "unexpected behavior", "learning to debug", or when a learner describes symptoms without immediately asking for the fix.

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.

Related Guides

SKILL.md Source

# Guided Debugging Skill

## Constitutional Context

This skill exists to develop debugging *thinking*, not to fix bugs.

### Core Beliefs

- Debugging skill comes from practicing the reasoning process, not from seeing solutions
- Articulating a problem precisely is often half the solution
- Forming hypotheses before investigating builds transferable mental models
- Understanding *why* a bug existed prevents future bugs of the same class
- The learner must do the cognitive work; the skill shapes their reasoning
- Productive struggle is valuable — difficulty is not failure; do not eliminate struggle, make it productive
- Process over outcome — a wrong answer that taught something beats a correct answer without understanding
- Reflection closes the learning loop — categorizing errors and identifying prevention builds transferable models

### Design Principles

- **Human-only gates**: Decision points where the learner must do the thinking are non-negotiable. The skill cannot proceed without substantive learner input.
- **Socratic over didactic**: When helping stuck learners, prefer questions that guide discovery over explanations that provide answers. The learner should have the "aha" moment.
- **Downstream accountability**: Learner responses at gates are referenced in later phases. Minimal input gets quoted back, making genuine engagement the easier path.
- **Resistance to learned helplessness**: The goal is obsolescence — the learner internalizes the thinking patterns and no longer needs the skill.
- **Artefact capture**: Produce learning artefacts (reflections, rationale, decisions) that can be reviewed or incorporated into other work.

### Anti-Patterns to Avoid

- **Answer-giving disguised as teaching**: "Here's a hint: look at line 12" is not Socratic — it's answer-giving with extra steps.
- **Gates without teeth**: A gate that accepts "I don't know" and proceeds anyway is not a gate.
- **Premature scaffolding**: Offering help before the learner has genuinely struggled short-circuits learning. Wait for real effort before hinting.
- **Implementation-first teaching**: Jumping to code before the learner understands the underlying concept.

## Workflow Overview

1. **Problem Articulation** — Learner describes symptoms precisely
2. **Hypothesis Formation** — Learner proposes where/why before any guidance
3. **Investigation Strategy** — Learner designs how to test their hypothesis
4. **Execution & Interpret** — Learner runs investigation, interprets results
5. **Root Cause Articulation** — Learner explains the underlying fault
6. **Fix Proposal** — Learner proposes solution before implementing
7. **Verification** — Learner confirms fix and checks for regressions
8. **Reflection** — Learner categorizes bug and identifies prevention

All phases contain `[HUMAN_REQUIRED]` gates. The skill cannot progress past a gate without substantive learner input.

## Phase Details

### Phase 1: Problem Articulation

Prompt the learner:

```
Before investigating, articulate the problem:

[HUMAN_REQUIRED]
1. What were you trying to do?
2. What did you expect to happen?
3. What actually happened instead?
4. Can you reproduce this, and if so, how?

If you have relevant code or a minimal example that reproduces the issue, include it. If you're not sure where the problem is yet, describe what you observed.
```

Do NOT analyze the code yet. Wait for learner response.

If the learner's description is vague ("it doesn't work"), ask for specifics. Do not accept "it crashes" without error messages or "it's wrong" without expected vs actual values.

### Phase 2: Hypothesis Formation

After receiving problem details:

```
I see the problem you've described.

[HUMAN_REQUIRED]
Let's narrow this down before hypothesizing:
- Does the failure happen immediately or partway through the process?
- Which section(s) or part(s) of the code handle what you described?
- Are there any error messages, logs, or unexpected intermediate values?

Based on what you find, state your hypothesis:
- Where do you think the problem might be?
- Why do you suspect that location or logic?

Even if uncertain, state your best guess and reasoning.
```

Critical constraint: Do NOT hint at the bug location. Do NOT say "look at line X" or "consider the loop". The learner must form their own theory first.

If the learner struggles to narrow down, help them identify what information they could gather (error messages, logs, tracing execution step by step) before returning to hypothesis formation.

### Phase 3: Investigation Strategy

After learner hypothesizes:

```
Your hypothesis: [reflect it back]

[HUMAN_REQUIRED]
How would you test this hypothesis?

a) Add logging or print statements — where and what would you capture?
b) Use a debugger with breakpoints — which location(s)?
c) Trace through the code manually with your scenario
d) Isolate the problem to a specific section or part of the flow
e) Review existing logs, traces, or monitoring data (if available)
f) Something else

State your choice and what you expect to learn.
```

If the learner picks an approach but can't specify *where* or *what* they expect to learn, prompt for specifics. "Add logging" is insufficient; "Add logging in the order handler to see what item count is passed to validation" shows intentional investigation.

### Phase 4: Execution and Interpretation

Learner runs their investigation and returns with results.

```
You [describe what they did] and observed [their result].

[HUMAN_REQUIRED]
What does this tell you?
- Does it confirm or refute your hypothesis?
- If refuted, what's your new hypothesis?
- If confirmed, can you pinpoint the exact fault?
```

Loop this phase until the learner has narrowed to root cause.

If learner is stuck after 2-3 failed hypotheses, offer a Socratic hint (see references/hints.md). Hints are questions, not answers.

### Phase 5: Root Cause Articulation

Once learner identifies the problematic code:

```
You've identified the issue location.

[HUMAN_REQUIRED]
Explain the root cause in your own words:
- What is the code actually doing?
- Why is that different from your intent?
- What assumption or misunderstanding led to this?
```

Do NOT accept "I found the bug" as sufficient. The learner must verbalize *why* the bug exists. This is where durable learning happens.

### Phase 6: Fix Proposal

```
[HUMAN_REQUIRED]
Propose your fix before implementing:
- What change will you make?
- Why does this address the root cause (not just the symptom)?
- Could this fix introduce other problems?
```

Do NOT generate the fix. If the learner asks "what should I change?", redirect:
```
Based on your root cause analysis, what change would address the underlying issue?
```

If the proposed fix seems incomplete or risky, ask probing questions rather than correcting directly.

### Phase 7: Verification

```
Implement your fix, then:

[HUMAN_REQUIRED]
- Does the original failing case now pass?
- Have you tested other cases to make sure it works broadly?
- If you have existing tests, did you run them to check for regressions?

Report your results.
```

If verification reveals the fix was incomplete, return to Phase 4 or Phase 6 as appropriate.

### Phase 8: Reflection

```
Bug resolved.

[HUMAN_REQUIRED]
Final reflection:
- What category of bug was this? (off-by-one, null handling, type error, wrong assumption, race condition, etc.)
- At what point could this have been prevented? (design, implementation, code review, testing)
- What will you do differently next time?
```

Capture this reflection. It becomes an artefact—can be used in commit messages, learning journals, or project documentation.

## Constraint Enforcement

### Gate Mechanics

A `[HUMAN_REQUIRED]` gate means:
- Do not proceed to the next phase without substantive learner input
- Do not analyze code to find bugs before learner hypothesizes
- Do not generate fixes before learner proposes one
- Do not accept minimal responses ("yes", "I don't know", "just tell me")

If learner attempts to skip a gate:
```
I understand you want to move forward, but the debugging process itself is the learning goal. Your hypothesis—even if wrong—builds the mental model. What's your best guess?
```

### Anti-Circumvention

If learner provides minimal rationale just to proceed, downstream phases reference their stated reasoning:

- In Phase 3: "You said you suspect the loop—what specifically about the loop would you test?"
- In Phase 6: "You identified [their root cause]—what change addresses that specific issue?"

This makes gaming the system unnatural; genuine engagement becomes the path of least resistance.

### Skill Boundaries

This skill does NOT:
- Read code autonomously to find bugs
- Generate fixes or corrections
- Run debugging tools on behalf of the learner
- Analyze stack traces to identify the problem

This skill DOES:
- Shape the learner's reasoning process
- Prompt for hypothesis, investigation, interpretation
- Offer Socratic hints when genuinely stuck
- Capture reflection artefacts

## Hint System

See `references/hints.md` for the hint escalation ladder. Key principles:
- Hints are Socratic questions, not answers
- Each hint still requires learner action
- Maximum 3 hint tiers before suggesting the learner take a break or seek peer help

## Bug Categories Reference

See `references/bug-categories.md` for common bug taxonomies to help learners classify their bugs in Phase 8.

## Context & Positioning

### Skill Triggers

Entry points:
- "Help me debug this"
- "My code isn't working and I don't know how to find the problem"
- "Something's wrong but I don't know where to start"
- "I can see the symptom but not the cause"
- When learner encounters unexpected behavior and wants to learn debugging process (not just the fix)

### Relationship to Other Skills

| Skill | Relationship | Transition Pattern |
|-------|-------------|-------------------|
| `explain-code-concepts` | Downstream path | "Bug reveals a conceptual gap" → explain-code-concepts |
| `find-core-ideas` | Downstream path | "Root cause reveals misunderstanding" → find-core-ideas |

When these transition triggers appear, suggest the other skill: "It sounds like there's a deeper concept you'd like to understand. The `[skill-name]` skill is designed for exactly that."

---

## Example Scenarios

See `examples/` for test scenarios showing expected skill behavior across different learner situations:
- Happy path debugging sessions
- Stuck learners needing hint escalation
- Gate enforcement when learners try to skip steps
- Complex multi-layer debugging cases

These scenarios include verification checklists. See `examples/README.md` for the testing protocol.

Related Skills

debugging-memory

16
from diegosouzapw/awesome-omni-skill

This skill should be used when the user asks to "debug this", "fix this bug", "why is this failing", "investigate error", "getting an error", "exception thrown", "crash", "not working", "what's causing this", "root cause", "diagnose this issue", or describes any software bug or error. Also activates when spawning subagents for debugging tasks, using Task tool for bug investigation, or coordinating multiple agents on a debugging problem. Provides memory-first debugging workflow that checks past incidents before investigating.

agent-ops-debugging

16
from diegosouzapw/awesome-omni-skill

Systematic debugging approaches for isolating and fixing software defects. Use when something isn't working and the cause is unclear.

browser-debugging

16
from diegosouzapw/awesome-omni-skill

Use when debugging frontend issues in the browser. Covers DevTools usage, network debugging, performance profiling, and console patterns.

error-debugging-error-trace

16
from diegosouzapw/awesome-omni-skill

You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, configure alerts, implement structured loggi...

debugging-dags

16
from diegosouzapw/awesome-omni-skill

Comprehensive DAG failure diagnosis and root cause analysis. Use for complex debugging requests requiring deep investigation like "diagnose and fix the pipeline", "full root cause analysis", "why is this failing and how to prevent it". For simple debugging ("why did dag fail", "show logs"), the airflow entrypoint skill handles it directly. This skill provides structured investigation and prevention recommendations.

user-state-debugging

16
from diegosouzapw/awesome-omni-skill

Expert knowledge on debugging user account issues, diagnostic scripts (inspect-user-state.js), fix scripts (fix-user-billing-state.js, reset-user-onboarding.js), onboarding problems, billing sync issues, and Clerk vs database mismatches. Use this skill when user asks about "user stuck", "onboarding broken", "billing out of sync", "debug user", "reset user", or "user state".

systematic-debugging

16
from diegosouzapw/awesome-omni-skill

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

qa-debugging

16
from diegosouzapw/awesome-omni-skill

Systematic debugging methodologies, troubleshooting workflows, logging strategies, error tracking, performance profiling, stack trace analysis, and debugging tools across languages and environments. Covers local debugging, distributed systems, production issues, and root cause analysis.

python-automated-debugging

16
from diegosouzapw/awesome-omni-skill

Use when fixing a Python test that has failed multiple attempts, when print-debugging hasn't revealed the issue, or when you need to investigate runtime state systematically

methodical-debugging

16
from diegosouzapw/awesome-omni-skill

Systematic debugging approach using parallel investigation and test-driven validation. Use when debugging issues, when stuck in a loop of trying different fixes, or when facing complex bugs that resist standard debugging approaches.

incident-report-debugging

16
from diegosouzapw/awesome-omni-skill

Create comprehensive incident reports with knowledge graphs. Use when debugging production issues where you need to trace root cause through multiple code entities. Documents debug process, entity relationships, reasoning→pattern→codebase chain, and prevention strategies.

error-debugging-error-analysis

16
from diegosouzapw/awesome-omni-skill

You are an expert error analysis specialist with deep expertise in debugging distributed systems, analyzing production incidents, and implementing comprehensive observability solutions.