Skip to content

commandFrontend

Check Responsive

Reviews layout code for small-screen breakage such as overflow, fixed widths and cramped tap targets, then fixes the breakpoints.

npx workspacetemplates add check-responsive --tool claude-code

Writes 1 file to .claude/commands/

.claude/commands/check-responsive.md14 lines · 1.2 KBFile
---
description: Reviews layout code for small-screen breakage such as overflow, fixed widths and cramped tap targets, then fixes the breakpoints.
argument-hint: "[file, folder or page; default changed files]"
---

Check the responsive behavior of: $ARGUMENTS (the changed files from `git diff --name-only` if empty).

1. Read the markup and styles. Find the project's breakpoints (config, tokens or media queries) and use those, not new ones.
2. Look for: fixed `width` or `min-width` larger than 320px, `100vw` that causes sideways scroll, absolutely positioned elements, tables and `pre` blocks without an overflow wrapper, images without `max-width: 100%`, long unbroken strings without `overflow-wrap`, and flex or grid rows that never wrap.
3. Check touch targets are at least 44px, body text is at least 16px, and the viewport meta tag exists.
4. For each problem name the file and line, the width where it breaks, and the cause.
5. Apply fixes that are mechanical (wrap, `minmax`, `max-width`, a media query using an existing breakpoint). Ask before changing the visual design.

End with a table of issues found, fixed and left for you, and the widths you reasoned about (320, 375, 768).

What it does

Layouts that look fine on a laptop often break at 360 pixels wide: text spills out, tables push the page sideways and buttons sit too close together. This command reads the styles and markup for the files you name and finds those problems without needing a browser.

It lists each issue with the rule that causes it, applies small fixes, and leaves design decisions as questions for you.

Example

you › /check-responsive src/pages/pricing.tsx

agent › Found 4 issues. Fixed 3: .plans grid now uses repeat(auto-fit, minmax(240px, 1fr)); comparison table wrapped in an overflow-x container; hero image given max-width 100%.
Left for you: the sticky sidebar covers 40% of the screen at 375px. Hide it or make it a drawer?

Questions

Does it open a browser?
No. It reasons from the code and your breakpoints, so it can miss issues that only show with real content. Treat it as a first pass before a device check.
Will it redesign my layout?
It only makes mechanical fixes. Anything that changes how the page looks is raised as a question.
  • A11y Check

    CommandFrontend

    Free
  • Add Form Validation

    CommandFrontend

    Free
  • Add Loading States

    CommandFrontend

    Free
  • Convert to TypeScript

    Commandtypescript

    Free