PK/PD Modelling & Simulation
A full pharmacokinetic/pharmacodynamic toolkit — NCA, compartmental fitting, popPK QC, bioequivalence, DDI and Bayesian TDM — that flags the errors most analyses hide.
What it does
Turns Claude Code into a pharmacometrics assistant backed by nine Python scripts, each answering one question:
nca.py— non-compartmental exposure metrics (AUC, Cmax, lambda_z, t½, CL/F) with explicit AUC method, BLQ rule and lambda_z window; raises findings for >20% extrapolation or a terminal phase that was never reachedfit_compartmental.py— 1/2/3-compartment comparison with AIC, BIC and F-test, log-scale estimation, RSE and parameter-correlation checks, plus a runs test that separates structural misspecification from a wrong error modelcheck_popk_dataset.py— catches the silent NONMEM dataset defects (BLQtext read as zero, blank covariates becoming 0 kg, ADDL without II, duplicate timestamps)simulate_regimen.py— steady-state and population simulation with target-attainment fractionsexposure_response.py— Emax/sigmoid ER plus ICH E14-style C-QTc using the 90% CI upper boundbioequivalence.py— ABE vs EMA ABEL vs FDA RSABE, with sample size and exact powerallometry_and_fih.py— allometric scaling with Anderson-Holford maturation, MRSD and MABELddi_static.py— ICH M12 basic and mechanistic static models with cut-offstdm_bayes.py— MAP Bayesian individual parameter estimation from measured levels
Every script supports --format table|tsv|json, sends data to stdout and findings to stderr, and exits 0/1/2 so it can gate a pipeline. Fourteen reference documents cover NCA conventions, popPK, PBPK, special populations, regulatory guidance and the software ecosystem.
Who it's for
- Pharmacokineticists and pharmacometricians in pharma or CROs
- Anyone preparing datasets and model assumptions before NONMEM, Monolix or nlmixr2
- Regulatory scientists who need the right bioequivalence criterion applied to the right design
- Graduate students who want the reasoning, not just the numbers
Examples
- NCA reporting — run
python3 nca.py -i profile.csv --dose 100 --route extravascular --partial-auc 0-24; the finding that 25% of AUCinf is extrapolated justifies reporting AUC(0-tau) at steady state instead. - Model selection defence — AIC prefers a 3-compartment model, but Q3 has 98% RSE; use the BIC, F-test and RSE output to document why the 2-compartment model was retained.
- Regimen choice — simulate 500 mg q12h and show only 44% of the population attains a trough of 4 mg/L, then compare alternative regimens on attainment rather than the typical patient.
Scope note: the scripts compute and diagnose; they never conclude. Bioequivalence decisions, patient dosing and QT liability remain with qualified clinicians and regulators, and the bundled vancomycin model is explicitly illustrative.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/pkpd-modeling folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pkpd-modeling/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/sas && mkdir -p ~/.claude/skills && cp -r /tmp/sas/skills/pkpd-modeling ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal in your working directory.
- Clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills folder if needed:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/pkpd-modeling ~/.claude/skills/ - Check your Python:
python3 --version(3.11+ required), thenpip install numpy scipy. - Restart Claude Code and try a prompt such as "Run an NCA on this concentration-time file" or "Check this popPK dataset before I run NONMEM".
- To use the scripts directly:
cd ~/.claude/skills/pkpd-modeling/scriptsand runpython3 nca.py --help.