# Color Summary Slide

> 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.

- Skill: `yizhao6211999/color-summary-slide` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add yizhao6211999/color-summary-slide`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yizhao6211999/color-summary-slide/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: yizhao6211999 (https://skillmd.com/u/yizhao6211999)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/yizhao6211999/color-summary-slide

---


# 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

```bash
pip3 install python-pptx pillow pymupdf
```

## Design system (the rules)

1. **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.

2. **Always show a legend** on the first slide (`deck.legend`) so the color
   mapping is explicit.

3. **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.

4. **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.

5. **Rich text format** used by every component:
   ```python
   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:

1. Open it and locate identifier regions (usually the top strip and the left
   study-list panel).
2. **Crop to just the region of interest** (e.g. the brain) so identifiers are
   physically removed — do not merely cover them.
3. Re-open the crop and confirm no text identifiers remain.

```python
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
  `card`s on the right (supports-Dx / against-alternative / final diagnosis).
- **Image slide** — de-identified `image` on the left; findings + conclusion
  `card`s on the right.

### 3. Generate
Copy the example and adapt the content dicts:

```bash
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:

```python
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:

```python
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.

