Point the derived implement/goal/workflow prompts at the plan's markdown spec instead of the rendered HTML (cutting ~90% of the tokens an implementing agent spends reading the plan), keep the HTML plan fully updated — steps checked and marked complete — via explicit spec-edit + re-render instructions, and render the ## Next Steps section into the HTML plan as legacy plans had it.
Implementing agents were being briefed with the 60–120 KB rendered HTML when the 5–10 KB markdown spec carries strictly more information — and the old copy-button prompt invited the HTML hand-edits the markdown-first architecture forbids. After this change every derived prompt points at the spec, agents tick progress in the spec and re-render, and the Next Steps follow-up cards render in the HTML again.
Read and implement all steps in the plan at docs/plans/reference-md-spec-in-plan-prompts.md — Reference the markdown spec in plan prompts and render Next Steps again. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/reference-md-spec-in-plan-prompts.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: Reference the markdown spec in plan prompts and render Next Steps again. The plan at docs/plans/reference-md-spec-in-plan-prompts.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/reference-md-spec-in-plan-prompts.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/reference-md-spec-in-plan-prompts.md — Reference the markdown spec in plan prompts and render Next Steps again. Brief subagents with the plan file at docs/plans/reference-md-spec-in-plan-prompts.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/reference-md-spec-in-plan-prompts.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.
reference-md-spec-in-plan-prompts.html
docs/plans/reference-md-spec-in-plan-prompts.html
docs/plans/reference-md-spec-in-plan-prompts.md
Context
The story behind this plan — what prompted the work and why it matters now.
Since the markdown-first rewrite (2.18–2.20) the .md spec is the source of truth: all progress state is checkbox syntax in the spec, and hand-editing the rendered HTML is forbidden. But the three derived prompts still pointed at the .html file (10–20× the spec's size, mostly CSS/JS/SVG chrome), and the copy-button prompt told agents to read "a self-contained HTML file" and "mark it done in the plan" — inviting exactly the checked-attribute edits the architecture bans. The workflow prompt multiplied the waste by briefing every subagent with the HTML.
Separately, the markdown-first renderer skipped ## Next Steps, a section legacy hand-written plans rendered as collapsible cards with paste-ready prompts — the CSS, icon, and copyPrompt() JS never left the shell, only the parsing and rendering wiring was missing.
Files that change
Every file this plan touches, and what happens to each one.
scripts/build-plan-html.mjsmodified prompts use the spec path; plan-md meta; Next Steps card + nav filter; CLI passes the real spec path- scripts/lib/
plan-spec.mjsmodified parse ## Next Steps into a nextSteps key beside sections (round-trip stays byte-stable)plan-shell.mjsmodified next-steps chrome + nav entry, nextStepsBlock template, plan-md meta tag, Spec drawer row, markdown-first buildImplementPrompt
kit/plugins/plan-agent/scripts/build-plan-html.mjsmodified byte-identical bundled copy- kit/plugins/plan-agent/scripts/lib/
plan-spec.mjsmodified byte-identical bundled copyplan-shell.mjsmodified byte-identical bundled copy
- kit/plugins/plan-agent/skills/implementation-plan/reference/
SKELETON.htmlmodified plan-md meta, Spec row, markdown-first copy-button JSSKELETON.mdmodified Next Steps bullet/fence syntax
kit/plugins/plan-agent/skills/implementation-plan/guidelines/section-catalog.mdmodified Next Steps catalog entry; removed from the markdown-only groupkit/plugins/plan-agent/skills/implementation-plan/SKILL.mdmodified spec-path prompts, plan-md meta, Next Steps cards documentedkit/plugins/plan-agent/CHANGELOG.mdmodified 2.21.0 entry.claude-plugin/marketplace.jsonmodified plan-agent 2.20.0 → 2.21.0- tests/plugins/
test-build-plan-html.mjsmodified spec-path prompt pins, plan-md meta, Next Steps parse/render coveragetest-extractor-wiring.shmodified pins the new self-contained copy-button JS
Steps
The step-by-step work, in order — each step says what to do, why it matters, and how to check it worked.
## Next Steps in parseSpecMarkdown into a nextSteps key returned beside sections (bullets → summary/desc/prompt items, bullet-less content → prose).
progress does — outside sections.## Next Steps section and confirm the card, <pre> prompt, and nav entry appear; a spec without the section renders neither.mdPath render option, CLI passes the real spec path, .html → .md fallback — and emit it as the plan-md meta tag plus a Spec drawer row.
plan-implement/plan-goal/plan-workflow contents ending in .md and a plan-md meta tag.[x] step markers, flip criteria to - [x], set status: completed, then re-render the sibling HTML — never hand-edit it.
checked-attribute edits; the re-render step is what keeps the HTML plan checked and marked complete exactly as before.Tests
The tests that prove the change does what it promises.
.md spec path, plan-md meta and Spec row render, ## Next Steps parses beside sections and renders as collapsible cards with copy buttons, and committed plans still round-trip; Run: node tests/plugins/test-build-plan-html.mjsDefinition 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.
Render a spec containing a ## Next Steps section with the bundled renderer and open the HTML: the Implement row and drawer prompts name the .md spec, the drawer shows File/Path/Spec rows, and the Next Steps card expands to a paste-ready prompt with a working Copy button. Run the full plugin test suite — node tests/plugins/test-build-plan-html.mjs plus the goal-prompt, extractor-wiring, and humanized-skeleton shell tests — and confirm every check passes, including the ≥10-plan round-trip and the bundled-copy identity check. Flip a criterion in a spec, re-render, and confirm the HTML checkbox state follows the spec.
Wrapping up
Three gates that must all pass before this plan is marked completed.
Completion Report
No items to report — all requirements met.