km-survival-curve

km-survival-curve is a skill for Claude Code, Codex from aipoch/medical-research-skills. It costs 57 tokens per session (2,462 once invoked), scanned A, original, MIT.

A workflow that draws a Kaplan-Meier survival curve, a chart showing how many people remain event-free over time in different risk groups. It reads a table containing follow-up time, event status, and a precomputed risk group.

In plain words
What is it for?
Use it to validate survival columns, handle time units, and export one PDF survival figure from a CSV or tab-delimited file.
Why use it?
It provides a standard way to compare time-to-event outcomes between groups without building the analysis manually.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to validate survival columns, handle time units, and export one PDF survival figure from a CSV or tab-delimited file.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aipoch/medical-research-skills/km-survival-curve
About the project

Medical Research Agent Skills is a library of agent instructions for medical and biomedical research, covering evidence analysis, study protocol design, data analysis, and academic writing. Researchers use it to guide compatible coding agents through common scientific workflows. The catalogue contains many of the library's skills and commands.

aipoch/medical-research-skills · 1,860 stars · on GitHub · aipoch.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aipoch/medical-research-skills --skill km-survival-curve
Clone the repo
git clone --depth 1 https://github.com/aipoch/medical-research-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for km-survival-curve

README.md
[![agentmods](https://agentmods.dev/badge/skills/aipoch/medical-research-skills/km-survival-curve/github.svg)](https://agentmods.dev/skills/aipoch/medical-research-skills/km-survival-curve)
Your own site
<a href="https://agentmods.dev/skills/aipoch/medical-research-skills/km-survival-curve"><img src="https://agentmods.dev/badge/skills/aipoch/medical-research-skills/km-survival-curve/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for km-survival-curve

Your own site · 80×15
<a href="https://agentmods.dev/skills/aipoch/medical-research-skills/km-survival-curve"><img src="https://agentmods.dev/badge/skills/aipoch/medical-research-skills/km-survival-curve.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,462 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00057 $0.02462
Opus 5 $0.00028 $0.01231
Sonnet 5 $0.00011 $0.00492
Haiku 4.5 $0.00006 $0.00246

Measured 13d ago against content hash e22a2a5b4b41, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

km-survival-curve scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

awesome-med-research-skills/Data Analysis/km-survival-curve/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Kaplan-Meier Survival Curve Analysis

Use this skill to run Kaplan-Meier survival analysis on a tabular dataset and export a single PDF survival figure.

Use This Skill When

  • You need a Kaplan-Meier survival curve from a table containing time, status, and group columns.
  • You need a command-line survival workflow with parameter validation.
  • You need a single Kaplan-Meier plot as the final analysis result.

Primary Command

Rscript scripts/main.R \
  --input_file <input_file> \
  --output_dir <output_dir> \
  --time_col <time_column> \
  --status_col <status_column> \
  --risk_col <group_column>

Prerequisites

  • Rscript is available in the shell.
  • Required R packages: optparse, data.table, survival, survminer, ggplot2.
  • Install missing packages with Rscript -e 'install.packages(c("optparse", "data.table", "survival", "survminer", "ggplot2"), repos="https://cloud.r-project.org")'.

Core Arguments

Argument Required Description
--input_file Yes Input data file in CSV or tab-delimited TXT/TSV format
--output_dir No Output directory, default ./KM_Results
--time_col No Survival time column, default futime
--status_col No Event status column, default fustat
--risk_col No Risk group column, default risk_group
--time_unit No Time unit label: year, month, or day, default year
--auto_convert_days No Heuristically convert large time values from days when time_unit is year or month, default true
--statistics_method No logrank or wald, default logrank

Plot Customization Arguments

Argument Default Description
--figure_width 10 Figure width in inches
--figure_height 7 Figure height in inches
--figure_family sans Font family
--title_x Time X-axis title. If left as default, the script renders Time (<time_unit>)
--title_y Survival probability Y-axis title
--title_main empty Plot title
--legend_position top top, bottom, left, right, none
--legend_show true Whether to show legend
--legend_title empty Legend title
--line_type solid Survival line type: solid, dashed, dotted, dotdash, longdash, twodash
--line_size 1 Survival line width
--line_colors #4DBBD5,#E64B35,#00A087,#3C5488,#F39B7F,#8491B4,#91D1C2,#DC0000 Comma-separated group colors
--censor_show true Whether to show censor markers
--censor_size 7 Censor marker size
--confidence_show true Whether to show confidence interval
--confidence_alpha 0.2 Confidence band transparency
--risk_table_show true Whether to show the risk table
--risk_table_border true Whether to show the risk table border
--risk_table_panel false Whether to show the risk table panel background
--risk_table_size 6 Risk table font size
--axis_title_size 12 Axis title font size
--axis_text_size 10 Axis tick-label font size
--legend_text_size 11 Legend text font size

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 228 lines · 57 tokens per session scan A e22a2a5b4b41

Subscribe to this mod's changes

km-survival-curve is a skill published in the GitHub repository aipoch/medical-research-skills (1,860 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 2,462 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories