Complete survival analysis library in Python. An agent skill from brycewang-stanford/Auto-Empirical-Research-Skills.

MITAuto-check passedResearch & Science

Install Lifelines

skills CLI
$ npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill lifelines -a claude-code

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

GitHub CLI
$ gh skill install brycewang-stanford/Auto-Empirical-Research-Skills lifelines --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/brycewang-stanford/Auto-Empirical-Research-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/63-tondevrel-scientific-agent-skills/lifelines .claude/skills/lifelines && 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
lifelines
GitHub stars
4.5k
Token cost
~771 tokens
SKILL.md length
220 words
Files
1
Skills in repo
383
Repo updated
First seen
Licence
MIT

At a glance

Complete survival analysis library in Python. An agent skill from brycewang-stanford/Auto-Empirical-Research-Skills.

  • Tasks that involve Clinical and healthcare research
  • SKILL.md covers When to Use, Core Principles, Quick Reference and Critical Rules, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Lifelines is an agent skill from brycewang-stanford/Auto-Empirical-Research-Skills. Complete survival analysis library in Python. Handles right-censored data, Kaplan-Meier curves, and Cox regression. Standard for clinical trial analysis and epidemiology.

Its SKILL.md is about 770 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Clinical and healthcare research. It works with Python. The repository describes itself as: 🔬 A curated collection of 23,000+ agent skills for empirical research across 8 social science disciplines. | 精选 23,000+ AI Agent 技能库,覆盖8大社会科学学科的实证研究。CoPaper.AI… The licence is MIT.

When your agent uses it

  • Tasks that involve Clinical and healthcare research

Example prompts

  • “/lifelines”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9fa87d8. 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 python).

    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

Lifelines loads about 771 tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 220 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~771

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 brycewang-stanford/Auto-Empirical-Research-Skills at commit 9fa87d8, republished under its MIT licence (© brycewang-stanford). 220 words, ~771 tokens.

Download SKILL.mdSave it as .claude/skills/lifelines/SKILL.md (or your agent's skills folder).
name
lifelines
description
Complete survival analysis library in Python. Handles right-censored data, Kaplan-Meier curves, and Cox regression. Standard for clinical trial analysis and epidemiology.
version
0.28
license
MIT

Lifelines - Survival Analysis

In medicine, we often care about "Time to Event" (death, recovery, relapse). Lifelines handles the complexity of "censored" data (patients who left the study).

When to Use

  • Analyzing clinical trial data (time to death, disease progression).
  • Comparing survival between treatment groups.
  • Identifying risk factors using Cox Proportional Hazards regression.
  • Building survival models for prognosis.
  • Epidemiology studies (time to infection, recovery).

Core Principles

Censoring

Patients who haven't experienced the event by the end of the study are "censored". Lifelines properly accounts for this.

Hazard Ratios

In Cox regression, a hazard ratio > 1 means increased risk; < 1 means decreased risk.

Survival Curves

Kaplan-Meier estimates the probability of survival over time without assuming a distribution.

Quick Reference

Standard Imports
python
from lifelines import KaplanMeierFitter, CoxPHFitter
from lifelines.statistics import logrank_test
import pandas as pd
Basic Patterns
python
# 1. Kaplan-Meier (Visualizing survival)
kmf = KaplanMeierFitter()
kmf.fit(durations=df['days'], event_observed=df['died'])
kmf.plot_survival_function()
kmf.median_survival_time_  # Time when 50% have died

# 2. Cox Proportional Hazards (Risk factors)
cph = CoxPHFitter()
cph.fit(df, duration_col='days', event_col='died')
cph.print_summary() # See hazard ratios for age, drug type, etc.
cph.plot_partial_effects_on_outcome(covariates=['age'], values=[30, 50, 70])

Critical Rules

✅ DO
  • Use event_observed correctly - 1 = event occurred, 0 = censored.
  • Check proportional hazards assumption - Use cph.check_assumptions() to validate Cox model.
  • Compare groups with logrank test - Statistical test for survival curve differences.
  • Plot confidence intervals - Survival estimates have uncertainty, especially with small samples.
❌ DON'T
  • Don't ignore censoring - Treating censored patients as "survived" biases results.
  • Don't use regular regression - Time-to-event data requires specialized methods.
  • Don't assume proportional hazards - If violated, use stratified Cox or parametric models.

Advanced Patterns

Comparing Multiple Groups
python
from lifelines.statistics import multivariate_logrank_test

# Compare survival across treatment groups
results = multivariate_logrank_test(df['days'], df['group'], df['died'])
print(results.p_value)
Parametric Models
python
from lifelines import WeibullFitter, ExponentialFitter

# When you need to extrapolate beyond observed data
wf = WeibullFitter()
wf.fit(df['days'], df['died'])
wf.plot()

Lifelines transforms complex survival data into actionable medical insights, enabling evidence-based decisions in clinical research and practice.

© brycewang-stanford, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/63-tondevrel-scientific-agent-skills/lifelines of brycewang-stanford/Auto-Empirical-Research-Skills.

Open the folder on GitHubat commit 9fa87d8

Compare with similar skills

Lifelines 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.

Lifelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lifelines this skillbrycewang-stanford/Auto-Empirical-Research-Skills4.5k—~771Automated safety check: PassMIT
Histolab Whole Slide Image Tilingdavila7/claude-code-templates32k11 repos~5.1kAutomated safety check: PassMIT
NeuroKit2 Biosignal Processingdavila7/claude-code-templates32k11 repos~3kAutomated safety check: PassMIT
PyHealth Clinical ML Toolkitdavila7/claude-code-templates32k11 repos~4.4kAutomated safety check: PassMIT
pydicom DICOM Toolkitdavila7/claude-code-templates32k11 repos~3.3kAutomated safety check: PassMIT
openFDA Regulatory Data Queriesdavila7/claude-code-templates32k11 repos~3.6kAutomated safety check: PassMIT

Similar skills

  • Histolab Whole Slide Image Tiling

    davila7/claude-code-templates

    Processes digital pathology whole slide images with histolab: tissue detection, mask creation, tile extraction and dataset preparation for deep learning.

    32k GitHub starsUsed in 11 repos~5.1k 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 11 repos~3k tokens
    Research & ScienceAuto-check passed
  • PyHealth Clinical ML Toolkit

    davila7/claude-code-templates

    Builds machine learning pipelines on clinical data with PyHealth: EHR datasets, prediction tasks, medical code mapping, healthcare models and evaluation.

    32k GitHub starsUsed in 11 repos~4.4k tokens
    Research & ScienceAuto-check passed
  • pydicom DICOM Toolkit

    davila7/claude-code-templates

    Reads, edits, anonymizes and converts DICOM medical imaging files with pydicom, including pixel data extraction and compressed transfer syntaxes.

    32k GitHub starsUsed in 11 repos~3.3k tokens
    Research & ScienceAuto-check passed
  • openFDA Regulatory Data Queries

    davila7/claude-code-templates

    Queries the openFDA API from Python for drug, device, food and veterinary data: adverse events, recalls, labels, approvals, NDC and UNII lookups.

    32k GitHub starsUsed in 11 repos~3.6k tokens
    Data & AnalyticsAuto-check passed
  • Paperclip

    K-Dense-AI/scientific-agent-skills

    Searches and reads biomedical papers, FDA/PMDA/EMA documents, clinical trials, and protein records with the GXL Paperclip CLI and Python SDK.

    48k GitHub starsUsed in 1 repo~3.2k tokens
    Research & ScienceAuto-check: notes

More from brycewang-stanford/Auto-Empirical-Research-Skills

All 383 skills in this repo
  • Aer Consistency

    brycewang-stanford/Auto-Empirical-Research-Skills

    A skill your agent uses when auditing a finished or near-finished AER, AER:Insights, or AEJ manuscript for internal consistency: headline numbers across abstract, introduction, results, and tables…

    4.5k GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed
  • Latex Paper En

    brycewang-stanford/Auto-Empirical-Research-Skills

    English LaTeX academic paper assistant for existing .tex projects.

    4.5k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Bayesian Workflow

    brycewang-stanford/Auto-Empirical-Research-Skills

    Opinionated Bayesian modeling workflow with PyMC and ArviZ. An agent skill from brycewang-stanford/Auto-Empirical-Research-Skills.

    4.5k GitHub stars~3.5k tokensUpdated 4 days ago
    Auto-check passed
  • Daily Paper Generator

    brycewang-stanford/Auto-Empirical-Research-Skills

    A skill your agent uses when the user asks to "generate daily paper", "search arXiv for EEG papers", "find EEG decoding papers", "review brain-computer interface papers", or wants to create paper…

    4.5k GitHub stars~2.2k tokensUpdated 4 days ago
    Auto-check passed
  • Five Questions

    brycewang-stanford/Auto-Empirical-Research-Skills

    Deeply analyze any empirical economics PDF using the five-question framework (五问框架): research question, identification strategy, core estimand, robustness logic, and scholarly contribution.

    4.5k GitHub stars~1.7k tokensUpdated 4 days ago
    Auto-check: notes
  • Kaggle Research

    brycewang-stanford/Auto-Empirical-Research-Skills

    A skill your agent uses when a research task needs reproducible Kaggle discovery, metadata inspection, bounded public-data downloads, competition or kernel discovery, model discovery, or an…

    4.5k GitHub stars~868 tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Lifelines

What does Lifelines do?

Complete survival analysis library in Python. An agent skill from brycewang-stanford/Auto-Empirical-Research-Skills. Lifelines is an agent skill from brycewang-stanford/Auto-Empirical-Research-Skills. Complete survival analysis library in Python.

When should I use Lifelines?

Lifelines fits situations like: tasks that involve Clinical and healthcare research.

How do I install Lifelines in Claude Code?

Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill lifelines -a claude-code`. Or copy the skill folder (skills/63-tondevrel-scientific-agent-skills/lifelines in brycewang-stanford/Auto-Empirical-Research-Skills) into .claude/skills/lifelines in your project. Claude Code loads it when a task matches its description.

How do I install Lifelines in Codex?

Run `npx skills add brycewang-stanford/Auto-Empirical-Research-Skills --skill lifelines -a codex`. Or copy the skill folder (skills/63-tondevrel-scientific-agent-skills/lifelines in brycewang-stanford/Auto-Empirical-Research-Skills) into .agents/skills/lifelines in your project. Codex loads it when a task matches its description.

Can I use Lifelines 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 brycewang-stanford/Auto-Empirical-Research-Skills --skill lifelines -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lifelines, .gemini/skills/lifelines, .github/skills/lifelines and .opencode/skills/lifelines in your project.

What does Lifelines need to run?

SKILL.md names no scripts, command-line tools or credentials: Lifelines is instructions for the agent only. Our summary lists: Python 3.

Does Lifelines 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 Lifelines 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 Lifelines use?

Lifelines 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 Lifelines use?

About 771 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Lifelines?

Skills that share tags, products or a category with Lifelines: Histolab Whole Slide Image Tiling (davila7/claude-code-templates, 32k stars), NeuroKit2 Biosignal Processing (davila7/claude-code-templates, 32k stars), PyHealth Clinical ML Toolkit (davila7/claude-code-templates, 32k stars) and pydicom DICOM Toolkit (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lifelines?

brycewang-stanford (a GitHub user) maintains it in brycewang-stanford/Auto-Empirical-Research-Skills, which has 4,542 GitHub stars. The repository holds 383 skills in this directory. The repository was last updated on October 5, 2026.

Source: brycewang-stanford/Auto-Empirical-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.