MCPInstall

causal-inference-root-cause

Systematically investigates causal relationships to identify true root causes rather than correlations or symptoms. Distinguishes genuine causation from spurious associations, tests competing explanations, and designs interventions addressing underlying drivers. Use when investigating why something happened, debugging systems, analyzing failures, evaluating policy impacts, or when user mentions root cause, causal chain, confounding, spurious correlation, or asks "why did this really happen?"

Installs
108
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/lyndonkl/claude --skill causal-inference-root-cause
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads causal-inference-root-cause automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Causal Inference & Root Cause Analysis

Table of Contents

Key concepts: root cause (fundamental issue), proximate cause (immediate trigger), confounding variable (third factor creating spurious correlation), counterfactual ("what would have happened without X?"), and causal mechanism (pathway through which X affects Y).

Quick Example:

# Effect: Website conversion rate dropped 30%

## Competing Hypotheses:
1. New checkout UI is confusing (proximate)
2. Payment processor latency increased (proximate)
3. We changed to a cheaper payment processor that's slower (root cause)

## Test:
- Rollback UI (no change) → UI not cause
- Check payment logs (confirm latency) → latency is cause
- Trace to processor change → processor change is root cause

## Counterfactual:
"If we hadn't switched processors, would conversion have dropped?"
→ No, conversion was fine with old processor

## Conclusion:
Root cause = processor switch
Mechanism = slow checkout → user abandonment

Workflow

Copy this checklist and track your progress:

Root Cause Analysis Progress:
- [ ] Step 1: Define the effect
- [ ] Step 2: Generate hypotheses
- [ ] Step 3: Build causal model
- [ ] Step 4: Test causality
- [ ] Step 5: Document and validate

Step 1: Define the effect

Describe effect/outcome (what happened, be specific), quantify if possible (magnitude, frequency), establish timeline (when it started, is it ongoing?), determine baseline (what's normal, what changed?), and identify stakeholders (who's impacted, who needs answers?). Key questions: What exactly are we explaining? One-time event or recurring pattern? How do we measure objectively?

Step 2: Generate hypotheses

List proximate causes (immediate triggers/symptoms), identify potential root causes (underlying factors), consider confounders (third factors creating spurious associations), and challenge assumptions (what if initial theory wrong?). Techniques: 5 Whys (ask "why" repeatedly), Fishbone diagram (categorize causes), Timeline analysis (what changed before effect?), Differential diagnosis (what else explains symptoms?). For simple investigations → Use resources/template.md. For complex problems → Study resources/methodology.md for advanced techniques.

Step 3: Build causal model

Draw causal chains (A → B → C → Effect), identify necessary vs sufficient causes, map confounding relationships (what influences both cause and effect?), note temporal sequence (cause precedes effect - necessary for causation), and specify mechanisms (HOW X causes Y). Model elements: Direct cause (X → Y), Indirect (X → Z → Y), Confounding (Z → X and Z → Y), Mediating variable (X → M → Y), Moderating variable (X → Y depends on M).

Step 4: Test causality

Check temporal sequence (cause before effect?), assess strength of association (strong correlation?), look for dose-response (more cause → more effect?), test counterfactual (what if cause absent/removed?), search for mechanism (explain HOW), check consistency (holds across contexts?), and rule out confounders. Evidence hierarchy: RCT (gold standard) > natural experiment > longitudinal > case-control > cross-sectional > expert opinion. Use Bradford Hill Criteria (9 factors: strength, consistency, specificity, temporality, dose-response, plausibility, coherence, experiment, analogy).

Step 5: Document and validate

Create causal-inference-root-cause.md with: effect description/quantification, competing hypotheses, causal model (chains, confounders, mechanisms), evidence assessment, root cause(s) with confidence level, recommended tests/interventions, and limitations/alternatives. Validate using resources/evaluators/rubric_causal_inference_root_cause.json: verify distinguished proximate from root cause, controlled confounders, explained mechanism, assessed evidence systematically, noted uncertainty, recommended interventions, acknowledged alternatives. Minimum standard: Score ≥ 3.5.

Common Patterns

For incident investigation (engineering):

  • Effect: System outage, performance degradation
  • Hypotheses: Recent deploy, traffic spike, dependency failure, resource exhaustion
  • Model: Timeline + dependency graph + recent changes
  • Test: Logs, metrics, rollback experiments
  • Output: Postmortem with root cause and prevention plan

For metric changes (product/business):

  • Effect: Conversion drop, revenue change, user engagement shift
  • Hypotheses: Product changes, seasonality, market shifts, measurement issues
  • Model: User journey + external factors + recent experiments
  • Test: Cohort analysis, A/B test data, segmentation
  • Output: Causal explanation with recommended actions

For policy evaluation (research/public policy):

  • Effect: Health outcome, economic indicator, social metric
  • Hypotheses: Policy intervention, confounding factors, secular trends
  • Model: DAG with confounders + mechanisms
  • Test: Difference-in-differences, regression discontinuity, propensity matching
  • Output: Causal effect estimate with confidence intervals

For debugging (software):

  • Effect: Bug, unexpected behavior, test failure
  • Hypotheses: Recent changes, edge cases, race conditions, dependency issues
  • Model: Code paths + data flows + timing
  • Test: Reproduce, isolate, binary search, git bisect
  • Output: Bug report with root cause and fix

Guardrails

Do:

  • Distinguish correlation from causation explicitly
  • Generate multiple competing hypotheses (not just confirm first theory)
  • Map out confounding variables and control for them
  • Specify causal mechanisms (HOW X causes Y)
  • Test counterfactuals ("what if X hadn't happened?")
  • State confidence levels and uncertainty
  • Acknowledge alternative explanations
  • Recommend testable interventions based on root cause

Don't:

  • Confuse proximate cause with root cause
  • Cherry-pick evidence that confirms initial hypothesis
  • Assume correlation implies causation
  • Ignore confounding variables
  • Skip mechanism explanation (just stating correlation)
  • Overstate confidence without strong evidence
  • Stop at first plausible explanation without testing alternatives
  • Propose interventions without identifying root cause

Common Pitfalls:

  • Post hoc ergo propter hoc: "After this, therefore because of this" (temporal sequence ≠ causation)
  • Spurious correlation: Two things correlate due to third factor or coincidence
  • Confounding: Third variable causes both X and Y
  • Reverse causation: Y causes X, not X causes Y
  • Selection bias: Sample is not representative
  • Regression to mean: Extreme values naturally move toward average

Quick Reference

  • Template: resources/template.md - Structured framework for root cause analysis
  • Methodology: resources/methodology.md - Advanced techniques (DAGs, confounding control, Bradford Hill criteria)
  • Quality rubric: resources/evaluators/rubric_causal_inference_root_cause.json
  • Output file: causal-inference-root-cause.md
  • Key distinction: Correlation (X and Y move together) vs. Causation (X → Y mechanism)
  • Gold standard test: Randomized controlled trial (eliminates confounding)
  • Essential criteria: Temporal sequence (cause before effect), mechanism (how it works), counterfactual (what if cause absent)

FAQ

What does the causal-inference-root-cause skill do?

Systematically investigates causal relationships to identify true root causes rather than correlations or symptoms. Distinguishes genuine causation from spurious associations, tests competing explanations, and designs interventions addressing underlying drivers. Use when investigating why something happened, debugging systems, analyzing failures, evaluating policy impacts, or when user mentions root cause, causal chain, confounding, spurious correlation, or asks "why did this really happen?"

How do I install causal-inference-root-cause?

Run npx skills add https://github.com/lyndonkl/claude --skill causal-inference-root-cause in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/causal-inference-root-cause/ (personal) or .claude/skills/causal-inference-root-cause/ (project).

Which AI agents can use causal-inference-root-cause?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is causal-inference-root-cause safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains causal-inference-root-cause?

It is published by lyndonkl in lyndonkl/claude. It has 108 recorded installs.

More from lyndonkl/claude

View all →

evaluation-rubrics

lyndonkl/claude

Designs structured scoring tools with explicit criteria, performance scales, and descriptors for consistent, transparent quality assessment. Use when need quality criteria and scoring scales to evaluate work consistently, compare alternatives objectively, set acceptance thresholds, reduce subjective bias, or when user mentions rubric, scoring criteria, quality standards, evaluation framework, inter-rater reliability, or grading/assessing work.

Develops business strategies grounded in rigorous competitive and market analysis using proven frameworks (Good Strategy kernel, Porter's 5 Forces, SWOT, Blue Ocean, Playing to Win, Value Chain Analysis, BCG Matrix). Use when developing strategy (market entry, product launch, expansion, M&A, turnaround), conducting competitive analysis, making strategic decisions (build vs buy, pricing, positioning), planning strategic initiatives, or when user mentions strategy, competitive analysis, Porter's 5 Forces, SWOT, market positioning, or strategic frameworks.

Business & Finance491 installs

Guides systematic multi-pass review and editing of scientific manuscripts (research articles, reviews, perspectives) to improve clarity, structure, scientific rigor, and reader comprehension. Use when reviewing or editing research manuscripts, journal articles, or perspectives, when user mentions manuscript, paper draft, article, research writing, journal submission, reviewer feedback, or needs to improve scientific writing.

Open the skill to read its SKILL.md instructions.

Open the skill to read its SKILL.md instructions.

417 installs

Open the skill to read its SKILL.md instructions.

350 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs