agentleFS
tatashbartatashbar/Economic-Modeling-Studio/.agents/skills/build-causal-ml/SKILL.md

build-causal-ml

Skill4 starsChanged 6 days agoMITView on GitHub

Builds a causal machine-learning analysis (double ML, causal forests) with identification argument and sensitivity checks.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If a required input is ABSENT, that part is NOT ASSESSED — NO DATA: do not estimate or invent it.

    line 26
  2. Very specific:

    Collaboration: Follow .claude/docs/collaboration-protocol.md: ask questions first, present options, get approval before writing files, and …

    line 28
  3. Distinctive:

    Write the identification argument and assumptions before touching the data

    line 47
  4. Distinctive:

    Check overlap; trim if needed and report what was trimmed

    line 50
  5. Distinctive:

    Run sensitivity to unobserved confounding and specification

    line 53
  6. Distinctive:

    Write the result in terms of what the evidence supports and what it does not

    line 54
  7. Distinctive:

    After the identification note: confirm assumptions are acceptable

    line 58
  8. Distinctive:

    After the main estimate: confirm the estimand before heterogeneity work

    line 59
  9. Distinctive:

    Before reporting heterogeneity: confirm which subgroups are policy-relevant

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Generated from .claude/skills/build-causal-ml/SKILL.md by tools/sync_agents.py. Edit the source, then run the script. -->

/build-causal-ml — Build Causal ML

Category: Build (AI) · Primary agent: causal-ml-specialist

Builds a causal machine-learning analysis (double ML, causal forests) with identification argument and sensitivity checks.

Arguments: whatever the user wrote after the command name.

Purpose

Build a causal machine-learning analysis that estimates treatment effects, and how they vary across units, with double/debiased ML or causal forests, while keeping identification explicit. The output is an estimate whose identifying assumptions are written down before estimation, compared with a conventional econometric estimate, and tested for sensitivity to unobserved confounding.

Use it when there are many potential controls, heterogeneity of effects matters for targeting, or flexible functional forms are needed for nuisance functions in an otherwise well-identified design.

Do not use it when there is no credible identification strategy (ML will not create one), or a standard panel or quasi-experimental design answers the question directly (/local-projections, /policy-simulation).

Before you start

  1. Check required inputs. For each input below record FOUND or ABSENT (never 'assumed'):
    • Data sheet
    • Identification argument If a required input is ABSENT, that part is NOT ASSESSED — NO DATA: do not estimate or invent it; name what is missing and which skill produces it. If all required inputs are absent, stop and say so.
  2. Check confidentiality. Identify the data classification level of the inputs (.claude/docs/confidentiality-and-ai-use.md). Do not proceed with restricted or confidential data in a way the policy does not allow.
  3. Collaboration. Follow .claude/docs/collaboration-protocol.md: ask questions first, present options, get approval before writing files, and update production/session-state/active.md after each approved section.

Agents

  • causal-ml-specialist — primary agent; coordinates the work and integrates results
  • panel-causal-inference-specialist — Panel econometrics and causal inference
  • interpretable-ml-specialist — Makes AI models explainable

Each agent is defined in .claude/agents/<name>.md. If your tool runs subagents, run these agents as subagents, in parallel where the steps are independent; otherwise read each agent's file and apply its instructions in turn. Subagents only write to the paths named in your instructions.

Key design decisions (present options, let the user choose)

DecisionTypical optionsWhat it changes
Identificationselection on observables, IV, difference-in-differences with ML controlsCredibility of the estimate
EstimandATE, ATT, CATE, policy valueWhat is reported
Learnerslasso, random forests, boosting, neural networks, ensemblesNuisance-function quality
Heterogeneity methodcausal forests, best linear predictor, sorted group effectsReliability of subgroup findings
Sensitivityomitted-variable-bias bounds, placebo testsRobustness statement

Workflow

  1. Write the identification argument and assumptions before touching the data
    • Draw the causal diagram; list confounders and why unobserved ones are unlikely to matter
  2. Implement with cross-fitting; compare to a standard econometric estimate
    • Check overlap; trim if needed and report what was trimmed
  3. Estimate heterogeneous effects and test stability
    • Validate heterogeneity on held-out data; avoid data-mined subgroups
  4. Run sensitivity to unobserved confounding and specification
  5. Write the result in terms of what the evidence supports and what it does not
  6. Register the model as a lego set (/lego-map): a baseplate plus bricks with declared studs (variables, units, timing) and stubs, so components can later be attached, detached or swapped

Checkpoints with the user

  • After the identification note: confirm assumptions are acceptable
  • After the main estimate: confirm the estimand before heterogeneity work
  • Before reporting heterogeneity: confirm which subgroups are policy-relevant

Common pitfalls

  • ML flexibility presented as identification
  • No cross-fitting
  • Poor overlap ignored
  • Heterogeneity found by search reported as fact

Output

models/ai/<name>-causal/ (+ model.lego.json)

The folder holds the identification note, estimation code with cross-fitting, overlap diagnostics, heterogeneity analysis, sensitivity results and the lego manifest. Every run saves its results to output/<run-id>/ in the model folder, with a run log (.claude/rules/model-code.md).

Gate / verdict

  • Identification assumptions stated
  • Comparison with a conventional estimate
  • Sensitivity analysis present
  • Lego manifest passes python tools/lego.py check
  • Cross-fitting and overlap diagnostics are documented
  • Heterogeneity results are validated out of sample

Suggested next steps

  • /validate-model
  • /technical-note
  • /lego-map

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.