Color-Coded Summary Slide
Overview
Use this skill to produce short, dense, color-coded summary slides (typically
1–4 slides) that explain a reasoning process — most often a clinical
diagnostic process: how a diagnosis was reached from presentation →
imaging → labs/CSF → differential → conclusion. The signature move is that
color encodes the type of information, not decoration, so a reader can
scan a slide and immediately tell clinical facts from imaging from lab data
from "ruled out" from "confirmed".
This is different from /journal-reading and /case-report (full decks). Reach
for this skill when the user wants a tight visual summary of a specific
question ("summarise how we diagnosed X", "make a 2-page slide on the workup",
"add a slide with the MRI and the findings").
Triggers: "色彩總結 / 顏色分類 slide", "diagnostic process slide", "summarise the
workup", "differential diagnosis slide", "compact summary slide", "add the
imaging screenshot with findings".
Prerequisites
pip3 install python-pptx pillow pymupdf
Design system (the rules)
Color = information type. Assign each information category a semantic key
and keep it stable across every slide. Defaults in scripts/colorsummary.py:
| key |
color |
use for |
clinical |
amber |
symptoms, history, triggers, teaching points |
imaging |
blue |
CT / MRI / X-ray / imaging findings |
csf / lab |
purple |
CSF, lab panels, fluid data |
infection / danger |
red |
infection, "negative / excluded", red flags |
tumor / good |
green |
tumor/positive evidence, normal values, "supports Dx" |
diagnosis |
navy |
conclusions, final diagnosis, takeaways |
Rename/extend the TYPES dict per domain, but never use a color for two
meanings in one deck.
Always show a legend on the first slide (deck.legend) so the color
mapping is explicit.
Compact + large font. Prefer few words, big type. Body 13–15 pt, values
14–16 pt bold, headers 26–28 pt. Cards taller, whitespace tighter.
Components (all in scripts/colorsummary.py):
header(title, sub, page) — navy bar + accent underline + page number.
legend(keys) — color→type key.
banner(kind, runs) — one accented strip (e.g. the clinical "trigger").
timeline(steps) — step cards with colored headers + arrows between them.
kv_panel(title, kind, rows) — key/value data table with flag chips
(e.g. ↑, ↑↑, normal, "malig (–)"); ideal for CSF/lab panels.
card(kind, title, body, solid=False) — an interpretation card; solid
fills the accent (use for the final diagnosis / conclusion).
takeaway(runs) — navy bottom bar for the one-line "so what".
image(path, caption) — de-identified image panel with border; returns the
right edge x so you can place annotation cards beside it.
Rich text format used by every component:
runs = [ line, line, ... ] # one paragraph per line
line = (text, size, bold, color) # single-run line, OR
line = [ (text, size, bold, color), ... ] # multi-run line
# color = a TYPES/COLORS key string ("imaging","tumor","dark","white","sub","mint") or an RGBColor
De-identification (REQUIRED for images)
Clinical screenshots (PACS/EMR) almost always contain PHI — patient name, full
chart number, DOB — in the top bar and side panels. Before placing any image
on a slide:
- Open it and locate identifier regions (usually the top strip and the left
study-list panel).
- Crop to just the region of interest (e.g. the brain) so identifiers are
physically removed — do not merely cover them.
- Re-open the crop and confirm no text identifiers remain.
from PIL import Image
im = Image.open("pacs_screenshot.png").convert("RGB")
im.crop((left, top, right, bottom)).save("crop_deid.png") # brain only
Never version-control the output or the source images (they contain PHI) — see
"Output" below.
Workflow
1. Gather the narrative
Read the source records (progress notes, imaging reports, lab/CSF data). Pull
out, per step: the date/tag, the finding, and which type it is (clinical /
imaging / csf / infection-negative / tumor-positive / diagnosis).
2. Plan the slides
Typical shapes (mix as needed):
- Timeline slide — presentation → workup steps → diagnosis set.
- Data + differential slide —
kv_panel (CSF/labs) on the left; stacked
cards on the right (supports-Dx / against-alternative / final diagnosis).
- Image slide — de-identified
image on the left; findings + conclusion
cards on the right.
3. Generate
Copy the example and adapt the content dicts:
cp .claude/skills/color-summary-slide/scripts/example_diagnostic_process.py /tmp/build.py
# edit the content dicts, then:
python3 /tmp/build.py path/to/deid_image.png /path/to/out.pptx
Or import the library directly:
import sys; sys.path.insert(0, ".claude/skills/color-summary-slide/scripts")
from colorsummary import Deck
deck = Deck()
s = deck.header("...", "...", page="1 / 3")
deck.legend(s, ["clinical", "imaging", "csf", "infection", "tumor"])
# ... banner / timeline / kv_panel / card / takeaway / image ...
deck.save("out.pptx")
4. Verify layout
This environment cannot always render PPTX to preview. Check programmatically:
from pptx import Presentation
from pptx.util import Emu
p = Presentation("out.pptx"); SW, SH = p.slide_width, p.slide_height
for si, s in enumerate(p.slides, 1):
for sh in s.shapes:
if sh.left is None: continue
r, b = sh.left + (sh.width or 0), sh.top + (sh.height or 0)
if r > SW + 9144 or b > SH + 9144:
print("overflow slide", si, sh.shape_type)
No output = nothing runs off the slide. If a text box overflows, shorten the
text or enlarge the card (compactness comes from fewer words, not smaller font).
Output
- Save the
.pptx to the working directory (or the relevant {date} JR/ folder).
- PHI: if the content contains patient data, do not commit it to git —
deliver the file directly. The repo's
.gitignore already excludes *.pptx,
*.pdf, and *.docx.
Files
scripts/colorsummary.py — the helper library (Deck + components + palette).
scripts/example_diagnostic_process.py — runnable 3-slide worked example
(timeline → CSF panel + differential → image). Run it to see the output, then
copy and adapt.
1---2name: color-summary-slide3description: Build compact, color-coded summary slides (PPTX) where color encodes information type — for diagnostic-process walkthroughs, differential-diagnosis summaries, workup timelines, and image-annotation slides. Use when a user wants a small (1-4 slide) visual summary with a legend, step-card timeline, key-value data panels (e.g. CSF/lab), interpretation cards, and de-identified image panels.4---56# Color-Coded Summary Slide78## Overview910Use this skill to produce **short, dense, color-coded summary slides** (typically111–4 slides) that explain a reasoning process — most often a clinical12**diagnostic process**: how a diagnosis was reached from presentation →13imaging → labs/CSF → differential → conclusion. The signature move is that14**color encodes the *type* of information**, not decoration, so a reader can15scan a slide and immediately tell clinical facts from imaging from lab data16from "ruled out" from "confirmed".1718This is different from `/journal-reading` and `/case-report` (full decks). Reach19for this skill when the user wants a **tight visual summary** of a specific20question ("summarise how we diagnosed X", "make a 2-page slide on the workup",21"add a slide with the MRI and the findings").2223Triggers: "色彩總結 / 顏色分類 slide", "diagnostic process slide", "summarise the24workup", "differential diagnosis slide", "compact summary slide", "add the25imaging screenshot with findings".2627## Prerequisites2829```bash30pip3 install python-pptx pillow pymupdf31```3233## Design system (the rules)34351. **Color = information type.** Assign each information category a semantic key36 and keep it stable across every slide. Defaults in `scripts/colorsummary.py`:3738 | key | color | use for |39 |-----|-------|---------|40 | `clinical` | amber | symptoms, history, triggers, teaching points |41 | `imaging` | blue | CT / MRI / X-ray / imaging findings |42 | `csf` / `lab` | purple | CSF, lab panels, fluid data |43 | `infection` / `danger` | red | infection, "negative / excluded", red flags |44 | `tumor` / `good` | green | tumor/positive evidence, normal values, "supports Dx" |45 | `diagnosis` | navy | conclusions, final diagnosis, takeaways |4647 Rename/extend the `TYPES` dict per domain, but never use a color for two48 meanings in one deck.49502. **Always show a legend** on the first slide (`deck.legend`) so the color51 mapping is explicit.52533. **Compact + large font.** Prefer few words, big type. Body 13–15 pt, values54 14–16 pt bold, headers 26–28 pt. Cards taller, whitespace tighter.55564. **Components** (all in `scripts/colorsummary.py`):57 - `header(title, sub, page)` — navy bar + accent underline + page number.58 - `legend(keys)` — color→type key.59 - `banner(kind, runs)` — one accented strip (e.g. the clinical "trigger").60 - `timeline(steps)` — step cards with colored headers + arrows between them.61 - `kv_panel(title, kind, rows)` — key/value data table with **flag chips**62 (e.g. ↑, ↑↑, normal, "malig (–)"); ideal for CSF/lab panels.63 - `card(kind, title, body, solid=False)` — an interpretation card; `solid`64 fills the accent (use for the final diagnosis / conclusion).65 - `takeaway(runs)` — navy bottom bar for the one-line "so what".66 - `image(path, caption)` — de-identified image panel with border; returns the67 right edge x so you can place annotation cards beside it.68695. **Rich text format** used by every component:70 ```python71 runs = [ line, line, ... ] # one paragraph per line72 line = (text, size, bold, color) # single-run line, OR73 line = [ (text, size, bold, color), ... ] # multi-run line74 # color = a TYPES/COLORS key string ("imaging","tumor","dark","white","sub","mint") or an RGBColor75 ```7677## De-identification (REQUIRED for images)7879Clinical screenshots (PACS/EMR) almost always contain PHI — patient name, full80chart number, DOB — in the top bar and side panels. **Before** placing any image81on a slide:82831. Open it and locate identifier regions (usually the top strip and the left84 study-list panel).852. **Crop to just the region of interest** (e.g. the brain) so identifiers are86 physically removed — do not merely cover them.873. Re-open the crop and confirm no text identifiers remain.8889```python90from PIL import Image91im = Image.open("pacs_screenshot.png").convert("RGB")92im.crop((left, top, right, bottom)).save("crop_deid.png") # brain only93```9495Never version-control the output or the source images (they contain PHI) — see96"Output" below.9798## Workflow99100### 1. Gather the narrative101Read the source records (progress notes, imaging reports, lab/CSF data). Pull102out, per step: the date/tag, the finding, and **which type** it is (clinical /103imaging / csf / infection-negative / tumor-positive / diagnosis).104105### 2. Plan the slides106Typical shapes (mix as needed):107- **Timeline slide** — presentation → workup steps → diagnosis set.108- **Data + differential slide** — `kv_panel` (CSF/labs) on the left; stacked109 `card`s on the right (supports-Dx / against-alternative / final diagnosis).110- **Image slide** — de-identified `image` on the left; findings + conclusion111 `card`s on the right.112113### 3. Generate114Copy the example and adapt the content dicts:115116```bash117cp .claude/skills/color-summary-slide/scripts/example_diagnostic_process.py /tmp/build.py118# edit the content dicts, then:119python3 /tmp/build.py path/to/deid_image.png /path/to/out.pptx120```121122Or import the library directly:123124```python125import sys; sys.path.insert(0, ".claude/skills/color-summary-slide/scripts")126from colorsummary import Deck127deck = Deck()128s = deck.header("...", "...", page="1 / 3")129deck.legend(s, ["clinical", "imaging", "csf", "infection", "tumor"])130# ... banner / timeline / kv_panel / card / takeaway / image ...131deck.save("out.pptx")132```133134### 4. Verify layout135This environment cannot always render PPTX to preview. Check programmatically:136137```python138from pptx import Presentation139from pptx.util import Emu140p = Presentation("out.pptx"); SW, SH = p.slide_width, p.slide_height141for si, s in enumerate(p.slides, 1):142 for sh in s.shapes:143 if sh.left is None: continue144 r, b = sh.left + (sh.width or 0), sh.top + (sh.height or 0)145 if r > SW + 9144 or b > SH + 9144:146 print("overflow slide", si, sh.shape_type)147```148No output = nothing runs off the slide. If a text box overflows, shorten the149text or enlarge the card (compactness comes from fewer words, not smaller font).150151## Output152153- Save the `.pptx` to the working directory (or the relevant `{date} JR/` folder).154- **PHI:** if the content contains patient data, do **not** commit it to git —155 deliver the file directly. The repo's `.gitignore` already excludes `*.pptx`,156 `*.pdf`, and `*.docx`.157158## Files159160- `scripts/colorsummary.py` — the helper library (Deck + components + palette).161- `scripts/example_diagnostic_process.py` — runnable 3-slide worked example162 (timeline → CSF panel + differential → image). Run it to see the output, then163 copy and adapt.