Ship the Save as PDF button in every plan-agent generated HTML plan — port the window.print() export that landed in plan-interview (PR #272) into plan-agent's skeleton and SKILL.md output contract, so each new plan exposes one-click PDF export with zero external dependencies.
Read and implement all steps in the plan at docs/plans/port-pdf-export-button-to-plan-agent.html — Port the Save as PDF button into plan-agent generated HTML plans. Start from the embedded digest: awk '!f && /<script[^>]*id="plan-digest"/{f=1;next} f && /<\/script>/{exit} f' docs/plans/port-pdf-export-button-to-plan-agent.html
port-pdf-export-button-to-plan-agent.html
docs/plans/port-pdf-export-button-to-plan-agent.html
Context
PR #272 (2026-06-07) added a Save as PDF button to HTML plans — but only inside the plan-interview plugin's markdown-to-html assets. Plans are actually generated by plan-agent's implementation-plan skill, which keeps its own independent reference/SKELETON.html, and that pipeline never received the button: 53 of 54 plans in docs/plans/ lacked it, including every plan generated since. Markdown plan conversion also moved into plan-agent (2.2.0), so no current generation path produced the export button. This plan ports the button markup, CSS, savePDF() function, and print-hide rule into the skeleton, and pins the requirement in the SKILL.md HTML output contract plus a smoke test so the two pipelines cannot silently diverge again.
Files to Modify
kit/plugins/plan-agent/skills/implementation-plan/reference/SKELETON.htmlmodified button markup, CSS, savePDF(), print hidekit/plugins/plan-agent/skills/implementation-plan/SKILL.mdmodified Save as PDF bullet in HTML Output Requirementskit/plugins/plan-agent/CHANGELOG.mdmodified 2.4.0 release entry.claude-plugin/marketplace.jsonmodified plan-agent 2.4.0 plus description mentiontests/plugins/test-save-pdf.shnew six-assertion smoke testdocs/plans/index.htmlgenerated gallery index rebuild
Steps
.plan-title heading and the status badge inside .plan-header-top in reference/SKELETON.html, wired as type="button" onclick="savePDF()" with an explicit aria-label. This matches the placement contract plan-interview's html-spec defined in PR #272, so both pipelines render the control in the same place.Verify
bash tests/plugins/test-save-pdf.sh pass — the button sits between .plan-title and .status-badge with full type/onclick/aria-label wiring..save-pdf-btn CSS block (accent background, hover/active/focus-visible states, prefers-reduced-motion opt-out) beside the status-badge styles, and append .save-pdf-btn to the main @media print hide list. The control must look native to the plan header and must never appear inside the PDF it produces.Verify
function savePDF() { window.print(); } ahead of buildImplementPrompt(). The browser's native print dialog offers a "Save as PDF" destination on Chrome, Edge, Firefox, and Safari — zero dependencies keeps every plan a single self-contained file.Verify
window.print().Verify
save-pdf-btn is documented in the SKILL.md..claude-plugin/marketplace.json, mention the export button in the marketplace description, and add the 2.4.0 CHANGELOG entry. A new user-visible capability is a minor bump per the marketplace versioning rules.Verify
marketplace.json shows plan-agent 2.4.0 and the CHANGELOG head reads "2.4.0 — Save as PDF button".Tests
File: tests/plugins/test-save-pdf.sh
Type: smoke test
Asserts: the skeleton every plan is generated from renders a Save as PDF button between the title and the status badge, wired to savePDF() → window.print(), hidden in @media print, and required by the SKILL.md output contract.
Run: bash tests/plugins/test-save-pdf.sh
File: tests/plugins/test-save-pdf.sh
Targets: reference/SKELETON.html header markup, inline script, and print styles; the SKILL.md HTML Output Requirements.
Key cases: button placement order, onclick and aria-label wiring, window.print() body, @media print hide list, CSS class definition, spec bullet presence.
Acceptance Criteria
Verification
Run bash tests/plugins/test-save-pdf.sh — all six assertions pass. Open this plan file in a browser: the header shows the Save as PDF button between the title and the completed badge; clicking it opens the native print dialog with a Save as PDF destination, and the button itself is absent from the print preview. Existing suites stay green: bash tests/plugins/test-plan-digest.sh.
Completion Checklist
Completion Report
No items to report — all requirements met.