/doesntbreak:screenshot-check local .html file or http(s) URL to check defaults to the project's examplesfrom doesntbreak
Render a page in a real headless browser at four widths and prove whether it horizontally overflows. The measured counterpart to /doesntbreak:audit. Saves a screenshot per width.
Ships in doesntbreak. Installing the plugin adds it to Claude Code.
You are running a measured responsive check. Unlike /doesntbreak:audit, which
reasons from source, this command loads the target in a real headless browser at
several widths and reports whether the page actually overflows horizontally. A
page-level horizontal scrollbar is the bug this hunts for.
Target: $ARGUMENTS
Resolve it as follows:
http:// or https://: load the URL directly (the user's dev server).file://
protocol, so serve the file's directory over HTTP and load it from localhost.
Start a static server in that directory (for example
python3 -m http.server 8765 --bind 127.0.0.1) in the background, navigate to
http://127.0.0.1:8765/<filename>, and stop the server when the run finishes. The
npx fallback in Path B opens file:// directly and does not need a server.examples/*.html if they exist; otherwise ask the
user for a target and stop.Check these four, in order: 320, 375, 768, 1440 (px). They are the smallest phones, common phones, the awkward tablet middle, and a desktop control width.
Prefer a connected Playwright MCP browser. If none is available, use the checked-in runner in Path B. If neither works, report that a browser tool is required and stop.
For each width: resize the viewport to that width (height 800 is fine), navigate to the target, wait for load, then evaluate this in the page and record the result:
() => {
const docW = document.documentElement.scrollWidth;
const viewW = window.innerWidth;
const overflow = docW - viewW;
let offender = null;
if (overflow > 1) {
let worst = null, worstRight = viewW;
for (const el of document.querySelectorAll('*')) {
const r = el.getBoundingClientRect();
if (r.width > 0 && r.right > worstRight + 1) { worst = el; worstRight = r.right; }
}
if (worst) offender = {
tag: worst.tagName.toLowerCase(),
id: worst.id || null,
cls: (typeof worst.className === 'string' && worst.className) || null,
right: Math.round(worstRight),
};
}
return { docW, viewW, overflow, offender };
}
Then take a full-page screenshot for that width. overflow > 1 (a one-pixel
tolerance for sub-pixel rounding) means the page scrolls sideways; offender names
the element poking past the right edge, which is the §8 overflow hunt from
${CLAUDE_PLUGIN_ROOT}/skills/doesntbreak/references/patterns.md done automatically.
Run the repository's single evaluator rather than duplicating its measurement logic:
node "${CLAUDE_PLUGIN_ROOT}/scripts/responsive-check.js" \
--target "$TARGET" \
--output-dir "$OUTPUT_DIR"
It uses playwright-core with an installed system Chrome/Chromium; it never downloads
a bundled browser. Run npm install in the plugin directory once if dependencies
are not installed. Override discovery with --executable-path /path/to/chrome or
DOESNTBREAK_CHROME_PATH. It emits one JSON object per viewport on stdout and a
concise summary on stderr. Exit 0 means the observed outcome matched --expect
(or no overflow without --expect), 1 means the page outcome did not match, and
2 means configuration, HTTP navigation, or browser execution failed. Delayed
client-side layouts can use --settle-ms N (0–10000, default 100).
Report exactly these sections.
A table, one row per width:
width | PASS / FAIL | offending element when FAIL (tag#id.class, measured right edge vs viewport)
PASS means no horizontal scroll (overflow <= 1). FAIL means the page scrolls
sideways at that width.
Save the PNGs to a dedicated directory outside the repo (a temp or scratchpad path),
not the working tree, so a check run never dirties the user's git status. Name them
by width, for example shot-320.png. List the saved paths, one per
width. Run the check before and after a fix to capture two sets and compare them. Note: the Playwright MCP may also drop a
.playwright-mcp/ scratch folder in the working directory; do not commit it.
One line. Either "No horizontal scroll at 320 / 375 / 768 / 1440px." or name the
widths that FAIL and the dominant offending element. If this was run against a known
fixture pair, note that examples/broken.html is expected to FAIL and
examples/fixed.html is expected to PASS.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub codewithasnari/doesntbreak --plugin doesntbreak3 commands in this plugin
/auditRules sourceReport-only responsive UI audit. Scans HTML/CSS/React/Tailwind layout code for the 9 doesntbreak rules and reports findings with file:line, severity, and exact fixes. Never edits files./fixRules sourceApply the doesntbreak responsive fixes to layout code. Finds the same offenders /doesntbreak:audit reports, edits the source to fix the high-confidence ones, flags the judgment calls, and verifies with a real browser. Leaves changes unstaged for review, never commits.