npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

medprotocol-core

v0.7.3

Published

Medical protocol workflows, calculation logic, and CLI for Claude Code

Readme

Medical Protocol

AI-agent-driven clinical tools — validated calculation logic, a terminal CLI, and workflows for Claude Code. Open source, privacy-first, 801 tests.

Quick Start

Install the Claude Code plugin

npx medical-protocol install

Then describe what you need: "I need a vital signs monitor with fluid balance tracking" — the agent handles the rest.

Symlink mode (for multi-project or dev setups)

npx medical-protocol install --link

This clones the repo to ~/.medical-protocol and creates symlinks instead of copying files. All linked projects update instantly when you git pull in the clone — no need to re-run install per project.

# Use an existing local clone
npx medical-protocol install --link --source ~/my-clone

# Check symlink health and repo status
npx medical-protocol check

# Pull latest changes
npx medical-protocol update

Run the CLI

npx medprotocol abg --ph 7.25 --pco2 30 --hco3 12
ABG Analysis
────────────
  Disorder        Metabolic Acidosis
  Compensation    Inadequate compensation
  Interpretation  Primary Metabolic Acidosis, with Inadequate compensation
                  by Respiratory Alkalosis.
  Expected range  24.0–28.0
npx medprotocol vitals --bp 145/95 --hr 88 --rr 18 --spo2 96 --temp 37.2
Vital Signs
───────────
  Blood Pressure    145/95 mmHg (High)
  Heart Rate        88 bpm (Normal)
  Respiratory Rate  18 breaths/min (Normal)
  Temperature       37.2°C (Normal)
  SpO2              96% — SpO2/FiO2: 457
npx medprotocol bmi --weight 70 --height-m 1.75 --metric
BMI Calculator
──────────────
  BMI       22.9
  Category  Normal
  Weight    70 kg
  Height    1.75m

9 commands: bmi, abg, vitals, pafi, dka, water-balance, cardiology, sepsis, ckd

Architecture

Three parts: this repo (workflows, plugin, lib/ logic, CLI), medprotocol-ui (separate repo — shadcn-style component delivery), and the doctor's project (Next.js app built by the agent). Pure calculation logic lives in lib/ — no framework deps, shared by CLI and UI. See CLAUDE.md for full directory structure.

Clinical Components

9 validated clinical modules:

| Module | What it calculates | |--------|-------------------| | Vital Signs | BP, HR, RR, SpO2, Temp — validated ranges, color-coded alerts, FHIR R4 output | | Acid-Base | Primary disorder, compensation, anion gap, delta ratio (Winter's, Henderson-Hasselbalch) | | BMI | WHO classification — underweight, normal, overweight, obese | | Water Balance | Insensible losses, endogenous water, net fluid balance | | PaFi (ARDS) | PaO2/FiO2 ratio with Berlin Definition severity classification | | DKA | Hourly glucose/ketone/HCO3 rates, resolution criteria, cerebral edema warnings | | Cardiology | ASCVD 10-year risk, HEART score, CHA₂DS₂-VASc | | Sepsis | qSOFA, full SOFA (6 organs), lactate clearance, hour-1 bundle compliance | | CKD | eGFR (CKD-EPI 2021), KDIGO staging, KFRE 2/5-year risk, progression tracking |

Tests

npm test                              # Run all 801 tests (23 files)
npx vitest run tests/acid-base/       # Run a single test directory
npx vitest run tests/bmi/bmi.test.ts  # Run a single test file
npm run test:watch                    # Watch mode

Covers: extreme values, negative inputs, triple acid-base disorders, zero divisors, mixed disorder detection, boundary conditions for every classification tier.

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for any new clinical logic in tests/
  4. Run npm test — all 801 tests must pass
  5. Submit a PR

New clinical modules need three things:

  1. Pure logic in lib/
  2. Workflow file in public/medical-protocol/providers/claude-code/workflows/
  3. Classification row in public/medical-protocol/context/classification.md

License

See LICENSE.