Pyhealth
BioTender-max/awesome-bio-agent-skills
Build clinical/healthcare deep-learning pipelines with PyHealth — loading EHR/signal/imaging datasets (MIMIC-III/IV, eICU, OMOP, SleepEDF, ChestXray14, EHRShot), defining tasks (mortality…
Builds machine learning pipelines on clinical data with PyHealth: EHR datasets, prediction tasks, medical code mapping, healthcare models and evaluation.
$ npx skills add davila7/claude-code-templates --skill pyhealth -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install davila7/claude-code-templates pyhealth --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/scientific/pyhealth .claude/skills/pyhealth && rm -rf skills-srcUse ~/.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/
Install the "pyhealth" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth into .claude/skills/pyhealth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pyhealth", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealthType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add davila7/claude-code-templates --skill pyhealth -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install davila7/claude-code-templates pyhealth --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .agents/skills && cp -r skills-src/cli-tool/components/skills/scientific/pyhealth .agents/skills/pyhealth && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pyhealth" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth into .agents/skills/pyhealth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pyhealth", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add davila7/claude-code-templates --skill pyhealth -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install davila7/claude-code-templates pyhealth --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/cli-tool/components/skills/scientific/pyhealth .cursor/skills/pyhealth && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pyhealth" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth into .cursor/skills/pyhealth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pyhealth", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/davila7/claude-code-templates.git --path cli-tool/components/skills/scientific/pyhealth--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add davila7/claude-code-templates --skill pyhealth -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install davila7/claude-code-templates pyhealth --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/cli-tool/components/skills/scientific/pyhealth .gemini/skills/pyhealth && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pyhealth" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth into .gemini/skills/pyhealth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pyhealth", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install davila7/claude-code-templates pyhealthInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add davila7/claude-code-templates --skill pyhealth -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .github/skills && cp -r skills-src/cli-tool/components/skills/scientific/pyhealth .github/skills/pyhealth && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pyhealth" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth into .github/skills/pyhealth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pyhealth", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add davila7/claude-code-templates --skill pyhealth -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install davila7/claude-code-templates pyhealth --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/cli-tool/components/skills/scientific/pyhealth .opencode/skills/pyhealth && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pyhealth" agent skill from https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/scientific/pyhealth into .opencode/skills/pyhealth/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pyhealth", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pyhealthBuilds machine learning pipelines on clinical data with PyHealth: EHR datasets, prediction tasks, medical code mapping, healthcare models and evaluation.
PyHealth is a Python library for healthcare AI. The skill organizes work as a five-stage pipeline: load a healthcare dataset such as MIMIC-III, MIMIC-IV, eICU, OMOP or sleep EEG data, define a prediction task, pick a model, train it, then calibrate and validate for clinical use. Its quick start loads MIMIC-IV, applies a mortality prediction task, splits the data by patient and builds data loaders.
Task examples include mortality prediction, hospital readmission, length of stay and drug recommendation. The skill also covers translating between medical coding systems (ICD-9 and ICD-10, NDC, RxNorm, ATC), models such as RETAIN, SafeDrug, GAMENet, StageNet and a Transformer for EHR, and evaluation with fairness metrics, calibration, interpretability and uncertainty quantification. Reference files cover datasets, medical coding, models, preprocessing, tasks, and training and evaluation.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 79182c5. It shows what the files ask for, not the result of running them.
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.
Shell commands in SKILL.md call:
uvFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
pyhealth.readthedocs.iogithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
PyHealth Clinical ML Toolkit loads about 4.4k tokens when it runs, and up to ~22k if it reads all its reference files. Until then it costs about 126 tokens; SKILL.md has 1,424 words of instructions outside code blocks.
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.
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.
The full file from davila7/claude-code-templates at commit 79182c5, republished under its MIT licence (© davila7). 1,424 words, ~4,382 tokens.
.claude/skills/pyhealth/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.PyHealth is a comprehensive Python library for healthcare AI that provides specialized tools, models, and datasets for clinical machine learning. Use this skill when developing healthcare prediction models, processing clinical data, working with medical coding systems, or deploying AI solutions in healthcare settings.
Invoke this skill when:
PyHealth operates through a modular 5-stage pipeline optimized for healthcare AI:
Performance: 3x faster than pandas for healthcare data processing
from pyhealth.datasets import MIMIC4Dataset
from pyhealth.tasks import mortality_prediction_mimic4_fn
from pyhealth.datasets import split_by_patient, get_dataloader
from pyhealth.models import Transformer
from pyhealth.trainer import Trainer
# 1. Load dataset and set task
dataset = MIMIC4Dataset(root="/path/to/data")
sample_dataset = dataset.set_task(mortality_prediction_mimic4_fn)
# 2. Split data
train, val, test = split_by_patient(sample_dataset, [0.7, 0.1, 0.2])
# 3. Create data loaders
train_loader = get_dataloader(train, batch_size=64, shuffle=True)
val_loader = get_dataloader(val, batch_size=64, shuffle=False)
test_loader = get_dataloader(test, batch_size=64, shuffle=False)
# 4. Initialize and train model
model = Transformer(
dataset=sample_dataset,
feature_keys=["diagnoses", "medications"],
mode="binary",
embedding_dim=128
)
trainer = Trainer(model=model, device="cuda")
trainer.train(
train_dataloader=train_loader,
val_dataloader=val_loader,
epochs=50,
monitor="pr_auc_score"
)
# 5. Evaluate
results = trainer.evaluate(test_loader)This skill includes comprehensive reference documentation organized by functionality. Read specific reference files as needed:
File: references/datasets.md
Read when:
Key Topics:
File: references/medical_coding.md
Read when:
Key Topics:
File: references/tasks.md
Read when:
Key Topics:
File: references/models.md
Read when:
Key Topics:
File: references/preprocessing.md
Read when:
Key Topics:
File: references/training_evaluation.md
Read when:
Key Topics:
uv pip install pyhealthRequirements:
Objective: Predict patient mortality in intensive care unit
Approach:
references/datasets.mdreferences/tasks.mdreferences/models.mdreferences/training_evaluation.mdreferences/training_evaluation.mdObjective: Recommend medications while avoiding drug-drug interactions
Approach:
references/datasets.mdreferences/tasks.mdreferences/models.mdreferences/medical_coding.mdreferences/training_evaluation.mdObjective: Identify patients at risk of 30-day readmission
Approach:
references/datasets.mdreferences/tasks.mdreferences/preprocessing.mdreferences/models.mdreferences/training_evaluation.mdObjective: Classify sleep stages from EEG signals
Approach:
references/datasets.mdreferences/tasks.mdreferences/preprocessing.mdreferences/models.mdreferences/training_evaluation.mdObjective: Standardize diagnoses across different coding systems
Approach:
references/medical_coding.md for comprehensive guidanceObjective: Automatically assign ICD codes from clinical notes
Approach:
references/datasets.mdreferences/tasks.mdreferences/preprocessing.mdreferences/models.mdreferences/training_evaluation.mdAlways split by patient: Prevent data leakage by ensuring no patient appears in multiple splits
from pyhealth.datasets import split_by_patient
train, val, test = split_by_patient(dataset, [0.7, 0.1, 0.2])Check dataset statistics: Understand your data before modeling
print(dataset.stats()) # Patients, visits, events, code distributionsUse appropriate preprocessing: Match processors to data types (see references/preprocessing.md)
Start with baselines: Establish baseline performance with simple models
Choose task-appropriate models:
Monitor validation metrics: Use appropriate metrics for task and handle class imbalance
Calibrate predictions: Ensure probabilities are reliable (see references/training_evaluation.md)
Assess fairness: Evaluate across demographic groups to detect bias
Quantify uncertainty: Provide confidence estimates for predictions
Interpret predictions: Use attention weights, SHAP, or ChEFER for clinical trust
Validate thoroughly: Use held-out test sets from different time periods or sites
ImportError for dataset:
Out of memory:
max_seq_length)Poor performance:
Slow training:
device="cuda")# Complete mortality prediction pipeline
from pyhealth.datasets import MIMIC4Dataset
from pyhealth.tasks import mortality_prediction_mimic4_fn
from pyhealth.datasets import split_by_patient, get_dataloader
from pyhealth.models import RETAIN
from pyhealth.trainer import Trainer
# 1. Load dataset
print("Loading MIMIC-IV dataset...")
dataset = MIMIC4Dataset(root="/data/mimic4")
print(dataset.stats())
# 2. Define task
print("Setting mortality prediction task...")
sample_dataset = dataset.set_task(mortality_prediction_mimic4_fn)
print(f"Generated {len(sample_dataset)} samples")
# 3. Split data (by patient to prevent leakage)
print("Splitting data...")
train_ds, val_ds, test_ds = split_by_patient(
sample_dataset, ratios=[0.7, 0.1, 0.2], seed=42
)
# 4. Create data loaders
train_loader = get_dataloader(train_ds, batch_size=64, shuffle=True)
val_loader = get_dataloader(val_ds, batch_size=64)
test_loader = get_dataloader(test_ds, batch_size=64)
# 5. Initialize interpretable model
print("Initializing RETAIN model...")
model = RETAIN(
dataset=sample_dataset,
feature_keys=["diagnoses", "procedures", "medications"],
mode="binary",
embedding_dim=128,
hidden_dim=128
)
# 6. Train model
print("Training model...")
trainer = Trainer(model=model, device="cuda")
trainer.train(
train_dataloader=train_loader,
val_dataloader=val_loader,
epochs=50,
optimizer="Adam",
learning_rate=1e-3,
weight_decay=1e-5,
monitor="pr_auc_score", # Use AUPRC for imbalanced data
monitor_criterion="max",
save_path="./checkpoints/mortality_retain"
)
# 7. Evaluate on test set
print("Evaluating on test set...")
test_results = trainer.evaluate(
test_loader,
metrics=["accuracy", "precision", "recall", "f1_score",
"roc_auc_score", "pr_auc_score"]
)
print("\nTest Results:")
for metric, value in test_results.items():
print(f" {metric}: {value:.4f}")
# 8. Get predictions with attention for interpretation
predictions = trainer.inference(
test_loader,
additional_outputs=["visit_attention", "feature_attention"],
return_patient_ids=True
)
# 9. Analyze a high-risk patient
high_risk_idx = predictions["y_pred"].argmax()
patient_id = predictions["patient_ids"][high_risk_idx]
visit_attn = predictions["visit_attention"][high_risk_idx]
feature_attn = predictions["feature_attention"][high_risk_idx]
print(f"\nHigh-risk patient: {patient_id}")
print(f"Risk score: {predictions['y_pred'][high_risk_idx]:.3f}")
print(f"Most influential visit: {visit_attn.argmax()}")
print(f"Most important features: {feature_attn[visit_attn.argmax()].argsort()[-5:]}")
# 10. Save model for deployment
trainer.save("./models/mortality_retain_final.pt")
print("\nModel saved successfully!")For detailed information on each component, refer to the comprehensive reference files in the references/ directory:
Total comprehensive documentation: ~28,000 words across modular reference files.
© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files (references) in cli-tool/components/skills/scientific/pyhealth of davila7/claude-code-templates.
Open the folder on GitHubat commit 79182c5
We found 15 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 11 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.
PyHealth Clinical ML Toolkit 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| PyHealth Clinical ML Toolkit this skilldavila7/claude-code-templates | 33k | 11 repos | ~4.4k | Automated safety check: Pass | MIT | |
| PyhealthBioTender-max/awesome-bio-agent-skills | 200 | — | ~1.8k | Automated safety check: Pass | Custom licence | |
| Scaffold Examplecomet-ml/comet-examples | 174 | — | ~1k | Automated safety check: Pass | None | |
| Scikit Learn Machine Learningjaechang-hits/SciAgent-Skills | 374 | 1 repos | ~4k | Automated safety check: Pass | BSD-3-Clause | |
| Qiskit 2.x Quantum ML Referenceaiming-lab/AutoResearchClaw | 15k | — | ~4.7k | Automated safety check: Pass | MIT | |
| tangermeme Genomic Model Analysisjmschrei/tangermeme | 318 | — | ~1.6k | Automated safety check: Pass | MIT |
BioTender-max/awesome-bio-agent-skills
Build clinical/healthcare deep-learning pipelines with PyHealth — loading EHR/signal/imaging datasets (MIMIC-III/IV, eICU, OMOP, SleepEDF, ChestXray14, EHRShot), defining tasks (mortality…
comet-ml/comet-examples
Scaffold a brand-new Comet example in this repo from the canonical template under templates/integration-example/.
jaechang-hits/SciAgent-Skills
Classical ML in Python: classification, regression, clustering, dim reduction, evaluation, tuning, preprocessing pipelines.
aiming-lab/AutoResearchClaw
Reference patterns for writing qiskit 2.x code for variational quantum machine learning: feature maps, VQC training, VQE for chemistry, MPS circuits and noise models.
jmschrei/tangermeme
Routes agents to the right tangermeme reference for analyzing trained genomic deep learning models, from attributions and motif experiments to variant effects and design.
Orchestra-Research/AI-Research-SKILLs
Shows how to organize PyTorch training with Lightning's LightningModule and Trainer, covering validation, DDP, callbacks and learning-rate scheduling.
davila7/claude-code-templates
Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.
davila7/claude-code-templates
Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.
davila7/claude-code-templates
Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.
davila7/claude-code-templates
Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.
davila7/claude-code-templates
Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.
davila7/claude-code-templates
Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.
Works with
Categories
Builds machine learning pipelines on clinical data with PyHealth: EHR datasets, prediction tasks, medical code mapping, healthcare models and evaluation. PyHealth is a Python library for healthcare AI. The skill organizes work as a five-stage pipeline: load a healthcare dataset such as MIMIC-III, MIMIC-IV, eICU, OMOP or sleep EEG data, define a prediction task, pick a model, train it, then calibrate and validate for clinical use.
PyHealth Clinical ML Toolkit fits situations like: training a mortality or readmission model on MIMIC-IV records; translating diagnosis or drug codes between ICD, NDC, RxNorm and ATC; building a drug recommendation model with SafeDrug or GAMENet; checking a clinical model for calibration and fairness before deployment.
Run `npx skills add davila7/claude-code-templates --skill pyhealth -a claude-code`. Or copy the skill folder (cli-tool/components/skills/scientific/pyhealth in davila7/claude-code-templates) into .claude/skills/pyhealth in your project. Claude Code loads it when a task matches its description.
Run `npx skills add davila7/claude-code-templates --skill pyhealth -a codex`. Or copy the skill folder (cli-tool/components/skills/scientific/pyhealth in davila7/claude-code-templates) into .agents/skills/pyhealth in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill pyhealth -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pyhealth, .gemini/skills/pyhealth, .github/skills/pyhealth and .opencode/skills/pyhealth in your project.
Going by SKILL.md and its folder, PyHealth Clinical ML Toolkit needs the command-line tools its instructions call (uv). Our summary lists: Python with `pyhealth` installed; Access to a healthcare dataset such as MIMIC-IV, eICU or OMOP.
SKILL.md names 2 domains. As links in the text: pyhealth.readthedocs.io and github.com. This is read from the text; nothing was executed.
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.
PyHealth Clinical ML Toolkit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.4k tokens (SKILL.md is roughly 18k 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 18k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with PyHealth Clinical ML Toolkit: Pyhealth (BioTender-max/awesome-bio-agent-skills, 200 stars), Scaffold Example (comet-ml/comet-examples, 174 stars), Scikit Learn Machine Learning (jaechang-hits/SciAgent-Skills, 374 stars) and Qiskit 2.x Quantum ML Reference (aiming-lab/AutoResearchClaw, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,552 GitHub stars. The repository holds 479 skills in this directory. The repository was last updated on October 11, 2026.
Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.