explain-diff A developer created a Python script called render.py that generates self-contained HTML pages for the explain-diff skill, reducing token waste by separating content from boilerplate CSS and JavaScript. The tool takes a JSON spec with only the variable content and renders a complete page with randomized quiz options. | /usr/bin/env python3 | | """ | | render.py — render a structured explain-diff spec into the self-contained HTML | | page format used by the explain-diff-html command see ~/.claude/commands/ | | explain-diff-html.md, recipe from | | https://gist.github.com/geoffreylitt/a29df1b5f9865506e8952488eac3d524 . | | | | Why this exists: the CSS, quiz JavaScript, and page scaffolding are identical | | across every invocation of the explain-diff skill — only the content prose, | | diagrams, quiz questions actually changes per diff. Regenerating the full | | ~250 lines of boilerplate CSS/JS by hand every time wastes tokens. This script | | takes a small JSON spec with just the content and renders the final page. | | | | Usage: | | python render.py spec.json -o output.html | | | | If -o is omitted, writes to