MCPInstall
aperivue avatar

replicate-study

Use when applying a published cohort study's methodology to a different database. Extracts the design from the source paper, maps variables to the target database with a harmonization table, generates the analysis code and reports every forced deviation.

Installs
115
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/aperivue/medsci-skills --skill replicate-study
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads replicate-study automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Replicate Study Skill

Apply a published study's methodology to a different database and report every place the target database forced a deviation.

Inputs

  1. Source paper: PDF, DOI, or markdown of the paper to replicate
  2. Target database path: CSV/SAS data file(s) to use
  3. Harmonization table (optional): CSV mapping source → target variables
    • Default: ${CLAUDE_SKILL_DIR}/references/harmonization_knhanes_nhanes.csv (if KNHANES↔NHANES)

Reference Files

  • ${CLAUDE_SKILL_DIR}/references/methodology_extraction_template.md — checklist for extracting study design
  • ${CLAUDE_SKILL_DIR}/references/harmonization_knhanes_nhanes.csv — KNHANES↔NHANES variable mapping (67 rows)
  • ${CLAUDE_SKILL_DIR}/references/harmonization_3country.csv — KNHANES+NHANES+CHNS 3-country mapping (46 rows)
  • Upstream templates (read on demand):
    • ${CLAUDE_SKILL_DIR}/../write-paper/references/paper_types/nhis_cohort.md
    • ${CLAUDE_SKILL_DIR}/../write-paper/references/paper_types/cross_national.md
    • ${CLAUDE_SKILL_DIR}/../analyze-stats/references/analysis_guides/survey_weighted.md
    • ${CLAUDE_SKILL_DIR}/../analyze-stats/references/analysis_guides/propensity_score.md

Workflow

Phase 1: Source Paper Analysis

  1. Read the source paper (PDF → text, or markdown).
  2. Extract the methodology by filling methodology_extraction_template.md: study design, database (name, country, years, N), population (inclusion/exclusion, age range), exposure and outcome (variable, definition, coding), covariates with definitions, statistical methods (regression type, adjustment models, subgroup analyses), survey design (weights, strata, PSU), and every sensitivity analysis.
  3. Outdated source definitions: if the source used a pre-2023 definition that has since been superseded (e.g., NAFLD → MASLD 2023, CKD-EPI 2009 → 2021 race-free), call /define-variables to cross-check whether to mirror the legacy definition (pure replication) or upgrade to the current one (extension). Record the choice in the difference report.
  4. Output: structured extraction summary for user review.

Phase 2: Variable Mapping

  1. Load the harmonization table (columns: domain, concept, concept_en, one variable/label column set per database such as knhanes_var / nhanes_var, and harmonization_notes).
  2. For each extracted variable (exposure, outcome, covariates), find the matching row and flag it DIRECT_MATCH / RECODE_NEEDED / NOT_AVAILABLE / PROXY_AVAILABLE. If a mapping is uncertain, write [VERIFY: variable_name] and ask the user to confirm it against the data dictionary; never guess a variable name, column name or coding.
  3. Generate a mapping report:
    • Green: directly available (no recoding)
    • Yellow: available but needs recoding (document transformation)
    • Red: not available in target DB (propose proxy or exclusion)
  4. Output: variable mapping table (variable_mapping.csv) for user approval.

Phase 3: Code Generation

  1. Generate self-contained, reproducible analysis code (Python with pandas + R via subprocess for survey-weighted analysis): a. Data loading & cleaning: read target DB, derive inclusion/exclusion flags (keep every row) b. Variable derivation: recode variables per mapping table c. Survey design setup: define svydesign object (strata, PSU, weights) on the full file, then restrict it with subset(design, <inclusion flag>); deleting rows before the design is declared gives wrong standard errors (/analyze-stats survey_weighted.md, subpopulation analysis). Weighted analysis is mandatory for KNHANES/NHANES — never run unweighted models. Never pool data across surveys; analyze each country's data with its own survey design. 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
  2. Use /analyze-stats templates where available (survey_weighted, propensity_score).
  3. Use Asian BMI cutoffs (≥25 for obesity) for Korean data, even if the source used WHO (≥30).
  4. Run the code on the target data; every number in results/ and the report comes from that executed output.

Phase 4: Difference Report

Save replication_report.md in the working directory, documenting every deviation from the source methodology:

SectionContent
Study DesignSame / Modified (explain)
DatabaseSource DB → Target DB (N, years, country)
PopulationInclusion/exclusion differences
Variable MappingFull mapping table with match status
Unavailable VariablesWhat's missing and how handled
Methodological DifferencesAny forced changes (e.g., BMI cutoffs, LDL direct measurement vs Friedewald)
Expected DifferencesWhy results may differ (population, measurement, cultural)

Note that KNHANES/NHANES are de-identified public data (IRB exempt or waived). Cite only with a /search-lit-confirmed DOI/PMID; otherwise mark the reference [UNVERIFIED - NEEDS MANUAL CHECK].

Phase 5: Validation Checklist

Before reporting completion, verify:

  • All source paper covariates accounted for (mapped, proxied, or documented as missing)
  • Survey weights correctly applied (NEVER analyze unweighted if source used weights)
  • Obesity/BMI cutoffs match target population standards (Asian vs WHO)
  • Fasting requirements matched (fasting glucose, lipids)
  • Age restrictions applied correctly
  • Code runs without errors on target data
  • Output tables match source paper structure

Output Files

{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)

FAQ

What does the replicate-study skill do?

Use when applying a published cohort study's methodology to a different database. Extracts the design from the source paper, maps variables to the target database with a harmonization table, generates the analysis code and reports every forced deviation.

How do I install replicate-study?

Run npx skills add https://github.com/aperivue/medsci-skills --skill replicate-study in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/replicate-study/ (personal) or .claude/skills/replicate-study/ (project).

Which AI agents can use replicate-study?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is replicate-study safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains replicate-study?

It is published by aperivue in aperivue/medsci-skills. It has 115 recorded installs.

More from aperivue/medsci-skills

View all →
aperivue avatar

check-reporting

aperivue/medsci-skills

Use when auditing a manuscript item by item against a reporting guideline or risk-of-bias tool. Covers 49 reporting guidelines and risk-of-bias tools (STROBE, CONSORT, STARD, TRIPOD+AI, PRISMA, QUADAS and more), marking each item PRESENT, PARTIAL or MISSING. Not a reviewer critique (/self-review).

Data & Databases181 installs
aperivue avatar

meta-analysis

aperivue/medsci-skills

Use when running a systematic review and meta-analysis, DTA or intervention. Covers PROSPERO protocol, search, screening, extraction, risk of bias (QUADAS-3, RoB 2, ROBINS-I), bivariate/HSROC or random-effects pooling, forest plots, heterogeneity and PRISMA reporting. Topic scouting is /ma-scout.

Data & Databases177 installs
aperivue avatar

make-figures

aperivue/medsci-skills

Use when a paper needs publication-ready figures or a visual abstract. Makes ROC, forest, calibration, Kaplan-Meier and Bland-Altman plots, CONSORT/STARD/PRISMA flow diagrams, confusion matrices, pipeline diagrams and journal visual abstracts, checking the journal's AI-image policy first.

Data & Databases155 installs
aperivue avatar

analyze-stats

aperivue/medsci-skills

Use when data needs statistical analysis. Runs reproducible Python/R code for Table 1, diagnostic accuracy, agreement, regression, survival, propensity score, survey-weighted and repeated-measures models, with publication tables. Sample size is /calc-sample-size; pooling studies is /meta-analysis.

Testing & QA154 installs
aperivue avatar

verify-refs

aperivue/medsci-skills

Use when checking whether a manuscript's references are real. Audits each citation against PubMed and CrossRef, flags fabricated or mismatched entries and writes qc/referenceaudit.json. Audit-only; never edits references or refs.bib. Citation-key checks are /manage-refs.

Security152 installs
aperivue avatar

search-lit

aperivue/medsci-skills

Use when finding papers or building a reference list. Searches PubMed, Semantic Scholar and bioRxiv/medRxiv, includes only references verified through an API, and generates BibTeX. Auditing an existing reference list is /verify-refs.

Backend & APIs151 installs

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases495.1K installs
prisma avatar

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases444.5K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases442.4K installs
prisma avatar

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases441.4K installs
prisma avatar

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases434.1K installs

Obtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), runs or mentions create-db or npx create-db, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.

OfficialData & Databases428.8K installs