Ship a deterministic renderer that turns a small Markdown plan spec into today's full styled HTML plan — proven by round-trip tests showing the rendered output re-extracts to the identical spec.
Every plan today is typed out by the model as roughly 85 KB of HTML, nearly half of it boilerplate that never changes between plans. This work moves that boilerplate into a script: authors write a small Markdown spec and the renderer stamps out the styled, interactive HTML page. We'll know it worked when specs extracted from existing plans render back to HTML that re-extracts identically, with every downstream tool contract intact.
Read and implement all steps in the plan at docs/plans/build-plan-html-renderer.md — Build the Markdown-spec-to-HTML plan renderer. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/build-plan-html-renderer.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
More ways to run this plan — goal & workflow prompts, file path
Achieve this goal: Build the Markdown-spec-to-HTML plan renderer. The plan at docs/plans/build-plan-html-renderer.md describes one approach — use it as reference, but optimize for the outcome. Fan out across parallel subagents where that serves the outcome. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/build-plan-html-renderer.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
Run a workflow to implement the plan at docs/plans/build-plan-html-renderer.md — Build the Markdown-spec-to-HTML plan renderer. Brief subagents with the plan file at docs/plans/build-plan-html-renderer.md. Reserve a final verification phase for the lead agent, not a subagent. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/build-plan-html-renderer.md — tick each step's [x] marker and each criterion's - [x], set status: completed — and re-render the HTML from the spec. If any check failed, leave status: in-progress and say which.
build-plan-html-renderer.html
docs/plans/build-plan-html-renderer.html
docs/plans/build-plan-html-renderer.md
Context
The story behind this plan — what prompted the work and why it matters now.
This is Phase 1 of the guideline-driven plan generation proposal ( docs/proposals/plan-generation-from-markdown-guidelines.md , commit ad5ea81 ). That investigation measured the current pipeline: the skill file costs ~19k tokens to load, the 2,015-line SKELETON.html ~22k tokens to read, and the average 84 KB plan ~21k output tokens to write — 40–48% of every plan being identical CSS, JavaScript, and SVG. The repository already ships the read side of the fix: extractSections() and buildDigest() in scripts/lib/plan-spec.mjs derive a Markdown spec from any plan's HTML. Phase 1 builds the write side — a renderer that produces the exact DOM contract that finalize-plan , the plans gallery, and the smoke tests depend on — plus round-trip tests and a regeneration hook. Later phases rewrite the skill around planning guidelines; nothing in this phase changes how plans are authored yet.
Files that change
Every file this plan touches, and what happens to each one.
- kit/plugins/plan-agent/
CHANGELOG.mdmodified 2.18.0 entry for renderer, tests, hookhooks.jsonmodified register the render-plan-html hook
- scripts/lib/
plan-shell.mjsnew style and layout shell extracted from SKELETON.htmlplan-spec.mjsmodified add parseSpecMarkdown(), inverse of buildDigest()
.claude-plugin/marketplace.jsonmodified bump plan-agent to 2.18.0kit/plugins/plan-agent/hooks/render-plan-html.pynew PostToolUse hook re-rendering sibling HTMLscripts/build-plan-html.mjsnew spec-to-HTML renderer CLItests/plugins/test-build-plan-html.mjsnew unit, CLI, and round-trip property tests
Steps
The step-by-step work, in order — each step says what to do, why it matters, and how to check it worked.
Tests
The tests that prove the change does what it promises.
Definition of done
The plan counts as done when every statement below is true — check each one off as you verify it.
Final check
One last pass to confirm the whole change works end to end.
Write a fresh sample spec, render it with node scripts/build-plan-html.mjs , and open the HTML in a browser: header badges, progress bar, step chips, and copy buttons all render, with no unfilled skeleton placeholder tokens. Run node scripts/extract-plan-spec.mjs against the rendered file and confirm the printed spec matches the source. Then run node tests/plugins/test-build-plan-html.mjs (the round-trip suite over committed plans) plus the existing smoke tests tests/plugins/test-humanized-skeleton.sh and tests/plugins/test-goal-prompt.sh — all must exit 0. Finally, simulate the hook: pipe a PostToolUse JSON payload for a spec write into kit/plugins/plan-agent/hooks/render-plan-html.py and confirm the sibling HTML is regenerated, then repeat with a non-plans markdown path and confirm nothing changes.
Wrapping up
Three gates that must all pass before this plan is marked completed.
Completion Report
No items to report — all requirements met.