use-debug

Enforce root-cause investigation before proposing any code fixes.

1|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/mtthsnc/autonome --skill use-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: use-debug
Source: https://github.com/mtthsnc/autonome/tree/main/skills/use-debug
Command: npx skills add https://github.com/mtthsnc/autonome --skill use-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Random fixes waste time and create new bugs. Quick patches mask underlying issues.

Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.

The Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST

If you haven't completed Phase 1, you cannot propose fixes.

Phase 1: Root Cause Investigation

BEFORE attempting ANY fix:

  1. Read Error Messages Carefully

    • Read stack traces completely
    • Note line numbers, file paths, error codes
    • They often contain the exact solution
  2. Reproduce Consistently

    • Can you trigger it reliably?
    • Exact steps? Every time?
    • If not reproducible → gather more data, don't guess
  3. Check Recent Changes

    • Git diff, recent commits
    • New dependencies, config changes
    • Environmental differences
  4. Gather Evidence in Multi-Component Systems

    For each component boundary:

    • Log what data enters component
    • Log what data exits component
    • Verify environment/config propagation
    • Check state at each layer

    Run once to gather evidence showing WHERE it breaks THEN analyze evidence to identify failing component

  5. Trace Data Flow

    • Where does bad value originate?
    • What called this with bad value?
    • Keep tracing up until you find the source
    • Fix at source, not at symptom

Phase 2: Pattern Analysis

  1. Find Working Examples

    • Locate similar working code in same codebase
    • What works that's similar to what's broken?
  2. Compare Against References

    • If implementing pattern, read reference implementation COMPLETELY
    • Don't skim - understand the pattern fully
  3. Identify Differences

    • What's different between working and broken?
    • Don't assume "that can't matter"

Phase 3: Hypothesis and Testing

  1. Form Single Hypothesis

    • State clearly: "I think X is the root cause because Y"
    • Be specific
  2. Test Minimally

    • SMALLEST possible change to test hypothesis
    • One variable at a time
    • Don't fix multiple things at once
  3. Verify Before Continuing

    • Did it work? Yes → Phase 4
    • Didn't work? Form NEW hypothesis
    • DON'T add more fixes on top

Phase 4: Implementation

  1. Create Failing Test Case

    • Use the autonome:use-tdd skill
    • Simplest possible reproduction
    • MUST have before fixing
  2. Implement Single Fix

    • Address the root cause identified
    • ONE change at a time
    • No "while I'm here" improvements
  3. Verify Fix

    • Test passes now?
    • No other tests broken?
    • Issue actually resolved?
  4. If Fix Doesn't Work

    • STOP
    • Count: How many fixes have you tried?
    • If < 3: Return to Phase 1, re-analyze
    • If ≥ 3: STOP and question the architecture
    • DON'T attempt Fix #4 without discussion
  5. If 3+ Fixes Failed: Question Architecture

    Pattern indicating architectural problem:

    • Each fix reveals new shared state/coupling in different place
    • Fixes require "massive refactoring"
    • Each fix creates new symptoms elsewhere

    STOP and question fundamentals:

    • Is this pattern fundamentally sound?
    • Should we refactor architecture vs. continue fixing symptoms?

Red Flags - STOP

If you catch yourself thinking:

  • "Quick fix for now, investigate later"
  • "Just try changing X and see if it works"
  • "Add multiple changes, run tests"
  • "Skip the test, I'll manually verify"
  • "It's probably X, let me fix it"
  • "I don't fully understand but this might work"
  • "Here are the main problems: [lists fixes without investigation]"
  • Proposing solutions before tracing data flow
  • "One more fix attempt" (when already tried 2+)
  • Each fix reveals new problem in different place

ALL of these mean: STOP. Return to Phase 1.

If 3+ fixes failed: Question the architecture.

Common Rationalizations

| Excuse | Reality | |--------|---------| | "Issue is simple, don't need process" | Simple issues have root causes too. | | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check. | | "Just try this first, then investigate" | First fix sets the pattern. Do it right from start. | | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. | | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. | | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. |

Supporting Techniques

Available in this directory:

  • root-cause-tracing.md - Trace bugs backward through call stack
  • defense-in-depth.md - Add validation at multiple layers
  • condition-based-waiting.md - Replace arbitrary timeouts

Related skills:

  • autonome:use-tdd - For creating failing test case
  • autonome:use-verify - Verify fix worked

Phase 1 to Quick Start

Begin by reading error messages, reproducing reliably, and gathering evidence before proposing any fixes.

Quick Start

Read the four phases and begin with Phase 1: Root Cause Investigation before proposing any fixes.

Frequently Asked Questions about use-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is root-cause debugging and why is it necessary?

Root-cause debugging requires identifying the exact source of a bug before attempting fixes. It prevents quick patches that mask underlying issues, ensuring systematic error resolution instead of random guess-and-check changes.

How do I trace data flow to find where a bad value originates?

Trace data flow by logging what enters and exits component boundaries, then verify state at each layer. Keep tracing the bad value up the call stack until you find the source, and fix it there rather than at the symptom.

What is the best way to debug a consistently reproducible error?

The best way to debug is to read stack traces completely, note line numbers and file paths, check recent git changes, and gather evidence across component boundaries to identify the failing component before proposing fixes.

When should I stop fixing bugs and question the software architecture?

Stop and question the architecture if three or more fixes fail. If each fix reveals new shared state, requires massive refactoring, or creates new symptoms elsewhere, the pattern indicates a fundamental architectural problem.

How do I test a debugging hypothesis minimally?

Test a debugging hypothesis by making the smallest possible change to test one variable at a time. State the root cause clearly, verify if it works, and do not add multiple fixes on top if it fails.

Why do I need a failing test case before implementing a bug fix?

You need a failing test case before fixing to prove the bug exists and verify the fix works. Untested fixes do not stick, and having the simplest possible reproduction ensures the root cause is actually resolved.