Agent skill

Python Causality Guide

by wentorai in wentorai/research-plugins

Learn causal inference with Python using the Brave and True handbook

MITAuto-check passedResearch & Science

Install Python Causality Guide

skills CLI
$ npx skills add wentorai/research-plugins --skill python-causality-guide -a claude-code

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

GitHub CLI
$ gh skill install wentorai/research-plugins python-causality-guide --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/wentorai/research-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analysis/econometrics/python-causality-guide .claude/skills/python-causality-guide && 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
python-causality-guide
GitHub stars
298
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
615 words
Files
1
Skills in repo
428
Repo updated
First seen
Licence
MIT

At a glance

Learn causal inference with Python using the Brave and True handbook

  • Works in 5 steps: Always graph your data first: Visual… → Understand your identification strategy:… → Cluster standard errors appropriately:… → …
  • Tasks that involve Econometrics and empirical research
  • SKILL.md covers Overview, Installation and Setup, Core Methods Covered and Research Workflow Integration, plus 2 more sections
  • Calls pip, git and python; reaches github.com

What it does

Python Causality Guide is an agent skill from wentorai/research-plugins. Learn causal inference with Python using the Brave and True handbook

Its SKILL.md is about 1.7k 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. It works with Python. The repository describes itself as: 350+ academic research skills, MCP configs, and plugins for Research-Claw and AI agents. The licence is MIT.

When your agent uses it

  • Tasks that involve Econometrics and empirical research

Example prompts

  • “/python-causality-guide”

Requirements

  • Python 3

Workflow steps

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

  1. Always graph your data first: Visual inspection reveals patterns that inform modeling choices and expose violations of identifying…
  2. Understand your identification strategy: Before running any estimator, articulate clearly what variation identifies the causal effect and…
  3. Cluster standard errors appropriately: When treatment is assigned at group level, cluster standard errors at that level to avoid…
  4. Run robustness checks: Vary specifications, bandwidths, control variables, and functional forms to assess sensitivity of conclusions.
  5. Report effect sizes alongside p-values: Statistical significance without practical significance is not informative for policy or…

What it can do on your machine

Read from SKILL.md and the folder at commit bf44b3c. 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

    Shell commands in SKILL.md call:

    • pip
    • git
    • python
    • jupyter

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    Also links to:

    • matheusfacure.github.io

    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

Python Causality Guide loads about 1.7k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 615 words of instructions outside code blocks.

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

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 wentorai/research-plugins at commit bf44b3c, republished under its MIT licence (© wentorai). 615 words, ~1,739 tokens.

Download SKILL.mdSave it as .claude/skills/python-causality-guide/SKILL.md (or your agent's skills folder).
name
python-causality-guide
description
Learn causal inference with Python using the Brave and True handbook

Causal Inference for the Brave and True

Overview

Causal Inference for the Brave and True is an open-source, Python-based textbook by Matheus Facure that teaches causal inference methods through practical implementations. The book bridges the gap between theoretical econometrics textbooks and hands-on data science practice, presenting each method with runnable Python code, real-world datasets, and intuitive explanations that demystify the mathematics behind causal reasoning.

The handbook covers the full spectrum of causal inference techniques used in modern empirical research, from foundational concepts like potential outcomes and directed acyclic graphs (DAGs) through advanced methods including instrumental variables, regression discontinuity, difference-in-differences, and synthetic control. Each chapter builds on the previous one, constructing a coherent framework for thinking about causation from observational data.

With over 3,000 GitHub stars, this resource has become a standard reference for graduate students, applied researchers, and data scientists seeking to add causal reasoning to their analytical toolkit. The emphasis on Python implementation makes it directly applicable to modern research workflows.

Installation and Setup

The handbook runs as Jupyter notebooks. Set up the environment:

bash
git clone https://github.com/matheusfacure/python-causality-handbook.git
cd python-causality-handbook

# Create a virtual environment
python -m venv causal-env
source causal-env/bin/activate

# Install dependencies
pip install numpy pandas matplotlib seaborn scikit-learn statsmodels
pip install linearmodels causalinference
pip install jupyter

Launch the notebook server:

bash
jupyter notebook

The chapters are organized as numbered Jupyter notebooks, starting from foundational concepts and progressing to advanced methods. Each notebook is self-contained with all data loading and analysis code included.

Core Methods Covered

Potential Outcomes Framework: The book begins by establishing the Neyman-Rubin potential outcomes model, defining treatment effects and the fundamental problem of causal inference:

python
import pandas as pd
import numpy as np
from scipy.stats import ttest_ind

# Estimate ATE from randomized experiment
treated = data[data["treatment"] == 1]["outcome"]
control = data[data["treatment"] == 0]["outcome"]
ate = treated.mean() - control.mean()
t_stat, p_value = ttest_ind(treated, control)
print(f"ATE: {ate:.3f}, p-value: {p_value:.4f}")

Regression and Matching: OLS regression for causal estimation, understanding omitted variable bias, propensity score methods, and matching estimators:

python
import statsmodels.formula.api as smf

# OLS with controls
model = smf.ols("outcome ~ treatment + age + income + education", data=data)
results = model.fit(cov_type="HC1")
print(results.summary().tables[1])

Instrumental Variables: Two-stage least squares and the local average treatment effect, with practical guidance on instrument validity and weak instrument diagnostics:

python
from linearmodels.iv import IV2SLS

# Two-stage least squares
iv_formula = "outcome ~ 1 + [treatment ~ instrument]"
iv_model = IV2SLS.from_formula(iv_formula, data=data)
iv_results = iv_model.fit(cov_type="robust")
print(iv_results.summary)

Difference-in-Differences: Parallel trends assumption, two-way fixed effects, event study designs, and staggered treatment adoption:

python
# Difference-in-Differences with two-way fixed effects
did_model = smf.ols(
    "outcome ~ treated_post + C(unit_id) + C(time_period)",
    data=panel_data
)
did_results = did_model.fit(cov_type="cluster", cov_kwds={"groups": panel_data["unit_id"]})

Regression Discontinuity: Sharp and fuzzy RD designs, bandwidth selection, and local polynomial estimation for identifying causal effects at policy thresholds.

Synthetic Control: Constructing counterfactual units from donor pools for comparative case studies, with inference via placebo tests.

Show full SKILL.md (291 more words)Show less

Research Workflow Integration

Graduate Coursework: The handbook maps directly to applied econometrics and causal inference course syllabi. Students can follow along with lectures by running the corresponding notebooks, experimenting with parameter changes, and observing how different assumptions affect estimates.

Method Selection Guide: Use the decision framework presented across chapters to choose the appropriate method for your research question:

  • Randomized experiment available: simple comparison of means or regression adjustment
  • Selection on observables: matching, propensity scores, or regression
  • Unobserved confounders with instrument: instrumental variables
  • Policy threshold: regression discontinuity
  • Before/after with control group: difference-in-differences
  • Single treated unit over time: synthetic control

Replication and Extension: Each chapter uses real or realistic datasets. Researchers can adapt the code to their own data by replacing data loading steps while preserving the analytical pipeline.

Teaching Tool: Instructors can assign chapters as interactive homework, asking students to modify assumptions, change specifications, or apply methods to new datasets. The notebook format makes it straightforward to create assignments with embedded solutions.

Best Practices Highlighted in the Handbook

  1. Always graph your data first: Visual inspection reveals patterns that inform modeling choices and expose violations of identifying assumptions.
  2. Understand your identification strategy: Before running any estimator, articulate clearly what variation identifies the causal effect and what assumptions are required.
  3. Cluster standard errors appropriately: When treatment is assigned at group level, cluster standard errors at that level to avoid overstating statistical significance.
  4. Run robustness checks: Vary specifications, bandwidths, control variables, and functional forms to assess sensitivity of conclusions.
  5. Report effect sizes alongside p-values: Statistical significance without practical significance is not informative for policy or scientific understanding.

References

© wentorai, 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 skills/analysis/econometrics/python-causality-guide of wentorai/research-plugins.

Open the folder on GitHubat commit bf44b3c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in wentorai/research-plugins, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Python Causality Guide 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.

Python Causality Guide compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Causality Guide this skillwentorai/research-plugins2981 repos~1.7kAutomated safety check: PassMIT
Stata C Pluginsdylantmoore/stata-skill2911 repos~5.8kAutomated safety check: PassCustom licence
Capture Environmentpedrohcgs/claude-code-my-workflow1.6k—~2.8kAutomated safety check: NotesMIT
Fin Data Acquisitioncsmar432/finai-research109—~2kAutomated safety check: PassMIT
Empirical Research MethodsCitrus-bit/Anaxa120—~1.9kAutomated safety check: PassCC-BY-SA-4.0
Diagnosepedrohcgs/claude-code-my-workflow1.6k—~4.2kAutomated safety check: PassMIT

Similar skills

  • Stata C Plugins

    dylantmoore/stata-skill

    Develop high-performance C/C++ plugins for Stata using the stplugin.h SDK.

    291 GitHub starsUsed in 1 repo~5.8k tokens
    Research & ScienceAuto-check passed
  • Capture Environment

    pedrohcgs/claude-code-my-workflow

    Snapshot the computational environment for a replication package — detects the analysis stack (R / Stata / Python) and emits the right lockfiles (renv.lock + sessionInfo.txt, requirements.txt /…

    1.6k GitHub stars~2.8k tokensUpdated 10 days ago
    Research & ScienceAuto-check: notes
  • Fin Data Acquisition

    csmar432/finai-research

    根据REFINEDDESIGN.md中的变量定义,自动获取所需数据并生成可执行的回归分析脚本(Python/Stata)。

    109 GitHub stars~2k tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • A skill your agent uses for empirical social-science research, applied economics, public policy, education, finance, management, sociology, psychology, epidemiology, or public-health data studies.

    120 GitHub stars~1.9k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Diagnose

    pedrohcgs/claude-code-my-workflow

    Root-cause a failing or wrong empirical result with a disciplined reproduce → minimise → hypothesise → instrument → fix loop, instead of guessing-and-poking.

    1.6k GitHub stars~4.2k tokensUpdated 10 days ago
    Research & ScienceAuto-check passed
  • Differential Audit

    pedrohcgs/claude-code-my-workflow

    Compare two implementations of the same thing — a port (R↔Python↔Stata), a reimplementation, a replication package, a refactor, or a new version against the old — so that agreement means something.

    1.6k GitHub stars~1.6k tokensUpdated 10 days ago
    Research & ScienceAuto-check: notes

More from wentorai/research-plugins

All 428 skills in this repo
  • Abstract Writing Guide

    wentorai/research-plugins

    Craft structured research abstracts that maximize clarity and journal acceptance

    298 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Academic Citation Manager

    wentorai/research-plugins

    Manage academic citations across BibTeX, APA, MLA, and Chicago formats

    298 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Academic Paper Summarizer

    wentorai/research-plugins

    Summarize academic papers with structured extraction of key elements

    298 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Academic Study Methods

    wentorai/research-plugins

    Evidence-based study techniques for academic learning and retention

    298 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Academic Tone Guide

    wentorai/research-plugins

    Adjust writing tone and register for academic audiences and venues

    298 GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed
  • Academic Translation Guide

    wentorai/research-plugins

    Academic translation, post-editing, and Chinglish correction guide

    298 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check passed

Works with

Questions about Python Causality Guide

What does Python Causality Guide do?

Learn causal inference with Python using the Brave and True handbook. Python Causality Guide is an agent skill from wentorai/research-plugins.

When should I use Python Causality Guide?

Python Causality Guide fits situations like: tasks that involve Econometrics and empirical research.

How do I install Python Causality Guide in Claude Code?

Run `npx skills add wentorai/research-plugins --skill python-causality-guide -a claude-code`. Or copy the skill folder (skills/analysis/econometrics/python-causality-guide in wentorai/research-plugins) into .claude/skills/python-causality-guide in your project. Claude Code loads it when a task matches its description.

How do I install Python Causality Guide in Codex?

Run `npx skills add wentorai/research-plugins --skill python-causality-guide -a codex`. Or copy the skill folder (skills/analysis/econometrics/python-causality-guide in wentorai/research-plugins) into .agents/skills/python-causality-guide in your project. Codex loads it when a task matches its description.

Can I use Python Causality Guide 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 wentorai/research-plugins --skill python-causality-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-causality-guide, .gemini/skills/python-causality-guide, .github/skills/python-causality-guide and .opencode/skills/python-causality-guide in your project.

What does Python Causality Guide need to run?

Going by SKILL.md and its folder, Python Causality Guide needs the command-line tools its instructions call (pip, git, python and jupyter). Our summary lists: Python 3.

Does Python Causality Guide access the network?

SKILL.md names 2 domains. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. As links in the text: matheusfacure.github.io. This is read from the text; nothing was executed.

Is Python Causality Guide 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 Python Causality Guide use?

Python Causality Guide 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 Python Causality Guide use?

About 1.7k tokens (SKILL.md is roughly 7k 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 Python Causality Guide?

Skills that share tags, products or a category with Python Causality Guide: Stata C Plugins (dylantmoore/stata-skill, 291 stars), Capture Environment (pedrohcgs/claude-code-my-workflow, 1.6k stars), Fin Data Acquisition (csmar432/finai-research, 109 stars) and Empirical Research Methods (Citrus-bit/Anaxa, 120 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Causality Guide?

wentorai (a GitHub user) maintains it in wentorai/research-plugins, which has 298 GitHub stars. The repository holds 428 skills in this directory. The repository was last updated on June 19, 2026.

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