agentleFS
manish1803manish1803/nextjs-fullstack-skills/skills/01-frontend-engineering/responsive-mobile-first/SKILL.md

responsive-mobile-first

Skill2 starsChanged 4 months agoMITView on GitHub

Design and implement responsive, mobile-first layouts using fluid typography, container queries, and correct Tailwind/CSS breakpoint strategy. Use whenever the user builds any UI layout, mentions "responsive", "mobile", "breakpoints", asks why a layout breaks on small screens, or is building anything user-facing without specifying device — always assume mobile-first unless told otherwise.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default posture: build for the smallest viewport first, then progressively enhance upward.

    line 8
  2. Very specific:

    Don't skip straight to lg: for something that also needs to look right at md: — test the in-between.

    line 13
  3. Very specific:

    Fluid typography: use clamp() (text-[clamp(1.5rem,4vw,2.5rem)] or a Tailwind plugin) for hero/display text instead of jumping abruptly at …

    line 16
  4. Very specific:

    Layout primitives: prefer flex/grid with flex-wrap, grid-cols-1 md:grid-cols-2 lg:grid-cols-3 over fixed pixel widths.

    line 17
  5. Very specific:

    Images/media: always constrain with max-w-full h-auto or next/image with sizes set correctly per breakpoint to avoid oversized downloads on …

    line 21
  6. Distinctive:

    No horizontal scroll at any breakpoint unless explicitly intentional (e.g.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Responsive & Mobile-First Design Skill

Default posture: build for the smallest viewport first, then progressively enhance upward. Never build desktop-first and retrofit mobile with overrides.

Breakpoint strategy (Tailwind defaults, extend only if justified)

sm 640px · md 768px · lg 1024px · xl 1280px · 2xl 1536px

  • Base (no prefix) styles = mobile (< 640px). Add md:/lg: to layer in more complex layouts as space grows.
  • Don't skip straight to lg: for something that also needs to look right at md: — test the in-between.

Core patterns

  • Fluid typography: use clamp() (text-[clamp(1.5rem,4vw,2.5rem)] or a Tailwind plugin) for hero/display text instead of jumping abruptly at breakpoints.
  • Layout primitives: prefer flex/grid with flex-wrap, grid-cols-1 md:grid-cols-2 lg:grid-cols-3 over fixed pixel widths.
  • Container queries (@container) for components that must adapt to their parent's width, not the viewport — e.g. a Card that appears both in a narrow sidebar and a wide main column.
  • Touch targets: minimum 44×44px tappable area on interactive elements for mobile; increase spacing between adjacent tap targets.
  • Navigation: collapse to a drawer/sheet below md, not a squeezed horizontal nav.
  • Images/media: always constrain with max-w-full h-auto or next/image with sizes set correctly per breakpoint to avoid oversized downloads on mobile.

Testing checklist before calling a layout done

  1. 375px (small phone), 768px (tablet), 1024px (small laptop), 1440px+ (desktop)
  2. Long content (long names, long numbers) doesn't break the layout at any width
  3. No horizontal scroll at any breakpoint unless explicitly intentional (e.g. a carousel)
  4. Touch targets ≥44px on mobile; hover-only interactions have a tap/focus equivalent

Anti-patterns to flag

  • Hardcoded width: 800px on a container instead of max-w-3xl w-full
  • Desktop nav hidden with hidden md:block but no mobile alternative provided
  • Font sizes fixed at desktop scale, causing overflow/wrapping on mobile
  • Media queries scattered ad hoc instead of using the design system's breakpoint tokens

Example prompt this skill should trigger on

"Build a pricing page with 3 tiers — make sure it looks good on mobile too."

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.