agentleFS
SrejonKhanSrejonKhan/agent-skills/skills/debug_issue/SKILL.md

debug_issue

Skill3 starsChanged 2 months agoMITView on GitHub

A strict, scientific debugging protocol (The "Iron Law"). No fixes allowed without root cause investigation.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Core Principle: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.

    line 8
  2. Very specific:

    Use grep_search to find error messages in code.

    line 19
  3. Very specific:

    Use view_file to inspect logic.

    line 20
  4. Very specific:

    Use run_command to run reproduction scripts.

    line 21
  5. Distinctive:

    Error Messages: Read the ENTIRE stack trace.

    line 28
  6. Distinctive:

    MRE: Create a Minimal Reproducible Example (strip away everything else).

    line 35
  7. Distinctive:

    Trace Data Flow: Follow the bad value backwards.

    line 39
  8. Distinctive:

    The 3-Strike Rule: If you have tried 3 fixes and they failed, STOP.

    line 45
  9. Distinctive:

    If you catch yourself saying these, STOP and return to Step 1:

    line 57
  10. Distinctive:

    Binary Search: If a long script or a large commit history fails, cut it in half.

    line 65
  11. Very specific:

    Targeted Instrumentation: Don't just console.log("here").

    line 66
  12. Distinctive:

    Form Hypotheses & Controlled Experiments: Before changing code, write down what you think is wrong and what single change will prove it.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Systematic Debugging (The Iron Law)

Core Principle: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST. Symptom patching is failure.

Inputs

  • Issue Description: What is broken?
  • Observed Behavior: What is happening instead?
  • Stack Trace/Logs: (Optional) Error output.

Tooling Strategy

  • Use grep_search to find error messages in code.
  • Use view_file to inspect logic.
  • Use run_command to run reproduction scripts.

Workflow

1. Isolation & Symptom Analysis

  • Deviation: Clearly define Expected vs Observed.
  • Error Messages: Read the ENTIRE stack trace. Do not skim.
  • Environment: Dev vs Prod? Recent changes?

2. Reproduction (The MRE)

  • Steps: List the exact steps to fail.
  • Determinism: Is it 100% consistent or flaky?
  • MRE: Create a Minimal Reproducible Example (strip away everything else).

3. Root Cause Investigation (The "Why")

  • Trace Data Flow: Follow the bad value backwards. Where did it originate?
  • Instrumentation: "Measure, Don't Guess." Add logs at boundaries.
  • Hypothesis: Formulate: "I think X fails because Y."

4. Implementation (The Fix)

  • The 3-Strike Rule: If you have tried 3 fixes and they failed, STOP.
    • Observation: You likely have an architecture problem, not a bug.
    • Action: Question the fundamental pattern.
  • Single Change: Apply ONE fix. Test it.

5. Verification & Regression

  • Verify: Does the MRE pass now?
  • Regression: Did anything else break? Run enhance_ui or standard tests.

Rationalization Busting

If you catch yourself saying these, STOP and return to Step 1:

  • "I'll just try this quickly..."
  • "It's probably X..."
  • "I don't know why this works but it does."

Advanced Debugging Strategies

  • Binary Search: If a long script or a large commit history fails, cut it in half. Test which half fails. Repeat.
  • Targeted Instrumentation: Don't just console.log("here"). Log state: console.log({ user: req.user, authHeader: req.headers.authorization }).
  • Form Hypotheses & Controlled Experiments: Before changing code, write down what you think is wrong and what single change will prove it.
  • Rubber Ducking / Write it Down: Explain the data flow step-by-step out loud (or in the prompt). The assumption gap often reveals itself.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.