Agent skill

Two Sample Mr Research Planner

by aipoch in aipoch/medical-research-skills

Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction.

MITAuto-check passedResearch & Science

Install Two Sample Mr Research Planner

skills CLI
$ npx skills add aipoch/medical-research-skills --skill two-sample-mr-research-planner -a claude-code

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

GitHub CLI
$ gh skill install aipoch/medical-research-skills two-sample-mr-research-planner --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/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'scientific-skills/Protocol Design/two-sample-mr-research-planner' .claude/skills/two-sample-mr-research-planner && 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
two-sample-mr-research-planner
GitHub stars
2k
Token cost
~2.7k tokens
SKILL.md length
1,150 words
Files
4 (incl. references)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction.

  • Works in 9 steps: Infer Study Type → Output Four Configurations → Recommend One Primary Plan → …
  • Users want to design
  • SKILL.md covers Supported Study Styles, Minimum User Input, Step-by-Step Execution and R Code Framework Guidelines, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Two Sample Mr Research Planner is an agent skill from aipoch/medical-research-skills. Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers:"design a two-sample MR study", "build a publishable MR paper", "test whether this biomarker causally affects this disease", "generate Lite/Standard/Advanced MR plans", "screen multiple exposures with MR", "bidirectional MR design", "causal inference using GWAS summary statistics", or "I…

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `eval_report_two-sample-mr-research-planner_polished_result.json`, `references/gwas_databases.md` and `references/iv_benchmarks.md`).

It sits in Research & Science, covering Data analysis. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Users want to design
  • Build a study using two-sample MR to test causal relationships

Example prompts

  • “design a two-sample MR study”
  • “build a publishable MR paper”
  • “test whether this biomarker causally affects this disease”
  • “/two-sample-mr-research-planner”

Workflow steps

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

  1. Infer Study Type
  2. Output Four Configurations
  3. Recommend One Primary Plan
  4. Full Step-by-Step Workflow
  5. Figure and Deliverable Plan
  6. Validation and Robustness Plan
  7. Risk Review
  8. Minimal Executable Version
  9. Publication Upgrade Path

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are r).

    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

Two Sample Mr Research Planner loads about 2.7k tokens when it runs, and up to ~5.1k if it reads all its reference files. Until then it costs about 205 tokens; SKILL.md has 1,150 words of instructions outside code blocks.

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

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 aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 1,150 words, ~2,738 tokens.

Download SKILL.mdSave it as .claude/skills/two-sample-mr-research-planner/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
two-sample-mr-research-planner
description
Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers:"design a two-sample MR study", "build a publishable MR paper", "test whether this biomarker causally affects this disease", "generate Lite/Standard/Advanced MR plans", "screen multiple exposures with MR", "bidirectional MR design", "causal inference using GWAS summary statistics", or "I want to study X and Y using MR". Always outputs four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

Two-Sample Mendelian Randomization Research Planner

Generates a complete two-sample MR study design from a user-provided research direction. Always outputs four workload configurations and a recommended primary plan.

Supported Study Styles

StyleDescriptionExample
A. Single Exposure → Single OutcomeOne biomarker or trait to one diseaseSerum uric acid → gout; vitamin D → osteoporosis
B. Multi-Exposure ScreeningPanel of exposures to one outcomeDietary factors → endometriosis; cytokine panel → RA
C. Bidirectional MRReciprocal causal testingInflammation ↔ depression; BMI ↔ osteoarthritis
D. Lifestyle / Diet / BehavioralSelf-reported behavioral exposuresCoffee intake → hypertension; sleep duration → stroke
E. Biomarker / Molecular TraitCirculating proteins, metabolitesCytokines → autoimmune disease; plasma proteins → Alzheimer's
F. Publication-OrientedComprehensive sensitivity-rich designFull estimator suite with complete figure set

Minimum User Input

  • One exposure (or exposure set) + one outcome
  • If limited detail is provided, infer a reasonable default design and state all assumptions explicitly

Step-by-Step Execution

Step 1: Infer Study Type

Identify:

  • Exposure(s) and outcome
  • Exposure class (dietary, biomarker, metabolite, behavioral, disease trait, molecular)
  • User goal: screening, bidirectional, causal verification, or publication strength
  • Whether MVMR or colocalization is justified
  • Time or resource constraints stated by the user
Step 2: Output Four Configurations

Always generate all four. For each configuration describe: goal, required data, major modules, expected workload, figure set, strengths, and weaknesses.

ConfigGoalTimeframeBest For
LiteFast minimal causal test2–4 weeksQuick launch, 1 exposure × 1 outcome
StandardPublication-ready core MR4–8 weeksSingle or small panel + sensitivity suite
AdvancedRobust multi-extension design8–14 weeksBidirectional, MVMR, replication GWAS
Publication+High-impact comprehensive paper12–20 weeksFull sensitivity, MVMR, colocalization, power
Step 3: Recommend One Primary Plan

Select the best-fit configuration and explain why, given the exposure type, outcome, and any stated user constraints (time, data access, publication goal).

Step 4: Full Step-by-Step Workflow

For each step include: step name, purpose, input, method, key parameters/thresholds, expected output, failure points, and alternative approaches.

Core modules to address when relevant:

  • Exposure GWAS selection + ancestry matching
  • Outcome GWAS selection
  • Instrument extraction (p < 5×10⁻⁸, LD clumping r² < 0.001 / 10,000 kb)
  • F-statistic screening (F > 10)
  • Harmonization (palindromic SNP handling)
  • IVW (primary analysis, random effects)
  • MR-Egger, weighted median, simple/weighted mode (complementary)
  • Heterogeneity (Cochran's Q, I²)
  • Pleiotropy (MR-Egger intercept, MR-PRESSO)
  • Leave-one-out analysis
  • Bidirectional MR (when justified — see Hard Rules)
  • MVMR (when confounding exposures need adjustment)
  • Power / MDES discussion
  • Colocalization (Advanced / Publication+ only; PP.H4 > 0.8 standard)

Exposure-class IV count benchmarks — state expected IV count and flag weak-instrument risk accordingly:

→ Full benchmarks by exposure class: references/iv_benchmarks.md

GWAS data sources by exposure class:

→ Recommended databases and last-verified dates: references/gwas_databases.md

Fault tolerance guidelines:

  • If the target GWAS is unavailable: state this explicitly, suggest the closest publicly available alternative, and recommend the Lite configuration until data access is confirmed
  • If IV count falls below 3: warn the user that MR is not feasible with current instruments; suggest waiting for larger GWAS or pivoting to a proxy exposure
  • If F-statistic < 10 for all IVs: do not proceed with IVW as primary; escalate to weak-instrument-robust methods (LIML, sisVIVE) and note this as a study limitation
Step 5: Figure and Deliverable Plan

Always list:

  • Scatter plots (exposure–outcome per estimator)
  • Forest plots (leave-one-out)
  • Funnel plots (pleiotropy visual)
  • Summary results table (all estimators)
  • Sensitivity analysis table
Step 6: Validation and Robustness Plan

State what each layer proves and what it does not prove. Distinguish:

  • Primary MR evidence: IVW result + instrument validity checks (F > 10, no strong pleiotropy signal)
  • Sensitivity support: estimator consistency across MR-Egger, weighted median, mode; Cochran Q non-significant
  • Higher-tier causal strengthening: MVMR (adjusts for correlated exposures), bidirectional MR (rules out reverse causation), colocalization (rules out LD confounding)
Step 7: Risk Review

Always include a self-critical section addressing:

  • Strongest part of the design
  • Most assumption-dependent part
  • Most likely source of false positives
  • Easiest part to overinterpret
  • Most likely reviewer criticisms: weak instruments, pleiotropy, ancestry mismatch, sample overlap, multiple-testing (for screening studies), behavioral phenotype noise, insufficient IV count for dietary/microbiome exposures
  • Revision strategy if first-pass findings fail
Step 8: Minimal Executable Version

Slim version using only publicly available GWAS: 1 exposure (or small set), 1 outcome, IVW + 1–2 complementary estimators, heterogeneity/pleiotropy/leave-one-out, concise interpretation. Confirm this fits within any stated time constraints before recommending.

Show full SKILL.md (464 more words)Show less
Step 9: Publication Upgrade Path

Explain what to add beyond Standard, which additions most improve publication strength, and which modules add rigor versus complexity. For molecular trait MR (proteins, metabolites), always include colocalization as a required upgrade for high-impact journals.

R Code Framework Guidelines

When providing R code examples or frameworks:

  • Always use the TwoSampleMR package (CRAN) as the primary tool
  • Mark all GWAS IDs as examples with an explicit inline comment: # EXAMPLE ID — replace with your target phenotype ID
  • Do not present example IDs as validated or guaranteed to resolve correctly
  • Provide the IEU Open GWAS API query pattern so users can search for their own phenotype IDs

Standard R framework template:

r
library(TwoSampleMR)
library(MRPRESSO)

# Step 1: Extract instruments for exposure
# EXAMPLE ID below — replace with your target exposure GWAS ID
exposure <- extract_instruments(outcomes = "ukb-b-XXXXX")  # EXAMPLE ID

# Step 2: Extract outcome data
# EXAMPLE ID below — replace with your target outcome GWAS ID
outcome <- extract_outcome_data(
  snps = exposure$SNP,
  outcomes = "ieu-b-XXXXX"  # EXAMPLE ID
)

# Step 3: Harmonise
harmonized <- harmonise_data(exposure, outcome)

# Step 4: Primary and sensitivity analyses
res <- mr(harmonized, method_list = c(
  "mr_ivw",
  "mr_egger_regression",
  "mr_weighted_median",
  "mr_weighted_mode"
))

# Step 5: Heterogeneity and pleiotropy
het  <- mr_heterogeneity(harmonized)
plt  <- mr_pleiotropy_test(harmonized)
loo  <- mr_leaveoneout(harmonized)

To find valid GWAS IDs: ao <- available_outcomes(); View(ao)

Hard Rules

  1. Never output only one generic plan — always output all four configurations.
  2. Always recommend one primary plan with justification.
  3. Always separate necessary modules from optional modules.
  4. Distinguish primary MR evidence, sensitivity support, and higher-tier causal strengthening.
  5. Do not force bidirectional or MVMR if the topic does not justify it.
  6. Do not overclaim causality when instruments are weak or behavioral phenotypes are noisy.
  7. Do not treat nominal estimator agreement as proof if sensitivity analyses are inconsistent.
  8. Do not ignore ancestry mismatch or sample-overlap concerns.
  9. If the user provides limited detail, infer a reasonable default design and state all assumptions clearly.
  10. Do not produce only a literature summary or flat methods list.
  11. Out-of-scope redirect: If the user requests a non-MR causal inference design (RCT, propensity score matching, DAG-based observational analysis, Bayesian network, etc.), clearly state that this skill covers two-sample MR only and recommend consulting appropriate resources (e.g., CONSORT for RCTs, STROBE for observational studies).

Input Validation

This skill accepts: a research direction involving a causal question between an exposure (biomarker, dietary factor, behavioral trait, molecular trait, or disease) and an outcome, where the user wants to design a two-sample Mendelian randomization study.

If the user's request does not involve MR study design — for example, asking to design an RCT, conduct a systematic review, write a manuscript introduction, perform propensity score analysis, or answer a general epidemiology question — do not proceed with the MR planning workflow. Instead respond:

"Two-Sample MR Research Planner is designed to generate Mendelian randomization study designs using GWAS summary statistics. Your request appears to be outside this scope. Please provide an exposure–outcome pair you want to test using MR, or use a more appropriate skill for your task (e.g., a systematic review skill for literature synthesis, or an experimental design skill for RCTs)."

Reference Files

FileContentUsed In
references/gwas_databases.mdRecommended GWAS sources by exposure class with last-verified datesStep 4 — GWAS selection
references/iv_benchmarks.mdTypical IV count ranges and weak-instrument risk flags by exposure classStep 4 — instrument extraction

© aipoch, 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 3 other files (references) in scientific-skills/Protocol Design/two-sample-mr-research-planner of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_two-sample-mr-research-planner_polished_result.json
  • references/gwas_databases.md
  • references/iv_benchmarks.md

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Two Sample Mr Research Planner 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.

Two Sample Mr Research Planner compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Two Sample Mr Research Planner this skillaipoch/medical-research-skills2k—~2.7kAutomated safety check: PassMIT
Neuropixels Data Analysisdavila7/claude-code-templates32k10 repos~2.8kAutomated safety check: PassMIT
Scanpy Single-Cell Analysisdavila7/claude-code-templates32k16 repos~2.8kAutomated safety check: PassMIT
NeuroKit2 Biosignal Processingdavila7/claude-code-templates32k12 repos~3kAutomated safety check: PassMIT
Modeling Competition Computation StageWuXinbo-bo/Math-model-skills111—~4.5kAutomated safety check: PassMIT
Single-Cell Initial AnalysisLigphiDonk/Oh-my--paper7381 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    32k GitHub starsUsed in 10 repos~2.8k tokens
    Research & ScienceAuto-check passed
  • Scanpy Single-Cell Analysis

    davila7/claude-code-templates

    Walks through single-cell RNA-seq analysis with Scanpy: loading .h5ad and 10X data, QC, normalization, PCA and UMAP, Leiden clustering, marker genes and cell type annotation.

    32k GitHub starsUsed in 16 repos~2.8k tokens
    Research & ScienceAuto-check passed
  • NeuroKit2 Biosignal Processing

    davila7/claude-code-templates

    Processes physiological signals with NeuroKit2 in Python: ECG, PPG, EEG, EDA, respiration, EMG and EOG, including HRV, events and complexity measures.

    32k GitHub starsUsed in 12 repos~3k tokens
    Research & ScienceAuto-check passed
  • Modeling Competition Computation Stage

    WuXinbo-bo/Math-model-skills

    Pipeline stage that turns a mathematical modeling report into runnable programs per sub-question, frozen numerical results and reviewable evidence files.

    111 GitHub stars~4.5k tokensUpdated 18 days ago
    Research & ScienceAuto-check passed
  • Single-Cell Initial Analysis

    LigphiDonk/Oh-my--paper

    Runs a seven-step quality-control and exploration pipeline on scRNA-seq, CyTOF or flow cytometry data and writes a plain-language report of what it found.

    738 GitHub starsUsed in 1 repo~1.4k tokens
    Research & ScienceAuto-check passed
  • Consolidates BERTopic, LDA or NMF topic output into a theory-driven classification framework and writes the final labels back to an Excel file.

    108 GitHub stars~1k tokensUpdated 15 days ago
    Research & ScienceAuto-check passed

More from aipoch/medical-research-skills

All 567 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 22 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 22 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 22 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 22 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 22 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 22 days ago
    Auto-check passed

Questions about Two Sample Mr Research Planner

What does Two Sample Mr Research Planner do?

Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Two Sample Mr Research Planner is an agent skill from aipoch/medical-research-skills. Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction.

When should I use Two Sample Mr Research Planner?

Two Sample Mr Research Planner fits situations like: users want to design; build a study using two-sample MR to test causal relationships.

How do I install Two Sample Mr Research Planner in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill two-sample-mr-research-planner -a claude-code`. Or copy the skill folder (scientific-skills/Protocol Design/two-sample-mr-research-planner in aipoch/medical-research-skills) into .claude/skills/two-sample-mr-research-planner in your project. Claude Code loads it when a task matches its description.

How do I install Two Sample Mr Research Planner in Codex?

Run `npx skills add aipoch/medical-research-skills --skill two-sample-mr-research-planner -a codex`. Or copy the skill folder (scientific-skills/Protocol Design/two-sample-mr-research-planner in aipoch/medical-research-skills) into .agents/skills/two-sample-mr-research-planner in your project. Codex loads it when a task matches its description.

Can I use Two Sample Mr Research Planner 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 aipoch/medical-research-skills --skill two-sample-mr-research-planner -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/two-sample-mr-research-planner, .gemini/skills/two-sample-mr-research-planner, .github/skills/two-sample-mr-research-planner and .opencode/skills/two-sample-mr-research-planner in your project.

What does Two Sample Mr Research Planner need to run?

SKILL.md names no scripts, command-line tools or credentials: Two Sample Mr Research Planner is instructions for the agent only.

Does Two Sample Mr Research Planner 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 Two Sample Mr Research Planner 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 Two Sample Mr Research Planner use?

Two Sample Mr Research Planner is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Two Sample Mr Research Planner use?

About 2.7k tokens (SKILL.md is roughly 11k 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 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Two Sample Mr Research Planner?

Skills that share tags, products or a category with Two Sample Mr Research Planner: Neuropixels Data Analysis (davila7/claude-code-templates, 32k stars), Scanpy Single-Cell Analysis (davila7/claude-code-templates, 32k stars), NeuroKit2 Biosignal Processing (davila7/claude-code-templates, 32k stars) and Modeling Competition Computation Stage (WuXinbo-bo/Math-model-skills, 111 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Two Sample Mr Research Planner?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.

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