Best for
- You want per-subgroup recall and leakage for a de-id or NER model.
- You suspect (or must rule out) that one group is under-protected.
- You need disparity numbers for a clinical AI governance review.
maziyarpanahi/openmed/skills/auditing-subgroup-fairness/SKILL.md
Audit an OpenMed NER or de-identification model for performance disparities across demographic subgroups (sex, age band, race/ethnicity when available) using openmed.eval.fairness_report. Use when the user wants per-subgroup recall and leakage, wants to check whether de-identification under-protects a group, wants to surface a documentation gap where subgroup data is missing, or needs equalized-odds-style disparity numbers for a clinical model. Trigger on "fairness", "subgroup", "bias audit", "d
Decision brief
An aggregate pass can hide a group the model fails. For de-identification that failure has a name: under-protection — PHI that leaks more often for one demographic group than another. openmed.eval.fairnessreport slices leakage and recall by gold-span group so disparities surface…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/maziyarpanahi/openmed --skill "skills/auditing-subgroup-fairness"Inspect the Agent Skill "auditing-subgroup-fairness" from https://github.com/maziyarpanahi/openmed/blob/e412ae8f3b04ae79b13663d34a422efc22109a3a/skills/auditing-subgroup-fairness/SKILL.md at commit e412ae8f3b04ae79b13663d34a422efc22109a3a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
python from openmed.eval import fairnessreport
1. Tag the gold corpus by group. Add a synthetic group to each PHI span's metadata (sex, age band, race/ethnicity surrogate). Use synthetic surrogates, not real protected attributes (see building-gold-corpus). 2. Run fairnessreport on the model + suite. 3. Read leakage first, re…
You want per-subgroup recall and leakage for a de-id or NER model.
For each surrogate group fairnessreport returns:
Review the “Gold fixtures must tag spans with a surrogate group, e.g.” section in the pinned source before continuing.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 83/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 4,847 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
An aggregate pass can hide a group the model fails. For de-identification that
failure has a name: under-protection — PHI that leaks more often for one
demographic group than another. openmed.eval.fairness_report slices leakage and
recall by gold-span group so disparities surface before deployment, not after a
breach.
For each surrogate group fairness_report returns:
max - min leakage across groups (the gap to close).Group membership comes from a group tag in each gold span's metadata (keys
group, demographic_group, or surrogate_group); ungrouped spans fall into
unspecified.
from openmed.eval import fairness_report
# Gold fixtures must tag spans with a surrogate group, e.g.
# {"start": 4, "end": 12, "label": "PERSON", "metadata": {"group": "female"}}
fair = fairness_report(
"OpenMed/Privacy-PII-Detection",
"golden", # named suite, or pass a list of fixtures
device="cpu",
)
print("leakage disparity:", fair.leakage_disparity)
print("worst group :", fair.worst_group, fair.worst_group_leakage)
for group, m in sorted(fair.per_group.items()):
print(f" {group:14s} recall={m.recall:.3f} leakage={m.leakage_rate:.4f}")
# Under-protection alarm: any group leaking more than the rest.
LEAKAGE_GAP_LIMIT = 0.0 # leakage-first: ideally zero leakage everywhere
assert fair.leakage_disparity <= LEAKAGE_GAP_LIMIT or fair.worst_group_leakage == 0
FairnessReport.to_dict() is JSON-ready and PHI-free — drop it straight into a
model card.
group to each PHI span's
metadata (sex, age band, race/ethnicity surrogate). Use synthetic surrogates,
not real protected attributes (see building-gold-corpus).fairness_report on the model + suite.leakage_disparity) and locate worst_group.
Equalized-odds framing: equal true-positive (recall) and equal leakage
across groups.building-gold-corpus: supplies group-tagged synthetic fixtures.evaluating-with-leakage-gates: an aggregate RELEASABLE decision
should be paired with this audit — overall pass, subgroup fail is exactly the
trap this catches.authoring-model-cards: FairnessReport.to_dict() fills the
quantitative-analysis / subgroup section.benchmarking-clinical-ner: same run, different slice (label vs
group).unspecified is not a real group. A pile of spans in unspecified means
your gold isn't tagged; fix the corpus before trusting the disparity.span_count,
total_chars) alongside rates; a 1-of-2 leak isn't a 50% population rate.openmed/eval/fairness.py
(fairness_report, FairnessReport, FairnessGroupMetrics).Alternatives
alirezarezvani/claude-skills
ISO 13485 Quality Management System implementation and maintenance for medical device organizations. Provides QMS design, documentation control, internal auditing, CAPA management, and certification support. Use when working with medical device quality systems, preparing for ISO 13485 audits, managing regulatory compliance documentation, setting up corrective actions, or building audit preparation programs. Useful for quality management, audit preparation, regulatory compliance, medical device d
K-Dense-AI/scientific-agent-skills
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
mgiovani/cc-arsenal
Multi-agent review team: architecture, security, performance, testing, style, docs/UX, plus an adversary that cross-examines the other 6, for security-sensitive, architectural, or large PRs (15+ files) where a single-agent pass risks missing cross-cutting issues. Use for auth/payments/PII changes, schema/pattern changes, compliance sign-off, or when asked to 'get the review team on this' / 'multi-agent review' / 'thorough review before merge'. For a standard PR or a quick pre-merge check, use /r
huggingface/skills
Build and publish a Gradio demo on Hugging Face Spaces for a user-provided LoRA. Use when someone asks to create, generate, ship, or publish a Space, demo, Gradio app, or playground for a LoRA — including LoRAs for Qwen-Image, Qwen-Image-Edit, LTX-Video, Wan, FLUX, SDXL, or other diffusion base models. Also triggers when someone describes a LoRA they trained or hosts on the Hub and wants to share it. Covers picking the right base pipeline and `diffusers` inference recipe, designing a UI tailored