muratcakmak/shipwright/design-tokens

Claude Code and agent skill by muratcakmak/shipwright

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Extract or create a typed design token system for a React Native app. Generates color, spacing, and typography token files with light and dark mode support mapped to iOS HIG values. Use when setting up or refactoring the design system.

Install

npx vskill@latest install muratcakmak/shipwright/design-tokens

SKILL.md

The same SKILL.md was published earlier as muratcakmak/shipwright/design-tokens.

Design Tokens

Create or extract a typed design token system for this React Native app.

Input: $ARGUMENTS

MANDATORY PREPARATION

  1. Read Shipwright Context from CLAUDE.md for existing token locations and styling approach
  2. Scan for existing tokens:
  • **/tokens/**, **/theme/**, **/constants/colors.*, **/constants/spacing.*
  • Check if NativeWind, Tamagui, or Unistyles is used (tokens live in their config)
  1. If Figma URL provided: Note the URL — tell the user to export color/typography values, or ask them to paste the token values

TOKEN STRUCTURE

Create token files in the project's preferred location (default: src/tokens/ or tokens/).

Colors (colors.ts)
typescript
export const palette = {
// Brand colors
primary: { light: '#007AFF', dark: '#0A84FF' },
// ... brand-specific colors
// iOS Semantic Colors (map to PlatformColor equivalents)
background: { light: '#FFFFFF', dark: '#000000' },
secondaryBackground: { light: '#F2F2F7', dark: '#1C1C1E' },
tertiaryBackground: { light: '#FFFFFF', dark: '#2C2C2E' },
groupedBackground: { light: '#F2F2F7', dark: '#000000' },
label: { light: '#000000', dark: '#FFFFFF' },
secondaryLabel: { light: '#3C3C43', dark: '#EBEBF5' }, // with 60% opacity
separator: { light: '#3C3C4349', dark: '#54545899' },
// ... extend as needed
} as const;
export type ColorToken = keyof typeof palette;
Spacing (spacing.ts)
typescript
export const spacing = {
xxs: 4,
xs: 8,
sm: 12,
md: 16,
lg: 24,
xl: 32,
xxl: 48,
} as const;
export type SpacingToken = keyof typeof spacing;
Typography (typography.ts)

Map to iOS HIG type scale with Dynamic Type support:

typescript
import { Platform, TextStyle } from 'react-native';
export const typography = {
largeTitle: { fontSize: 34, fontWeight: '700', lineHeight: 41 },
title1: { fontSize: 28, fontWeight: '700', lineHeight: 34 },
title2: { fontSize: 22, fontWeight: '700', lineHeight: 28 },
title3: { fontSize: 20, fontWeight: '600', lineHeight: 25 },
headline: { fontSize: 17, fontWeight: '600', lineHeight: 22 },
body: { fontSize: 17, fontWeight: '400', lineHeight: 22 },
callout: { fontSize: 16, fontWeight: '400', lineHeight: 21 },
subheadline: { fontSize: 15, fontWeight: '400', lineHeight: 20 },
footnote: { fontSize: 13, fontWeight: '400', lineHeight: 18 },
caption1: { fontSize: 12, fontWeight: '400', lineHeight: 16 },
caption2: { fontSize: 11, fontWeight: '400', lineHeight: 13 },
} as const satisfies Record<string, TextStyle>;
export type TypographyToken = keyof typeof typography;
Theme Hook (useTheme.ts)
typescript
import { useColorScheme } from 'react-native';
import { palette } from './colors';
export function useTheme() {
const colorScheme = useColorScheme();
const isDark = colorScheme === 'dark';
const colors = Object.fromEntries(
Object.entries(palette).map(([key, value]) => [
key,
isDark ? value.dark : value.light,
])
) as Record<keyof typeof palette, string>;
return { colors, isDark };
}

ADAPTATION RULES

  • If the project uses NativeWind: Create tokens as Tailwind config values in tailwind.config.js
  • If the project uses Tamagui: Create tokens in the Tamagui config (tamagui.config.ts)
  • If the project uses Unistyles: Create tokens as Unistyles themes
  • If the project uses plain StyleSheet: Create the token files above with a useTheme hook

CHECKLIST

  • [ ] Colors defined with light and dark variants
  • [ ] Spacing scale created (consistent multiplier)
  • [ ] Typography scale mapped to iOS HIG
  • [ ] Theme hook or config created for the project's styling approach
  • [ ] Existing hardcoded values identified for migration
  • [ ] Token files are TypeScript with as const for type safety
  • [ ] Updated Shipwright Context in CLAUDE.md with token file locations

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/muratcakmak/shipwright/design-tokens/badge)](https://verified-skill.com/skills/muratcakmak/shipwright/design-tokens)

Something wrong with this skill or its page? Tell us.