agentleFS
matthewdigiuseppematthewdigiuseppe/MStack/skills/robustness/SKILL.md

robustness

Skill17 starsChanged 3 months agoMITView on GitHub

Stress-tests the headline in three ways — a specification curve over the defensible choices, sensitivity to unobserved confounding or to the design's assumption (sensemakr, HonestDiD, plausibly-exogenous IV, RD bandwidths), and influence of single units or periods — plus placebos and alternative inference, with a stable/sensitive/fragile verdict and the sensitivity sentence the paper must carry. Use after the primary table is locked, or when the user asks for robustness checks or worries about cherry-picking.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    After /mstack:analyze and a passing /mstack:results-audit.

    line 15
  2. Distinctive:

    A curve padded with indefensible specifications: Write the inclusion rule first.

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

/mstack:robustness

Stage: analyze · Voice: skeptical-analyst

After /mstack:analyze and a passing /mstack:results-audit. Robustness is not more appendix tables; it answers three different questions about the headline, and a paper that answers only the first has not addressed the other two.

Procedure

  1. Load code/02-analyze.R, output/models/, prereg/osf-prereg.md (the pre-committed checks), .mstack/identification-review-*.md (the sensitivity analysis it named and the rival mechanisms), .mstack/theory.md (the rivals table), .mstack/config.yaml (design.type).
  2. Read ${CLAUDE_PLUGIN_ROOT}/references/robustness-protocols.md and the sensitivity tools at the end of ${CLAUDE_PLUGIN_ROOT}/references/identification-threats.md.
  3. The choice inventory. Enumerate every researcher degree of freedom in the primary spec and sort each alternative into a bin before running anything: substantive (a different operationalization, comparison group, or threshold; run and report even if it hurts), arbitrary (bandwidth, lag, winsorizing cut, window edges, polynomial order; vary over a grid), indefensible (dropping the control the theory requires, conditioning on a post-treatment variable, an estimator known to be biased for the design; not a robustness check, do not run it as one). Dimensions:

    ChoiceAlternatives
    Sample restrictionDrop the most restrictive cut; add a stricter one
    Outcome operationalizationAlternative scaling or scoring; dichotomized vs. continuous; alternative source
    Treatment operationalizationContinuous vs. binary; alternative threshold; lagged treatment
    Control setWith and without the contestable controls; never a post-treatment one
    Fixed effectsDrop or add a dimension; interactive FE
    ClusteringMore aggregated level; wild cluster bootstrap
    Functional formLevels vs. logs vs. shares; PPML for flows
    EstimatorThe design's heterogeneity-robust alternatives
    CompositionWith / without outliers or specific subgroups; leave-one-unit-out
    Time windowEarlier / later cutoffs; leave-one-period-out
    WeightsWeighted vs. unweighted

    Then add the rows of the rivals table as placebo and subgroup tests: each rival's observable implication becomes a specification whose result is predicted in advance.

  4. Write code/05-robustness.R: load data/clean/analytic.rds (never re-clean); define the primary spec as a function; iterate over the substantive and arbitrary alternatives; store a long data frame (spec_name, dimension, value, coef, se, ci_low, ci_high, n) to output/models/robustness.rds; run the placebos and negative controls; run the sensitivity analysis for the design (sensemakr with benchmark covariates for selection on observables; HonestDiD for DiD; plausibly-exogenous intervals for IV; a bandwidth and donut grid for RD); run the influence analysis (leave-one-unit-out and leave-one-period-out); run the alternative inference (more aggregated clustering, wild cluster bootstrap, randomization inference for experiments).
  5. Write code/06-robustness-table-and-curve.R. Copy ${CLAUDE_PLUGIN_ROOT}/skills/robustness/assets/spec-curve.R to code/spec-curve.R and source() it for plot_spec_curve() and summarize_robustness(); specr may draw the dashboard panel. Render output/tables/table-robustness.tex (each alternative against the primary), output/figures/specification-curve.pdf (all coefficients with intervals ranked by magnitude, the primary marked, the inclusion rule in the caption), output/figures/sensitivity.pdf (the contour, breakdown, or bandwidth plot for the design), and output/figures/influence.pdf (leave-one-out estimates).
  6. Verdict on the curve, stated as a descriptive convention: Stable (more than 80% of alternatives agree in sign and significance; the headline survives), Sensitive (sign flips or significance vanishes in a meaningful fraction; qualify the headline or rejustify the spec), Fragile (only the primary survives; rewrite the headline as conditional or switch to a more conservative primary). Report separately whether any placebo "worked", which single unit or period carries the estimate, and the sensitivity sentence.
  7. Save to .mstack/robustness-<YYYY-MM-DD>.md: the inventory with bins, the verdict, the sensitivity sentence in the form the paper will use ("an unobserved confounder would need to be X times as strong as [covariate] to bring the estimate to zero"; "the estimate survives post-treatment violations of parallel trends up to M̄ = …"), the placebo results, the influential units, and a one-paragraph interpretation.

Outputs

  • code/05-robustness.R, code/06-robustness-table-and-curve.R, code/spec-curve.R.
  • output/models/robustness.rds, output/tables/table-robustness.tex, output/figures/specification-curve.pdf, output/figures/sensitivity.pdf, output/figures/influence.pdf.
  • .mstack/robustness-<date>.md.
  • Summary block: specs run and share agreeing with the primary, the sensitivity sentence, placebo results, influential units, verdict.

Anti-patterns

  • Cherry-picked checks. Show the alternatives that could break the result, not just the ones that don't.
  • A curve padded with indefensible specifications. Write the inclusion rule first.
  • Fragility hidden in an appendix. A fragile result is stated in the main text.
  • Adding checks until one supports the primary. Forking paths in disguise.
  • Heterogeneity as robustness. Pre-specified moderators only; the subgroup where the effect appears is not a check.

Next

/mstack:viz (the curve and the sensitivity plot are figures), then /mstack:draft-section results.

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.