Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.

MITAuto-check passedResearch & Science

Install Causal

skills CLI
$ npx skills add ai-analyst-lab/ai-analyst --skill causal -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ai-analyst-lab/ai-analyst causal --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/causal .claude/skills/causal && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
causal
GitHub stars
304
Token cost
~1.8k tokens
SKILL.md length
607 words
Files
1
Skills in repo
43
Repo updated
First seen
Licence
MIT

At a glance

Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.

  • Works in 3 steps: Ask 4-6 diagnostic questions → Recommend: Pre-Post, DiD, PSM,… → Output: recommended method + confidence…
  • Difference-in-differences
  • SKILL.md covers Purpose, When to Use, Modes and Confidence Ladder, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Causal is an agent skill from ai-analyst-lab/ai-analyst. Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats. Invoke as /causal. Trigger on "causal", "caused", "impact of", "effect of", "attribution", "counterfactual", "difference-in-differences", "DiD", "propensity matching", "pre-post". If randomization IS possible, route to /experiment design instead.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Econometrics and empirical research and Experimental design. The repository describes itself as: AI Product Analyst — Claude Code-powered data analysis toolkit. The licence is MIT.

When your agent uses it

  • Difference-in-differences
  • Propensity matching

Example prompts

  • “causal”
  • “caused”
  • “impact of”
  • “/causal”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Ask 4-6 diagnostic questions
  2. Recommend: Pre-Post, DiD, PSM, Regression Adjustment, or "not feasible"
  3. Output: recommended method + confidence level + rationale

What it can do on your machine

Read from SKILL.md and the folder at commit 52c0744. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Causal loads about 1.8k tokens when it runs. Until then it costs about 104 tokens; SKILL.md has 607 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ai-analyst-lab/ai-analyst at commit 52c0744, republished under its MIT licence (© ai-analyst-lab). 607 words, ~1,786 tokens.

Download SKILL.mdSave it as .claude/skills/causal/SKILL.md (or your agent's skills folder).
name
causal
description
Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats. Invoke as /causal. Trigger on "causal", "caused", "impact of", "effect of", "attribution", "counterfactual", "difference-in-differences", "DiD", "propensity matching", "pre-post". If randomization IS possible, route to /experiment design instead.

Skill: /causal — OpenCausalInf Causal Inference Toolkit

Purpose

Multi-mode skill for causal inference when experiments aren't possible. Helps users estimate treatment effects from observational data with explicit assumption checking, sensitivity analysis, and mandatory caveats. Uses coded helpers from helpers/stats/experiment_stats/causal/.

When to Use

Invoke as /causal [mode] or trigger on causal inference intents:

  • "Did this feature actually cause the improvement?"
  • "We can't run an experiment, but..."
  • "Was this change responsible for the metric movement?"
  • "Can we measure the impact retroactively?"

Modes

/causal select

Purpose: Walk the method selection decision tree and recommend a causal method. Agent: agents/causal/causal-method-selector.md Flow:

  1. Ask 4-6 diagnostic questions:
    • Can you randomize? → Route to /experiment design
    • Do you have a comparison group?
    • Do you have pre-treatment data?
    • Are there observable confounders you can measure?
    • How many time periods do you have?
  2. Recommend: Pre-Post, DiD, PSM, Regression Adjustment, or "not feasible"
  3. Output: recommended method + confidence level + rationale Checkpoint: Method confirmation (Type C — user must confirm before analysis)
/causal analyze

Purpose: Run the selected causal method on data. Agent: agents/causal/causal-analyzer.md Flow:

  1. Read selected method from previous step or user input
  2. Dispatch to appropriate helper:
    python
    from helpers.stats.experiment_stats.causal import (
        pre_post_analysis, did_basic, propensity_match,
        regression_adjust,
    )
    # Method routing:
    # "pre_post" → pre_post_analysis(pre, post, covariates)
    # "did"      → did_basic(df, outcome, treat, post)
    # "psm"      → propensity_match(df, treat, covariates, outcome)
    # "regression" → regression_adjust(df, outcome, treatment, covariates)
  3. Generate charts (treatment effect, balance plots for PSM, event study for DiD)
  4. Output: working/causal_analysis_results.json
/causal check

Purpose: Run assumption checks for the selected method. Agent: agents/causal/causal-assumption-checker.md Flow:

  1. Identify which assumptions apply to the selected method:
    • DiD: Parallel trends, no anticipation, stable composition
    • PSM: Common support, balance (SMD < 0.1), positivity
    • Pre-Post: No concurrent events, trend stability
    • Regression: All confounders included, correct specification
  2. Run quantitative checks:
    python
    from helpers.stats.experiment_stats.causal import (
        check_parallel_trends, check_common_support,
        balance_table,
    )
  3. Output: per-assumption PASS / WARNING / FAIL verdicts Checkpoint: Any FAIL (Type C) → present options: adjust method, add caveats, or abort
/causal sensitivity

Purpose: Test how robust the estimate is to unmeasured confounding. Agent: agents/causal/causal-sensitivity.md Flow:

  1. Run sensitivity analysis based on method:
    python
    from helpers.stats.experiment_stats.causal import rosenbaum_bounds, e_value
    # PSM: rosenbaum_bounds(treated_outcomes, control_outcomes)
    # All: e_value(risk_ratio, ci_lower)
  2. Translate to plain language: "An unmeasured confounder would need to be X times stronger than anything we measured to explain away this result."
  3. Output: sensitivity report
Show full SKILL.md (281 more words)Show less
/causal report

Purpose: Generate a report with mandatory caveats. Agent: agents/causal/causal-report-generator.md Flow:

  1. Compile: estimate + CI + assumption verdicts + sensitivity results
  2. Place on confidence ladder (RCT > DiD+reg > PSM > DiD > regression > pre-post)
  3. Include mandatory caveat block (method-specific, non-negotiable)
  4. Output: outputs/causal_report_{{DATE}}.md
/causal full

Purpose: End-to-end: select → analyze → check → sensitivity → report. Flow: Runs all modes in sequence. All Type C checkpoints fire.

Confidence Ladder

Methods ranked by causal credibility (highest to lowest):

LevelMethodConfidence
1RCT (Randomized Experiment)HIGH
2DiD + Regression AdjustmentMODERATE-HIGH
3PSM (Good Overlap + Balance)MODERATE
4DiD (Parallel Trends OK)MODERATE
5Regression AdjustmentLOW-MODERATE
6Pre-Post (With Trend)LOW
7Pre-Post (Simple)VERY LOW

Mandatory Caveats (Non-Negotiable)

Every causal report MUST include the method-specific caveat. These are architecturally required — the agent cannot produce a report without them.

MethodMandatory Caveat
Pre-Post"Assumes nothing else changed during this period. Any concurrent event could explain this result."
DiD"Assumes the control group would have followed the same trend. Plausible but unprovable."
PSM"Controls for observed confounders only. Unmeasured factors could bias this estimate."
Regression"Assumes all relevant confounders are included and the model is correctly specified."

Helper Function Reference

FunctionModuleUse For
pre_post_analysis()causal.pre_postPre-post comparison
did_basic()causal.did2x2 DiD estimator
parallel_trends_test()causal.didTest parallel trends assumption
event_study()causal.didPeriod-by-period effects
propensity_match()causal.matchingPSM pipeline
balance_table()causal.balanceSMD balance diagnostics
love_plot()causal.balanceBefore/after balance visual
regression_adjust()causal.regressionOLS with covariates
rosenbaum_bounds()causal.sensitivityPSM sensitivity
e_value()causal.sensitivityUniversal sensitivity measure
check_parallel_trends()causal.assumptionsDiD assumption
check_common_support()causal.assumptionsPSM assumption

Cross-Product Handoffs

  • /causal select → "Can you randomize? YES" → suggest /experiment design
  • /experiment power → NOT_VIABLE → suggest /causal select
  • /causal check → All assumptions FAIL → suggest redesign or descriptive-only analysis

State Management

analyses/{slug}/
├── causal_config.yaml       # Method selection + parameters (tracked)
├── working/                  # Intermediates (gitignored)
│   ├── causal_analysis_results.json
│   ├── assumption_report.md
│   └── sensitivity_report.md
└── outputs/                  # Final reports (per-analysis run folder)
    └── causal_report_{{DATE}}.md

© ai-analyst-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/causal of ai-analyst-lab/ai-analyst.

Open the folder on GitHubat commit 52c0744

Compare with similar skills

Causal next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Causal compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Causal this skillai-analyst-lab/ai-analyst304—~1.8kAutomated safety check: PassMIT
Fin Experiment Designcsmar432/finai-research109—~4.2kAutomated safety check: PassMIT
Judea PearlK-Dense-AI/mimeo282—~1.7kAutomated safety check: PassMIT
Academic Paper Verifybrycewang-stanford/Auto-Empirical-Research-Skills4.5k—~2.9kAutomated safety check: PassCustom licence
Designing Experimentsforyourhealth111-pixel/Vibe-Skills3.6k—~600Automated safety check: PassApache-2.0
Jape Identification Strategyfranklee16/academic-research-skills2231 repos~707Automated safety check: PassNone

Similar skills

  • Fin Experiment Design

    csmar432/finai-research

    经济金融实证方法设计。根据研究想法和REFINEDDESIGN.md,生成完整的实证研究设计方案,覆盖识别策略选择、样本构建、变量定义、稳健性检验清单和内生性处理方案。

    109 GitHub stars~4.2k tokensUpdated 3 days ago
    Research & ScienceAuto-check passed
  • Judea Pearl

    K-Dense-AI/mimeo

    Applies Judea Pearl's causal reasoning frameworks to distinguish correlation from causation, evaluate AI capabilities, and make counterfactual decisions.

    282 GitHub stars~1.7k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Academic Paper Verify

    brycewang-stanford/Auto-Empirical-Research-Skills

    Thoroughly verify all code, tables, figures, modeling decisions, and quantitative claims in an academic paper against its source R scripts and output files.

    4.5k GitHub stars~2.9k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Designing Experiments

    foryourhealth111-pixel/Vibe-Skills

    Design experiments and quasi-experiments before analysis. An agent skill from foryourhealth111-pixel/Vibe-Skills.

    3.6k GitHub stars~600 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Jape Identification Strategy

    franklee16/academic-research-skills

    A skill your agent uses when designing or defending the empirical identification of a Journal of Applied Econometrics (JAE) manuscript — a credible strategy applied to real data, with assumptions…

    223 GitHub starsUsed in 1 repo~707 tokens
    Research & ScienceAuto-check passed
  • Performing Causal Analysis

    foryourhealth111-pixel/Vibe-Skills

    Estimate causal effects from existing data. An agent skill from foryourhealth111-pixel/Vibe-Skills.

    3.6k GitHub stars~370 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed

More from ai-analyst-lab/ai-analyst

All 43 skills in this repo
  • Always Compare

    ai-analyst-lab/ai-analyst

    Never present a metric or number in isolation; anchor every number to a comparison (prior period, benchmark, or another segment) or state that none is available.

    304 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Archaeology

    ai-analyst-lab/ai-analyst

    Retrieve proven SQL patterns, table cheatsheets, and join patterns from .knowledge/query-archaeology/ so past work gets reused.

    304 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed
  • Archive Analysis

    ai-analyst-lab/ai-analyst

    Save completed analyses to the knowledge system's analysis archive for future reference.

    304 GitHub stars~2.7k tokensUpdated 8 days ago
    Auto-check passed
  • Auth Preflight

    ai-analyst-lab/ai-analyst

    Verify Google Workspace MCP authentication at the start of any session that needs Google APIs (Docs, Slides, Drive).

    304 GitHub stars~3.1k tokensUpdated 8 days ago
    Auto-check passed
  • Chart To Drive

    ai-analyst-lab/ai-analyst

    Standardized workflow for uploading local chart PNGs to Google Drive and making them available for insertion into Google Docs and Slides.

    304 GitHub stars~1.4k tokensUpdated 8 days ago
    Auto-check passed
  • Codex Review

    ai-analyst-lab/ai-analyst

    Independently validate the current analysis with a second model (OpenAI Codex).

    304 GitHub stars~3k tokensUpdated 8 days ago
    Auto-check passed

Questions about Causal

What does Causal do?

Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats. Causal is an agent skill from ai-analyst-lab/ai-analyst. Causal inference toolkit for when experiments are not possible: estimate treatment effects from observational data with assumption checks and mandatory caveats.

When should I use Causal?

Causal fits situations like: difference-in-differences; propensity matching.

How do I install Causal in Claude Code?

Run `npx skills add ai-analyst-lab/ai-analyst --skill causal -a claude-code`. Or copy the skill folder (.claude/skills/causal in ai-analyst-lab/ai-analyst) into .claude/skills/causal in your project. Claude Code loads it when a task matches its description.

How do I install Causal in Codex?

Run `npx skills add ai-analyst-lab/ai-analyst --skill causal -a codex`. Or copy the skill folder (.claude/skills/causal in ai-analyst-lab/ai-analyst) into .agents/skills/causal in your project. Codex loads it when a task matches its description.

Can I use Causal in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ai-analyst-lab/ai-analyst --skill causal -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/causal, .gemini/skills/causal, .github/skills/causal and .opencode/skills/causal in your project.

What does Causal need to run?

SKILL.md names no scripts, command-line tools or credentials: Causal is instructions for the agent only. Our summary lists: Python 3.

Does Causal access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Causal safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Causal use?

Causal is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Causal use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Causal?

Skills that share tags, products or a category with Causal: Fin Experiment Design (csmar432/finai-research, 109 stars), Judea Pearl (K-Dense-AI/mimeo, 282 stars), Academic Paper Verify (brycewang-stanford/Auto-Empirical-Research-Skills, 4.5k stars) and Designing Experiments (foryourhealth111-pixel/Vibe-Skills, 3.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Causal?

ai-analyst-lab (a GitHub organization) maintains it in ai-analyst-lab/ai-analyst, which has 304 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on September 30, 2026.

Source: ai-analyst-lab/ai-analyst on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.