agentleFS
RBraga01RBraga01/a-team/skills/five-whys/SKILL.md

five-whys

Skill24 starsChanged 24 days agoMITView on GitHub

Root cause analysis using the Five Whys technique. Use when a bug persists despite surface fixes, a failure recurs, or a process keeps breaking. Ensures the fix targets the root, not the symptom.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use pre-mortem.

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.
  • Ingramradical235Skill

    pre-mortem

    Pre-mortem analysis, scenario planning, future state narratives, and contingency frameworks. Use before finalizing any Strategy Kernel, when planning major initiatives, or when preparing Plan B triggers.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't stop until you reach something you control — a decision, a process, a line of code, a missing configuration.

    line 31
  2. Distinctive:

    Read the chain bottom-up: "No review checklist → cache key missing user_id → data leak." If the chain holds, the root cause is valid.

    line 45
  3. Distinctive:

    If you can only fix an intermediate level, document the root cause as tracked technical debt with a concrete TODO.

    line 57
  4. Distinctive:

    Test each branch independently.

    line 70
  5. Distinctive:

    Stop before the 5th why if you reach a clear, actionable root cause.

    line 74
  6. Very specific:

    Run this skill before launching the systematic-debugging agent — Five Whys defines the investigation scope

    line 90
  7. Very specific:

    After finding the root cause, use the tdd-guide agent to write the test that would have caught it

    line 91
  8. Very specific:

    If the root cause implies a process change, document the analysis in DAILY.md

    line 92

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

Five Whys — Root Cause Analysis

The Rule

DO NOT FIX THE SYMPTOM. FIND THE CAUSE.

A fix that doesn't address the root cause is temporary. The cause returns.

Protocol

Step 1 — Define the problem precisely

One concrete sentence. Not vague.

WrongCorrect
"The system is slow""GET /orders exceeds 3s for 90% of requests in prod since Friday"
"Tests fail sometimes""test_payment_flow fails in CI roughly 1 in 20 runs with no clear error message"

Step 2 — Five Whys cascade

For each answer, ask: "Why does that happen?"

Don't stop until you reach something you control — a decision, a process, a line of code, a missing configuration.

Problem: Users see another user's data
  Why 1: Cache returns the wrong entry
  Why 2: Cache key does not include user_id
  Why 3: Developer assumed the endpoint was public
  Why 4: No isolation test existed for this endpoint
  Why 5: Code review had no data isolation checklist
  → Root cause: review process missing a security checklist

Step 3 — Validate in reverse

Read the chain bottom-up: "No review checklist → cache key missing user_id → data leak." If the chain holds, the root cause is valid.

Step 4 — Fix at the root, not the symptom

Fix at the deepest level that is practical to change.

Fix levelExampleDurability
SymptomManually flush cacheHours
Proximate causeAdd user_id to cache keyDays
Root causeAdd isolation checklist to reviewPermanent

If you can only fix an intermediate level, document the root cause as tracked technical debt with a concrete TODO.

Branching

A root cause can have multiple branches — explore all before choosing where to fix.

Problem: Deploy fails in prod but not in staging
  Branch A: different configuration (env vars, secrets)
  Branch B: prod data has different volume or format
  Branch C: network dependencies only reachable in prod

Test each branch independently. Do not assume.

When to Stop

Stop before the 5th why if you reach a clear, actionable root cause. Stop after the 5th if the chain hasn't converged — there may be multiple independent root causes.

Output

Document the analysis:

**Problem:** [concrete one-liner]
**Root cause:** [deepest level found]
**Fix:** [concrete action with file/component]
**Temporary fix (if needed):** [what you apply now while the real fix is in progress]
**Technical debt:** [what remains unresolved and why]

Integration with A Team

  • Run this skill before launching the systematic-debugging agent — Five Whys defines the investigation scope
  • After finding the root cause, use the tdd-guide agent to write the test that would have caught it
  • If the root cause implies a process change, document the analysis in DAILY.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.