agentleFS
orchnesaiorchnesai/orchnes-360/skills/root-cause-analysis/SKILL.md

root-cause-analysis

Skill3 starsChanged 9 days agoMITView on GitHub

Evidence-driven root cause analysis for any software problem — code bugs (crashes, wrong results, failing or flaky tests), performance problems (slowness, memory leaks, high CPU/cost) and production incidents (outages, error spikes, data issues). Finds the true cause instead of patching symptoms, proves it with a reproduction and a test, and writes a short report. Use when the user says "why does this fail", "debug", "find the cause", "it's slow", "memory leak", "outage", "postmortem", "RCA", or when a fix didn't hold.

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use incident-response, observability and 8 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.
  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 3 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 3 projects that use this

  • SentrySkill

    architecture-review

    Staff-level codebase health review. Finds monolithic modules, silent failures, type safety gaps, test coverage holes, and LLM-friendliness issues.

    Also in 3 projects that use this

  • MicrosoftSkill

    adversarial-review

    Adversarial review of a system design from 6 critical perspectives -- SRE, security, staff engineer, finance, operator, and developer advocate. Produces a unified risk assessment. Use for INTERACTIVE on-demand reviews during a design conversation (/adversarial-review). For RECIPE-DRIVEN reviews (where prior step context is needed), use the systems-design-critic agent instead.

    Also in 3 projects that use this

  • GoogleSkill

    domain-modeling

    Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.

    Also in 4 projects that use this

  • GoogleSkill

    improve-codebase-architecture

    Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

    Also in 3 projects that use this

  • +3 more from google

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 19 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. Distinctive:

    Write it as one sentence. A vague symptom produces a vague cause.

    line 26
  2. Distinctive:

    Read the actual error and stack trace fully.

    line 35
  3. Distinctive:

    Run the cheapest discriminating test first.

    line 39
  4. Distinctive:

    When the immediate cause is confirmed, ask "why was this possible?" until you reach something fixable in code, process or design (see 5 …

    line 42
  5. Distinctive:

    Write a test/check that fails because of the root cause.

    line 47
  6. Distinctive:

    Test passes; original reproduction no longer fails.

    line 49
  7. Distinctive:

    Add a guard against recurrence where cheap: assertion, validation, alert, lint rule, type.

    line 50
  8. Very specific:

    Use references/report-template.md.

    line 53
  9. Distinctive:

    Distrust your assumptions first: Verify the code you think runs is the code that runs (version, branch, cache, config, env vars).

    line 58
  10. Distinctive:

    Don't stack changes: If a fix attempt fails, revert it before trying the next.

    line 59

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

A root cause is found when you can explain the failure mechanism, reproduce it on demand, and make it disappear by changing exactly that cause. Anything less is a hypothesis.

1. Classify, then load only the matching guide

ProblemFile
Crash, exception, wrong output, failing/flaky test, build/CI failurereferences/types/bugs.md
Slowness, latency, high CPU, memory growth/leak, cost spikereferences/types/performance.md
Production outage, error-rate spike, degraded service, data corruptionreferences/types/incidents.md

Production incident? Mitigate first (rollback, feature flag off, scale up), analyze second. Techniques (5 Whys, bisection, fishbone, fault tree, differential diagnosis): references/techniques.md.

2. The core loop (all problem types)

Step 1 — Define the symptom precisely

Expected vs actual, exact error text, where (env, version, input), when it started, how often, who is affected. Write it as one sentence. A vague symptom produces a vague cause.

Step 2 — Reproduce

Get a reliable reproduction, then shrink it to the minimum (smallest input, fewest steps, single test). Cannot reproduce? Gather more evidence (logs, traces, core dumps, metrics) or add targeted instrumentation — do not guess-fix.

Step 3 — Collect evidence before theorizing

  • What changed? (deploys, commits, dependencies, config, data, traffic, infrastructure) — git log, deploy history.
  • Where does it diverge? Last point where state was correct vs first point where it is wrong.
  • Read the actual error and stack trace fully; the first error is usually the real one, later ones cascade.

Step 4 — Hypotheses, ranked

List 2–4 candidate causes. For each: the evidence for it, the evidence against it, and a cheap test that would refute it. Run the cheapest discriminating test first. Change one variable at a time.

Step 5 — Find the cause behind the cause

When the immediate cause is confirmed, ask "why was this possible?" until you reach something fixable in code, process or design (see 5 Whys). Stop at the level where a fix prevents the whole class of failure, not only this instance.

Step 6 — Fix and prove

  1. Write a test/check that fails because of the root cause.
  2. Fix the root cause (not the symptom). Keep the diff minimal.
  3. Test passes; original reproduction no longer fails; related suites still pass.
  4. Add a guard against recurrence where cheap: assertion, validation, alert, lint rule, type.

Step 7 — Report

Use references/report-template.md. Short: symptom, root cause, evidence, fix, prevention.

3. Rules

  • No fix without a reproduction or conclusive evidence.
  • Correlation is not cause. "It started after deploy X" narrows the search; it doesn't name the cause.
  • Distrust your assumptions first. Verify the code you think runs is the code that runs (version, branch, cache, config, env vars).
  • Don't stack changes. If a fix attempt fails, revert it before trying the next.
  • Two failed fixes on the same hypothesis → the hypothesis is wrong. Go back to Step 3.
  • In long debugging sessions, escalate to a stronger model with a compact evidence packet (see autonomous-loop skill).

4. Anti-patterns

Retry/sleep to hide races · catching and ignoring the exception · raising timeouts without knowing why it's slow · deleting or skipping the failing test · "works on my machine" closure · fixing the line in the stack trace when the bad data came from upstream.

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.