Agent skill

Decision Curve Analysis

by aipoch in aipoch/medical-research-skills

A skill your agent uses when evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model, plotting decision and…

MITAuto-check passedData & Analytics

Install Decision Curve Analysis

skills CLI
$ npx skills add aipoch/medical-research-skills --skill decision-curve-analysis -a claude-code

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

GitHub CLI
$ gh skill install aipoch/medical-research-skills decision-curve-analysis --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/decision-curve-analysis' .claude/skills/decision-curve-analysis && 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
decision-curve-analysis
GitHub stars
2k
Token cost
~2.8k tokens
SKILL.md length
1,069 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 evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model, plotting decision and…

  • Works in 4 steps: Validate Input → Prepare Analysis Dataset → Fit Decision-Curve Model → …
  • Evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model
  • SKILL.md covers When to Use, When Not to Use, When to Read External Files and Usage, plus 11 more sections
  • Runs R and Shell scripts from its folder; calls bash; reaches cloud.r-project.org

What it does

Decision Curve Analysis is an agent skill from aipoch/medical-research-skills. Use when evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model, plotting decision and clinical-impact curves, and exporting summary outputs. NOT for: survival calibration, ROC-only discrimination analysis, nomogram construction, or time-to-event outcomes.

Its SKILL.md is about 2.8k 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_decision-curve-analysis_result.json`, `references/algorithm.md` and `references/cli-guide.md`).

It sits in Data & Analytics, covering Data visualization, CSV and tabular files and Performance reviews. 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

  • Evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model
  • Plotting decision and clinical-impact curves
  • Exporting summary outputs

Example prompts

  • “/decision-curve-analysis”

Requirements

  • A Bash shell

Workflow steps

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

  1. Validate Input
  2. Prepare Analysis Dataset
  3. Fit Decision-Curve Model
  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

Decision Curve Analysis loads about 2.8k tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 1,069 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
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,069 words, ~2,790 tokens.

Download SKILL.mdSave it as .claude/skills/decision-curve-analysis/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
decision-curve-analysis
description
Use when evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model, plotting decision and clinical-impact curves, and exporting summary outputs. NOT for: survival calibration, ROC-only discrimination analysis, nomogram construction, or time-to-event outcomes.
license
MIT
skill-author
AIPOCH

Decision Curve Analysis

When to Use

Use this skill when you need to:

  • evaluate whether a binary prediction model adds clinical net benefit across threshold probabilities;
  • visualize decision curves and clinical-impact curves from a clinical cohort;
  • export an auditable DCA model object together with summary text and PDFs.

Typical user requests:

  • "Run decision-curve analysis on this binary outcome and risk-score dataset."
  • "Generate DCA and clinical-impact plots for this prediction model."
  • "Compare net benefit across thresholds for this case-control cohort."

When Not to Use

Do not use this skill for:

  • time-to-event or survival outcomes;
  • ROC-only discrimination analysis without decision-curve outputs;
  • nomogram construction or calibration-curve analysis;
  • multiclass outcomes or non-binary endpoints.

When to Read External Files

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

Usage

bash
Rscript scripts/main.R \
  --data_file ./clinical_dca_data.csv \
  --outcome_col fustat \
  --predictor_col riskScore \
  --output_dir ./output/

Arguments

ShortLongTypeDefaultDescription
-d--data_filecharacterrequiredClinical CSV file with row names as sample IDs
--outcome_colcharacterfustatBinary outcome column encoded as 0/1
--predictor_colcharacterriskScoreNumeric predictor column used in the logistic DCA model
--study_designcharactercase-controlStudy design: case-control or cohort
--population_prevalencedouble0.3Population prevalence for case-control DCA (ignored for cohort design)
--threshold_bydouble0.01Threshold step size; values below 0.005 significantly increase computation time
--confidence_leveldouble0.95Confidence level passed to rmda::decision_curve()
--population_sizeinteger1000Population size used in the clinical-impact plot
--n_cost_benefitsinteger8Number of cost-benefit labels in the clinical-impact plot
--show_confidence_intervalsflagFALSEShow confidence intervals on the decision curve
--standardize_net_benefitflagFALSEReport standardized net benefit (sNB) instead of raw net benefit (NB)
--decision_curve_colorcharacter#E64B35Decision-curve line color
--impact_colorscharacter#E64B35,#4DBBD5Two comma-separated colors for the clinical-impact plot
--plot_widthdouble6PDF width in inches
--plot_heightdouble5.5PDF height in inches
--font_familycharactersansPDF font family
--plot_titlecharacterDecision Curve AnalysisDecision-curve plot title
--base_cexdouble0.9Base text-size multiplier
-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

Input Format

Clinical Data (--data_file)

CSV file with row names as sample IDs. The dataset must contain at least one binary outcome column and one numeric predictor column.

csv
,fustat,riskScore,FOXP3,CD45
Patient_1,1,0.630147268229631,5.7783584300481,3.5407433709834
Patient_2,0,0.23007730941193,6.70308857663772,3.11795942819676
Patient_3,1,0.534809528754818,5.46860669585825,3.40086667402884

Requirements

  • File extension must be .csv.
  • Row names must be non-missing, unique sample IDs.
  • outcome_col and predictor_col must exist.
  • Outcome values must use 0/1 encoding. Outcome values are coerced to numeric before validation; logical TRUE/FALSE are converted to 1/0. Factor or character values will produce SKILL_INVALID_PARAMETER.
  • Predictor values must be finite numeric values.
  • At least 20 rows, 5 positive outcomes, and 5 negative outcomes are required.

Design note: When --study_design cohort is selected, --population_prevalence has no statistical effect; the raw observed event rate is used instead. A warning is emitted if you set a non-default population_prevalence with cohort design.


Output Files

FileFormatDescription
data/dca_model.rdsRDSSaved rmda::decision_curve() result object
table/dca_summary.txtPlain textText summary of decision-curve net benefit statistics
plot/decision_curve.pdfPDFDecision-curve plot
plot/clinical_impact_curve.pdfPDFClinical-impact plot
session_info.txtPlain textSession information and run parameters
dca_summary.txt

Summary fields include:

  • threshold-specific net benefit statistics from summary(dca_model);
  • the selected measure (NB or sNB);
  • the fitted formula and study-design context recorded in session_info.txt.

Workflow

Step 1: Validate Input
  • Confirm the clinical CSV exists and is readable.
  • Check that the requested outcome and predictor columns are present.
  • Validate sample IDs, binary outcome coding, and numeric predictor values.
  • Emit warning if population_prevalence is non-default and study_design is cohort.
Step 2: Prepare Analysis Dataset
  • Keep only the outcome and predictor columns required for DCA.
  • Coerce outcome and predictor values to numeric.
  • Reject cohorts with too few rows or too few events/non-events.
Step 3: Fit Decision-Curve Model
  • Fit a logistic decision-curve model with rmda::decision_curve().
  • Build a threshold grid from 0 to 1 using threshold_by.
  • Apply population_prevalence when study_design is case-control.
Show full SKILL.md (416 more words)Show less
Step 4: Save Outputs
  • Save the fitted DCA object as .rds.
  • Export the text summary as .txt.
  • Render the decision curve and clinical-impact curve as PDFs.
  • Record session metadata for reproducibility.

Agent Response Contract

After a successful run, report:

  1. Study design and predictor used (e.g., case-control, riskScore)
  2. Net benefit metric reported (NB or sNB)
  3. Threshold range and step used for the grid
  4. Key finding: net benefit at clinically relevant threshold(s) from dca_summary.txt
  5. Artifact paths: plot/decision_curve.pdf, plot/clinical_impact_curve.pdf, data/dca_model.rds

Examples

Basic Usage
bash
Rscript scripts/main.R \
  --data_file clinical_dca_data.csv \
  --outcome_col fustat \
  --predictor_col riskScore \
  --output_dir ./output/
Cohort Design With Custom Plotting
bash
Rscript scripts/main.R \
  --data_file clinical_dca_data.csv \
  --study_design cohort \
  --outcome_col fustat \
  --predictor_col riskScore \
  --plot_title "Cohort DCA" \
  --decision_curve_color "#3C5488" \
  --impact_colors "#3C5488,#00A087" \
  --show_confidence_intervals \
  --output_dir ./cohort_output/
With Bundled Test Data
bash
Rscript scripts/main.R \
  --data_file tests/data/dca_data.csv \
  --outcome_col fustat \
  --predictor_col riskScore \
  --output_dir tests/output/ \
  --overwrite

Error Handling

ErrorCauseSolution
SKILL_INVALID_PARAMETERInvalid design, invalid numeric range, invalid outcome coding, insufficient rows/class counts, or failed model fittingCheck arguments, data ranges, and binary outcome coding
SKILL_FILE_NOT_FOUNDInput CSV does not existVerify the input path
SKILL_MISSING_COLUMNSRequired columns are absentCheck outcome_col and predictor_col names
SKILL_EMPTY_DATAInput file is empty or contains no usable rows/columnsCheck the CSV content
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('rmda', repos='https://cloud.r-project.org')"

IF error persists, READ: references/troubleshooting.md


Input Validation

This skill accepts: a single clinical CSV file with a binary outcome column (0/1 encoded) and a numeric predictor column, for decision curve analysis of a binary prediction model.

If the user's request does not involve decision curve analysis of a binary prediction model — for example, asking to run survival analysis, build ROC curves only, construct a nomogram, or analyze multiclass outcomes — do not proceed with the workflow. Instead respond:

"Decision Curve Analysis is designed to evaluate the clinical utility of binary prediction models by computing net benefit across decision thresholds. Your request appears to be outside this scope. Please provide a binary outcome dataset for DCA, or use a more appropriate tool for survival analysis, ROC analysis, or nomogram construction."


Testing

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

Rscript scripts/main.R \
  --data_file tests/data/dca_data.csv \
  --outcome_col fustat \
  --predictor_col riskScore \
  --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/dca_model.rds
|-- plot/clinical_impact_curve.pdf
|-- plot/decision_curve.pdf
|-- session_info.txt
`-- table/dca_summary.txt

References

  1. Vickers AJ, Elkin EB. Decision curve analysis: a novel method for evaluating prediction models.
  2. rmda package documentation for clinical decision-curve analysis.

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: 1.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/decision-curve-analysis of aipoch/medical-research-skills.

  • SKILL.md
  • eval_report_decision-curve-analysis_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/dca_data.csv
  • tests/run_smoke_test.R
  • tests/run_smoke_test.sh

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Decision Curve Analysis 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.

Decision Curve Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Decision Curve Analysis this skillaipoch/medical-research-skills2k—~2.8kAutomated safety check: PassMIT
Analysis Graphingclshortfuse/renodx4.5k—~1.1kAutomated safety check: PassMIT
Paper FiguresEvoScientist/EvoSkills4761 repos~4.4kAutomated safety check: PassApache-2.0
Raccoon DataanalysisSenseTime-Copilot/raccoon-dataanalysis-skill137—~1.9kAutomated safety check: PassNone
CSV Data Analysis5zjk5/prompt-engineering127—~2.6kAutomated safety check: PassNone
ModelViz Scientific PlotshrdZhu/modelviz-skill286—~3.6kAutomated safety check: PassNone

Similar skills

  • Analysis Graphing

    clshortfuse/renodx

    RenoDX workflow for creating readable analysis graphs and plots from shader math, CSVs, EXRs, LUTs, hue sweeps, tone curves, gamut comparisons, energy/scalar maps, and test-pattern statistics.

    4.5k GitHub stars~1.1k tokensUpdated today
    Data & AnalyticsAuto-check passed
  • Paper Figures

    EvoScientist/EvoSkills

    A skill your agent uses to produce standalone, publication-ready PNG graphics and reproducible matplotlib scripts from tabular data (CSVs or DataFrames).

    476 GitHub starsUsed in 1 repo~4.4k tokens
    Data & AnalyticsAuto-check passed
  • Raccoon Dataanalysis

    SenseTime-Copilot/raccoon-dataanalysis-skill

    Raccoon (小浣熊) Data Analysis - Remote code interpreter and data visualization service powered by SenseTime.

    137 GitHub stars~1.9k tokensUpdated 6 mo ago
    Data & AnalyticsAuto-check passed
  • CSV Data Analysis

    5zjk5/prompt-engineering

    This skill should be used when users need to analyze CSV or Excel files, understand data patterns, generate statistical summaries, or create data visualizations.

    127 GitHub stars~2.6k tokensUpdated 24 days ago
    Data & AnalyticsAuto-check passed
  • ModelViz Scientific Plots

    hrdZhu/modelviz-skill

    Turns your CSV or Excel data and a plain-language request into a publication-style scientific chart by adapting a catalog template, then checks and repairs it.

    286 GitHub stars~3.6k tokensUpdated 2 mo ago
    Data & AnalyticsAuto-check passed
  • Data Analysis

    fastclaw-ai/fastclaw

    Analyze data, process CSV/JSON files, compute statistics, and create data visualizations.

    1.4k GitHub stars~410 tokensUpdated 3 days ago
    Data & AnalyticsAuto-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…

    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 Decision Curve Analysis

What does Decision Curve Analysis do?

A skill your agent uses when evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model, plotting decision and…. Decision Curve Analysis is an agent skill from aipoch/medical-research-skills. Use when evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model, plotting decision and clinical-impact curves, and exporting summary outputs.

When should I use Decision Curve Analysis?

Decision Curve Analysis fits situations like: evaluating the clinical utility of a binary prediction model from a single clinical CSV file by fitting a logistic decision-curve model; plotting decision and clinical-impact curves; exporting summary outputs.

How do I install Decision Curve Analysis in Claude Code?

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

How do I install Decision Curve Analysis in Codex?

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

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

What does Decision Curve Analysis need to run?

Going by SKILL.md and its folder, Decision Curve Analysis 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 Decision Curve Analysis 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 Decision Curve Analysis 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 Decision Curve Analysis use?

Decision Curve Analysis 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 Decision Curve Analysis use?

About 2.8k 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 Decision Curve Analysis?

Skills that share tags, products or a category with Decision Curve Analysis: Analysis Graphing (clshortfuse/renodx, 4.5k stars), Paper Figures (EvoScientist/EvoSkills, 476 stars), Raccoon Dataanalysis (SenseTime-Copilot/raccoon-dataanalysis-skill, 137 stars) and CSV Data Analysis (5zjk5/prompt-engineering, 127 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Decision Curve Analysis?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,978 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.