aperivue/replicate-study
Replicate an existing cohort study's methodology on a different database. Extracts study design from a source paper, maps variables to the target DB via harmonization table, generates analysis code, and produces a replication difference report.
npx skills add https://github.com/Aperivue/medsci-skills --skill replicate-study
You are assisting a medical researcher in replicating an existing published study's methodology
on a different database. This is a common research strategy: take a validated methodology from
Paper A (e.g., NHIS cohort study) and apply it to Database B (e.g., KNHANES, NHANES, or another
cohort) to produce a new paper with the same analytical rigor.
${SKILL_DIR}/references/harmonization_knhanes_nhanes.csv (if KNHANES↔NHANES)${SKILL_DIR}/references/methodology_extraction_template.md — checklist for extracting study design${SKILL_DIR}/references/harmonization_knhanes_nhanes.csv — KNHANES↔NHANES variable mapping (67 rows)${SKILL_DIR}/references/harmonization_3country.csv — KNHANES+NHANES+CHNS 3-country mapping (45 rows, if available)medsci-skills/skills/write-paper/references/paper_types/nhis_cohort.mdmedsci-skills/skills/write-paper/references/paper_types/cross_national.mdmedsci-skills/skills/analyze-stats/references/analysis_guides/survey_weighted.mdmedsci-skills/skills/analyze-stats/references/analysis_guides/propensity_score.mdpandas + R via subprocess for survey-weighted):a. Data loading & cleaning: read target DB, apply inclusion/exclusion
b. Variable derivation: recode variables per mapping table
c. Survey design setup: define svydesign object (strata, PSU, weights)
d. Table 1: demographics by exposure group (weighted)
e. Main analysis: replicate the primary model (logistic/Cox/linear regression)
f. Subgroup analyses: if specified in source paper
g. Sensitivity analyses: replicate all listed in source paper
/analyze-stats templates where available (survey_weighted, propensity_score).Generate a structured difference report documenting:
| Section | Content |
|---------|---------|
| Study Design | Same / Modified (explain) |
| Database | Source DB → Target DB (N, years, country) |
| Population | Inclusion/exclusion differences |
| Variable Mapping | Full mapping table with match status |
| Unavailable Variables | What's missing and how handled |
| Methodological Differences | Any forced changes (e.g., BMI cutoffs, LDL calculation) |
| Expected Differences | Why results may differ (population, measurement, cultural) |
Save as replication_report.md in the working directory.
Before reporting completion, verify:
/define-variables to cross-check whether to mirror the legacy definition (pure replication) or upgrade to current (extension). Document the choice explicitly in the difference report.{working_dir}/
├── replication_report.md — Structured difference report
├── variable_mapping.csv — Variable mapping table with match status
├── analysis_code.py — Main analysis script (Python + R calls)
├── analysis_code.R — R script for survey-weighted analysis
└── results/
├── table1.csv — Demographics table
├── main_results.csv — Primary analysis results
└── subgroup_results.csv — Subgroup analysis results (if applicable)
/replicate-study
Source paper: Joo 2026 (Psychiatry Research) — depression/diabetes cross-national
Target DB: /path/to/knhanes/HN18.csv
Harmonization: /path/to/harmonization_knhanes_nhanes.csv
[VERIFY: variable_name] and ask the user to confirm against the data dictionary./search-lit for all citations.Take aperivue/replicate-study from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.