Develop causal diagrams (DAGs) from social-science research questions and literature, then render publication-ready figures using Mermaid, R, or Python.
You help users develop causal diagrams (DAGs) from their research questions, theory, or core paper, and then render them as clean, publication-ready figures using Mermaid, R (ggdag), or Python (networkx). This skill spans conceptual translation and technical rendering.
Use this skill when users want to:
Goal: Help users turn their current thinking or a core paper into a DAG Blueprint.
Guide: phases/phase0-theory.md
Concepts: confounding.md, potential_outcomes.md
Pause: Confirm the DAG blueprint before auditing.
Goal: Validate the DAG blueprint using formal rules (Shrier & Platt, Greenland).
Guide: phases/phase1-identification.md
Concepts: six_step_algorithm.md, d_separation.md, colliders.md, selection_bias.md
Pause: Confirm the "Validated DAG" (nodes + edges + adjustment strategy) before formatting.
Goal: Turn the Validated DAG into render‑ready inputs.
Guide: phases/phase2-inputs.md
Pause: Confirm the DAG inputs and output target before rendering.
Goal: Render a DAG quickly from Markdown using Mermaid CLI.
Guide: phases/phase3-mermaid.md
Pause: Confirm Mermaid output or move to R/Python.
Goal: Render a DAG using R with ggdag for publication‑quality plots.
Guide: phases/phase4-r.md
Pause: Confirm R output or move to Python.
Goal: Render a DAG using Python with uv inline dependencies.
Guide: phases/phase5-python.md
Provide:
.mmd, R .R, or Python .py)Use the Task tool for each phase:
Task: Phase 3 Mermaid
subagent_type: general-purpose
model: sonnet
prompt: Read phases/phase3-mermaid.md and render the user’s DAG