Skip to main content
skill CX Codex

mobile-first-design · secondsky — Claude Code skill: what it does, how to install

Enforces mobile-first responsive styling starting at 320px, 48x48px touch targets, and a 500KB total page weight cap.

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

What mobile-first-design does

The skill directs coding assistants to structure UI development around progressive enhancement. It generates base CSS for small screens starting at 320px, then layers wider viewports through min-width queries at 768px and 1024px. Layout instructions rely on relative units like rem, %, and vw.

Performance rules set strict limits: First Contentful Paint under 3 seconds on 3G, gzipped JavaScript bundles under 100KB, and total page weight below 500KB. Interactive controls must adhere to a minimum 48x48px touch target. Without semantic HTML serving as the base layer, the layered progressive enhancement approach falls apart.

What it helps with

  • build responsive layouts starting from a 320px base with min-width queries
  • enforce minimum 48x48px tap targets for touch devices
  • keep gzipped JavaScript bundles under 100KB and page weight under 500KB
  • apply three-layer progressive enhancement from raw HTML to JavaScript

Example prompts for the agent

  • Build a responsive navigation header starting from a 320px mobile layout.
  • Check button styles across the checkout form against the 48x48px touch target rule.
  • Refactor page styles using progressive enhancement layers and relative units.

How to install mobile-first-design

1Skills CLI (Vercel)

npx skills add secondsky/claude-skills --skill mobile-first-design -a claude-code

2Manually: put the files in place

~/.claude/skills/mobile-first-design/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mobile-first-design/

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

Questions about mobile-first-design

How do I install mobile-first-design in Claude Code?

Run npx skills add secondsky/claude-skills --skill mobile-first-design -a claude-code. The file will be placed in ~/.claude/skills/mobile-first-design/SKILL.md.

Which breakpoints does mobile-first-design define?

It defines four ranges: Mobile (320-480px), Tablet (481-768px), Desktop (769-1024px), and Large (1025px+). Media queries scale up with min-width.

What performance limits does this skill require?

It targets First Contentful Paint in under 3 seconds on 3G. The JavaScript bundle cannot exceed 100KB gzipped, and total page weight must stay below 500KB.

Source text

SKILL.md · MIT
---
name: mobile-first-design
description: Designs responsive interfaces starting from mobile screens with progressive enhancement for larger devices. Use when building responsive websites, optimizing for mobile users, or implementing adaptive layouts.
license: MIT
---

# Mobile-First Design

Design interfaces starting with mobile as the foundation, then enhance for larger screens.

## Breakpoints

| Name | Width | Devices |
|------|-------|---------|
| Mobile | 320-480px | iPhone SE, small Android |
| Tablet | 481-768px | iPad mini |
| Desktop | 769-1024px | iPad Pro, laptops |
| Large | 1025px+ | Desktop monitors |

## Mobile-First CSS

```css
/* Base styles (mobile) */
.container {
  padding: 1rem;
}

.nav {
  display: none; /* Hidden on mobile */
}

.nav-toggle {
  display: block; /* Hamburger visible */
}

/* Tablet and up */
@media (min-width: 768px) {
  .container {
    padding: 2rem;
    max-width: 720px;
    margin: 0 auto;
  }

  .nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .container {
    max-width: 960px;
  }
}
```

## Touch-Friendly Design

```css
/* Minimum touch target: 48x48px */
.button {
  min-height: 48px;
  min-width: 48px;
  padding: 12px 24px;
}

/* Adequate spacing */
.list-item {
  padding: 16px;
  margin-bottom: 8px;
}
```

## Performance Requirements

| Metric | Target |
|--------|--------|
| First Contentful Paint | <3s on 3G |
| JS bundle | <100KB gzipped |
| Total page weight | <500KB |

## Progressive Enhancement

```html
<!-- Layer 1: Semantic HTML (works without CSS/JS) -->
<nav>
  <a href="/home">Home</a>
  <a href="/about">About</a>
</nav>

<!-- Layer 2: CSS enhances appearance -->
<!-- Layer 3: JS adds interactivity -->
```

## Best Practices

- Start design at 320px width
- Use relative units (rem, %, vw)
- Test on real devices
- Optimize images for mobile
- Minimize JavaScript for initial load
- Ensure readable text without zooming

© secondsky · MIT · secondsky/claude-skills

Similar skills

Everything for Frontend and UI →

mobile-first-design by other authors comes first.

From the same set94

zod Provides Zod 4 schema patterns and type inference rules for agent sessions. Useful when setting up API validation, environment configs, or v3 migrations. CX Codex +1 647installs nano-banana-prompts Builds structured prompts for Gemini 2.5 Flash Image. Replaces keyword tags with descriptive prose for photography, art, and iterative image editing. CX Codex +1 600installs rest-api-design This skill hands your agent a set of REST conventions: resource names, HTTP methods, status codes and JSON response shape. Useful when you start a new API or want existing endpoints to match. CX Codex +1 586installs image-optimization Guides web image optimization using AVIF and WebP formats, responsive <picture> markup, and lazy loading strategies to cut page load times. CX Codex +1 585installs web-performance-optimization A skill that walks your agent through code splitting, lazy loading, caching and Core Web Vitals monitoring for web apps. CX Codex +1 557installs api-authentication A skill that helps your coding agent write API authentication: JWT, OAuth 2.0, API keys, sessions and security headers. CX Codex +1 533installs web-performance-audit A skill that audits page speed: pulls Core Web Vitals, finds bottlenecks and points at what to fix. Useful when LCP or CLS drifts out of range. CX Codex +1 526installs kpi-dashboard-design A skill that guides the agent through KPI dashboard design: metric choice, layout, chart types and status colors. Useful when you build analytics views for leadership. CX Codex +1 507installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor