agentleFS
K95M65K95M65/AI_ONBOARD/skills/debug-systematically/SKILL.md

debug-systematically

Skill0 starsChanged 4 months agoMITView on GitHub

Reproduces software failures, isolates causal conditions, tests competing hypotheses, and either reports the supported diagnosis or implements and verifies the smallest authorized root-cause fix. Use for diagnosis or repair when the cause of a bug, crash, flaky test, incorrect output, performance regression, race condition, integration failure, or environment-specific behavior is unknown; do not use for feature development or a known-cause change that the user explicitly wants implemented test-first.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Run the smallest experiment that could disprove it.

    line 22
  2. Distinctive:

    Use logs, assertions, traces, profilers, debuggers, or temporary instrumentation only where they distinguish competing causes.

    line 25
  3. Distinctive:

    Add or refine a regression test that fails for the reproduced defect.

    line 35
  4. Distinctive:

    Do not suppress errors, weaken assertions, add arbitrary sleeps or retries, broaden timeouts, or upgrade dependencies without evidence that …

    line 37

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

Debug systematically

Replace guess-and-check editing with a reproducible chain from symptom to cause to verified correction.

Reproduce the failure

Capture the exact command or user path, expected result, observed result, environment, versions, input, frequency, and earliest known good state. Reduce nondeterminism where possible. If the failure cannot be reproduced, gather discriminating evidence instead of changing code speculatively.

Narrow the causal surface

  1. Identify the boundary where correct state first becomes incorrect.
  2. Compare passing and failing inputs, environments, commits, timing, or dependencies.
  3. Trace data and control flow across that boundary.
  4. Form one falsifiable hypothesis at a time.
  5. Run the smallest experiment that could disprove it.
  6. Record rejected hypotheses so they are not repeated.

Use logs, assertions, traces, profilers, debuggers, or temporary instrumentation only where they distinguish competing causes. Remove temporary instrumentation before finishing unless it has lasting operational value.

Respect the request boundary

For a diagnosis-only request, stop after identifying the supported cause, evidence, and likely correction. Implement only when the user asks to fix the bug or the request clearly includes repair.

Fix the cause

  • Add or refine a regression test that fails for the reproduced defect.
  • Make the smallest coherent correction at the causal boundary.
  • Do not suppress errors, weaken assertions, add arbitrary sleeps or retries, broaden timeouts, or upgrade dependencies without evidence that the change addresses the cause.
  • Preserve unrelated behavior and existing architecture.

Verify

Confirm the original reproduction now passes, the regression test detects the old behavior, and the relevant broader checks remain green. Exercise nearby edge cases implied by the cause. For intermittent failures, run enough repetitions to support the stability claim and report the sample.

Compose with test-browser-workflows for browser failures, a platform-specific testing skill where one exists, and a verifier agent for independent acceptance. When the cause and intended behavior are already known and the user wants a regression-first implementation, hand the change to develop-test-first instead of repeating its red-green-refactor loop here.

Finish a diagnosis-only request with the supported cause, decisive evidence, likely correction, commands run, and residual uncertainty. When repair was authorized, also report the implemented fix and regression coverage.

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.