$npx -y skills add Aperivue/medsci-skills --skill model-cardGenerate the documentation an engineer-built medical-imaging model must carry — a Model Card (Mitchell et al. 2019), a Datasheet for its dataset (Gebru et al. 2021), and a METRIC-informed data-quality pass — filled from user-supplied facts, then verify every required section is p
| 1 | # Model-Card Skill |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | This skill produces the **documentation an engineer-built medical-imaging model must carry**: a |
| 6 | **Model Card** (intended use, out-of-scope use, training data, per-subgroup performance, caveats), a |
| 7 | **Datasheet** for its dataset (provenance, composition, collection, labelling, consent), and a |
| 8 | **METRIC-informed data-quality pass**. It fills the templates **from facts the user supplies** — it |
| 9 | never invents a number, a provenance detail, a consent status, or a licence — and ships a deterministic |
| 10 | gate that no required section is missing or left as an unfilled `[NEEDS INPUT]` placeholder. |
| 11 | |
| 12 | It is the **reporting** seam of the model-engineering lane: after `/model-validation` audits the design |
| 13 | and `/model-evaluation` produces the numbers, this skill records them in a portable, auditable card that |
| 14 | `/write-paper` and `/check-reporting` consume. It mirrors `/version-dataset` structurally (generate + |
| 15 | deterministic verify). |
| 16 | |
| 17 | ## When to use |
| 18 | - A trained model needs a Model Card / Datasheet for a repo, Hugging Face card, or manuscript supplement. |
| 19 | |
| 20 | ## When NOT to use |
| 21 | - Auditing the validation design / metrics → `/model-validation`, `/model-evaluation`. |
| 22 | - Versioning the dataset bytes → `/version-dataset`; tabular variable docs → `/generate-codebook`. |
| 23 | - Item-by-item reporting-guideline compliance of the manuscript → `/check-reporting`. |
| 24 | - Building / training the model → `/model-scaffold`. |
| 25 | |
| 26 | ## Workflow |
| 27 | |
| 28 | ### Phase 1 — Collect the facts |
| 29 | Gather, from the user / the model's developers: task + architecture + provenance + licence; intended use |
| 30 | and out-of-scope use; training and evaluation cohorts; the reference standard and inter-reader agreement; |
| 31 | overall and **per-subgroup** performance; data collection, consent, and de-identification. Anything not |
| 32 | supplied stays `[NEEDS INPUT]` — never guess. |
| 33 | |
| 34 | ### Phase 2 — Fill the Model Card |
| 35 | Copy `${CLAUDE_SKILL_DIR}/references/model_card_template.md` to `MODEL_CARD.md` and fill each section |
| 36 | from the facts. Keep the headings. Numbers come only from `/model-evaluation` / executed results. |
| 37 | |
| 38 | ### Phase 3 — Fill the Datasheet |
| 39 | Copy `${CLAUDE_SKILL_DIR}/references/datasheet_template.md` to `DATASHEET.md` and fill the seven |
| 40 | question groups (Motivation, Composition, Collection, Preprocessing/Labeling, Uses, Distribution, |
| 41 | Maintenance). |
| 42 | |
| 43 | ### Phase 4 — METRIC data-quality pass |
| 44 | Walk `${CLAUDE_SKILL_DIR}/references/metric_dimensions.md` (completeness, correctness, consistency, |
| 45 | representativeness, timeliness, provenance, label provenance, fairness/coverage, leakage safety) and |
| 46 | record each finding in the Datasheet. Anything that affects the headline metric's validity is also a |
| 47 | `/model-validation` finding — cross-check there. |
| 48 | |
| 49 | ### Phase 5 — Verify completeness (deterministic gate) |
| 50 | ```bash |
| 51 | python3 ${CLAUDE_SKILL_DIR}/scripts/check_model_card_complete.py \ |
| 52 | --card MODEL_CARD.md --datasheet DATASHEET.md --strict |
| 53 | ``` |
| 54 | `MISSING_SECTION` / `EMPTY_REQUIRED_SECTION` must be zero before the card ships. |
| 55 | |
| 56 | ### Phase 6 — Hand off |
| 57 | Carry the card into `/write-paper` (the Methods / supplement reference it), `/check-reporting` |
| 58 | (CLAIM 2024 / TRIPOD+AI item audit of the manuscript), and `/self-review`. |
| 59 | |
| 60 | ## Anti-Hallucination |
| 61 | |
| 62 | - **Never invent evaluation numbers, subgroup results, or dataset provenance.** Every figure comes from |
| 63 | `/model-evaluation` or the user's executed results; every provenance / consent / licence statement is |
| 64 | user-confirmed. Unknown → `[NEEDS INPUT]`, which the gate flags. |
| 65 | - **Never mark a section complete without user-supplied content**, and never auto-fill a placeholder to |
| 66 | pass the gate. |
| 67 | - **Never assert a licence or consent status the user did not confirm.** |
| 68 | - The gate checks **presence**, not truth — a complete card can still contain a wrong number; validity |
| 69 | is `/model-validation` and the human's responsibility. |
| 70 | |
| 71 | ## Deterministic gate |
| 72 | `scripts/check_model_card_complete.py` — verifies every required Model Card / Datasheet section is |
| 73 | present and non-empty (stdlib, network-free). Reproducible challenge: |
| 74 | `bash ${C |