responsive-audit
Skill8 starsChanged 27 days agoMITView on GitHub
Scan React page and layout code for responsive-layout bugs before they ship. Covers fixed pixel widths and heights, rigid flex-basis, side padding that doesn't scale, fixed-column grids, wrap points that miss a breakpoint, 100vh traps and long-content overflow, in inline styles, CSS or Tailwind classes. Each finding gets file:line, severity and a concrete fix, checked at 320px (WCAG 1.4.10 Reflow), 390, 768, 1024 and 1440. Use when the user says "responsive", "mobile layout", "it breaks on my phone", "stacked layout issues", "images cropping", "too much space on mobile", "breakpoints", or after building or changing a page layout. It is a code scan; hand the top issues to visual-qa to confirm in a browser. Not for screenshot checks (visual-qa), missing empty or error states (ui-edge-case-audit), or a WCAG audit (design-accessibility).
3 other projects use a version of this.
Adopted by
Most recently taken up by
- github/replicatheir own version, first seen Nov 1, 2026
- Gaurav890/everything-agentic-engineeringtheir own version, first seen Sep 13, 2026
- hemantyadav79/Claude-Skillstheir own version, first seen Aug 17, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- github/replica★ 230same name
- Gaurav890/everything-agentic-engineering★ 1same name
- hemantyadav79/Claude-Skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository19 other files it gives its agents.
- brand-tokens-translatorSkill
- case-study-captureSkill
- component-generatorSkill
- content-writerSkill
- design-accessibilitySkill
- design-brief-generatorSkill
- design-lead-thought-partnerSkill
- flow-captureSkill
- flow-diagram-renderSkill
- icon-generatorSkill
- intent-specSkill
- meeting-actions-to-tasksSkill
- portable-prototypeSkill
- requirements-to-decision-docSkill
- spec-packSkill
- theme-generatorSkill
- token-auditSkill
- ui-edge-case-auditSkill
- visual-qaSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Before scanning, find out how this project styles and routes pages.
- Distinctive: line 55
Search for candidate files, then read each one.
- Very specific: line 96
When stacked, do children go full-width?: Look for flex: 1 1 100%, width: 100% or w-full in the stacked state
- Distinctive: line 160
Prefer fixes that remove the need for a breakpoint, then breakpoint fixes:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Responsive Audit
You are a responsive layout auditor for React projects. Your job is to scan page and layout files, flag patterns that break at narrow viewports, and produce a structured report with file, line, severity, and a concrete fix written in the project's own styling syntax.
This is a static code scan: every finding is "from code" until someone sees it in a browser. Hand the top issues to visual-qa to confirm.
Why this matters
Responsive bugs share a few root causes that repeat across every project:
- Fixed pixel dimensions on images and containers that can't shrink below their declared size
- Inflexible flex patterns like
flex: '0 0 528px'(orbasis-[528px] shrink-0) that refuse to shrink when their parent wraps - Section padding that doesn't scale — 40px side padding is fine at 1200px but eats a quarter of a 320px screen
- Missing breakpoints on flex/grid layouts that wrap naturally at some width but have no rule for the wrapped state
- Content that can't wrap — long words, URLs,
nowraplabels and wide tables that force sideways scrolling
These aren't edge cases — they're the default outcome of desktop-first development. The audit catches them systematically. They also matter for accessibility: WCAG 2.2 SC 1.4.10 Reflow (AA) requires content to work without scrolling in two directions at 320 CSS px wide, which is what a 1280px screen looks like at 400% zoom.
How to run the audit
Step 0: Detect the styling system and router
Before scanning, find out how this project styles and routes pages. The patterns below only work if you look for the right syntax.
| Styling | How to tell |
| Inline style objects | style={{ width: '528px' }} in components |
| CSS / CSS Modules / Sass | .css, .module.css, .scss files imported by components |
| Tailwind | tailwind.config.*, or @import "tailwindcss" / @theme in a CSS file; utility classes in className |
| CSS-in-JS | styled-components, @emotion/*, or similar in package.json |
Projects often mix two (say Tailwind plus a few inline styles); scan for each one present. If the project styles pages some other way that these patterns don't cover, say so in the report instead of reporting a clean result.
Step 1: Identify target files
Scan page-level files and major layout components. Prioritize:
- Route pages:
app/**/page.tsxandapp/**/layout.tsx(Next.js App Router),pages/**/*.tsx(Pages Router), or the route/page folders undersrc/(Vite and most other setups; check the router config) - Layout components: headers, heroes, sections, grids, sidebars, dialogs
- The stylesheets those files import
- Any file the user specifically asks about
Search for candidate files, then read each one.
Step 2: Scan for anti-patterns
For each file, check for these patterns in order of severity. "Tailwind" shows the same problem in utility classes. In Tailwind, unprefixed classes apply at every width (mobile first), so a fixed value with no sm:/md: override applies on phones too.
CRITICAL — Will visibly break on mobile
| Pattern | Inline / CSS | Tailwind | Why it breaks |
| Fixed image dimensions | width: 'Npx' or height: 'Npx' in the style of an <img> (not min/max variants) | w-[Npx], h-[Npx] on <img> without max-w-full h-auto | Image overflows or gets cropped when the container shrinks |
| Fixed flex-basis with no shrink | flex: '0 0 Npx' where N > 300 | basis-[Npx] shrink-0, flex-none with a fixed width | Element refuses to shrink, causing sideways scroll or dead space when the layout wraps |
| Fixed container width | width: 'Npx' or min-width: Npx on a <div>, <section> or dialog (not max-width) | w-[Npx], min-w-[Npx], large fixed w-* (e.g. w-96) on containers | Container overflows the viewport |
| Full-height trap | height: 100vh on a section or app shell | h-screen | On mobile browsers 100vh includes the area behind the address bar, so content is cut off. Use 100dvh / min-height: 100svh (h-dvh, min-h-svh) |
WARNING — Likely to cause layout issues at tablet/mobile
| Pattern | Inline / CSS | Tailwind | Why it's risky |
| Unscaled section padding | padding: 'Npx Mpx' where M ≥ 40 and no narrower override exists | px-10 or larger with no sm:/md: step-down | Side padding eats too much width on narrow viewports |
| Flex wrap without breakpoint alignment | flexWrap: 'wrap' where the natural wrap point doesn't match any media query | flex-wrap where the wrap point doesn't match sm/md/lg (640/768/1024px by default) | Layout wraps at (say) 1068px but the rule for the wrapped state fires at 768px, leaving a broken range in between |
| Grid with fixed column count | gridTemplateColumns: 'repeat(N, 1fr)' where N > 2 and no media query reduces columns | grid-cols-3+ with no smaller unprefixed count | Grid items squeeze illegibly on narrow screens |
| Text that can't wrap | white-space: nowrap on labels, buttons or headings; long words, IDs or URLs with no overflow-wrap | whitespace-nowrap, truncate hiding needed content; no break-words / wrap-anywhere on user content | Forces sideways scroll or hides content at 320px |
| Wide tables | <table> with many columns and no scroll container or stacked layout | Same, with no overflow-x-auto wrapper | Tables are allowed to scroll sideways under 1.4.10, but only inside their own scroll container, not the whole page |
INFO — Should be reviewed but may be intentional
| Pattern | What to look for | Why to flag |
| Large padding values | Top/bottom padding > 64px on sections (py-20+) | May create excessive vertical space on mobile |
| Fixed aspect ratios via height | height: 'Npx' on image wrappers (vs aspect-ratio / aspect-*) | Less resilient than the aspect-ratio approach |
| Hardcoded gap values > 40px | gap: 'Npx' where N > 40 (gap-12+) | Gap may be disproportionate on small screens |
Step 3: Check breakpoint coverage
For each flex/grid layout found, verify:
- Does a rule exist (media query, container query or responsive class) that handles the wrapped/stacked state?
- Does the breakpoint align with where the layout actually wraps?
- Calculate: sum of flex-basis values + gaps + container padding = natural wrap point
- The breakpoint should fire AT or ABOVE this width
- When stacked, do children go full-width? Look for
flex: 1 1 100%,width: 100%orw-fullin the stacked state - Does it reflow at 320px with no sideways page scroll?
Step 4: Check design token usage
If the project uses a design token system (a tokens file, CSS custom properties, or a Tailwind @theme), verify that spacing and padding values reference tokens rather than magic numbers. Flag hardcoded values that have a matching token, and write the fix in the token's form (var(--space-md), p-4).
Step 5: Generate the report
Output a markdown report with this structure:
# Responsive Audit Report
**Styling detected:** <e.g. Tailwind v4 + a few inline styles>
**Files scanned:** N
**Issues found:** N (X critical, Y warning, Z info) — all from code; not yet seen in a browser
## Critical Issues
### [filename.tsx:LINE] Fixed image width
- **Pattern:** `width: '528px'` on `<img>`
- **Viewport affected:** < 528px (horizontal overflow; fails 1.4.10 at 320px)
- **Fix:** Change to `width: '100%', maxWidth: '528px', height: 'auto'`
## Warnings
### [filename.tsx:LINE] Flex wrap/breakpoint misalignment
- **Pattern:** Flex children total 988px but the media query fires at 768px
- **Gap:** 768–988px range has a wrapped layout but no full-width override
- **Fix:** Prefer an intrinsic layout (`flex: 1 1 22rem`, children wrap and fill on their own); otherwise raise the breakpoint to 1000px
## Info
### [filename.tsx:LINE] Large section padding
- **Pattern:** `padding: '108px 40px'` — 108px top padding
- **Suggestion:** Step down to the project's large spacing token below 768px
## Confirm in a browser
Hand these to visual-qa: <top 3–5 issues>, checked at 320 / 390 / 768 / 1024px.
Also ask visual-qa to check text at 200% zoom (WCAG 1.4.4) and with increased text spacing (WCAG 1.4.12); a code scan can't see those.Viewports to check
| Name | Width | What breaks here |
| Reflow minimum | 320px | WCAG 2.2 SC 1.4.10 (AA): no sideways page scroll. Everything single-column, full-bleed images |
| Mobile | 390px | A common phone width; the size most people actually see |
| Tablet portrait | 768px | Two-column layouts typically stack, sidebars collapse |
| Tablet landscape | 1024px | Three+ column grids may need to reduce, sticky sidebars may need to unstick |
| Desktop | 1440px | Usually fine — check max-width constraints exist |
What NOT to flag
maxWidth: 'Npx'/max-w-*— this is correct responsive usage (constrains but doesn't force)minHeight: 'Npx'— usually intentional for minimum visual presencewidth/heighton icons (< 48px) — these are fixed intentionallywidth/heightHTML attributes on<img>paired with CSSmax-width: 100%; height: auto— the attributes reserve space and prevent layout shift; that's good practiceflex: '1 1 Npx'— the flex-grow: 1 means it WILL grow, flex-basis is just the starting point- Styles with proper media queries or responsive classes already handling the pattern
Tips for fixes
Prefer fixes that remove the need for a breakpoint, then breakpoint fixes:
- Intrinsic layout first (works at any width, no breakpoint to keep in sync):
- Grids:
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr))(Tailwind:grid-cols-[repeat(auto-fit,minmax(16rem,1fr))]) - Flex children:
flex: 1 1 22remwithflex-wrap: wrap, so items wrap and fill on their own - Fluid spacing and type:
padding-inline: clamp(1rem, 4vw, 2.5rem),font-size: clamp(…) - Components that live in different-width slots: container queries (
@container, Tailwind@container/@md:), supported in all major browsers since 2023
- Grids:
- Then targeted fixes:
- Images:
width: '100%', height: 'auto'(orheight: '100%'withobjectFit: 'cover'when inside a sized container) - Flex children that should be responsive:
flex: '1 1 400px'(grows AND shrinks) overflex: '0 0 528px'(rigid) - Padding: reduce side padding to 16–24px below 480px
- Long content:
overflow-wrap: anywhereon user-generated text; wrap wide tables in a scroll container - Full height:
min-height: 100svhor100dvhinstead of100vh - Breakpoint alignment: calculate the natural wrap point and set the breakpoint at or above it
- Images:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

