Desktop-first surfaces do not fail at "mobile" — they fail at specific widths in specific components in specific ways. Let an agent drive a real browser across the breakpoint range, catalog every breakage with a screenshot and cause, and only then fix — with container queries, clamp(), and modern grid instead of a media-query pile.
Tier: Core · Workflow area: Styling, responsive & i18n
The audit is the product of this playbook. Teams that skip straight to "make it responsive" fix the three breakages they happen to notice and ship the other nine. An agent with a browser notices all twelve.
Send the agent across the matrix, read-only. The instruction that produces a catalog instead of chatter:
Using the browser, visit each URL in routes.txt at widths 360, 390,
768, 1024, 1280 (height 900). At each stop: screenshot, then check for
(a) horizontal overflow (document.scrollingElement.scrollWidth >
innerWidth — report the offending element via elementsFromPoint along
the right edge), (b) text truncated or overlapping, (c) touch targets
under 44px at widths <= 768, (d) fixed-position elements covering
content, (e) images/media overflowing containers.
Output findings.md: one row per issue — route | width(s) | component
or selector | symptom | screenshot file | suspected CSS cause.
Change nothing.
The overflow probe matters: horizontal scroll is the number-one retrofit symptom and agents can detect it programmatically instead of squinting at screenshots.
Deduplicate into component-level work. Thirty findings usually collapse into six real problems — the same fixed-width card breaks on five routes. Have the agent do the first pass:
Group findings.md by root component (use the selector and screenshots).
For each group: one line naming the component, the width range where it
breaks, and the count of affected routes. Order by affected-route count.
You now have a ranked backlog with evidence attached — this is the artifact to show your lead before writing any CSS.
Choose the modern fix per class of breakage. Retrofits done as @media patches recreate the problem at the next unanticipated width. Match cause to tool. Fixed widths on cards/panels → max-width plus width: 100%, or grid minmax(). Row layouts that should stack → container queries (container-type: inline-size on the wrapper, @container (width < 480px)) so the component responds to its slot, not the viewport — critical for anything that renders in both a sidebar and a main column. Rigid type/spacing scales → clamp() (e.g. font-size: clamp(1rem, 0.9rem + 0.7vw, 1.25rem)). Column counts hardcoded per breakpoint → grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)). Tables → horizontal scroll in an overflow-x: auto wrapper, or a card layout under a container query; never let the page body scroll sideways.
Fix one component group per PR, agent-verified. Point the agent at one group with the fix strategy chosen:
Fix group 2 (OrderTable overflow below 768px) using the overflow-wrapper
strategy. Then re-run the step-1 audit for the affected routes only and
append a before/after screenshot pair per route to the PR description.
Confirm no NEW findings appeared at any width.
The "no new findings" clause is essential — responsive fixes love to break the width that was fine.
Sweep the in-between widths before closing. Breakpoint-ladder testing misses failures at 850px that 768 and 1024 both pass. One pass with a width-stepping loop (every 100px across the range, overflow check only) is cheap for an agent and catches the stragglers that make users think your app is flaky.
Install the regression tripwire. Add the overflow probe as a Playwright test across three widths per key route in CI. It is a one-expectation test — scrollWidth <= innerWidth — and it converts this one-time retrofit into a standing guarantee.
Audit with real content, not seed data. "Lorem" never overflows; a German customer name or a 14-digit order ID does. If staging data is short, have the agent inject long strings into the worst offenders before screenshotting.
findings.md plus screenshots to the model for steps 2–3; better for repeatable re-audits.Container queries are the single highest-leverage retrofit tool because they fix the component everywhere it renders, including contexts your audit never visited. When a component breaks in a narrow viewport, ask whether it would also break in a narrow slot — if yes, the fix is a container query, not a media query.