Causal design

From flonat/flonat-research · View interactive version

Causal design is an AI agent skill from the GitHub repository flonat/flonat-research. Design or audit the identification strategy for an observational study. Use when the task concerns estimands, causal assumptions, threats to identification, or defensible research design rather than model implementation.

How to use this skill

Skill file

Causal Design

Design and audit identification strategies for observational causal inference.

Output Path

Per rules/review-artefact-routing.md (auto-loads in research projects (path-scoped to paper-*/ and paper/)):

Modes

| Mode | What it does | Entry point |

|------|-------------|-------------|

| Design | Interview-driven strategy selection and memo production | "Design my causal strategy" / "What identification can I use?" |

| Audit | 4-phase causal inference check on existing paper/scripts | "Check my identification" / "Audit my econometrics" |

Default: Design. If the user points to an existing paper or estimation script, auto-select Audit mode.

When to Use

When NOT to Use

Shared References


Mode: Design

Phase 1: Interview

Before opening the interview, confirm the project's validation tier per CODE0 — Exploratory designs warrant lighter identification stress-testing than Publication-ready ones. Use CODE1 as the interview backbone; the prompts below adapt those probes to causal identification specifically.

Conduct a structured interview to understand the research setting. Ask these questions (adapt to what the user has already shared):

  1. Causal question: What causal effect are you trying to estimate? What is the treatment? What is the outcome?
  2. Variation: What source of variation in treatment do you exploit? Is it natural, policy-driven, institutional?
  3. Confounders: What are the main threats to identification? What unobservables worry you?
  4. Data structure: Panel, cross-section, or repeated cross-section? What units and time periods?
  5. Institutional context: Any thresholds, cutoffs, rollout dates, or instruments available?
  6. Prior literature: What identification strategies have others used for similar questions?

Do not proceed until the causal question and data structure are clear.

Phase 2: Strategy Selection

Read references/design-decision-tree.md and walk through the decision tree with the user's answers:

Phase 3: Strategy Memo

Write a strategy memo using references/strategy-memo-template.md. Save to docs/causal-strategy.md (or project-appropriate location).

The memo must specify:

  1. Estimand -- the exact causal parameter being estimated, in formal notation
  2. Identification strategy -- how variation is generated and why it is exogenous
  3. Key assumptions -- each one stated, with a defence or test plan
  4. Threats and mitigations -- what could go wrong and how to address it
  5. Diagnostics plan -- which tests to run before trusting the estimates
  6. Robustness checks -- pre-committed alternative specifications
  7. Alternative strategies considered -- why they were rejected

This memo is what data-analysis Phase 3 checks for before allowing estimation. It locks the research design per the design-before-results rule.

Phase 4: Adversarial Review

The reviewer follows CODE0 — when identification is vague or assumptions are hand-waved, the reviewer escalates rather than accommodating.

Delegate an adversarial review to the domain-reviewer agent. Read references/causal-audit-prompt.md and pass it as the prompt to the fresh-context sub-agent mechanism:

Launch the domain-reviewer agent with this prompt:
"You are reviewing a causal identification strategy memo. [Insert contents of causal-audit-prompt.md, customised with the specific strategy chosen]. The memo is at [path]. Focus exclusively on identification credibility."

The agent will produce a report at reviews/<scope>/domain-reviewer/<YYYY-MM-DD-HHMM>.md in the project, where <scope> is the paper slug or _project.

Phase 5: Iterate

Present the domain-reviewer's findings to the user. For each issue flagged:


Mode: Audit

Phase 1: Extract Claims

Read the paper (.tex files) and/or estimation scripts to extract every causal claim:

Produce a numbered list of claims with their locations (file:line).

Phase 2: Map Estimands to Identification

For each causal claim, determine:

| Claim | Estimand | Strategy | Key Assumption | Stated? | Defended? |

|-------|----------|----------|----------------|---------|-----------|

| ... | ... | ... | ... | Yes/No | Yes/No |

Flag any claim where:

Phase 3: Assumption Diagnostics

For each identification strategy found, check whether the required diagnostics are present and passing:

DiD / Event Study:

IV:

RDD:

Synthetic Control:

Event Study:

Phase 4: Code-Design Alignment

If estimation code exists, verify it implements the claimed design:

Audit Report

Produce an audit report at reviews/<scope>/causal-design/<YYYY-MM-DD-HHMM>.md (where <scope> is the paper slug or _project) with:

# Causal Audit Report

**Document:** [filename]
**Date:** YYYY-MM-DD
**Mode:** Audit

## Claims Inventory

[Numbered list of causal claims with locations]

## Estimand-Identification Map

[Table from Phase 2]

## Diagnostics Assessment

| Strategy | Diagnostic | Present? | Passing? | Notes |
|----------|-----------|----------|----------|-------|
| ... | ... | ... | ... | ... |

## Code-Design Alignment

[Phase 4 findings, or "N/A -- no code found"]

## Critical Issues

[List of issues that threaten identification credibility]

## Recommendations

[Ordered list of fixes, from most to least important]

Cross-References

| Resource | When read |

|----------|-----------|

| references/design-decision-tree.md | Design Phase 2 (strategy selection) |

| references/strategy-memo-template.md | Design Phase 3 (memo output) |

| references/causal-audit-prompt.md | Design Phase 4 (agent delegation prompt) |

| design-before-results rule | Both modes enforce this |

| domain-reviewer agent | Design Phase 4 (adversarial review) |

| data-analysis skill | Consumes the strategy memo |

| experiment-design skill | For experimental (not observational) designs |

| experiment-design/references/identification-strategies.md | Quick-reference for strategies (shared knowledge) |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.