agentleFS
aminemanai2003aminemanai2003/personal-agent-skills/skills/root-cause-debugging/SKILL.md

root-cause-debugging

Skill4 starsChanged 4 months agoMITView on GitHub

Diagnose reproducible or intermittent software failures by tracing evidence from symptom to originating cause, testing one hypothesis at a time, and adding regression coverage. Use when a bug, failing test, build error, production incident, performance regression, race, timeout, or unexplained behavior requires investigation and a verified fix; do not use for a known mechanical edit whose cause and remedy are already established.

5 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

10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill to investigate and fix an unexplained failure.

    line 21
  2. Distinctive:

    Read the complete error chain and inspect recent relevant changes before editing.

    line 27
  3. Distinctive:

    If disproved, preserve what the experiment taught, remove temporary changes, and form a new hypothesis.

    line 31
  4. Distinctive:

    Create a regression test or deterministic check that fails for the confirmed cause.

    line 32
  5. Distinctive:

    Do not propose a code fix before gathering enough evidence to name a testable cause, except for an explicitly labeled reversible mitigation …

    line 38
  6. Distinctive:

    Do not change multiple independent variables in one diagnostic experiment.

    line 39
  7. Distinctive:

    Do not hide the failure with a catch-all exception, retry, timeout increase, cache clear, or test skip unless evidence shows that behavior …

    line 40
  8. Distinctive:

    Do not expose secrets, personal data, or sensitive payloads through debugging logs.

    line 41
  9. Distinctive:

    Do not require a perfect reproduction before collecting useful evidence from an intermittent or external failure.

    line 42
  10. Distinctive:

    Do not claim root cause when only the immediate symptom or correlation is known.

    line 43

“Common” is measured: kept by at least 6 in 10 of the 5 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

Root Cause Debugging

Purpose

Replace guess-and-check fixes with a short evidence loop that explains why the failure occurs, fixes the responsible boundary, and prevents recurrence.

Inputs

  • Observed symptom, expected behavior, impact, and first known occurrence.
  • Reproduction steps, failing command, logs, stack traces, metrics, and environment details.
  • Recent changes, comparable working paths, dependency or configuration differences, and relevant tests.
  • Authorization for mitigation, instrumentation, code changes, and production access.

Scope Boundary

Use this skill to investigate and fix an unexplained failure. Use review-code for a review-only request and build-feature when the requested behavior is new rather than broken. During an active incident, contain user harm first when authorized, then continue the root-cause investigation.

Process

  1. Define the failure precisely: expected result, actual result, affected scope, frequency, and earliest known occurrence.
  2. Reproduce the smallest faithful case. Record exact commands, inputs, environment, timing, and whether reproduction is deterministic.
  3. Read the complete error chain and inspect recent relevant changes before editing. Separate observations from interpretations.
  4. Trace the failing value, state, or event backward across component boundaries until its first incorrect origin. Add narrow diagnostic instrumentation when existing evidence cannot locate the break.
  5. Compare the failing path with one working path or known-good version. List meaningful differences without assuming which one matters.
  6. State one falsifiable hypothesis with predicted evidence. Test it with the smallest experiment that changes one variable.
  7. If disproved, preserve what the experiment taught, remove temporary changes, and form a new hypothesis. After repeated failed fixes reveal different coupling failures, stop and reassess the architecture instead of stacking patches.
  8. Create a regression test or deterministic check that fails for the confirmed cause. For intermittent failures, make the trigger observable and repeatable enough to distinguish signal from chance.
  9. Implement the smallest fix at the originating boundary. Add defense in depth only where it blocks a realistic recurrence or makes failure explicit.
  10. Re-run the original reproduction, the regression check, adjacent tests, and broader checks proportional to the affected contract. Remove temporary diagnostics or convert useful ones into safe observability.

Constraints

  • Do not propose a code fix before gathering enough evidence to name a testable cause, except for an explicitly labeled reversible mitigation during an incident.
  • Do not change multiple independent variables in one diagnostic experiment.
  • Do not hide the failure with a catch-all exception, retry, timeout increase, cache clear, or test skip unless evidence shows that behavior is the correct contract.
  • Do not expose secrets, personal data, or sensitive payloads through debugging logs.
  • Do not require a perfect reproduction before collecting useful evidence from an intermittent or external failure.
  • Do not claim root cause when only the immediate symptom or correlation is known.

Verification

  • The explanation connects the initiating condition to the observed failure through inspectable evidence.
  • The regression check fails before the fix or otherwise demonstrates the original broken condition.
  • The fix addresses the source rather than only suppressing the symptom.
  • Original, adjacent, and relevant failure-path checks pass after the final change.
  • Temporary experiments and unsafe diagnostic output are removed.
  • Remaining uncertainty, environmental dependence, or unverified production behavior is stated explicitly.

Failure Modes

  • Editing the most suspicious line before reproducing or tracing the data flow.
  • Treating a passing rerun as proof for a flaky failure.
  • Adding retries to an invalid-state or authorization bug.
  • Fixing a deep stack-frame symptom while the invalid value is created earlier.
  • Preserving several speculative changes after only one appears to help.
  • Declaring an external service the cause without boundary evidence.

Examples

Failing test: reproduce the focused test, trace the malformed fixture to premature initialization, write a regression case, fix initialization, and rerun the focused and neighboring suites.

Intermittent timeout: capture timing at each boundary, distinguish queueing from execution latency, test the bottleneck hypothesis, then fix or bound the responsible stage rather than increasing every timeout.

Sources

See ../../sources/root-cause-debugging.sources.md.

For intermittent, multi-component, concurrency, and performance investigations, read references/diagnostic-playbook.md.

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.