reproducibility-audit
Skill12 starsChanged 19 days agoMITView on GitHub
Workflow for a computational reproducibility audit of a published paper: download the authors' data/code (usually OSF), reproduce the reported statistics and figures in an R + Quarto notebook, compare the paper against its preregistration, and assess the strength of evidence (attrition, clustering, multiplicity, specification errors, outcome selection). Use whenever the user asks to "reproduce", "audit", "check the stats/figures of", or "see whether the prereg was followed in" a published paper, or wants a judgment about how strong a paper's evidence is given its data. Covers folder organization for multi-paper audits, the report template with AI-generated disclaimers, an OSF fetch/prereg-hash script, a checklist of errors that recur in published analyses, and the robustness toolkit. Pairs with adversarial-protocol-review (the "what could manufacture this result?" mindset) and quarto-book (rendering conventions).
4 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- PerryLink/dsh-research-skillstheir own version, first seen Nov 15, 2026
- poldracklab/scientific-audit-skillsedited, first seen Nov 8, 2026
- cellrishi-code/claude-skills-atlastheir own version, first seen Nov 1, 2026
- jurgendn/agent-skillstheir own version, first seen Sep 17, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- poldracklab/scientific-audit-skills★ 132% same
Wrote their own version · 3
- jurgendn/agent-skills★ 10same name
- cellrishi-code/claude-skills-atlas★ 6same name
- PerryLink/dsh-research-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- adversarial-protocol-reviewSkill
- babyview-datasetSkill
- cdi-vocabulary-dataSkill
- cran-safe-releaseSkill
- gcp-large-stanSkill
- pre-submission-reviewSkill
- psis-loo-chunkedSkill
- quarto-bookSkill
- redivisSkill
- remote-vm-gotchasSkill
- rmd-qmd-manuscript-collabSkill
- shiny-to-datapageSkill
- stan-mixing-cold-startSkill
- wordbankSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 17 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
17
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Do the posted data and code reproduce the reported numbers and figures?
- Very specific: line 45
Keep .qmd paths relative to the paper folder (osf/...), so the folder can be moved.
- Very specific: line 46
Version control: run git init at the <topic>_audits/ root before the first script, with osf/ and papers/ in .gitignore.
- Very specific: line 47
If the user says a PDF is "in the folder" and it isn't, search for it (mdfind -name) and confirm it matches the OSF project title before …
- Distinctive: line 63
If a project has no registration, say so explicitly and switch stage 5 to "analytic flexibility".
- Distinctive: line 92
PDF extraction drops minus signs: Before flagging a CI like "[0.04, 0.42]" around a negative estimate as an error, look at the rendered …
- Distinctive: line 96
Run the authors' plotting code as written, then show a corrected or fuller version beside it.
- Distinctive: line 101
Captions that don't match the plot: Check swapped panel letters, wrong scale names (e.g.
- Distinctive: line 115
Judgment convention: when a secondary outcome's prereg prediction is non-directional, assume the implied direction is the intervention's …
- Distinctive: line 124
Claims vs output: Check every "significant" claim in Discussion and Abstract against the code's own output.
- Distinctive: line 140
Unit of manipulation: when a treatment varies only between a few providers, sites or classrooms:
- Distinctive: line 144
run leave-one-cell/cluster-out refits, and report all rows, not just the damning one.
- Distinctive: line 147
Fragility: leave-one-participant-out p-value range.
- Distinctive: line 154
Rows: every prereg primary and secondary outcome, plus the headline exploratory ones.
- Distinctive: line 157
Composite row: add an equal-weight composite of the self-report family as an omnibus row, labelled post hoc.
- Distinctive: line 158
Mediation caveat: when the *a* path is shared across outcomes, consistent "significant mediation" mostly reflects observational …
- Distinctive: line 160
Use the matrix to answer the user's likely question: *is this a real effect that was oversold, or something weaker?*
- Very specific: line 164
Start from templates/audit_template.qmd.
- Distinctive: line 167
Keep the template's section order: Summary (bottom line first) → Materials & provenance → Reproduction → Prereg deviations → …
- Very specific: line 168
Put computed numbers in inline r expressions wherever feasible.
- Distinctive: line 176
When asked about errors, separate those visible from the paper alone (arithmetic, label swaps) from those visible only in the code.
- Very specific: line 181
zsh: never use path as a shell loop variable.
- Distinctive: line 185
Authors' misspecified models are not scale-invariant: When reproducing their specification on transformed data (e.g.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reproducibility audit of a published paper
Goal: a private, self-contained rendered Quarto report (R code + prose). It answers three questions:
- Do the posted data and code reproduce the reported numbers and figures?
- Where does the paper depart from its preregistration (or, absent one, which analytic choices were left open)?
- Given everything, how strong is the evidence for the central claims?
Work through the stages in order. Verify every number you write against rendered output (stage 9).
Folder organization (multi-paper by default)
Audits tend to come in batches (e.g. several papers from one lab), so start with this layout even for a single paper:
~/Projects/<topic>_audits/
papers/ # source PDFs, untouched (the user may drop them here)
<firstauthor>/ # one folder per paper, lowercase first-author name
<firstauthor>_audit.qmd
<firstauthor>_audit.html # embed-resources: true -> single shareable-in-private file
osf/ # raw OSF download, original folder structure preserved
paper.txt # pdftotext -layout of the paper
prereg.txt # pdftotext -layout of the prereg (if any)
figs_paper/ # pdftoppm page renders, for viewing figures/CONSORT- Keep
.qmdpaths relative to the paper folder (osf/...), so the folder can be moved. - Version control: run
git initat the<topic>_audits/root before the first script, withosf/andpapers/in.gitignore. Keep it local, with no remote unless the user asks (see Privacy below). - If the user says a PDF is "in the folder" and it isn't, search for it (
mdfind -name) and confirm it matches the OSF project title before using it. Don't duplicate PDFs that already live inpapers/. - Privacy: these reports critique named colleagues' work. Render locally only. Do not publish them as Artifacts, to Quarto Pub, or anywhere else unless the user explicitly asks. Deliver the HTML with
SendUserFile.
Stage 1: Gather materials
python3 ~/.claude/skills/reproducibility-audit/scripts/osf_fetch.py files <node_id> --list-only # inspect first
python3 ~/.claude/skills/reproducibility-audit/scripts/osf_fetch.py files <node_id> --out osf # skips video/audio/zip and >200 MB by default
python3 ~/.claude/skills/reproducibility-audit/scripts/osf_fetch.py registration <reg_id> # prereg metadata + SHA-256 check
pdftotext -layout paper.pdf paper.txt
pdftoppm -r 110 -png -f <p> -l <p> paper.pdf figs_paper/p # then Read the PNGs to see figures/CONSORT- Prereg DOIs like
10.17605/OSF.IO/X4C56resolve toosf.io/x4c56. Check both/v2/registrations/<id>and the project'sregistrationscount; thefilescommand prints it. - Record
date_registeredagainst the end of data collection. A "prereg" registered after data collection is not prospective, even if it predates cleaning. Also note whether a self-described clinical trial is in a trial registry. - Confirm the prereg PDF you read is the frozen one. Compare the SHA-256 the registration stores with the file you downloaded; the script does this.
- If a project has no registration, say so explicitly and switch stage 5 to "analytic flexibility".
Stage 2: Read everything before computing
- Read the whole paper. List every inferential statistic in Results and every figure with its caption claims (n's, what the error bands are, which panel is which).
- Read the prereg in full, noting page numbers. Record:
- the outcome hierarchy (primary / secondary / exploratory);
- the stated hypotheses and analysis models;
- the mediator and outcome timepoints;
- exclusion rules, ITT vs per-protocol, the planned sample size;
- any explicit "exploratory / hypothesis-generating" labels;
- intervention components (e.g. a booster session the paper later omits).
- Read the authors' scripts:
- Which files do they read? Are those files posted?
- What are the exact model formulas, contrasts and labels?
- How do the plotting calls handle axis limits?
- Are analyses present in code but not reported (e.g. continuous-time models, extra outcomes)?
- Inventory the posted data against the codebook and scripts:
- Is it the full randomized sample or only completers?
- Are cluster IDs present (provider, site, session)?
- Are there renamed variables (e.g.
_t5…_t8→_t1…_t4)? - Are there measured outcomes that are never reported?
- Can missing variables be reconstructed from the code (ID ranges that encode branch; hard-coded ID lists for covariates)? Document every reconstruction.
Stage 3: Reproduce the reported statistics
- Refit the authors' exact specification first. Copy their formula, contrasts, reference levels and covariates, even where you think they are wrong. Then tabulate
claim | paper | reproducedwith a bold Status: line: exact reproduction, minor discrepancy (quantify it and give the likely cause, e.g. one missing observation), or major discrepancy. - Match the p-value method (sjPlot/Wald vs lmerTest Satterthwaite). Report which you used.
- Sign conventions. These often differ because of reference levels; say so rather than calling it an error.
- PDF extraction drops minus signs. Before flagging a CI like "[0.04, 0.42]" around a negative estimate as an error, look at the rendered page image.
Stage 4: Reproduce the figures
Run the authors' plotting code as written, then show a corrected or fuller version beside it. Recurring problems:
- Data silently dropped.
scale_y_continuous(limits=)(orylim()) deletes out-of-range rows beforegeom_smooth/stat layers are computed;coord_cartesian()only zooms. Count the rows dropped and compare with the n in the caption. - Figure lines that are not the model.
geom_smooth(method = "lm")throughtimepointtreated as a number shows pooled OLS lines through equally spaced points, not the categorical mixed model. - Jitter that adds fake variation.
position_jitter/jitterdodgewith a nonzeroheightadds vertical noise to measured values. Flag it when the noise is comparable to the effect. - Captions that don't match the plot. Check swapped panel letters, wrong scale names (e.g. "PHQ-9" for a PHQ-2 subscale), n's, and text references to the wrong panel.
- Hidden structure. Show the clustering structure the analysis ignores: cell or cluster means ± SE, not just pooled groups.
Stage 5: Preregistration deviations (or analytic flexibility)
Table: # | Preregistration (page) | Paper | Disclosed? | Severity (Major/Moderate/Minor). Look for:
- Outcome switching. A null primary outcome, with secondary or exploratory outcomes promoted to the abstract and described "as hypothesized". Prereg language like "hypothesis generating, not confirming" is decisive.
- Selective reporting of a planned panel (e.g. 1 of 49 biomarkers reported).
- Changed mediator timepoint, mediation run despite a prereg gate ("only for outcomes showing an effect"), and dropped serial or qualitative analyses.
- Analysis-set changes: per-protocol instead of the planned exclusions; changed medical exclusions (note when these are disclosed).
- Intervention components in the prereg but missing from the paper's Methods.
- Model form: prereg "slope" vs reported categorical contrasts. Run the prereg-faithful version; if it gives the same answer, say so.
Judgment convention: when a secondary outcome's prereg prediction is non-directional, assume the implied direction is the intervention's intended benefit. The problem worth flagging is promotion up the outcome hierarchy, not directionality.
No prereg: use a table Choice | Used | Alternatives in the data | Consequence. Cover outcome (including unreported measures in the data), baseline adjustment, summary statistic (slope vs endpoint), which contrast is highlighted vs the one implied by the stated hypothesis, and clustering. Credit constraints such as copying a previously published paradigm and analysis.
Stage 6: Error-hunting checklist (each has caught a real error)
- Arithmetic identities. In mediation, total = direct + indirect (c = c′ + ab). Check them on the printed figure and table values: it catches swapped labels without any code. Also check that CONSORT boxes add up (allocated ≥ completed in each arm).
- lavaan labels. Reusing one label (e.g.
cv*x1 + cv*x2) constrains those coefficients to be equal. Refit with the coefficients free and run an LRT on the constraint. A quick symptom: rescale one covariate (e.g. 1–7 → 0–1). If standardized results change, the model is misspecified. - Methods vs code. "Controlling for baseline X": is X actually in every equation the text implies (e.g. the mediator equation)?
- Claims vs output. Check every "significant" claim in Discussion and Abstract against the code's own output; Discussion lists drift.
- Baseline covariate in slope models. A baseline main effect adjusts level, not slope. Refit with
baseline × timewhen groups differ at baseline. - Copy-paste formula slips in scripts (a covariate listed twice and another dropped).
- Recode bugs (e.g.
'Woman' -> 'Women'creating a stray factor level).
Present specification errors as "before / after" code plus a decomposition table (fix A only, fix B only, both), so it's clear which fix does the work. Also show the downstream effect on every claim that used the model; corrections are often not one-directional, and saying so matters.
Stage 7: Robustness and threats toolkit
- Differential attrition (per-protocol analyses, unequal arm burden):
- χ² test of retention by arm, using CONSORT counts.
- Baseline balance among completers; this is reassuring only about the measured variables.
- Lee bounds on change scores. These are the worst case and usually very wide.
- One-factor selection-model tipping point. With retention q, E[Z | top q] = φ(Φ⁻¹(1−q))/q. Compute the gap between arms, then the ρ (completion propensity ↔ improvement) needed to produce the observed effect. Compare with the ρ implied for baseline levels.
- Benchmark against a low-attrition subsample (branch, site) if one exists.
- Note where the posted data exclude dropouts, which makes ITT impossible. The authors' ITT file is the obvious thing to request.
- Unit of manipulation: when a treatment varies only between a few providers, sites or classrooms:
- count the units per cell;
- give the design-effect table SE × √(1 + (m − 1)ρ) with df = units − unit-level parameters;
- compute cell-level ICCs (pre-treatment measures are especially telling);
- run leave-one-cell/cluster-out refits, and report all rows, not just the damning one.
- Multiplicity within prereg families (Holm/BH). List all nominal hits, including those in the unfavourable direction and those that survive.
- Subgroup or branch splits where the design differs. Treat the three-way interaction as post hoc, and list the confounded differences between branches.
- Fragility: leave-one-participant-out p-value range; ANCOVA on the endpoint as a cross-check.
- Timing: is the effect at one follow-up only? Does the mediator's time course fit the proposed mechanism? Does the prereg designate a key timepoint (usually not)?
Stage 8: Outcome × finding matrix
For trials with many outcomes, build a matrix:
- Rows: every prereg primary and secondary outcome, plus the headline exploratory ones.
- Columns: prereg role, how the paper treats it (headline / null mentioned / not mentioned), the effect at each timepoint, the effect per subsample, and mediation under the authors' and the corrected specification.
- Units: effects in baseline-SD units, sign-aligned so + = benefit.
- Composite row: add an equal-weight composite of the self-report family as an omnibus row, labelled post hoc.
- Mediation caveat: when the a path is shared across outcomes, consistent "significant mediation" mostly reflects observational mindset–outcome associations, not treatment effects. Say this explicitly.
Use the matrix to answer the user's likely question: is this a real effect that was oversold, or something weaker?
Stage 9: Write, render, and verify prose against output
- Start from
templates/audit_template.qmd. It includes the two required disclaimer callouts:callout-important"AI-generated — not for publication" (replaceMODELwith the model actually used, e.g. Claude Opus 5.5);callout-warning"Preliminary & unvetted analysis".
- Keep the template's section order: Summary (bottom line first) → Materials & provenance → Reproduction → Prereg deviations → Threats/robustness → Pattern across outcomes → Assessment → Session info.
- Put computed numbers in inline
rexpressions wherever feasible. Static markdown tables only for the paper's own numbers. - Render with
quarto render <file>.qmdand grep forOutput created. Expensive bootstraps (2000 draws × several lavaan models) take a few minutes. - After every render, extract the text and check each claim. Strip tags with a short Python script and read the tables. Drafted prose has repeatedly asserted things the tables contradicted ("only one hit", "dropping any other cell leaves it intact", mislabelled bounds). Also extract the embedded PNGs (base64 in the HTML) and look at them, e.g. to catch empty labels.
- Things that cut in the authors' favour (e.g. the tipping point needing an implausible ρ; a more consistent pattern for one factor) belong in the report too.
Stage 10: Assessment and follow-up conversation
- Rate each central claim (strong / moderate / weak / hypothesis-generating) with bulleted reasons. Distinguish computational reproducibility (often fine) from inferential strength (often not).
- When asked about errors, separate those visible from the paper alone (arithmetic, label swaps) from those visible only in the code.
- If asked whether something warrants a correction: a corrigendum fits errors that change specific stated conclusions without overturning the main results; a retraction is for broader failure. The usual route is to contact the authors first. Have the key models rerun independently before anything leaves the user's hands. Don't draft letters to journals unless asked.
Gotchas
- zsh: never use
pathas a shell loop variable. It is tied to$PATHand silently breaks every later command (curl: command not found). Use Python for download loops. - OSF API: folder children are at
relationships.files.links.related.href, and listings paginate (links.next). The download URL islinks.download. - Folder renames mid-session reset the shell cwd. Use absolute paths, or cd at the start of each command.
- Name clashes inside
mutate(): a tibble column named like an outer object (e.g. a result columnspecvs a lookup tablespec) masks it. Look values up outsidemutate(). - Authors' misspecified models are not scale-invariant. When reproducing their specification on transformed data (e.g. sign-aligned z-scores for a matrix), run it on the raw data and transform the output instead.
- Missing R packages (e.g.
effects): substitute (emmeans) and note the small numeric difference against the authors' hard-coded values.
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
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.

