Skip to content
Skills Library
Design & UX · Testing

verify-responsive

/verify-responsive

The default way to check a responsive UI — render the real page at real viewport widths in fixed-width iframes, then drive and assert it from the parent. Use whenever you need to see or verify a layout at a given width: a mobile or tablet breakpoint, or small-screen-only behavior. Reach for it first, ahead of resizing a window.

Repository
greybeard ↗
Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 25.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

The default way to check a responsive UI — render the real page at real viewport widths in fixed-width iframes, then drive and assert it from the parent. Use whenever you need to see or verify a layout at a given width: a mobile or tablet breakpoint, or small-screen-only behavior. Reach for it first, ahead of resizing a window.

Original author description

The default way to check a responsive UI — render the real page at real viewport widths in fixed-width iframes, then drive and assert it from the parent. Use whenever you need to see or verify a layout at a given width: a mobile or tablet breakpoint, or small-screen-only behavior. Reach for it first, ahead of resizing a window.

How it works

  1. Why not just resize the window
  2. Inputs
  3. Procedure
  4. What this does not give you
  5. Related
Original SKILL.md headings · 71 lines, 678 words
SKILL.md preview
---
name: verify-responsive
description: The default way to check a responsive UI — render the real page at real viewport widths in fixed-width iframes, then drive and assert it from the parent. Use whenever you need to see or verify a layout at a given width: a mobile or tablet breakpoint, or small-screen-only behavior. Reach for it first, ahead of resizing a window.
---

# Verify Responsive

"The CSS looks right" is not "it renders right at 390px." A media query only proves itself when something evaluates it at that width. This is §4 applied to UI — *define success criteria, loop until verified* — where the criterion is a rendered page at a real width, not a stylesheet that reads correctly.

The tool is one throwaway HTML file: fixed-width `<iframe>`s pointed at your running app. An iframe is a nested browsing context, so **its viewport is the iframe box** — width and height media queries, container queries, and `vw`/`vh` all resolve to the size you set. Two frames side by side puts both breakpoints in a single screenshot.

## Why not just resize the window

Don't — go straight to the harness. Resizing buys exactly one thing, a narrower viewport, which is the same thing the iframe gives you. The iframe then gives you three more:

- **Both breakpoints in one screenshot**, side by side, rather than one width at a time.
- **A frame you can script.** The parent clicks into it, reads state back, and asserts `innerWidth` and `matchMedia(...)` *from inside* the frame. A resized window can only be photographed.
- **No dependency on the resize having worked.** Browser-automation resize calls can quietly fail to change the layout viewport the page actually sees: the screenshot comes back at the old width, the desktop branch renders, and you sign off on a mobile layout you never rendered.

The tool that genuinely beats this harness is **device emulation**, not window resizing — see [what this does not give you](#what-this-does-not-give-you).

## Inputs

- `url` — the running page to check (e.g. `http://localhost:3000/pricing`)
- `widths` — viewports to render; default `390×844` (phone) and `1280×800` (desktop)
- `static-dir` — the directory the dev server serves **at the same origin** (`public/`, `static/`, `www/`)

## Procedure

1. **Start the app** and note its origin.

2. **Put the harness in the app's own `static-dir`** — not on a second server. Same-origin is the entire point: it is what makes step 4 possible. A harness on another port is cross-origin, `iframe.contentDocument` comes back `null`, and you are reduced to screenshots.

3. **Write `_viewports.html`** into that directory:

   ```html
   <!doctype html><meta charset="utf-8"><title>viewports</title>
   <style>
     body { margin:0; display:flex; gap:16px; background:#111; font:12px system-ui }
     figure { margin:0 } figcaption { color:#888; padding:4px }
     iframe { border:0; background:#fff }
   </style>
   <figure><figcaption>390 × 844</figcaption>
     <iframe id="m" src="/YOUR/PATH" width="390" height="844"></iframe></figure>
   <figure><figcaption>1280 × 800</figcaption>
     <iframe id="d" src="/YOUR/PATH" width="1280" height="800"></iframe></figure>
   ```

   Open `/_viewports.html` and screenshot it.

4. **Drive it and assert from the parent.** Same-origin, so the frame is fully scriptable — you can reach past what a screenshot shows:

   ```js
   const w = m.contentWindow, doc = m.contentDocument;
   w.innerWidth;                                 // 390
   w.matchMedia('(max-width: 640px)').matches;   // true → the mobile arm really is live
   doc.querySelector('[data-testid="menu"]').click();
   doc.querySelector('.drawer').className;       // read the result back
   w.localStorage.getItem('seen');               // and any state it wrote
   ```

   Assert the width from *inside* the frame before trusting a screenshot. "Looks narrow to me" is how you verify nothing.

5. **Delete the harness before committing.** Anything in the static dir ships. `rm _viewports.html`, then confirm with `git status` — don't leave it for review to catch.

## What this does not give you

The iframe narrows the **viewport**. It does not emulate a device. Measured inside a 390px frame on a laptop: `pointer: fine` and `hover: hover` are both still true, `navigator.maxTouchPoints` is `0`, and `devicePixelRatio` is the host's.

So a layout that branches on width is covered honestly. One that branches on `@media (hover: hover)`, sniffs the user agent, or swaps assets on DPR will render its **desktop** arm at 390px and mislead you with a screenshot that looks right. There is also no browser chrome, so `100dvh`-vs-`100vh` differences never show up. When the behavior under test depends on any of those, use real device emulation or a real device — this harness will lie to you.

## Related

- [`/visualize`](../visualize/SKILL.md) draws the *structure* of the code. This renders the *running UI*. Use this one when the question is "what does it actually look like at this width."

Versions

The database has no other skills named verify-responsive.

Database snapshot: 13.11.2026 · package version 968abfd23706 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90responsive-ui-review
    Review a website or application interface across viewport sizes and input modes. Use when a layout breaks, new screens are built, or responsive behavior needs a focused audit.
  • 100responsive-paradigms
    Mobile, tablet and desktop are different paradigms, not one layout scaled. Use when designing responsive layouts or deciding what each breakpoint shows.
  • 90responsive-breakpoints
    Framer-style responsive breakpoint editing in Design: one DOM tree per screen with cascading width-scoped overrides. Use when adding/removing breakpoints, editing a design at a specific device width, resolving which value renders at a width, or persisting responsive style changes.
  • 100audit-responsive
    Audit and fix layouts at every breakpoint; desktop is not a wide phone. Use when "responsive audit", desktop looks stretched, there is no max-width, or 1440 looks like a phone. Touch-first build → design-mobile-first.
  • 100web-qc
    Checks a deployed web page before anyone calls it shipped: opens the live site at desktop, tablet and mobile width, zooms on buttons, pricing and forms, runs overflow checks, and presses the real controls. Use when the user says things like: 'QC the page', 'check the live site',…
  • 100test-responsive-design
    Make UIs responsive across all devices and verify responsiveness using Playwright. Includes scrollbar testing, breakpoint verification, and layout validation. Use when implementing new features, fixing layout issues, or ensuring mobile compatibility.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.