A Claude Code Design Skill for Mobile App UI

· 5 min read

Ask any coding model for a settings screen and you will get roughly the same one: a list, default spacing, a blue accent, centered empty text. It works, and it looks like every other AI-built app. A design skill fixes this by giving Claude Code your design decisions before it writes the first widget.

This post shows how to build one for a mobile app, with examples in Flutter. The structure works the same for SwiftUI or React Native. For the bigger picture of skills and subagents, see Claude Code skills and subagents for mobile.

Why a skill and not a prompt

You could paste your design rules into each prompt. You will forget, and the rules will drift. A skill is a file Claude loads on its own when the task matches. Anthropic’s docs say Claude “uses skills when relevant, or you can invoke one directly with /skill-name.”

Design rules are also long, which suits skills. Anthropic notes “a skill’s body loads only when it’s used, so long reference material costs almost nothing until you need it.” Putting the same rules in CLAUDE.md would load them into every session, including ones about build scripts.

The folder layout

Anthropic recommends keeping the main file focused: “Keep SKILL.md under 500 lines. Move detailed reference material to separate files.” A design skill splits naturally:

.claude/skills/mobile-design/
├── SKILL.md          (rules and workflow)
├── tokens.md         (colors, type scale, spacing, radius)
├── components.md     (buttons, cards, lists, sheets, inputs)
├── states.md         (loading, empty, error, offline)
└── banned.md         (patterns to avoid, with reasons)

Claude reads the supporting files when SKILL.md points to them, so a task about a button reads components.md without loading everything.

The SKILL.md

---
name: mobile-design
description: Design rules for every screen and widget in this app. Use when creating or changing any UI, layout, theme or copy on screen.
paths:
  - "lib/**/presentation/**"
  - "lib/core/theme/**"
---

Before writing UI:
1. Read tokens.md. Use only theme tokens for color, type, spacing and radius. No literal Color(0x...) or EdgeInsets numbers in widgets.
2. Read components.md for any component you use.
3. Every screen handles loading, empty and error. See states.md.
4. Check banned.md before finishing.

After writing UI:
- Run the accessibility test (test/a11y_test.dart).
- Describe the screen's hierarchy in one sentence: what the eye hits first, second, third.

Two details matter here. The description leads with the use case, which Anthropic asks for: “Put the key use case first”, since the text is “truncated at 1,536 characters in the skill listing.” And the paths field takes “Glob patterns for the files that activate this skill”, so the design rules turn up when Claude edits screens, not when it edits a repository class.

tokens.md: decisions, not values alone

List each token with its job, so Claude can pick correctly:

## Color
- surface: page background
- surfaceRaised: cards and sheets, one step above surface
- accent: one primary action per screen, never decoration
- danger: destructive actions and errors only

## Spacing (4-point scale)
- 4, 8, 12, 16, 24, 32, 48
- Screen edge padding: 16. Between sections: 32.

## Type
- display: one per screen at most
- title, body, label, caption

The line “one primary action per screen” does more for visual quality than any color. Models love to put the accent color everywhere.

states.md: the part models skip

Generated screens often handle only the happy path. Spell out each state:

  • Loading: skeletons shaped like the content, not a centered spinner, for anything over a short wait.
  • Empty: what it is, why it is empty, and one action to fix it.
  • Error: plain words, what the person can do, a retry.
  • Long content: long names, large text, many items.

The onboarding best practices and paywall design posts cover two screens where these states matter most.

Accessibility you can test

Write accessibility rules as numbers from the platforms, then make a test enforce them. Flutter’s accessibility guide says “All tappable targets should be at least 48x48 pixels” and encourages “a contrast ratio of at least 4.5:1 between controls or text and the background, with the exception of disabled components.” It also says the UI “should remain legible and usable at very large scale factors for text size.”

Flutter ships an Accessibility Guideline API that “checks if your app’s UI meets Flutter’s accessibility recommendations.” From Flutter’s docs:

testWidgets('Follows a11y guidelines', (tester) async {
  final SemanticsHandle handle = tester.ensureSemantics();
  await tester.pumpWidget(const AccessibleApp());
  await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
  await expectLater(tester, meetsGuideline(iOSTapTargetGuideline));
  await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
  await expectLater(tester, meetsGuideline(textContrastGuideline));
  handle.dispose();
});

The comments in Flutter’s example say the Android check is “48 by 48 pixels” and the iOS check “44 by 44 pixels.” Point the skill at this test and tell Claude a screen is not done until it passes. Run it on every screen, not just the demo app.

banned.md: name the generic patterns

List the specific things you do not want, with a one-line reason. For example:

  • Gradient backgrounds on every screen (reads as template).
  • Emoji as icons.
  • Centered body text in long paragraphs.
  • Three identical cards in a row as the default layout.
  • Placeholder copy like “Lorem ipsum” or “Welcome to the app!”.

A list like this is short and very effective, because it names exactly what models produce when left alone.

Add a review step

A second pass catches what the first missed. A small reviewer subagent works well here, because Anthropic notes each subagent “runs in its own context window with a custom system prompt, specific tool access, and independent permissions.” Give it read-only tools and the design skill, and ask it to check one screen against tokens, states and banned patterns. Anthropic’s subagent docs say a skills field preloads skills, with “The full skill content is injected, not only the description.” See a Claude Code code reviewer subagent for the setup.

Keep it alive

Each time you correct Claude on a design point, add the rule to the skill. Claude Code “watches skill directories for file changes”, so edits apply in the current session. After a few weeks the skill describes your app better than any style guide you would have written up front.

For Flutter UI in general, see Claude Code for Flutter UI. MobileKit includes a design skill and an anti-generic checklist built on this structure.

Sources read on the day this post was written: Claude Code: Skills, Claude Code: Subagents, Flutter: Accessibility and Flutter: Accessibility testing.

Questions

What should a mobile design skill for Claude Code contain?

Your design tokens, rules for each component, the states every screen must handle (loading, empty, error), accessibility minimums and a short list of patterns to avoid. Long references go in separate files next to SKILL.md.

Can a skill enforce accessibility in a Flutter app?

It can require a widget test that uses Flutter's Accessibility Guideline API, which checks tap target sizes, labels and text contrast. The test fails the build when a screen breaks the rules.

Should the design skill load automatically?

Usually yes, scoped with the paths field to your UI folders, so Claude applies it whenever it edits screens and widgets but not when it works on data or build files.

Try it on your next idea

One payment, every update to this major version, and a refund window if it is not for you. Refund policy.