equiflow

equiflow is a skill for Claude Code, Codex from hannesill/m4. It costs 52 tokens per session (854 once invoked), scanned A, original, MIT.

A tool for drawing cohort-selection diagrams and checking whether patient groups are excluded unevenly. A cohort is the group of people included in a study; SMD is a statistic used to compare groups.

In plain words
What is it for?
Use it to document patient inclusion and exclusion, track variables such as age, race, insurance, and mortality, and measure selection bias in clinical machine-learning or research cohorts.
Why use it?
It helps reveal when the rules used to build a medical-research dataset leave out more people from certain demographic or socioeconomic groups.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to document patient inclusion and exclusion, track variables such as age, race, insurance, and mortality, and measure selection bias in clinical machine-learning or research cohorts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hannesill/m4/equiflow
View source ↗ hannesill/m4
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hannesill/m4 --skill equiflow
Clone the repo
git clone --depth 1 https://github.com/hannesill/m4

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for equiflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/hannesill/m4/equiflow/github.svg)](https://agentmods.dev/skills/hannesill/m4/equiflow)
Your own site
<a href="https://agentmods.dev/skills/hannesill/m4/equiflow"><img src="https://agentmods.dev/badge/skills/hannesill/m4/equiflow/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for equiflow

Your own site · 80×15
<a href="https://agentmods.dev/skills/hannesill/m4/equiflow"><img src="https://agentmods.dev/badge/skills/hannesill/m4/equiflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 854 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.00854
Opus 5.5 $0.00021 $0.00342
Sonnet 5.5 $0.00010 $0.00171
Haiku 4.5 $0.00005 $0.00085

Measured 2mo ago against content hash eba1eef8c6f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

equiflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/cohort_flow.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/m4/skills/clinical/equiflow/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

EquiFlow - Equity-Focused Cohort Flow Diagrams

Visualize and quantify selection bias in clinical ML/research cohorts. Based on Ellen et al. (2024) J Biomed Inform.

When to Use This Skill

  • Building patient cohorts from MIMIC-IV or eICU
  • Documenting inclusion/exclusion criteria with CONSORT-style diagrams
  • Detecting disproportionate exclusion of vulnerable groups
  • Quantifying selection bias via Standardized Mean Difference (SMD)

Default Equity Variables

When no variables are specified, CohortFlow automatically tracks:

Category Variables Column Aliases
Demographics gender gender, sex
race race, ethnicity
age anchor_age, age, admission_age
Socioeconomic insurance insurance, insurance_type, payer
language language, primary_language
marital_status marital_status, marital
Clinical los los, length_of_stay, icu_los
Outcome mortality hospital_expire_flag, mortality, death

SMD Interpretation

| |SMD| | Interpretation | Action | |-------|----------------|--------| | < 0.1 | Negligible | OK | | 0.1-0.2 | Small | Monitor | | > 0.2 | Meaningful | Investigate | | > 0.5 | Large | Serious concern |

See references/smd_interpretation.md for detailed guidance.

Critical Implementation Notes

  1. Auto-detection: CohortFlow scans DataFrame columns for known aliases. Override with use_defaults=False if you want full control.

  2. SMD > 0.2 is the default threshold for flagging potential bias. This follows established covariate balance literature.

  3. Missing data: Exclusion steps that remove patients with missing values can introduce systematic bias. Always check SMD after such steps.

Example Queries

Full workflow with MIMIC-IV

from cohort_flow import CohortFlow

# Step 1: Query MIMIC-IV
query = """
SELECT
    p.subject_id, p.gender, p.anchor_age,
    a.race, a.insurance, a.language, a.marital_status,
    a.hospital_expire_flag,
    i.los
FROM mimiciv_hosp.patients p
JOIN mimiciv_hosp.admissions a USING (subject_id)
JOIN mimiciv_icu.icustays i ON a.hadm_id = i.hadm_id
"""
df = execute_query(query)

# Step 2: Build cohort with equity tracking
cf = CohortFlow(df)  # Auto-detects equity variables

cf.exclude(df['anchor_age'] >= 18, "Age < 18", "Adults")
cf.exclude(df['los'] >= 24, "ICU < 24h", "ICU >= 24h")
cf.exclude(df['anchor_age'] <= 90, "Age > 90", "Age 18-90")

# Step 3: Check for bias
print(cf.check_bias())  # Flags variables with SMD > 0.2

# Step 4: Generate diagram
cf.plot("sepsis_cohort_flow")

Read the full file on GitHub · 105 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago Changed · +1 lines eba1eef8c6f4
  2. 3mo ago First seen · 104 lines · 52 tokens per session scan A e5200bd8c04d

Subscribe to this mod's changes

equiflow is a skill published in the GitHub repository hannesill/m4 (52 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 854 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

equiflow compared with skills from other repositories

equiflow next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
equiflowhannesill/m4Skill521mo agoMITA52Claude Code, Codex
arbor-agent-orchestratorRUC-NLPIR/ArborSkill1.2k27d agoApache-2.0A77Claude Code, Codex
tooluniverse-variant-analysismims-harvard/ToolUniverseSkill1.8kyesterdayApache-2.0A317Claude Code
tooluniverse-phylogeneticsmims-harvard/ToolUniverseSkill1.8kyesterdayApache-2.0A155Claude Code
tooluniverse-gene-enrichmentmims-harvard/ToolUniverseSkill1.8kyesterdayApache-2.0A102Claude Code
tooluniverse-systems-biologymims-harvard/ToolUniverseSkill1.8kyesterdayApache-2.0A72Claude Code
tooluniverse-cancer-variant-interpretationmims-harvard/ToolUniverseSkill1.8kyesterdayApache-2.0A93Claude Code