--- name: html-change-report description: Generate and open a self-contained dark-theme HTML change report (Keep a Changelog categories + code samples) for a git repo time window; use when Frank asks for a rendered report of recent work. --- # HTML change report (Keep a Changelog + review aids) Produce a self-contained HTML report of repo work in a time window and open it in Firefox. ## Data gathering - Window commits: `git log --since="24 hours ago" --pretty='%h|%ad|%s' --date=format:%H:%M` (split on `|`). - Metrics: `git diff --shortstat ^..HEAD`, per-area file counts via `git diff --name-only … | awk -F/ '{print $1"/"$2}' | sort | uniq -c | sort -rn`. - Bucket commits into phase/theme rows by time-of-day for the timeline table. ## Report structure (standard: Keep a Changelog 1.1.0) 1. Executive summary (metrics + 3-5 bullets). 2. Full commit timeline table, phase-color-tagged (border-left per phase). 3. `git show ` command list per theme — Frank uses this for his review pass. 4. Changes by category: Added/Changed/Fixed/Removed/Security; omit empty categories; cite commit hashes per item. Fixed = old behavior was a bug; Changed = intentional. 5. 4-6 notable code excerpts: read real files, pick load-bearing/instructive code, note file:lines + commits + why it matters. HTML-escape everything (`html.escape`). 6. Verification evidence table (what / how / result). 7. Incidents & open risks. 8. Actions required from Frank (numbered, effort hints). ## HTML requirements - Self-contained: inline CSS only, NO CDNs (must work from file:// offline). Dark theme CSS vars (#1a1b26 bg family works). - Sticky top nav, section anchors, `
` blocks, commit hashes as `.tag` chips.
- Build via python (eval kernel): subprocess for git data, string concat for CSS (avoid f-string brace pain), f-strings for rows.
- Literal `{}` in HTML text (e.g. `fallbackChains: {}`) inside an f-string is a SyntaxError — build that fragment by concatenation or double the braces.

## Delivery + verification
- Write to `$HOME/Reports/--.html` (outside repo, tree stays clean; create the dir — on Dankware that is /home/blank/Reports, on dank hosts /home/dank/Reports).
- Validate: python HTMLParser feed (parse errors) + open in headless browser (`write` JSON to xd://browser: open → run with `document.querySelectorAll` counts) → close tab. Element counts are sufficient proof; a fullPage screenshot of a long report returns a multi-MB raw pixel buffer dump — only screenshot short pages.
- Open for Frank: `nohup firefox --new-tab file:/// >/dev/null 2>&1 & disown`.