Skip to main content
skill CX Codex

viewports — Claude Code skill for responsive checks

This Claude Code skill checks pages for overflow and interface issues across viewport sizes. It runs after layout changes or when a specific phone or width is named.

MIT 180 installs ★ 69 updated 2026-11-14

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add raphaelsalaja/skills --skill viewports -a claude-code
Open on GitHub

What viewports does

The skill captures a page at set dimensions, on both sides of project breakpoints, in a short landscape viewport, and with text enlarged to 200%. It checks for sideways page scrolling, clipped labels, small touch targets, and controls revealed only by hover. Each render gets a screenshot, and findings are tied to their viewport and rule.

It reads breakpoint values from CSS, Tailwind config, or tokens, then runs overflow.js through the browser’s evaluate call. Script results remain candidates until a screenshot crop confirms them. The browser needs device and touch emulation; a width that could not be rendered is marked Not verified. The report groups findings by width, adds a severity summary, and ends with either Block or Approve.

What it helps with

  • spot sideways scrolling on narrow screens
  • test layout on both sides of a breakpoint
  • find clipped labels and overlaps at enlarged text
  • catch controls that appear only on hover
  • check actions in short viewports and with touch input

Example prompts for the agent

  • Check this page at the listed widths and on both sides of its breakpoints.
  • Find clipped text and sideways scrolling on a phone-sized viewport.
  • Test dialogs in landscape orientation and with text at 200%.

How to install viewports

1Skills CLI (Vercel)

npx skills add raphaelsalaja/skills --skill viewports -a claude-code

2Manually: put the files in place

~/.claude/skills/viewports/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/viewports/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about viewports

How do I install viewports in Claude Code?

Run npx skills add raphaelsalaja/skills --skill viewports -a claude-code. The skill file is placed at ~/.claude/skills/viewports/SKILL.md.

What does viewports do?

It captures a page at different viewport sizes and checks for overflow, clipped text, and inaccessible controls. Findings include the affected width.

What does viewports check on touch screens?

It emulates touch input and looks for actions available only on hover. It also checks dialogs and menus in a short landscape viewport.

Source text

SKILL.md · MIT
---
name: viewports
description: Renders a page at every width, each breakpoint edge, a short landscape phone and 200% text, then reports what overflows, clips or hides.
---

# Viewports

This skill renders one page at a fixed set of widths and heights. It measures each render for sideways scroll, clipped text, small targets and controls that only hover reveals.

## Every width rendered, none inferred

The widths are exact: 320, 375, 768, 1024 and 1440, plus 1px either side of each project breakpoint. A width reasoned from the media queries is a finding. Run it after any layout change and whenever the user names a phone or a width.

Opening the result belongs to `verify`. Alignment inside one render belongs to `alignment`. Safe areas, hit areas and dynamic viewport units belong to `defaults`, and a failure there cites its id.

## 1. Read the breakpoints

Read the breakpoints from the CSS, the Tailwind config or the tokens. Add 1px below and 1px above each one to the fixed widths. A sweep that skips the edges of a breakpoint is `viewports-cross-each-breakpoint`.

## 2. Render each width

Set the viewport through device emulation at each width. Use 320×568, 375×812, 768×1024, 1024×768 and 1440×900. Breakpoint edges render 800px tall. Emulate touch at every width under 1024. Take a full-page screenshot of each. A layout judged from the code is `viewports-render-every-width`.

## 3. Measure each render

Run [overflow.js](overflow.js) through the browser's evaluate call at each width. Treat each result as a candidate until a crop of that width shows it.

The page never scrolls sideways, though a box may scroll inside itself. A 40px sideways scroll at 320 is `viewports-no-sideways-scroll`.

Text is never cut by its box without an ellipsis or a clamp. A button label cut in half at 375 is `viewports-no-clipped-text`. A target under 24px cites `defaults-hit-area`.

## 4. Tap at touch widths

Tap through the page with touch emulated. Row actions, copy buttons and menus that appear on hover need another way to appear. A delete button that shows only on row hover is `viewports-no-hover-only-controls`.

## 5. Shorten the height

Render 812×375, a phone held sideways. Open each dialog, sheet and menu at that size. Content scrolls inside the overlay and its actions stay reachable. A dialog whose `Save` sits below the screen with no scroll is `viewports-short-heights`.

## 6. Double the text

At 1024 wide, set the root font size to 200% and render again. Text wraps and its boxes grow, with nothing overlapping. Labels overlapping their icons at 200% is `viewports-text-zoom`. A layout that cannot grow because sizes are set in `px` gets the same id.

## 7. Report by width

Return one screenshot per width with the overlay numbers, then the findings in the same order. A finding with no width named is `viewports-name-the-width`.

## The pair

Every check is a pair. The broken line sits beside the line that replaces it.

| Rule | Broken | Replacement |
| --- | --- | --- |
| `viewports-cross-each-breakpoint` | Checked at 375 and 1440 only | Also at 767 and 768, 1023 and 1024 |
| `viewports-render-every-width` | "The grid collapses at `md`, so mobile is fine" | Screenshots at 320, 375 and 768 |
| `viewports-no-sideways-scroll` | A `width: 400px` card at 320 | `max-width: 100%` on the card |
| `viewports-no-clipped-text` | `overflow: hidden` cutting a label at 375 | The label wraps, or truncates with a way back |
| `viewports-no-hover-only-controls` | Row actions behind `:hover` alone | Shown at all times under `(hover: none)` |
| `viewports-short-heights` | A dialog's `Save` below a 375px screen | `max-height: 100dvh` with the body scrolling |
| `viewports-text-zoom` | `height: 32px` on a button that clips at 200% | `min-height: 2rem` with padding |
| `viewports-name-the-width` | "The header overlaps" | "At 768, the header overlaps the search field" |

## Reporting

**Severity.** `HIGH` is sideways page scroll, a control that hover alone reveals on touch or an action unreachable at a short height. `MEDIUM` is clipped text, overlap at 200% text or a break at a breakpoint edge. `LOW` is a finding that does not name its width.

**Format.** One finding per root cause, naming the width:

```
1. file:line - [rule-id] at 375, what is wrong (measured values)
```

Cite the script's element when the source line is not found. Then a `Rule | Count | Severity` summary. `Block` when any `HIGH` remains, `Approve` otherwise. Mark any width you could not render as `Not verified`.

© raphaelsalaja · MIT · raphaelsalaja/skills

Similar skills

All skills for Frontend and UI →

From the same set25

The whole set →
motion This Claude Code skill sets interface motion rules for transitions, gestures, timing, and blur. It applies when an agent builds or changes animated UI behaviour. CX Codex +1 259installs gather A skill for Claude Code gathers design references from selected sources into one linked board. It runs on requests for inspiration or help improving a screen. CX Codex +1 187installs alignment This Claude Code skill measures alignment and visual balance on a rendered page. It reports uneven gaps, shifted edges and mismatched radii with screenshot evidence. CX Codex +1 183installs deconstruct The deconstruct skill for Claude Code breaks animations and UI interactions into a state machine and property timeline. CX Codex +1 182installs color Validates on-screen color contrast, enforces role tokens across components, and tunes dark mode palettes. Runs during interface reviews and frontend styling tasks. CX Codex +1 178installs audit Audits diffs, branches, or codebases against an entire skill set into a ranked report. Consolidates multi-rule findings before fixes begin. CX Codex +1 176installs frames This Claude Code skill records a browser interaction under CPU throttling and identifies dropped frames or input delays. It records the same steps again to check the fix. CX Codex +1 176installs match The match Claude Code skill rebuilds a named interface part from its source and compares the result with the reference. It activates when a request points to an app, URL, screenshot, or design file. CX Codex +1 175installs

Project sponsors

Companies that keep this analytics open