/everyday-causal-skills:causal-exercisesfrom everyday-causal-skills
Generates realistic causal inference practice exercises with simulated data and known ground truth. Supports experiments, DiD, IV, RDD, synthetic control, matching, time series, and DAG reasoning.
Ships in everyday-causal-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generate realistic causal inference exercises with simulated data. The true effect is known, so practitioners can verify their work.
references/lessons.md — known mistakes. Do not repeat them.references/dgp-library.md — available data-generating processes.references/method-registry.md — method details.# EVAL_EXECUTABLE as the first nonblank program line inside
exactly one correct-language code fence. Do not indent it or add other text
on that line. That fence contains the complete runnable program;
preflight snippets and illustrative alternatives stay unmarked.Ask: "What difficulty level? (Basic / Intermediate / Advanced)" Ask: "Any particular method to practice, or should I choose?"
Methods available: experiments, DiD, IV, RDD, synthetic control, matching, time series, DAG reasoning (variable selection, adjustment sets, bad control detection). Ask: "R or Python?"
If difficulty, method, and language are already supplied and the user requests the
complete exercise now, treat Step 1 as complete. Do not repeat the parameter intake:
provide the scenario and precise student deliverable in the same response. A
complete-exercise request alone is not a request to see the generator: keep
dgp.[R|py], the solution, and the true effect hidden until the debrief. Create
dataset artifacts only when execution and file-writing tools are available and the
run succeeds. Otherwise, explain that dataset creation requires executing the hidden
DGP; do not claim that a dataset was created or saved, and do not cite a dataset
path.
When the user explicitly requests the runnable generator, this direct-output rule is
the narrow exception to the normal instruction to conceal dgp.[R|py] until the
debrief: emit the complete runnable generator inline, but do not separately annotate
the true-effect parameter, explain the structural solution, or provide the answer.
If Bash or Write is unavailable, explicitly say that the generator was not executed,
the dataset was not saved, and no dataset path exists. Tell the student that
inspecting generator internals can spoil the exercise and that they can run the block
without reading it if they want a blind attempt.
Precedence over Step 3: The complete-exercise and explicit-generator branches above supersede Step 3's execution, save, and path-announcement instructions whenever the required execution or file-writing tools are unavailable. In those branches, follow Step 3 only after a DGP actually runs and its files are actually written; never repeat Step 3's generated-dataset or saved-path claim as a promise or hypothetical.
IV exercise contract: An IV exercise must teach relevance/strength and validity as separate questions. A strong first stage only shows that the instrument moves treatment; it does not establish independence or the exclusion restriction. Design the scenario and DGP so the student must reason about both:
Keep the challenge discoverable from the narrative and observed variables. Do not resolve the validity question for the student or reveal the true effect before the debrief.
Select a DGP from references/dgp-library.md matching the difficulty and method. Present a realistic business narrative. Do NOT reveal the method, the DGP, or the true effect, except for the narrow user-requested direct-generator case above. If the user already selected the method, do not pretend that method is hidden.
"Scenario: You work as a data analyst at [company]. [Business context narrative]. Your manager wants to know: [causal question]. You have access to the attached dataset."
Run the DGP code (using Bash tool) to generate the dataset. If it needs a package the user may not have, follow references/preflight.md: report what's missing and offer to install it for them — never install silently. Save files:
docs/causal-exercises/YYYY-MM-DD-<exercise>/data.csv — the datasetdocs/causal-exercises/YYYY-MM-DD-<exercise>/dgp.[R|py] — the DGP code (do not show until debrief unless the direct-generator exception applies)docs/causal-exercises/YYYY-MM-DD-<exercise>/solution.md — true effect and method (DO NOT show yet)Tell the user: "I've generated the dataset at [path]. Take a look and tell me: What causal method would you use and why?"
If the user asks for help, provide hints in order:
After the user presents their analysis (or asks for the answer):
Save debrief to docs/causal-exercises/YYYY-MM-DD-<exercise>/debrief.md.
Before this skill:
/causal-planner -- Optional; user may come directly to practiceAfter this skill:
/causal-[method] -- Apply the practiced method to real data/causal-dag -- Practice drawing DAGs, identifying adjustment sets, and detecting bad controlsIf the user identifies a problem with the exercise (e.g., DGP doesn't match the narrative, unrealistic parameters), record the lesson in references/lessons.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
14 skills in this plugin
/causal-auditorStress-tests any causal analysis for threats to validity across 5 categories identification, statistical, data quality, interpretation, and external validity. Use when user says "audit", "review my analysis", "what could go wrong", or "check assumptions". Not for implementing fixes./causal-dagGuides DAG construction and causal identification through structured conversation. Generates dagitty (R) or DoWhy (Python) code for adjustment sets, testable implications, and visualization. Use when user asks about DAGs, causal graphs, confounders, backdoor paths, colliders, bad controls, variable selection, or "what should I control for". Not for estimating causal effects (hand off to method skills)./causal-npx claudepluginhub robsontigre/everyday-causal-skills --plugin everyday-causal-skillsOther plugins' skills for the same job