Causal logo

Causal

Organization
ai-analyst-lab
causal

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.

Overview

Publisherai-analyst-lab
Repositoryai-analyst-plugin
Skill namecausal
Stars
34
Forks
13
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ai-analyst-lab on GitHub. Read the source before you install it.

Installation

Install the Causal AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ai-analyst-lab/ai-analyst-plugin/tree/main/ai-analyst-plus/skills/causal
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ai-analyst-lab/ai-analyst-plugin.git /tmp/ai-analyst-plugin
mkdir -p .claude/skills
cp -r /tmp/ai-analyst-plugin/ai-analyst-plus/skills/causal .claude/skills/causal
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Causal in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Causal on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Causal is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

If the skill install path cannot be resolved (some sandboxed environments): read the script file(s) from this skill, write a copy into a scripts/ folder inside the working folder, and run from there. The scripts are self-contained.

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 the coded estimator library bundled in this skill at scripts/causal_stats/.

Using the bundled library: add this skill's scripts/ directory to sys.path, then import, e.g.

python
import sys
sys.path.insert(0, "<path to this skill>/scripts")  # the scripts/ dir next to this SKILL.md
from causal_stats import did_basic

Requires pandas, numpy, scipy, statsmodels, and scikit-learn (for propensity matching); install the last two in the sandbox if missing.

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: the causal-method-selector plugin agent 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: the causal-analyzer plugin agent Flow:

  1. Read selected method from previous step or user input
  2. Dispatch to the appropriate bundled estimator:
    python
    from causal_stats 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: the causal-assumption-checker plugin agent 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 causal_stats 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: the causal-sensitivity plugin agent Flow:

  1. Run sensitivity analysis based on method:
    python
    from causal_stats 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

/causal report

Purpose: Generate a report with mandatory caveats. Agent: the causal-report-generator plugin agent 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: reports/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_stats.pre_postPre-post comparison
did_basic()causal_stats.did2x2 DiD estimator
parallel_trends_test()causal_stats.didTest parallel trends assumption
event_study()causal_stats.didPeriod-by-period effects
propensity_match()causal_stats.matchingPSM pipeline
balance_table()causal_stats.balanceSMD balance diagnostics
love_plot()causal_stats.balanceBefore/after balance visual
regression_adjust()causal_stats.regressionOLS with covariates
rosenbaum_bounds()causal_stats.sensitivityPSM sensitivity
e_value()causal_stats.sensitivityUniversal sensitivity measure
check_parallel_trends()causal_stats.assumptionsDiD assumption
check_common_support()causal_stats.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
└── reports/                  # Final reports (tracked)
    └── causal_report_{{DATE}}.md

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Causal AI skill do?

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.

Why use Causal on TypingMind?

Because you install it once and use it with any model. Causal is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Causal in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ai-analyst-lab/ai-analyst-plugin/tree/main/ai-analyst-plus/skills/causal. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Causal?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Causal?

As many as you like. As long as a model supports skills, you can use Causal with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Causal AI skill free?

Yes. It is published on GitHub by ai-analyst-lab under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇