Academic-Writing: Skill for Claude Code

.claude/skills/build-twfe-explainer/SKILL.md

build-twfe-explainer is a skill for Claude Code from AlessandroCaforio/Academic-Writing. It costs 25 tokens per session (5,612 once invoked), scanned C, original, MIT.

A multi-step tool for building a self-contained HTML lesson about two-way fixed-effects (TWFE) regression, a statistical method for comparing changes across groups and time. It covers regression, confounding, causal inference, panel data, t-statistics, and how fixed effects affect results.

In plain words
What is it for?
Use it to create or rerun the full TWFE mathematics explainer, or to run only data extraction, drafting, verification, or document assembly.
Why use it?
It helps turn a complex statistical topic into a structured teaching document with data gathering, drafts, checking, and assembly handled in separate stages.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is AlessandroCaforio/Academic-Writing's own configuration. It tells Claude Code how to work on Academic-Writing itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Academic-Writing configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/alessandro/Projects/Tesi/results/.twfe_workspace/drafts.

Reuse

Borrowing it

Nothing to install: this file belongs to AlessandroCaforio/Academic-Writing. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AlessandroCaforio/Academic-Writing/main/.claude/skills/build-twfe-explainer/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AlessandroCaforio/Academic-Writing

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-twfe-explainer

README.md
[![agentmods](https://agentmods.dev/badge/skills/alessandrocaforio/academic-writing/build-twfe-explainer/github.svg)](https://agentmods.dev/skills/alessandrocaforio/academic-writing/build-twfe-explainer)
Your own site
<a href="https://agentmods.dev/skills/alessandrocaforio/academic-writing/build-twfe-explainer"><img src="https://agentmods.dev/badge/skills/alessandrocaforio/academic-writing/build-twfe-explainer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for build-twfe-explainer

Your own site · 80×15
<a href="https://agentmods.dev/skills/alessandrocaforio/academic-writing/build-twfe-explainer"><img src="https://agentmods.dev/badge/skills/alessandrocaforio/academic-writing/build-twfe-explainer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,612 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.05612
Opus 5 $0.00013 $0.02806
Sonnet 5 $0.00005 $0.01122
Haiku 4.5 $0.00003 $0.00561

Measured 9d ago against content hash bf069a07af7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

build-twfe-explainer scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf /Users/alessandro/Projects/Tesi/results/.twfe_workspace
.claude/skills/build-twfe-explainer/SKILL.md · 423 lines

How it starts

The opening of the file, as written. The whole thing — 423 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TWFE Math Explainer — Multi-Agent Pipeline

Build a definitive, self-contained HTML teaching document explaining TWFE mathematics, causal inference formalism, and how fixed effects change significance. Uses 6 specialized agents across 5 phases.

Arguments

  • all — Run the full pipeline (default)
  • phase0 through phase5 — Run a specific phase (assumes prior phases completed)
  • data-only — Run only Phase 1 (data extraction)
  • drafts-only — Run only Phase 2 (assumes Phase 1 done)
  • verify-only — Run only Phase 3 (assumes Phases 1-2 done)
  • assemble-only — Run only Phase 4 (assumes Phases 1-3 done)

Target Document Structure (23 sections)

PRIMERS (P1–P7)
  P1: What Is a Regression?  (Gauss/Legendre history, full OLS derivation)
  P1½: Language of Statistics  (variance, covariance, key identities)
  P2: The Problem of Confounders  (Simpson's paradox)
  P3: Fixed Effects  (within estimator derivation)
  P4: The t-Statistic  (Student/Gosset 1908 history)
  P5: Panel Data & Pseudo-Panels
  P6: The Language of Causality  ← NEW (Potential Outcomes + DAGs)

ROAD MAP  (visual flow diagram)

CORE ANALYSIS (S1–S9)
  S1: Setup — The Specification Ladder  (empirical table)
  S2: FWL Theorem  (Frisch & Waugh 1933, Lovell 1963 — full dissertation)
  S3: SE Formula  (6-step derivation from first principles)
  S4: Variance Decomposition  (the key asymmetry)
  S5: Transition (1)→(2) — The Critical Jump
  S6: Transition (2)→(3) — State FE Refinement
  S7: Transition (3)→(4) — Cost of Over-Saturation
  S8: OVB  (full derivation + Simpson's paradox worked example)
  S9: Summary

ADVANCED TOPICS (S10–S16)
  S10: Identification & Parallel Trends  (potential outcomes + DAG + shift-share)
  S11: Pseudo-Panel  (Deaton 1985 — full history + derivation)
  S12: Moulton Problem  (Moulton 1990 — history + derivation)
  S13: Oster Test  (AET 2005 + Oster 2019 — full history)
  S14: Statistical Power & Honest Assessment
  S15: Geometry of FWL
  S16: Causal Graphs Applied  ← NEW (full DAG for this study)

Read the full file on GitHub · 423 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 423 lines · 25 tokens per session scan C bf069a07af7d

Subscribe to this mod's changes

build-twfe-explainer is a skill published in the GitHub repository AlessandroCaforio/Academic-Writing (17 stars, last pushed 5mo ago), licensed MIT. It adds 25 tokens to every session and 5,612 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

scaffold-exercises

Scaffold a graded problem set with sections, problems, worked solutions, and short "why this matters" explainers across analytical, empirical, and coding types. Use when user says "make a problem set on X", "scaffold exercises for this lecture", "create practice problems", "generate homework with a solution key"…

pedrohcgs/claude-code-my-workflow · 101 tokens

lean-check

Formalize a self-authored lemma or theorem in Lean 4/mathlib and require a clean lake build without sorry. Use when the mathematical claim can be stated faithfully and machine-checked. For numerical falsification or symbolic algebra, use $numerical-check or $symbolic-check.

flonat/flonat-research · 63 tokens

mathmodel-skill

An end-to-end workflow for mathematical-modeling competitions, including CUMCM, MCM/ICM, and the Electrical Cup. It guides teams from choosing a problem through modeling, solving, checking, writing, rule compliance, and final review.

handsomeZR-netizen/mathmodel-skill · 127 tokens

math-proof

Write clear, detailed mathematical proofs for academic papers. Use when the user asks to prove a result, derive an equation, justify a claim analytically, or expand a proof sketch into a full proof. Also trigger on "prove", "show analytically", "derive", "justify mathematically", or "write a proof".

flonat/flonat-research · 68 tokens

proofcheck

A systematic checker for mathematical proofs in statistics and machine-learning research papers.

gyf9712/stat-theory-skills · 57 tokens

theory-simulation

Bridge between theoretical results and Monte Carlo simulation, built to top-stat-journal standards (AoS, JASA, JRSS-B, Biometrika, Bernoulli). Two modes: (1) DESIGN mode — for each theoretical claim, design new simulations that verify rates, coverage, stress-test assumptions, and reveal theory-improvement…

gyf9712/stat-theory-skills · 214 tokens