Eliminate horizontal overflow in every HTML plan — retrofit all 55 shipped files in docs/plans/ with a versioned 8-line CSS block via an idempotent script, and bake the same block into the plan skeleton so every future plan is born responsive.
Read and implement all steps in the plan at docs/plans/retrofit-responsive-plan-css.md — Retrofit responsive CSS into every HTML plan. Verify against the plan's Tests, Verification, and Acceptance Criteria before reporting done. If everything passed, mark completion in docs/plans/retrofit-responsive-plan-css.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: Retrofit responsive CSS into every HTML plan. The plan at docs/plans/retrofit-responsive-plan-css.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/retrofit-responsive-plan-css.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/retrofit-responsive-plan-css.md — Retrofit responsive CSS into every HTML plan. Brief subagents with the plan file at docs/plans/retrofit-responsive-plan-css.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/retrofit-responsive-plan-css.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.
retrofit-responsive-plan-css.html
docs/plans/retrofit-responsive-plan-css.html
docs/plans/retrofit-responsive-plan-css.md
Context
The story behind this plan — what prompted the work and why it matters now.
A 390px-viewport browser audit found 16 of the 54 HTML files in docs/plans/ overflow horizontally — the worst ( add-multi-host-deploy-targets.html ) by 294px of sideways scroll. Current-generation, digest-era plans are affected too: the defect is content-dependent, not template-generation-dependent.
Three root causes combine:
Unbreakable tokens with no wrap rule. File paths and commands like kit/plugins/docs-publisher/reference/.gitlab-ci.yml inside inline <code> , list items, and bare divs have no overflow-wrap anywhere in the template — a token wider than a phone screen simply cannot break.
Grid min-content propagation. Grid items default to min-width: auto , so one unwrappable token in main inflates the shared single-column track and stretches the sidebar with it. overflow-wrap: break-word wraps visually but does not reduce min-content size — only anywhere does, which is why both min-width: 0 and inherited overflow-wrap: anywhere are needed.
Component stragglers. The three-column .compare-grid does not collapse below 600px in some template generations, and table cells have no wrap rule.
The fix is proven: injecting the block below into all 54 rendered files in a width-controlled iframe harness took the overflow count from 16 to 0, with no effect on already-clean files ( anywhere only activates when a single word exceeds the line, so normal prose is untouched).
/* plan-responsive-fix v1 — injected by scripts/retrofit-responsive-plans.mjs */
body { overflow-wrap: anywhere; }
main, nav, aside { min-width: 0; }
.layout > *, .wrap > *, .compare-grid > * { min-width: 0; }
pre { white-space: pre-wrap; max-width: 100%; }
table { max-width: 100%; }
img, video { max-width: 100%; height: auto; }
@media (max-width: 600px) { .compare-grid { grid-template-columns: 1fr; } }
Because every plan is a self-contained single-file HTML document (embedded CSS, no external assets — by design, so plans survive file:// opens, copies, and email), skeleton improvements never reach already-shipped plans. The retroactive mechanism is a versioned injector script, mirroring the scripts/backfill-plan-digests.mjs (2.3.0) and scripts/backfill-save-pdf.mjs (2.4.0) precedents — this is the third injector in that family. The block is wrapped as <style id="plan-responsive-fix" data-version="1"> and inserted immediately before </head> ; the id + version pair is the idempotency key (current → skip, older → replace, missing → inject). docs/plans/index.html is always excluded — it is regenerated from scratch by docs/plans/build-index.sh via the rebuild hook and already renders clean at phone width.
Files that change
Every file this plan touches, and what happens to each one.
scripts/retrofit-responsive-plans.mjsnew idempotent injector with --check gatedocs/plans/*.htmlmodified 55 files (incl. this plan) — v1 block injected before </head>skills/implementation-plan/reference/SKELETON.htmlmodified same v1 block embedded nativelyCHANGELOG.mdmodified 2.4.1 entry.claude-plugin/marketplace.jsonmodified plan-agent 2.4.0 → 2.4.1tests/plugins/test-responsive-retrofit.shnew corpus + fixtures + skeleton-sync guard
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.
Confirm the whole change end-to-end, in this order:
Run bash tests/plugins/test-responsive-retrofit.sh — exit 0 covers the corpus check, fixture cases, and the skeleton/script sync assert.
Serve docs/ locally and re-run the width-controlled iframe audit at 390px and 320px across all 55 plan files: load each file in an iframe of each width and compare documentElement.scrollWidth against the iframe width. Expected overflow count: 0 at both widths (it was 16 at 390px before the retrofit; 320px grounds WCAG 1.4.10 reflow).
Visually open add-multi-host-deploy-targets.html (worst offender, previously +294px) and persist-checkbox-state-in-html-attributes-review.html (table-heavy review file) at phone width — no horizontal scrollbar, long paths wrap, tables fit.
Run the injector a second time — it reports all files skipped and git diff gains nothing.
Confirm .claude-plugin/marketplace.json shows plan-agent 2.4.1 with a matching CHANGELOG.md entry, and that the JSON passed the settings-hook validation on save.
Wrapping up
Three gates that must all pass before this plan is marked completed.
Completion Report
No items to report — all requirements met.