Replicate Study logo

Replicate Study

Organization
Aperivue
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.

Overview

PublisherAperivue
Repositorymedsci-skills
Skill namereplicate-study
Stars
349
Forks
82
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Aperivue on GitHub. Read the source before you install it.

Installation

Install the Replicate Study AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Aperivue/medsci-skills/tree/main/skills/replicate-study
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Aperivue/medsci-skills.git /tmp/medsci-skills
mkdir -p .claude/skills
cp -r /tmp/medsci-skills/skills/replicate-study .claude/skills/replicate-study
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Replicate Study in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Replicate Study on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Replicate Study is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Replicate Study AI 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.

Why use Replicate Study on TypingMind?

Because you install it once and use it with any model. Replicate Study is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Replicate Study in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Aperivue/medsci-skills/tree/main/skills/replicate-study. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Replicate Study?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Replicate Study?

As many as you like. As long as a model supports skills, you can use Replicate Study with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Replicate Study AI skill free?

Yes. It is published on GitHub by Aperivue under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇