Agent skill

Model Calibration Curve

by aipoch in aipoch/medical-research-skills

A skill your agent uses when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or…

MITAuto-check passedBusiness, Finance & HR

Install Model Calibration Curve

skills CLI
$ npx skills add aipoch/medical-research-skills --skill model-calibration-curve -a claude-code

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

GitHub CLI
$ gh skill install aipoch/medical-research-skills model-calibration-curve --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/'awesome-med-research-skills/Data Analysis/model-calibration-curve' .claude/skills/model-calibration-curve && 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
model-calibration-curve
GitHub stars
1.9k
Token cost
~2.7k tokens
SKILL.md length
1,014 words
Files
12 (incl. scripts, references)
Skills in repo
578
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or…

  • Works in 4 steps: Validate Input → Prepare Survival Modeling Data → Build Calibration Models → …
  • More prediction horizons from a clinical CSV file
  • SKILL.md covers When to Use, When Not to Use, When to Read External Files and Input Validation, plus 11 more sections
  • Runs R and Shell scripts from its folder; calls bash; reaches cloud.r-project.org

What it does

Model Calibration Curve is an agent skill from aipoch/medical-research-skills. Use when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or more prediction horizons from a clinical CSV file. NOT for: nomogram construction, univariate Cox screening, ROC analysis, or decision-curve analysis.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including scripts and reference files (for example `eval_report_model-calibration-curve_result.json`, `references/algorithm.md` and `references/cli-guide.md`).

It sits in Business, Finance & HR, covering Performance reviews and CSV and tabular files. 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

  • More prediction horizons from a clinical CSV file
  • Tasks that involve Performance reviews
  • Tasks that involve CSV and tabular files

Example prompts

  • “/model-calibration-curve”

Requirements

  • A Bash shell

Workflow steps

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

  1. Validate Input
  2. Prepare Survival Modeling Data
  3. Build Calibration Models
  4. Save Outputs

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

    Ships 4 files in scripts/ (R and Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • cloud.r-project.org

    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

Model Calibration Curve loads about 2.7k tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 1,014 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
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
~4.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); the scripts in this folder are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 1,014 words, ~2,704 tokens.

Download SKILL.mdSave it as .claude/skills/model-calibration-curve/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
model-calibration-curve
description
Use when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or more prediction horizons from a clinical CSV file. NOT for: nomogram construction, univariate Cox screening, ROC analysis, or decision-curve analysis.
license
MIT
skill-author
AIPOCH

Model Calibration Curve

When to Use

Use this skill when you need to:

  • validate a survival model with bootstrap calibration curves;
  • compare predicted and observed survival probabilities at multiple horizons;
  • export calibration statistics together with a PDF visualization.

Typical user requests:

  • "Generate 1-, 2-, and 3-year calibration curves for this prognosis model."
  • "Check whether the Cox model built from age, gender, and risk is well calibrated."
  • "Export calibration statistics and a calibration PDF from this clinical cohort."

When Not to Use

Do not use this skill for:

  • nomogram construction;
  • univariate or multivariable Cox feature screening;
  • ROC, calibration-free discrimination, or decision-curve analysis;
  • non-survival endpoints or multiclass classification tasks.

When to Read External Files

SituationFile to ReadPurpose
Need algorithm detailsreferences/algorithm.mdStatistical method and formulas
Need to run analysisscripts/main.RGet the complete command
Encounter errorsreferences/troubleshooting.mdFind solutions
Need CLI examplesreferences/cli-guide.mdParameter usage examples

Input Validation

This skill accepts:

  • A clinical CSV file with sample IDs as row names, survival time, event indicator, and pre-selected prognostic features
  • Requests to assess calibration of a survival (Cox) model via bootstrap resampling at one or more prediction horizons

If the user's request does not involve survival model calibration from a clinical CSV file — for example, asking to construct a nomogram, screen Cox features, generate an ROC curve, analyze a decision curve, or work with non-survival outcomes — do not proceed with this workflow. Instead respond:

"model-calibration-curve is designed to validate survival model calibration by generating bootstrap calibration curves from a clinical CSV file. Your request appears to be outside this scope. Please use a nomogram-construction skill for nomogram building, a roc-diagnostic-performance skill for ROC analysis, or a decision-curve-analysis skill for DCA."


Prerequisites

R packages required: rms, qs, openxlsx, optparse.

Install with:

r
install.packages(c("rms", "qs", "openxlsx", "optparse"), repos = "https://cloud.r-project.org")

Or run the bootstrap installer:

bash
Rscript scripts/install_dependencies.R

Note: --help requires optparse to be loaded. If the package check fires before option parsing, install optparse first, then run --help. The root fix (deferring heavy package checks until after argument parsing) must be applied in scripts/main.R.


Usage

bash
Rscript scripts/main.R \
  --data_file ./clinical_data.csv \
  --features age,stage,risk \
  --years 1,2,3 \
  --output_dir ./output/

Arguments

ShortLongTypeDefaultDescription
-d--data_filecharacterrequiredClinical CSV file with sample IDs as row names
-f--featurescharacterrequiredComma-separated model features used in the Cox model
-t--time_colcharacterfutimeSurvival time column
-e--event_colcharacterfustatEvent indicator column using 0/1 encoding
-y--yearscharacter1,2,3Prediction horizons in the same units as time_col
-b--bootstrap_repsinteger1000Bootstrap replications for rms::calibrate()
-o--output_dircharacter./output/Output directory
--overwriteflagFALSEAllow writing into a non-empty output directory
-s--seedinteger42Random seed for reproducibility
-T--timeout_secondsinteger0Elapsed time limit in seconds; 0 disables timeout
--plot_widthdouble6PDF width in inches
--plot_heightdouble6PDF height in inches
--font_familycharactersansPDF font family
--line_widthdouble1.5Calibration curve line width
--colorscharacter#0073C2,#EFC000,#868686,#CD534C,#7AA6DDComma-separated colors for time-point curves
--plot_titlecharacterCalibration CurvePlot title
--base_cexdouble0.9Base text-size multiplier

Input Format

Clinical Data (--data_file)

CSV file with row names as sample IDs and columns for model features, survival time, and event indicator.

csv
"",age,gender,stage,futime,fustat,risk
"SAMPLE_001",">65","Female","StageI&II",1.12,0,"high"
"SAMPLE_002","<=65","Male","StageIII&IV",1.92,1,"high"
"SAMPLE_003",">65","Male","StageI&II",4.47,1,"low"

Requirements

  • File extension must be .csv.
  • Row names must be unique sample IDs.
  • All requested features plus time_col and event_col must exist.
  • Survival time values must be finite numbers greater than 0.
  • Event values must use 0/1 encoding.
  • Complete-case filtering must leave at least 30 samples and at least 10 events.
Feature Selection (--features)
  • Comma-separated without line breaks: age,gender,risk
  • Character predictors are converted to factors before Cox fitting.
  • If every requested feature is absent after validation, the run stops.

Output Files

FileFormatDescription
data/calibration_data.qsQS serialized objectSerialized calibration result bundle, including calibration objects and summary metadata
table/calibration_statistics.xlsxExcel workbook (.xlsx)Per-time-point means and overall model summary
plot/calibration_curve.pdfPDF (.pdf)Combined calibration curve visualization
session_info.txtPlain text (.txt)Session information and run parameters
Show full SKILL.md (384 more words)Show less
calibration_statistics.xlsx

Workbook sheets:

  • Time_Point_Stats: predicted mean, observed mean, and bias-corrected mean for each calibration horizon.
  • Model_Summary: overall C-index, sample count, event count, selected features, and fitted formula.

Workflow

Step 1: Validate Input
  • Confirm the clinical CSV exists and is readable.
  • Check that requested features, survival time, and event columns are present.
  • Remove incomplete rows across all required columns.
Step 2: Prepare Survival Modeling Data
  • Convert survival time and event columns to numeric.
  • Convert character predictors to factors.
  • Reject data with non-positive follow-up times, invalid event coding, too few samples, or too few events.
Step 3: Build Calibration Models
  • Fit a Cox proportional hazards model with the requested features.
  • Run rms::calibrate() for each prediction horizon using bootstrap resampling.
  • Compute the concordance index for the fitted model.
Step 4: Save Outputs
  • Serialize the calibration result bundle as .qs.
  • Export statistics to Excel.
  • Render a combined calibration PDF.
  • Record session metadata for reproducibility.

Examples

Basic Calibration Analysis
bash
Rscript scripts/main.R \
  --data_file clinical_data.csv \
  --features age,stage,risk \
  --output_dir ./output/
Custom Horizons And Bootstrap Count
bash
Rscript scripts/main.R \
  --data_file clinical_data.csv \
  --features age,gender,risk \
  --years 1,3,5 \
  --bootstrap_reps 1500 \
  --output_dir ./custom_output/
Custom Plot Styling
bash
Rscript scripts/main.R \
  --data_file clinical_data.csv \
  --features age,stage,risk \
  --plot_width 7 \
  --plot_height 6 \
  --line_width 2 \
  --colors "#1B9E77,#D95F02,#7570B3" \
  --plot_title "Three-Horizon Calibration" \
  --output_dir ./styled_output/
With Bundled Test Data
bash
Rscript scripts/main.R \
  --data_file tests/data/sample_clinical_survival_data.csv \
  --features age,gender,risk \
  --bootstrap_reps 20 \
  --output_dir tests/output/ \
  --overwrite

Error Handling

ErrorCauseSolution
SKILL_INVALID_PARAMETERMissing required argument, invalid numeric values, invalid event coding, insufficient complete cases, insufficient events, or failed model fittingCheck argument values, data validity, and event/sample counts
SKILL_FILE_NOT_FOUNDInput CSV does not existVerify the path
SKILL_MISSING_COLUMNSRequired feature/time/event columns are absentCheck column names and spelling
SKILL_EMPTY_DATAInput file is empty, complete-case filtering removed all rows, or no requested features remainedCheck file content and requested feature names
SKILL_SAMPLE_MISMATCHReserved for cross-file sample mismatch scenariosNot expected for this single-file workflow
SKILL_PACKAGE_NOT_FOUNDRequired R package is missingInstall with: Rscript -e "install.packages(c('rms', 'qs', 'openxlsx'), repos='https://cloud.r-project.org')"

IF error persists, READ: references/troubleshooting.md


Testing

Smoke Test With Included Data
bash
Rscript scripts/main.R --help

Rscript scripts/main.R \
  --data_file tests/data/sample_clinical_survival_data.csv \
  --features age,gender,risk \
  --bootstrap_reps 20 \
  --output_dir tests/output/ \
  --overwrite
Automated Smoke Test Script
bash
Rscript tests/run_smoke_test.R

Optional shell wrapper:

bash
bash tests/run_smoke_test.sh
Expected Output
text
tests/output/
|-- data/calibration_data.qs
|-- plot/calibration_curve.pdf
|-- session_info.txt
`-- table/calibration_statistics.xlsx

References

  1. Harrell FE. Regression Modeling Strategies.
  2. Steyerberg EW et al. Assessing the performance of prediction models.
  3. Austin PC, Steyerberg EW. Graphical assessment of calibration for survival models.

For detailed algorithm, READ: references/algorithm.md


Implementation Checklist

  • CLI parsing with optparse
  • set.seed() for reproducibility
  • Top-level CRAN dependency checks
  • Session info recording
  • Timeout parameter exposed as CLI option
  • Relative-path source() usage via get_script_dir()
  • Modular script structure in scripts/
  • Test data provided in tests/data/
  • Error handling with SKILL_* codes
  • Reference docs provided in references/

Last updated: 2026-04-27 | Version: 2.1.0

© 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 11 other files (scripts, references) in awesome-med-research-skills/Data Analysis/model-calibration-curve of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_model-calibration-curve_result.json
  • references/algorithm.md
  • references/cli-guide.md
  • references/troubleshooting.md
  • scripts/functions.R
  • scripts/main.R
  • scripts/run_analysis.R
  • scripts/utils.R
  • tests/data/sample_clinical_survival_data.csv
  • tests/run_smoke_test.R
  • tests/run_smoke_test.sh

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Model Calibration Curve 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.

Model Calibration Curve compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Model Calibration Curve this skillaipoch/medical-research-skills1.9k—~2.7kAutomated safety check: PassMIT
Social Performance Reviewstevenflanagan1/social-ai-team244—~3.7kAutomated safety check: PassNone
Sequence Performancegooseworks-ai/goose-skills1.2k1 repos~3.3kAutomated safety check: PassMIT
Bio Proteomics Spectral LibrariesGPTomics/bioSkills1.2k1 repos~4.6kAutomated safety check: PassMIT
Regimejackson-video-resources/markov-hedge-fund-method484—~1.6kAutomated safety check: PassCustom licence
Apify Buying Signal Detectionapify/awesome-skills266—~5.1kAutomated safety check: NotesApache-2.0

Similar skills

  • Social Performance Review

    stevenflanagan1/social-ai-team

    Monthly social media performance review for SMBs. An agent skill from stevenflanagan1/social-ai-team.

    244 GitHub stars~3.7k tokensUpdated 3 days ago
    Business, Finance & HRAuto-check passed
  • Sequence Performance

    gooseworks-ai/goose-skills

    Email campaign/sequence performance review composite. An agent skill from gooseworks-ai/goose-skills.

    1.2k GitHub starsUsed in 1 repo~3.3k tokens
    Business, Finance & HRAuto-check passed
  • Builds and manages DIA spectral libraries as peptide query parameters (precursor m/z, a few fragment m/z plus relative intensities, normalized RT, optional CCS), covering experimental DDA…

    1.2k GitHub starsUsed in 1 repo~4.6k tokens
    Research & ScienceAuto-check passed
  • Regime

    jackson-video-resources/markov-hedge-fund-method

    Detect the market regime (Bull / Bear / Sideways) for ANY asset and turn it into a tradeable signal or a risk filter.

    484 GitHub stars~1.6k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Apify Buying Signal Detection

    apify/awesome-skills

    Official

    Set up a recurring buying-signal detection pipeline that finds companies showing buying intent across three signal types — job postings (hiring for the persona), fundraising events (recent raises)…

    266 GitHub stars~5.1k tokensUpdated 17 days ago
    Business, Finance & HRAuto-check: notes
  • Journal

    kazukinagata/shinkoku

    This skill should be used when the user wants to record bookkeeping entries (仕訳), import transaction data from CSV files, receipts, or invoices, or manage their general ledger.

    365 GitHub stars~2.3k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed

More from aipoch/medical-research-skills

All 578 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…

    1.9k GitHub stars~2.2k tokensUpdated 23 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.

    1.9k GitHub stars~1.4k tokensUpdated 23 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.

    1.9k GitHub stars~3.7k tokensUpdated 23 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

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

    1.9k GitHub stars~1.8k tokensUpdated 23 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…

    1.9k GitHub stars~1.7k tokensUpdated 23 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

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

    1.9k GitHub stars~1.3k tokensUpdated 23 days ago
    Auto-check passed

Questions about Model Calibration Curve

What does Model Calibration Curve do?

A skill your agent uses when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or…. Model Calibration Curve is an agent skill from aipoch/medical-research-skills. Use when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or more prediction horizons from a clinical CSV file.

When should I use Model Calibration Curve?

Model Calibration Curve fits situations like: more prediction horizons from a clinical CSV file; tasks that involve Performance reviews; tasks that involve CSV and tabular files.

How do I install Model Calibration Curve in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill model-calibration-curve -a claude-code`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/model-calibration-curve in aipoch/medical-research-skills) into .claude/skills/model-calibration-curve in your project. Claude Code loads it when a task matches its description.

How do I install Model Calibration Curve in Codex?

Run `npx skills add aipoch/medical-research-skills --skill model-calibration-curve -a codex`. Or copy the skill folder (awesome-med-research-skills/Data Analysis/model-calibration-curve in aipoch/medical-research-skills) into .agents/skills/model-calibration-curve in your project. Codex loads it when a task matches its description.

Can I use Model Calibration Curve 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 model-calibration-curve -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/model-calibration-curve, .gemini/skills/model-calibration-curve, .github/skills/model-calibration-curve and .opencode/skills/model-calibration-curve in your project.

What does Model Calibration Curve need to run?

Going by SKILL.md and its folder, Model Calibration Curve needs R and a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: A Bash shell.

Does Model Calibration Curve access the network?

SKILL.md names 1 domain. In commands or code: cloud.r-project.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Model Calibration Curve 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Model Calibration Curve use?

Model Calibration Curve 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 Model Calibration Curve 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 2k tokens, read only when the agent opens those files.

What are the alternatives to Model Calibration Curve?

Skills that share tags, products or a category with Model Calibration Curve: Social Performance Review (stevenflanagan1/social-ai-team, 244 stars), Sequence Performance (gooseworks-ai/goose-skills, 1.2k stars), Bio Proteomics Spectral Libraries (GPTomics/bioSkills, 1.2k stars) and Regime (jackson-video-resources/markov-hedge-fund-method, 484 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Model Calibration Curve?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,937 GitHub stars. The repository holds 578 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.