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.
npx skills add secondsky/claude-skills --skill mobile-first-design -a claude-codeWhat 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-widthqueries - 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-code2Manually: put the files in place
~/.claude/skills/mobile-first-design/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mobile-first-design/
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-first-design -a codex2Manually: put the files in place
.agents/skills/mobile-first-design/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-first-design -a cursor2Manually: put the files in place
.cursor/skills/mobile-first-design/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install secondsky/claude-skills mobile-first-design2Manually: put the files in place
.github/skills/mobile-first-design/SKILL.md1Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-first-design -a gemini-cli2Platform CLI
gemini skills install https://github.com/secondsky/claude-skills --path plugins/mobile-first-design/skills/mobile-first-designManually: put the files in place
.devin/skills/mobile-first-design/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add secondsky/claude-skills --skill mobile-first-design -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.