agentleFS
epicsagasepicsagas/epic-harness/skills/debug/SKILL.md

debug

Skill20 starsChanged 2 months agoApache-2.0View on GitHub

Systematic root-cause isolation for test failures, runtime errors, or unexpected behavior. Narrow hypothesis → verify → fix.

192 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-discord, add-slack and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    add-discord

    Add Discord bot channel integration via Chat SDK.

    Also in 11 projects that use this

  • MicrosoftSkill

    add-slack

    Add Slack channel integration via Chat SDK.

    Also in 11 projects that use this

  • +10 more from microsoft

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.

    line 11
  2. Very specific:

    Check if a resolution or pattern node exists for this error category

    line 17
  3. Distinctive:

    If a past resolution exists, apply it directly instead of re-debugging from scratch

    line 18
  4. Distinctive:

    Read the full error message and stack trace

    line 23
  5. Distinctive:

    If the fix is a workaround, add a TODO with explanation

    line 44
  6. Distinctive:

    Run the failing test — must pass now

    line 49
  7. Distinctive:

    Run the full test suite — no regressions

    line 50
  8. Distinctive:

    If this was a bug, the regression test stays

    line 51
  9. Very specific:

    If the fix involved 3+ debug steps, record a resolution node via epic mem add --title "..." --type resolution --body "..."

    line 56
  10. Distinctive:

    Before claiming the bug is fixed, show ALL of these:

    line 82

“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “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

Debug — Systematic Debugging

Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST. Symptom fixes are whack-a-mole debugging.

Process

0. Recall

  • Query the knowledge graph: epic mem search "ERROR_MESSAGE_OR_FILE" for the error message or file name
  • Check if a resolution or pattern node exists for this error category
  • If a past resolution exists, apply it directly instead of re-debugging from scratch

Why: Past resolutions save 10-30 minutes of re-investigation. The knowledge graph exists so you don't repeat work.

1. Observe

  • Read the full error message and stack trace
  • Identify: What was expected? What actually happened?
  • Note the exact file, line, and function

Why: Precise observation prevents misdiagnosis. Most debug loops start from skimming the error instead of reading it fully.

2. Hypothesize

Form 2-3 possible causes. Rank by likelihood.

Why: Ranked hypotheses prevent random code changes. Even a wrong hypothesis narrows the search space.

3. Isolate

  • Narrow the scope: Binary search through recent changes
  • Reproduce minimally: Smallest input that triggers the error
  • Check assumptions: Print/log intermediate values
  • Bisect: git log --oneline -10 — when did it last work?

Why: Isolation proves the cause before you touch any code. Without it, you're guessing.

4. Fix

  • Fix the root cause, not the symptom
  • If the fix is a workaround, add a TODO with explanation

Why: Root cause fixes are permanent. Symptom patches rot and hide the real bug.

5. Verify

  • Run the failing test — must pass now
  • Run the full test suite — no regressions
  • If this was a bug, the regression test stays

Why: A passing fix without verification is wishful thinking. The full suite catches side effects.

6. Record

  • If the fix involved 3+ debug steps, record a resolution node via epic mem add --title "..." --type resolution --body "..."
  • Include: error category, root cause, solution approach
  • This enables future sessions to skip re-debugging the same class of issues

Why: Recording turns one-time debugging into institutional knowledge. Future sessions benefit from your effort.

When to Trigger

  • Any test failure during /go execution
  • Runtime error in tool output
  • "Unexpected" in any output

Anti-Rationalization

ExcuseRebuttalWhat to do instead
"Let me just try again"Retrying without changing anything is not debugging.Form a new hypothesis before each attempt.
"It works on my machine"Environment differences are bugs too.Reproduce in the actual target environment first.
"I'll just catch the exception"That hides the bug, doesn't fix it.Fix the root cause. Only catch what you can handle meaningfully.
"It's probably a flaky test"Flaky tests hide real bugs. Prove it's flaky before dismissing.Run it 3x in isolation. If it fails consistently, it's real.
"I'll add more logging"Logging without a hypothesis is fishing.Hypothesize first, then add targeted logging to confirm/deny.
"It's probably just a typo"Assumptions are the enemy of debugging. Reproduce first, then diagnose.Read the full error, reproduce it, and verify before assuming simplicity.
"Let me just try changing this one thing"Whack-a-mole debugging creates more bugs. Follow the hypothesis → isolate → fix cycle.Form a hypothesis, isolate the cause, then fix with evidence.
"The error message tells me everything"Error messages describe symptoms, not root causes. Investigate the chain.Trace the error to its origin. The message is the starting point, not the answer.

Evidence Required

Before claiming the bug is fixed, show ALL of these:

  • Root cause identified: one sentence explaining WHY it broke
  • Fix applied: diff showing the change
  • Previously failing test now passes (show output)
  • Full test suite passes (no regressions)
  • If bug came from a pattern, regression test added to prevent recurrence

"It works now" without root cause = symptom patch, not a fix.

Red Flags

  • Changing random things hoping something works
  • More than 3 retry attempts without forming a new hypothesis
  • Suppressing errors instead of fixing them

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.

Reviews can't be read right now.

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.