skills/28-maxwell2732-paper-replicate-agent-demo/dot-claude/skills/replicate-paper/SKILL.md
Run a full 6-phase autonomous replication of a biomedical/epidemiology paper against UK Biobank or similar cohort data, producing Python and R scripts plus a validated replication report. Use when asked to replicate a paper end-to-end, or when invoked as /replicate-paper [paper.pdf] [data.csv|dta].
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research replicate-paperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Trigger: /replicate-paper [paper.pdf] [data.csv|dta] or "replicate this paper"
Purpose: Full 6-phase autonomous replication of a biomedical/epidemiology paper using UK Biobank or similar data. Produces Python and R scripts plus a polished validation report.
/replicate-paper papers/AuthorYear.pdf data/ukb_extract.csv
Or with just: "replicate this paper" (Claude will ask for paths if not provided).
Goal: Understand exactly what needs to be replicated.
quality_reports/[paper_name]_replication_targets.mdOutput: quality_reports/[paper_name]_replication_targets.md
Goal: Confirm what we can and cannot replicate given the available data.
data/[filename])quality_reports/[paper_name]_data_audit.mdOutput: quality_reports/[paper_name]_data_audit.md
Goal: Map the paper's methods to our dataset before writing a single line of code.
quality_reports/[paper_name]_variable_map.mdOutput: quality_reports/[paper_name]_variable_map.md
Goal: Produce clean, reproducible Python and R scripts that implement the paper's analysis.
Rules:
python-code-conventions.md and r-code-conventions.md exactlyrandom.seed(YYYYMMDD) + numpy.random.seed(YYYYMMDD) (Python); set.seed(YYYYMMDD) (R)pathlib.Path for all Python paths; here::here() for all R pathsreplication-protocol.md translation pitfall tablesPython script: replications/[paper_name]/python/replicate.py
Structure:
# Replication: [Paper Author (Year)]
# Date: YYYY-MM-DD
# Original: Stata / R
# Python version: X.Y.Z
# Key packages: pandas X.X, statsmodels X.X, lifelines X.X
from pathlib import Path
import random
import numpy as np
import pandas as pd
# ... other imports
random.seed(YYYYMMDD)
np.random.seed(YYYYMMDD)
DATA_DIR = Path(__file__).parents[3] / "data"
RESULTS_DIR = Path(__file__).parent / "results"
RESULTS_DIR.mkdir(exist_ok=True)
# --- 1. Load Data ---
# --- 2. Sample Construction ---
# --- 3. Model Fitting ---
# --- 4. Save Results ---
R script: replications/[paper_name]/R/replicate.R
Structure:
# Replication: [Paper Author (Year)]
# Date: YYYY-MM-DD
# Original: Stata / Python
# R version: X.Y.Z
# Key packages: survival X.X, fixest X.X
library(here)
library(tidyverse)
library(survival)
# ... other packages
set.seed(YYYYMMDD)
data_dir <- here("data")
results_dir <- here("replications", "[paper_name]", "R", "results")
dir.create(results_dir, recursive = TRUE, showWarnings = FALSE)
# --- 1. Load Data ---
# --- 2. Sample Construction ---
# --- 3. Model Fitting ---
# --- 4. Save Results ---
Outputs:
replications/[paper_name]/python/replicate.pyreplications/[paper_name]/R/replicate.Rreplications/[paper_name]/python/results/ (parquet/pkl files)replications/[paper_name]/R/results/ (rds files)Goal: Run both scripts and compare results to gold standard targets.
python replications/[paper_name]/python/replicate.pyRscript replications/[paper_name]/R/replicate.Rreplication-protocol.md:
replications/[paper_name]/validation_report.mdOutput: replications/[paper_name]/validation_report.md
Goal: Produce a polished, self-contained replication report.
Report structure:
# Replication Report: [Paper Author (Year)]
**Date:** [YYYY-MM-DD]
**Replicator:** Claude (domain-reviewer verified)
## Paper Summary
[1 paragraph: research question, population, exposure, outcome, key finding]
## Methods Summary
[Bullet list: sample, exclusions, covariates, model, SEs, software]
## Data
[Bullet list: our dataset, N after exclusions, any discrepancies vs. paper sample]
## Results Comparison
| Target | Table/Fig | Paper Value | Our Value (Python) | Our Value (R) | Diff | Status |
|--------|-----------|-------------|-------------------|---------------|------|--------|
## Discrepancies
[Each discrepancy: what, investigated how, resolved or not]
## Corrective Steps Taken
[Any adjustments made during validation and why]
## Verdict
**[REPLICATED / PARTIAL / FAILED]**
- Targets matched: N / Total
- Remaining discrepancies: [list or "none"]
## Reproducibility
- Python: X.Y.Z | pandas X.X | statsmodels X.X | lifelines X.X
- R: X.Y.Z | survival X.X | fixest X.X
- Data: [filename, UKB application ID if applicable]
- Seed: YYYYMMDD
Save to: reports/[paper_name]_replication_report.md
After saving: run domain-reviewer agent on the report.
After Phase 6, score the output. Minimum 80/100 to commit.
Auto-commit if score >= 80:
git add replications/[paper_name]/ reports/[paper_name]_replication_report.md quality_reports/[paper_name]_*.md
git commit -m "Replicate [Paper Author (Year)] -- [VERDICT]: N/Total targets matched"
| Failure | Recovery | |---------|---------| | Script syntax error | Fix before proceeding | | N mismatch > 5% | Stop, audit inclusion/exclusion criteria | | All point estimates off by same factor | Check unit conversion (HR vs. log-HR, OR vs. log-OR) | | SEs systematically too large | Check clustering level | | Cannot install package | Document, note in report, use closest alternative | | Data variable missing | Document gap; attempt proxy; flag as ASSUMED in report |
tools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.