Logo: Causal Exercises

Causal Exercises

Communautéit
RobsonTigre
causal-exercises

Generéiert Übungsaufgabe mat simuléierten Donnéeën a bekannter Wourecht als Referenz fir all Methode vun der kausaler Inferenz. Benotzt dës Fäegkeet, wann de Benotzer „üben“, „Übung“, „simuléieren“, „kausal Inferenz léieren“ oder „meng Fäegkeeten testen“ seet. Net fir d’Analyse vu reellen Donnéeën.

Iwwersiicht

EditeurRobsonTigre
Repositoryeveryday-causal-skills
Skill-Nummcausal-exercises
Stären
83
Forks
10
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    RobsonTigre huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Causal Exercises an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/RobsonTigre/everyday-causal-skills/tree/main/skills/causal-exercises
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RobsonTigre/everyday-causal-skills.git /tmp/everyday-causal-skills
mkdir -p .claude/skills
cp -r /tmp/everyday-causal-skills/skills/causal-exercises .claude/skills/causal-exercises
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Causal Exercises an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Causal Exercises automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Causal Exercises net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Causal Exercises

Generate realistic causal inference exercises with simulated data. The true effect is known, so practitioners can verify their work.

Before You Begin

  1. Read references/lessons.md — known mistakes. Do not repeat them.
  2. Read references/dgp-library.md — available data-generating processes.
  3. Read references/method-registry.md — method details.
  • Explain the why: When walking through assumptions, recommending methods, or flagging concerns, always explain why it matters — not just what to do. Help the user build intuition, not just follow instructions.

Quality Standards

  • Complete every stage. Do not skip assumption checks or robustness tests.
  • Quality over speed. A thorough analysis with caveats beats a fast one without.
  • When uncertain, say so. Flag limitations rather than presenting weak evidence as strong.
  • Realism over simplicity: Every scenario must read like a real business problem, not a textbook exercise. Use company names, job titles, and domain-specific language.
  • Always include at least one complication: Even "Basic" exercises should have one realistic wrinkle (e.g., slightly noisy data, an obvious but important assumption to check). Pure textbook setups teach nothing about real practice.
  • Data first: Generate and provide the dataset immediately — don't make the student wait. They should be able to start exploring within seconds.
  • Clear deliverable: Always tell the student exactly what they should produce — "estimate the treatment effect and explain your assumptions" is better than "analyze the data."
  • Canonical runnable block: When showing a DGP or solution program, put the exact line # 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.

Exercise Flow

Step 1: Choose Parameters

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.

  • Basic: Clean setup, one method clearly correct, no complications.
  • Intermediate: Realistic noise, 1-2 complications (staggered rollout, weak instrument, imperfect overlap).
  • Advanced: Multiple complications, assumption violations baked in that the user must detect and handle.

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:

  • vary instrument strength across a labeled scenario, parameter, or comparison and require a first-stage coefficient, robust F statistic, and weak-instrument diagnosis;
  • include a scenario-specific validity challenge, such as a plausible direct path from the encouragement to the outcome, and ask the student to defend independence, exclusion, and monotonicity rather than declaring the instrument valid from its F statistic;
  • define the compliers in the scenario and teach LATE as the average treatment effect for those compliers. For example, an encouragement design identifies the effect among people who take treatment when encouraged but not otherwise, not the ATE for everyone; and
  • make the requested deliverable trace a path from data to first-stage diagnostics, reduced form and 2SLS, assumption assessment, and a scenario-specific LATE interpretation.

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.

Step 2: Generate Scenario

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."

Step 3: Create and Save Data

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 dataset
  • docs/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?"

Step 4: Progressive Hints (On Request)

If the user asks for help, provide hints in order:

  1. "Think about how the treatment was assigned."
  2. "What data structure do you have? Cross-sectional or panel?"
  3. "The key identification strategy here involves [hint at mechanism]."
  4. "The method I had in mind is [method]."
  5. "The key assumption to check is [specific assumption]."

Step 5: Review and Debrief

After the user presents their analysis (or asks for the answer):

  1. Reveal the true DGP and true effect.
  2. Compare: "Your estimate of [X] vs the true effect of [Y]."
  3. Explain the gap — connect the error to a specific cause:
    • If method was correct but estimate is off: "The gap of [Z] is [sampling variability / a finite-sample artifact]. With more data, this would shrink. Your approach was sound."
    • If method was correct but assumption was violated: "Your estimate missed because [assumption] was violated in this data. Here's how: [specific mechanism from the DGP]. The diagnostic that would have caught it is [test/plot] — it would have shown [what to look for]."
    • If method was wrong: "This scenario called for [correct method] because [reason]. The method you chose assumes [assumption], which doesn't hold here because [explanation from DGP]."
  4. Connect to practice: "In real data, you wouldn't know the true effect. The way to protect yourself is [specific diagnostic or robustness check that would have flagged the issue]."
  5. Score: "Your estimate of [X] vs truth of [Y] — [assessment]."

Save debrief to docs/causal-exercises/YYYY-MM-DD-<exercise>/debrief.md.

Common Issues

  • Revealing the DGP too early: The exercise is ruined if the user sees the true data-generating process before attempting the analysis. Never show DGP code or true effects until the debrief stage unless the user explicitly requested the runnable generator under the narrow direct-output exception; even then, withhold the separate solution and true-effect annotation.
  • Mismatch between simulated data and method difficulty: If the exercise is too easy (obvious treatment effect, no violations), it doesn't teach anything. Ensure exercises include realistic complications.
  • Conflating a strong instrument with a valid one: A large first-stage F statistic supports relevance, not independence or exclusion. Grade these as separate parts of an IV exercise.

Integration

Before this skill:

  • /causal-planner -- Optional; user may come directly to practice

After this skill:

  • /causal-[method] -- Apply the practiced method to real data
  • /causal-dag -- Practice drawing DAGs, identifying adjustment sets, and detecting bad controls

Self-Correction

If 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.

Heefeg gestallte Froen

Wat mécht de KI-Skill Causal Exercises?

Generéiert Übungsaufgabe mat simuléierten Donnéeën a bekannter Wourecht als Referenz fir all Methode vun der kausaler Inferenz. Benotzt dës Fäegkeet, wann de Benotzer „üben“, „Übung“, „simuléieren“, „kausal Inferenz léieren“ oder „meng Fäegkeeten testen“ seet. Net fir d’Analyse vu reellen Donnéeën.

Firwat Causal Exercises op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Causal Exercises besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Causal Exercises an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/RobsonTigre/everyday-causal-skills/tree/main/skills/causal-exercises an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Causal Exercises benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Causal Exercises benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Causal Exercises domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Causal Exercises gratis?

Jo. RobsonTigre huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇