Agent skill

Replicate Study

by Aperivue in Aperivue/medsci-skills

A skill your agent uses when applying a published cohort study's methodology to a different database.

MITAuto-check passedResearch & Science

Install Replicate Study

skills CLI
$ npx skills add Aperivue/medsci-skills --skill replicate-study -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Aperivue/medsci-skills replicate-study --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Aperivue/medsci-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/replicate-study .claude/skills/replicate-study && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
replicate-study
GitHub stars
329
Token cost
~1.7k tokens
SKILL.md length
653 words
Files
8 (incl. references)
Skills in repo
54
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when applying a published cohort study's methodology to a different database.

  • Works in 5 steps: Source Paper Analysis → Variable Mapping → Code Generation → …
  • Applying a published cohort studys methodology to a different database
  • SKILL.md covers Inputs, Reference Files, Workflow and Output Files
  • Runs Python scripts from its folder

What it does

Replicate Study is an agent skill from Aperivue/medsci-skills. 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.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `references/methodology_extraction_template.md`, `skill.yml` and `tests/test_alcohol_harmonization.py`).

It sits in Research & Science. The repository describes itself as: Agent Skills for medical research — literature search, reporting-guideline & citation checks, statistics, publication figures, submission. Works with Claude Code, Codex, Cursor &… The licence is MIT.

When your agent uses it

  • Applying a published cohort studys methodology to a different database

Example prompts

  • “/replicate-study”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Source Paper Analysis
  2. Variable Mapping
  3. Code Generation
  4. Difference Report
  5. Validation Checklist

What it can do on your machine

Read from SKILL.md and the folder at commit 3b14ae2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Replicate Study loads about 1.7k tokens when it runs, and up to ~8.7k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 653 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~8.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Aperivue/medsci-skills at commit 3b14ae2, republished under its MIT licence (© Aperivue). 653 words, ~1,680 tokens.

Download SKILL.mdSave it as .claude/skills/replicate-study/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
replicate-study
description
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.
model
opus
metadata.triggers
replicate study, replicate paper, 논문 복제, 방법론 복제, reproduce study, replication, 다른 DB로, swap database, 데이터 교체

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.
Show full SKILL.md (342 more words)Show less
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)

© Aperivue, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in skills/replicate-study of Aperivue/medsci-skills.

  • SKILL.md
  • references/harmonization_3country.csv
  • references/harmonization_knhanes_nhanes.csv
  • references/methodology_extraction_template.md
  • skill.yml
  • tests/fixtures/main_alcohol_rows/harmonization_3country.csv
  • tests/fixtures/main_alcohol_rows/harmonization_knhanes_nhanes.csv
  • tests/test_alcohol_harmonization.py

Open the folder on GitHubat commit 3b14ae2

Compare with similar skills

Replicate Study next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Replicate Study compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Replicate Study this skillAperivue/medsci-skills329—~1.7kAutomated safety check: PassMIT
Academic Paper Writing PipelineImbad0202/academic-research-skills51k—~16kAutomated safety check: PassCustom licence
Scientific Venue Templatesdavila7/claude-code-templates32k9 repos~5.1kAutomated safety check: NotesMIT
Horizontal-Vertical Deep ResearchKKKKhazix/khazix-skills21k—~2.1kAutomated safety check: PassMIT
Econ Writehanlulong/econ-writing-skill6462 repos~14kAutomated safety check: PassMIT
NSFC Budget Justification Writerhuangwb8/ChineseResearchLaTeX2.9k2 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Academic Paper Writing Pipeline

    Imbad0202/academic-research-skills

    Runs a 12-agent pipeline that plans, drafts, cites, reviews and formats academic papers, with modes for revision, rebuttals, abstracts and citation checks.

    51k GitHub stars~16k tokensUpdated 4 days ago
    Research & ScienceAuto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    32k GitHub starsUsed in 9 repos~5.1k tokens
    Research & ScienceAuto-check: notes
  • Horizontal-Vertical Deep Research

    KKKKhazix/khazix-skills

    Runs a two-axis deep research method on a product, company, concept or person: its full history over time, compared with peers today, delivered as a typeset PDF report.

    21k GitHub stars~2.1k tokensUpdated 6 days ago
    Research & ScienceAuto-check passed
  • Econ Write

    hanlulong/econ-writing-skill

    Expert economics paper writing assistant synthesizing advice from 50+ top guides by Cochrane, McCloskey, Shapiro, Head, Bellemare, Goldin, Glaeser, Kremer, and other leading economists.

    646 GitHub starsUsed in 2 repos~14k tokens
    Research & ScienceAuto-check passed
  • NSFC Budget Justification Writer

    huangwb8/ChineseResearchLaTeX

    Writes a submission-ready NSFC budget justification as a LaTeX project and renders budget.pdf from your grant proposal text and supporting materials.

    2.9k GitHub starsUsed in 2 repos~1.4k tokens
    Research & ScienceAuto-check passed
  • Study

    alaliqing/claude-paper

    A skill your agent uses when the user wants to read, study, analyze, or deeply understand a research paper (PDF).

    344 GitHub starsUsed in 1 repo~2.5k tokens
    Research & ScienceAuto-check: notes

More from Aperivue/medsci-skills

All 54 skills in this repo
  • Model Assessment

    Aperivue/medsci-skills

    A skill your agent uses when validating or evaluating a trained medical-imaging model.

    329 GitHub starsUsed in 1 repo~4.5k tokens
    Auto-check passed
  • Obsidian Paper Vault

    Aperivue/medsci-skills

    A skill your agent uses when turning a folder of research PDFs into Obsidian notes, even if Obsidian is not named.

    329 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Radiomics ML

    Aperivue/medsci-skills

    A skill your agent uses when building or auditing a radiomics or tabular clinical-ML prediction model with a classical learner (LASSO, SVM, random forest, XGBoost and similar).

    329 GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed
  • Verify Refs

    Aperivue/medsci-skills

    A skill your agent uses when checking whether a manuscript's references are real.

    329 GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed
  • Clean Data

    Aperivue/medsci-skills

    A skill your agent uses when a clinical CSV/Excel dataset needs profiling and cleaning before analysis (missing values, outliers, duplicates, type mismatches).

    329 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Design Study

    Aperivue/medsci-skills

    A skill your agent uses when checking a radiology or medical AI study design before drafting or submission.

    329 GitHub stars~3.9k tokensUpdated 2 days ago
    Auto-check passed

Questions about Replicate Study

What does Replicate Study do?

A skill your agent uses when applying a published cohort study's methodology to a different database. Replicate Study is an agent skill from Aperivue/medsci-skills. Use when applying a published cohort study's methodology to a different database.

When should I use Replicate Study?

Replicate Study fits situations like: applying a published cohort studys methodology to a different database.

How do I install Replicate Study in Claude Code?

Run `npx skills add Aperivue/medsci-skills --skill replicate-study -a claude-code`. Or copy the skill folder (skills/replicate-study in Aperivue/medsci-skills) into .claude/skills/replicate-study in your project. Claude Code loads it when a task matches its description.

How do I install Replicate Study in Codex?

Run `npx skills add Aperivue/medsci-skills --skill replicate-study -a codex`. Or copy the skill folder (skills/replicate-study in Aperivue/medsci-skills) into .agents/skills/replicate-study in your project. Codex loads it when a task matches its description.

Can I use Replicate Study in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Aperivue/medsci-skills --skill replicate-study -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/replicate-study, .gemini/skills/replicate-study, .github/skills/replicate-study and .opencode/skills/replicate-study in your project.

What does Replicate Study need to run?

Going by SKILL.md and its folder, Replicate Study needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Replicate Study access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Replicate Study safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Replicate Study use?

Replicate Study is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Replicate Study use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7k tokens, read only when the agent opens those files.

What are the alternatives to Replicate Study?

Skills that share tags, products or a category with Replicate Study: Academic Paper Writing Pipeline (Imbad0202/academic-research-skills, 51k stars), Scientific Venue Templates (davila7/claude-code-templates, 32k stars), Horizontal-Vertical Deep Research (KKKKhazix/khazix-skills, 21k stars) and Econ Write (hanlulong/econ-writing-skill, 646 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Replicate Study?

Aperivue (a GitHub organization) maintains it in Aperivue/medsci-skills, which has 329 GitHub stars. The repository holds 54 skills in this directory. The repository was last updated on October 5, 2026.

Source: Aperivue/medsci-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.