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
Autonomous multi-round research review loop using MiniMax API. Use when you want to use MiniMax instead of Codex MCP for external review. Trigger with "auto review loop minimax" or "minimax review".
tools
Autonomous research review loop using any OpenAI-compatible LLM API. Configure via llm-chat MCP server or environment variables. Trigger with "auto review loop llm" or "llm review".
tools
Autonomous multi-round research review loop using MiniMax API. Use when you want to use MiniMax instead of Codex MCP for external review. Trigger with "auto review loop minimax" or "minimax review".
tools
Autonomous research review loop using any OpenAI-compatible LLM API. Configure via llm-chat MCP server or environment variables. Trigger with "auto review loop llm" or "llm review".