agentleFS
riz007riz007/architect-os/skills/aos-debugging/SKILL.md

aos-debugging

Skill1 starsChanged 7 months agoMITView on GitHub

A structured debugging loop for tracking down a bug, failing test, exception, stack trace, regression, or "this used to work" report. Use proactively when investigating why code is broken, reproducing a failure, or diagnosing unexpected behavior — before changing any code. Prevents guess-driven editing by forcing reproduction, hypothesis, and a single verified fix.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 8 are distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If you cannot reproduce it, say so and gather more signal (logs, a failing test, the stack trace) before touching code.

    line 14
  2. Distinctive:

    Read the stack trace top-down to the first frame in our code.

    line 20
  3. Distinctive:

    Read the actual source at that location — do not assume what it does.

    line 21
  4. Distinctive:

    If the evidence contradicts the hypothesis, discard it and form a new one.

    line 28
  5. Distinctive:

    No shotgun edits, no "try this and see." One deliberate change.

    line 34
  6. Distinctive:

    If the fix touches business logic, keep it in the service layer (see aos-implementing-features).

    line 35
  7. Distinctive:

    Add a regression test that would have caught this bug, so it stays fixed.

    line 41
  8. Distinctive:

    Run the surrounding test suite to confirm nothing else broke.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Diagnosing bugs

This is a model-invoked discipline. When something is broken, resist the urge to start editing. Work the loop.

1. Reproduce first

  • Get a deterministic reproduction: the exact command, input, and expected vs. actual.
  • If you cannot reproduce it, say so and gather more signal (logs, a failing test, the stack trace) before touching code.
  • Capture the smallest reproduction you can — a failing unit test is ideal.

2. Locate, don't guess

  • Read the stack trace top-down to the first frame in our code.
  • Read the actual source at that location — do not assume what it does.
  • Form one hypothesis at a time, stated concretely: "X is null because Y returns early when Z."

3. Confirm the hypothesis before fixing

  • Prove it with a log, a breakpoint, a test, or by reading the data flow end to end.
  • If the evidence contradicts the hypothesis, discard it and form a new one. Do not stack speculative fixes.

4. Fix at the root, once

  • Change the smallest thing that addresses the root cause — not the symptom.
  • No shotgun edits, no "try this and see." One deliberate change.
  • If the fix touches business logic, keep it in the service layer (see aos-implementing-features).

5. Verify and lock it in

  • Re-run the reproduction. Confirm it now passes.
  • Add a regression test that would have caught this bug, so it stays fixed.
  • Run the surrounding test suite to confirm nothing else broke.

Anti-patterns to avoid

  • Editing multiple files hoping one sticks.
  • "Fixing" by adding a null-check at the symptom while the real cause is upstream.
  • Removing a failing assertion instead of fixing the behavior.
  • Declaring it fixed without re-running the reproduction.

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.