Guide · Agent skill
How to use the scikit-survival Analysis agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The scikit-survival skill is a set of instructions, reference notes and small local Python scripts that tells an AI agent how to build and check survival analysis workflows. Survival analysis models the time until an event happens, such as a failure or a relapse, when some subjects are only partly observed (censored). After reading this guide you will know what the skill changes, how to install it, how to ask for work that triggers it, and what to check before trusting the results.
Quick start
- 1Download the ZIP. Download the skill ZIP from this page.
- 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ in a project. Alternatively, upload the ZIP under Settings, Capabilities, Skills in the Claude apps.
- 3Create the Python environment. Install uv, then run the uv venv and uv pip install commands from this guide to create an isolated environment with the pinned packages.
- 4Describe your survival problem. State your data, the event, whether subjects are censored, and whether there is a competing cause.
- 5Let the agent set up the outcome. The agent builds the event and time structured array and validates it before modelling.
- 6Review the split and metrics. Check that preprocessing was fit on training data only and that metrics use the correct prediction types.
What the scikit-survival skill makes the agent do
Once the skill is loaded, the agent follows a fixed workflow for survival analysis. It defines the outcome correctly, validates it, splits the data before any learned preprocessing, fits models with scikit-survival, and reports metrics that account for censoring.
The skill covers right-censored outcomes, Cox proportional hazards models, Coxnet, IPC ridge, survival trees and forests, gradient boosting, and survival SVMs. It also covers nonparametric cumulative incidence for competing risks. It does not provide Fine-Gray regression, so the agent cannot deliver that method from this skill.
- Sets up the outcome as a structured array of event status and time
- Keeps imputers, encoders, scalers and alpha choices inside training-only pipelines
- Uses censoring-aware metrics such as IPCW concordance, dynamic AUC and Brier scores
- Includes local command-line tools for validating CSV files, estimating competing-risk cumulative incidence, evaluating metrics and writing Markdown model cards
Install the skill from the ZIP download
Download the ZIP for the skill from this page. Then choose one of two routes. For a single user on your own machine, unzip it into your personal skills folder, ~/.claude/skills/. For a single project, unzip it into the .claude/skills/ folder inside the project so that it applies only there.
If you use the Claude apps instead of a local setup, you can upload the ZIP under Settings, then Capabilities, then Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into .claude/skills/ inside your project folder
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Set up the Python environment the examples need
The skill's executable examples expect Python and the uv package manager, along with a pinned scikit-survival stack. The commands below create an isolated environment and install those pinned packages. Binary wheels are preferred. A source build needs a C/C++ compiler, and OSQP may also need CMake.
The skill's notes say the upstream scikit-survival package is GPL-3.0-or-later, while the skill itself is MIT-licensed. Review upstream licensing before you redistribute anything.
- Python 3.11 or later is required; check the skill's compatibility notes for the minimum
- Install uv, the Python package manager, before running the commands
- A C/C++ compiler is needed only when no binary wheel is available
uv venv .venv-survival --python 3.13
source .venv-survival/bin/activate
uv pip install "scikit-survival==0.28.0" "scikit-learn==1.9.1" "numpy==2.5.1" "pandas==3.0.6" "scipy==1.18.1" "ecos==2.0.14" "osqp==1.1.3" "joblib==1.6.0" "numexpr==2.14.2" "narwhals==2.26.0"Ask for survival work in plain language
You do not need special syntax. Describe the data, the question and the event you care about. The agent should load the skill when your request matches its scope: survival or time-to-event modelling, censored data, competing risks, or auditing an existing survival pipeline.
Say whether your data has censored subjects and what the event is. If you have a competing cause, say so, because the skill treats competing risks differently from ordinary survival probabilities.
- "Fit a Cox model on this CSV of patient follow-up times and events, with a leakage-safe pipeline."
- "Check whether my survival pipeline fits imputers before splitting the data."
- "Estimate cumulative incidence of relapse, treating death without relapse as a competing event."
- "Compare a random survival forest and a gradient boosting model using censoring-aware metrics."
Follow the built-in workflow and guardrails
The skill's workflow is ordered on purpose. The most important rules are: split before learned preprocessing, fit censoring distributions on training data only, restrict evaluation times to the test follow-up, and match predictions to metrics. Concordance and dynamic AUC need higher-is-riskier scores, while Brier metrics need survival probabilities.
Competing risks need care. Cumulative incidence is not one minus Kaplan-Meier when other causes are censored. Treat the outputs as analysis results to review, not as clinical advice.
- Concordance and dynamic AUC use risk scores where higher means more risk
- Brier metrics use survival probability arrays of shape (n_test, n_times)
- Survival SVMs do not produce survival probabilities for Brier metrics
- Report discrimination, calibration, prediction error and cumulative incidence separately
Safety, data and network notes
The bundled scripts run locally and are network-free by default. They read local files you point them at, so the scripts can process sensitive data. The skill does not make that data safe to share. You are responsible for data governance, consent and review before analysing patient data.
The skill states that its outputs are not clinical advice, causal evidence or proof of clinical utility. Use it to build and audit models, and have a qualified person review any conclusion that affects people.
- Scripts: yes, the skill runs local Python scripts
- Network use: none by default
- Data: you are responsible for governance of any sensitive files you load
What people use it for
- Building a Cox proportional hazards model with a leakage-safe preprocessing pipeline for follow-up data
- Estimating cumulative incidence for one cause when another cause competes with it, using the nonparametric method
- Auditing an existing survival pipeline for leakage, wrong metric inputs or misuse of Kaplan-Meier with competing events
- Teaching right-censored methods with the synthetic examples and small local scripts
Frequently asked questions
Is the scikit-survival skill free to use?
The skill is MIT-licensed, as stated on this page. The upstream scikit-survival package is GPL-3.0-or-later, so review that licence before you redistribute code or outputs.
What do I need to run the scikit-survival skill?
You need Python 3.11 or later, the uv package manager, and the pinned scikit-survival stack listed in the install commands. A C/C++ compiler is needed only if no binary wheel is available, and CMake may be needed for OSQP.
Where do I put the skill files?
Unzip the downloaded ZIP into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project. In the Claude apps, upload the ZIP under Settings, then Capabilities, then Skills.
Does the skill support Fine-Gray or other competing-risk regression?
No. The skill provides only nonparametric cumulative incidence for competing risks. It does not provide Fine-Gray regression, so the agent cannot deliver that from this skill.
Does the skill send my data over the network?
The bundled scripts are local and network-free by default, and they read the files you give them. You remain responsible for governance of any sensitive or patient data you analyse.
Why does my survival pipeline give misleading metrics?
Common causes are fitting preprocessing before the split, using pooled train and test outcomes for censoring weights, using risk scores where survival probabilities are needed, or using an evaluation time grid outside the test follow-up. Ask the agent to audit the pipeline against the skill's workflow.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you build or audit survival models in Python and want guardrails against leakage, wrong metric inputs and competing-risk mistakes. Pick something else if you need Fine-Gray regression, clinical decision support, or a tool that handles sensitive patient data without your own governance review.
Download the skill