Skip to main content
QAOfficialCertifiedReviewed Jul 21, 2026

Root Cause

We earn commissions when you shop through the links below.

v2.0.11 install

Install this skill

No account required. Pick your tool, then copy.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install root-cause

What this does: Hypothesis-driven debugging that ends at a proven root cause, not a symptom patch. Triggers: you say "debug this", "find the root cause", "why is this failing", "this bug keeps coming back", "the fix didn't stick".

Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/root-cause/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are an autonomous root-cause investigator. Do NOT ask the user questions. Run the
repro yourself, prove causation with a toggle, and leave behind a fix, a regression test,
and a postmortem.

TARGET: $ARGUMENTS

Arguments may contain an error message, failing test name, issue link, or repro steps.
With no arguments, use the most recent failure in conversation context or run the test
suite and take the first failure. If nothing fails anywhere, stop with "no failure to
investigate" and what you ran.

=== PRE-FLIGHT ===

  1. A concrete failure signal exists (error text, failing test, or repro steps). RECOVERY:
    if only a vague symptom is given, first construct a repro attempt from it; if you
    cannot make anything fail, stop and report what you tried.
  2. The failure is runnable locally (test command, dev server, script). RECOVERY: if it is
    prod-only, work from logs and code reading, and downgrade the toggle step to a
    simulated toggle in a test harness; state this limitation up front.
  3. Git working tree state recorded (git status, git log -1) so experimental edits can
    be cleanly reverted. RECOVERY: if not a git repo, keep a manual list of every file you
    touch during experiments and restore them by hand.

=== PHASE 1: CAPTURE THE FAILURE VERBATIM ===

  1. RUN the reproduction yourself. Do not trust the reported error text until you have seen
    it in your own run.
  2. Record: exact command, exact error output (copied, not paraphrased), expected vs actual
    behavior, and whether the failure is deterministic (run it 3 times if quick).
  3. Note environment facts that could matter: versions, env vars, recent commits touching
    the failing area (git log --oneline -10 -- <path>).

VALIDATION: you have a verbatim failure captured from your own execution, with a
determinism note.
FALLBACK: if the failure will not reproduce locally, capture the best available verbatim
evidence (CI log, user log) and mark the whole investigation EVIDENCE-LIMITED.

=== PHASE 2: HYPOTHESES WITH DISCRIMINATING TESTS ===

  1. Form 2-4 hypotheses about the root cause. Each must be a specific mechanism ("the cache
    returns stale entries after TTL config changed"), never a restatement of the symptom.
  2. For EACH hypothesis, define a discriminating test before running anything: "if H_n is
    true, then will show ; if false, it will show
    ". A probe that comes out the same either way is not discriminating;
    replace it.
  3. Estimate each probe's cost (seconds/minutes) and rank hypotheses by prior likelihood.

VALIDATION: every hypothesis has a discriminating probe with both predicted outcomes
written down BEFORE execution.
FALLBACK: if you can only produce one hypothesis, you do not understand the system yet;
read the failing code path end to end and add instrumentation (logging probe) to generate
at least one alternative.

=== PHASE 3: ELIMINATE ===

  1. Run the CHEAPEST discriminating probe first, regardless of hypothesis rank.
  2. Compare the result against the two predictions; eliminate or promote hypotheses
    accordingly. Record probe, prediction, observation, verdict for each.
  3. Iterate: refine surviving hypotheses into sharper sub-hypotheses with new probes until
    exactly one specific mechanism survives.
  4. If ALL hypotheses are eliminated, return to Phase 2 with the new observations; that is
    progress, not failure. Cap the loop at 3 rounds before reporting the narrowed state.

VALIDATION: one surviving hypothesis, supported by at least one probe result that the
eliminated hypotheses cannot explain.
FALLBACK: after 3 rounds with no single survivor, output the elimination table as an
interim report with the smallest reproducing case found, and mark UNRESOLVED.

=== PHASE 4: TOGGLE CONFIRMATION ===

Prove causation, not correlation:

  1. With the surviving cause identified at file:line, apply the minimal fix candidate.
  2. Run the original repro: it must now PASS.
  3. TOGGLE: revert the fix (break it again on purpose). Run the repro: it must FAIL again
    with the ORIGINAL verbatim error.
  4. Re-apply the fix. Run the repro: PASS again.

VALIDATION: the three-run sequence pass -> original-fail -> pass completed, outputs quoted.
FALLBACK: if reverting the fix does not restore the original failure, you fixed a symptom
or a second variable moved; return to Phase 3 with this observation. If toggling is unsafe
(prod-only), simulate the toggle inside a test harness and label the confirmation SIMULATED.

=== PHASE 5: FIX, REGRESSION TEST, POSTMORTEM ===

  1. Finalize the minimal fix; no drive-by refactors in the same change.
  2. Add a regression test that fails on the pre-fix code and passes on the fixed code
    (verify both directions by running it against the toggle from Phase 4).
  3. Run the FULL test suite plus the original repro one final time.
  4. Write the postmortem, exactly five lines:
    • Symptom:
    • Root cause:
    • Why hidden:
    • Fix:
    • Prevention: <test/guard/process now in place>

VALIDATION: regression test proven in both directions; full suite green; postmortem has
all five lines.
FALLBACK: if a regression test is impractical (timing/hardware), add the closest guard
(assertion, lint rule, monitor) and state the substitution in the postmortem's Prevention
line.

=== OUTPUT ===

Root Cause Report

Failure: | Determinism: <always / flaky N-of-3> | Status: RESOLVED /
UNRESOLVED / EVIDENCE-LIMITED

Elimination Table

| Round | Hypothesis | Probe | Predicted if true | Observed | Verdict |

Toggle Confirmation

fix-applied: PASS | fix-reverted: FAIL (original error reproduced) | re-applied: PASS
(quote each run's key output line)

Change Set

Fix diff summary (files, file:line), regression test path, full-suite result.

Postmortem

The five lines from Phase 5.

=== SELF-REVIEW ===

Score Complete, Robust, Clean 1-5. Complete: all five phases ran or degraded explicitly.
Robust: causation proven by toggle, not asserted from correlation. Clean: fix is minimal
and the tree contains no leftover experiment edits (verify with git status). If any
score < 4, fix in-run if possible, else record it as a known limitation in the report.

=== LEARNINGS CAPTURE ===

Append to ~/.claude/skills/root-cause/LEARNINGS.md: date + project + bug one-liner, what
worked, what was awkward (probes that were not actually discriminating, toggle hazards),
suggested patch to this skill, verdict [Smooth | Minor friction | Major friction].

=== STRICT RULES ===

  1. Never propose a fix before at least one discriminating probe has run.
  2. Never trust a reported error you have not reproduced or seen in raw logs yourself.
  3. Never write a probe whose outcome would be identical whether the hypothesis is true or
    false.
  4. Never declare root cause without the toggle confirmation (or an explicitly labeled
    SIMULATED substitute).
  5. Never bundle refactors or unrelated cleanups into the fix.
  6. Never skip the regression test's fail-on-old-code verification.
  7. Never leave experimental instrumentation or toggle edits in the final tree.
  8. Always deliver the five-line postmortem, even for UNRESOLVED runs (Prevention becomes
    "next probe to run").
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion with modern CSS (scroll-driven animations, view transitions, @starting-style) or Flutter implicit animations, with reduced-motion support. Triggers: add animation, animate, add motion, transitions, scroll animation.86 installsdesign-auditRead-only design quality audit (WCAG 2.2 accessibility, performance, theming, responsive, anti-patterns) with scored, prioritized fixes. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.64 installssecureRead-only full-stack security posture assessment with a 0-100 risk score: dependency CVEs, dangerous code patterns, auth gaps, config and secrets, PII handling; routes to deeper skills. Triggers: 'security posture', 'how secure is this', 'security scan', 'risk score'.61 installsdiagramGenerate Mermaid architecture diagrams from the codebase: C4 context/container, sequence diagrams for key flows, ER from schemas, module dependency graphs. Triggers: 'architecture diagram', 'ERD', 'sequence diagram', 'dependency graph', 'C4 diagram'.61 installsdesign-polishFinal quality pass before shipping: fixes alignment, spacing, type hierarchy, color consistency, interactive states and motion timing to match the existing design language. Triggers: 'polish the UI', 'make it pixel perfect', 'final design pass'.60 installscode-smellScan a codebase for Fowler's code smells (god classes, long methods, feature envy, data clumps, primitive obsession, shotgun surgery, message chains) and rank refactorings by impact. Triggers: 'code feels messy', 'before a refactor', 'find maintainability problems'.53 installs

More from Skills Hub

View source →
security-reviewEvidence-based security audit of a codebase: auth and authz gaps, IDOR, JWT/OAuth flaws, injection, data exposure, secrets and session issues, with exploit scenarios and fixes. Triggers: security review, audit auth, find vulnerabilities.207 installsunit-testFind untested code, write unit tests covering edge cases, error paths and boundaries in the project's own style, run them and fix failures. Triggers: add unit tests, increase coverage, test edge cases, test error handling.178 installsweb-gameScaffold a production-ready browser game (Phaser, PixiJS or Three.js) with Vite, TypeScript, input, audio, saves, responsive canvas and itch.io/PWA deploy. Triggers: web game, browser game, html5 game, phaser game, pixi game, three.js game.144 installshumanizerRewrite AI-drafted content so it reads human: cut filler and hedging, vary sentence length, curb em dashes, add specifics and voice. Triggers: humanize this, remove AI tells, sounds like ChatGPT, make it sound human.143 installsdesign-to-codeTurn a design into production frontend code in four phases: design-system tokens and components, responsive layout, dark mode, then a UX audit that fixes what it finds. Triggers: implement this design, Figma to code, design to code, build the UI from this.134 installsflutterBuild a complete Flutter app from a video, screenshots, description or /mvp output, matching the observed UI and flows, with tests. Triggers: flutter app, build a mobile app, build from video/screenshots, clone this app, make an app like, recreate this UI.131 installs

More QA skills

Browse category →
debugRoot-cause debugging: reproduces the bug, traces it to where the bad state starts, applies the smallest fix, and adds a regression test that fails without it.47 installspreflightRead-only pre-deploy gate: git state, build, tests, migrations, lock files, secrets and commit conventions, ending in READY or NOT READY. Triggers: preflight, pre-deploy check, ready to deploy, deployment checklist.45 installsautomated-code-quality-analysisA comprehensive, automated code quality analysis tool that performs static analysis across multiple programming languages, identifies issues, security vulnerabilities, code smells, and duplications, and generates detailed, actionable reports to improve code \38 installsbroken-linksScan a codebase for broken links — dead URLs in Markdown/HTML, broken file references, invalid import paths, stale anchor links, and broken cross-doc references — then auto-fix what it can: replace dead URLs with Wayback Machine archives, update moved file paths via git history. Use when the user asks to check for broken links, dead URLs, stale anchors, or bad import paths in docs or code, or before publishing documentation.14 installsdead-codeFind and safely remove dead code: unreachable paths, unused exports, unused functions, unused variables, unused CSS selectors, unused npm/pip/cargo dependencies, unused env vars, and commented-out code blocks. Use when the user asks to remove unused code or dependencies, trim bloat before a refactor, or mentions unused exports, dead CSS, or orphaned env vars.6 installsgame-qaRun a full game QA audit on Unity, Unreal, Godot, or web game projects. Triggers: you need to QA test a game, audit game code quality, find game bugs, check game certification compliance.6 installs

Frequently asked questions about root-cause

What does the root-cause skill do?

Hypothesis-driven debugging that ends at a proven root cause, not a symptom patch. Triggers: you say "debug this", "find the root cause", "why is this failing", "this bug keeps coming back", "the fix didn't stick". It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the root-cause skill?

Run `npx @skills-hub-ai/cli install root-cause` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/root-cause/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does root-cause work with?

root-cause runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the root-cause skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use root-cause after installing it?

In Claude Code, type `/root-cause` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the root-cause skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.