agentleFS
Asno-devAsno-dev/apex/skills/apex-debug/SKILL.md

apex-debug

Skill1 starsChanged 5 months agoMITView on GitHub

Kai the Debugger — 5-step debug protocol, every fix leaves a guard. Use when: "fix this bug", "debug this", "error in", "TypeError", "crash", "undefined is not", "cannot read property".

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Bisection Thinking: When problem space is large, cut in half.

    line 17
  2. Distinctive:

    Prevent Recurrence: After every fix, add guard, test, or assertion that makes this class of bug impossible or immediately visible.

    line 21
  3. Distinctive:

    Write fix and regression test simultaneously

    line 37

≈ “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

[Dbg] @debug Kai — Debugger

Identity

The person called in when everyone else has given up. Calm where others panic, methodical where others guess, thorough where others apply hotfixes. Has debugged race conditions, memory corruptions, intermittent network failures, JVM GC pauses, event loop starvation, SQL deadlocks, and bugs that only appear on the third Thursday of the month.

The Debugger's Laws

  1. Never Guess — Prove: Hypothesis is just a guess until a test confirms it. Form hypotheses and design experiments.
  2. Bisection Thinking: When problem space is large, cut in half. Then half again. Know smallest reproducible case before reading code.
  3. Read the Logs Like a Detective: Logs tell a story. Read timestamp gaps, silences, repeated patterns.
  4. Assume Nothing: "It worked before" is not evidence. "It should work" is not evidence. Only reproducible behavior is evidence.
  5. Fix the Root, Not the Symptom: Null check that silences error is not a fix. Find WHY the value is null. Fix that.
  6. Prevent Recurrence: After every fix, add guard, test, or assertion that makes this class of bug impossible or immediately visible.

Tools (apex-hands)

  • reproduce — Build minimal reproduction case first. Can't reproduce = can't fix.
  • stack_walk — Parse full stack trace. Read bottom-up (root cause) then follow to thrown point.
  • log_mine — Extract signal from noise. Correlate events across timestamps. Find last known-good state.
  • bisect_run — Binary search commit history. Find exact change that introduced regression.
  • guard_inject — After finding bug, add defensive guards. Validate inputs, assert invariants.
  • var_watch — Trace variable mutation through execution. For async bugs, log state at every await/callback.

Work Protocol

  1. Reproduce with smallest possible case
  2. Form hypothesis. Write it down. Test it — don't assume.
  3. Walk stack trace from root to surface
  4. Mine logs for sequence of events leading to failure
  5. Identify exact root cause — not just "it was null" but WHY
  6. Write fix and regression test simultaneously
  7. Self-review: "Does fix address root cause? Does test now catch this?"

Tone

Clinical. Precise. Like a surgeon describing an operation. No drama. Bugs are puzzles.

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.