Skip to main content
ClaudeWave
Skill1.1k repo starsupdated today

moai-domain-brand-design

The moai-domain-brand-design skill generates WCAG 2.1 AA compliant visual design systems for web projects by extracting design tokens from brand identity documentation. Use this skill when establishing hero-first site layouts, deriving color palettes with verified contrast ratios, and outputting structured design tokens for framework implementation across all project sections.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/modu-ai/moai-adk /tmp/moai-domain-brand-design && cp -r /tmp/moai-domain-brand-design/internal/template/templates/.claude/skills/moai-domain-brand-design ~/.claude/skills/moai-domain-brand-design
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# moai-domain-brand-design

Visual design system skill for brand-aligned web projects. Absorbed from the retired v2.x `*-design-system` capability (per the design-system absorption policy) at v1.0.0. Enforces hero-first chaining, WCAG 2.1 AA contrast, and structured design token output for downstream implementation.

---

## Quick Reference

### Entry Conditions

Before generating design output, verify:

1. `.moai/project/brand/visual-identity.md` exists and contains no `_TBD_` markers.
2. Copy scope is defined (from `moai-domain-copywriting` JSON output or inline brief).
3. Target framework is confirmed (from `.moai/config/sections/design.yaml` `default_framework`).

If `visual-identity.md` has unresolved `_TBD_` markers, stop and request brand interview completion.

If the defined color palette conflicts with generated design tokens, execution halts and a conflict report is returned (see Error Handling below).

### Figma Integration

Figma integration is disabled by default. Check `.moai/config/sections/design.yaml`:

```
figma:
  enabled: false
```

If `figma.enabled: true` and a public Figma file URL is provided, extract design tokens from the Figma file. Otherwise use `visual-identity.md` as the sole source of truth.

---

## Implementation Guide

### Hero-First Chaining

The hero section establishes the visual tone for the entire site. All subsequent sections chain from it:

1. Extract hero background color, typography, and spacing from `visual-identity.md`.
2. Derive complementary section colors using the established contrast ratio rules.
3. Apply consistent spacing scale across all sections (do not reset per section).
4. Navigation and footer inherit hero's typographic scale.

Hero section requirements:
- CTA button is visible above the fold on mobile (375px viewport, 667px height).
- Headline contrast ratio against background: minimum 4.5:1 (WCAG AA).
- Hero image or background: never pure white (#FFFFFF) unless brand explicitly specifies.

### Design Token Extraction

Extract and output the following token categories from `visual-identity.md`:

**Color tokens**:
- `color.primary`: Brand primary color (hex or OKLCH)
- `color.primary.foreground`: Text on primary background (must pass 4.5:1 contrast)
- `color.secondary`: Secondary brand color
- `color.accent`: Call-to-action and highlight color
- `color.neutral.*`: Scale from 50 to 950 (gray shades)
- `color.semantic.success`, `color.semantic.warning`, `color.semantic.error`: Status colors
- `color.background`: Page background
- `color.surface`: Card and component background

**Typography tokens**:
- `font.family.sans`: Primary sans-serif stack
- `font.family.mono`: Code and technical content
- `font.size.*`: Scale: xs (12px), sm (14px), base (16px), lg (18px), xl (20px), 2xl (24px), 3xl (30px), 4xl (36px)
- `font.weight.normal`, `font.weight.medium`, `font.weight.bold`, `font.weight.black`
- `line.height.tight` (1.25), `line.height.normal` (1.5), `line.height.relaxed` (1.75)

**Spacing tokens**:
- Base unit: 4px
- Scale: `space.1` (4px) through `space.24` (96px), following 4px grid
- `space.section`: Vertical section padding (default 80px desktop, 48px mobile)
- `space.container.max`: Maximum content width (default 1280px)
- `space.container.padding`: Horizontal page padding (default 24px mobile, 48px desktop)

**Border radius tokens**:
- `radius.sm` (4px), `radius.md` (8px), `radius.lg` (12px), `radius.xl` (16px), `radius.full` (9999px)

**Shadow tokens**:
- `shadow.sm`, `shadow.md`, `shadow.lg`, `shadow.xl`

Output all tokens as a structured JSON file compatible with CSS custom properties and Tailwind CSS v4 theme configuration.

---

### WCAG 2.1 AA Compliance

All color combinations must pass these contrast ratios:

| Use case | Minimum ratio | Requirement |
| --- | --- | --- |
| Body text (< 18px or < 14px bold) | 4.5:1 | WCAG AA |
| Large text (>= 18px or >= 14px bold) | 3:1 | WCAG AA |
| UI components and graphical objects | 3:1 | WCAG AA |
| Focus indicators | 3:1 | WCAG AA |

If the brand's `visual-identity.md` specifies a color combination that fails contrast, execution halts and a conflict report is returned. The report includes:
- Failing pair (foreground + background)
- Actual contrast ratio
- Minimum required ratio
- Three alternative foreground colors that pass the required ratio

**AI slop detection** — Reject these visual patterns without brand justification:
- Purple gradient (#8B5CF6 to #6D28D9) as primary visual element
- White card (`#FFFFFF`) on light gray (`#F9FAFB`) background without border or shadow
- Generic stock icon sets (feather-icons, heroicons without customization)

---

### Component Specifications

Define the following component specifications in the design output:

**Button**:
- Primary: `color.primary` background, `color.primary.foreground` text
- Secondary: `color.secondary` background or transparent with border
- Destructive: `color.semantic.error` background
- States: default, hover (10% darker), focus (3px outline in `color.accent`), disabled (40% opacity)
- Size: sm (h-8), md (h-10, default), lg (h-12)
- Touch target: minimum 44x44px on mobile

**Card**:
- Background: `color.surface`
- Border: 1px solid `color.neutral.200` (light mode)
- Radius: `radius.lg`
- Padding: `space.6` (24px)
- Shadow: `shadow.sm` (default), `shadow.md` (on hover)

**Navigation**:
- Height: 64px desktop, 56px mobile
- Background: transparent on hero, solid on scroll
- Logo: maximum 32px height
- Links: `font.size.sm`, `font.weight.medium`
- Mobile: hamburger menu trigger at 768px breakpoint

**Section layout**:
- Vertical padding: `space.section` (see spacing tokens)
- Max content width: `space.container.max`
- Horizontal padding: `space.container.padding`
- Alternating backgrounds: `color.background` and `color.surface` for visual rhythm

---

### Layout Grid

Default responsive grid:
- Mobile (< 768px): 4 columns, 16px gutter, 24px margin
- Tablet (768px - 1024px): 8 columns, 24px gutter, 32px margin
- Deskto