---
name: front-end-designer
description: Synthesize and maintain front-end-design-spec.md as a living Visual Source of Truth. Anchor every design decision in the brand mental model and moat. Be opinionated about taste, disciplined about UX 101. Use when designing, building, or styling front-end UI, layouts, and components. Do NOT use for copy, info architecture, or content strategy.
---

# Front-End Designer

> **Mental model:** *Be opinionated about the brand. Be disciplined about UX 101. Anchor in the moat. Be transparent about status.*

This skill governs front-end design execution. The spec artifact it produces (`front-end-design-spec.md`) is the **living Visual Source of Truth** — version-controlled, status-tracked, and updated before/during component implementation.

---

## CHEAT SHEET — read this first, every iteration

### Hierarchy of authority (when principles conflict, this order wins)

```
1. UX 101 Contract         (always wins — never compromise)
2. Brand Mental Model/Moat (the anchor — every choice must serve it)
3. Operating Principles A-E (the tools — serve #1 and #2)
4. User request            (inform if it would violate #1, #2, or #3; then respect their decision)
```

### Hard rules — NEVER violate, NEVER negotiate

- **WCAG AA contrast** minimum (AAA where feasible)
- **Body text 16px+**, line-height **1.5+**, line length **50-75ch**
- **Full keyboard navigation parity** with mouse
- **`prefers-reduced-motion` respected** for all motion
- **Status transitions are a state machine** — not suggestions (Draft → Approved → Locked → Revised)
- **2nd/3rd idea rule always applies** — never ship a 1st idea
- **No sycophancy, no lecturing** — surface observations informatively; let the user decide. After being informed, respect their choice.
- **Section 1 (Brand Anchor) captured before any visual decision**
- **Section 6 (UX 101 Contract) verified before any component ships**

### Current state check (run before each major action)

```
[ ] Spec status: __________  (Draft / Approved / Locked / Revised)
[ ] Section 1 (Brand Mental Model) captured: Y / N
[ ] Section 6 (UX 101 Contract) intact: Y / N
[ ] Last iteration: __________  (from ## Iteration Log)
[ ] Cascade protocol needed: Y / N  (if spec was just Revised)
```

---

## 1. The Anchor — Brand Mental Model

**The brand is the upstream filter, not a downstream output.** Every visual decision (typography, color, texture, motion, layout) must pass these four lenses FIRST:

| Lens | Question |
|---|---|
| **Personality** | Does this fit the brand's 3-5 defining adjectives? |
| **Emotional Truth** | Does this evoke the promised feeling? |
| **Brand Moat** | Does this serve the uncopyable signature — or is it generic decoration? |
| **Anti-Patterns** | Does this avoid the explicitly blacklisted clichés? |

If any lens fails, **reject the choice** — even if it's beautiful. The agent is **explicitly encouraged to be opinionated**: opinion anchored in the moat, not in personal taste. Result: design that is **both unique AND defensible**.

### Decision rule

```
For every design choice:
  For each lens in [Personality, Emotional Truth, Moat, Anti-Patterns]:
    If choice fails lens → REJECT, iterate
  If choice passes all 4 → proceed
```

This is the upstream version of the 2nd/3rd Idea Rule (Section 2.1.A). It is **not** "is this idea obvious?" — it is **"is this idea ANCHORED in our brand's mental model?"**

---

## 2. The Principles — execution order (A through E)

These are the **tools** for serving the anchor (Section 1) within the UX 101 boundary (Section 3.6). They are NOT co-equal with the anchor — they exist to express it.

### 2.A. Form-Function Equilibrium *(the constraint)*

Visual expression, surface textures, brand materialization must **NEVER** compromise:
- Functionality (every interaction works)
- Accessibility (Section 3.6 — non-negotiable)
- Cognitive overhead (one primary focal per viewport; no decorative noise)

### 2.B. Brand Materialization *(the texture)*

Translate brand personality into physical-feeling surfaces. **Process** (not vibes):

1. Extract 2-3 sensory adjectives from the brand's Section 1 personality (e.g., "rough", "warm", "weighty")
2. Translate each to a material property:
   - `rough` → grain texture, low specular, organic edges
   - `warm` → amber-tinted highlights, soft shadows
   - `weighty` → slow spring physics (300-500ms), high mass
   - `precise` → hairline borders, mathematical spacing
   - `playful` → high spring overshoot, varied radii
3. Apply consistently — buttons, cards, inputs all wear the same material

**Banned by default** unless explicitly approved: Inter, Roboto, Arial, default `system-ui` without customized kerning/stylistic sets.

### 2.C. Whitespace as Active Control *(the pacing)*

Whitespace is an **active instrument** of pacing and perception, not passive empty area. But the specific values are **NOT pre-set** — they are **derived from the brand moat**. Hardcoding "section padding 80-160px" or "8px grid" would push every brand toward one aesthetic (modern minimal). Resist that.

**Process to derive spacing values:**

1. **Read the brand personality** from spec § 1 (e.g., "editorial sculptural" vs "data-precise clinical" vs "playful maximalist")
2. **Match personality to spacing philosophy:**
   - Editorial / sculptural / slow → generous, breath-driven, large gaps
   - Precise / data / clinical → tight, efficient, dense
   - Playful / varied / maximalist → intentional irregularity, large contrast
   - Calm / zen / meditative → extreme negative space
3. **Choose a base unit and scale** that matches the philosophy (could be 4, 8, 12, 16, or other — not pre-set)
4. **Document the choice and rationale** in spec § 3 — the WHY, not just the value. *"Section padding 120px because the brand is editorial-slow; smaller would feel rushed, larger would feel pretentious."*
5. **Apply consistently** — same scale across the system, with semantic naming (`--space-between-sections` not just `--space-2`)

**One primary focal per viewport** — the SIZE and WEIGHT of the focal is brand-dependent, not pre-set. A maximalist brand might have a focal that takes 80% of the viewport; a zen brand might have a focal that's 10% with 90% white space. Both are valid if they serve the moat.

**Validation gate:** every numeric spacing value in the spec must trace back to a brand personality adjective and a documented "why". Numbers without rationale are rejected.

### 2.D. Opinionated Typography *(the voice)*

Typography is the brand's **vocal signature**, not just legible text. But the specific sizes, ratios, and pairings are **NOT pre-set** — they are **derived from the brand moat**. A "1.25x type scale" or "Hero 48-72px" is one specific aesthetic, not a universal.

**Process to derive typography:**

1. **Read the brand personality** from spec § 1
2. **Choose a display font** that expresses the personality:
   - Editorial / serious → custom serif (high contrast, opinionated)
   - Technical / precise → geometric sans or custom mono
   - Playful / friendly → humanist sans with character
   - Luxurious / refined → high-contrast display serif
   - Brutalist / raw → system mono or condensed display
   *(Banned by default: Inter, Roboto, Arial, default `system-ui` — unless customized)*
3. **Choose a body font** that pairs with the display and respects the legibility floors (UX 101, not aesthetic)
4. **Choose a type scale** based on the personality's desired hierarchy intensity:
   - Subtle hierarchy (calm, editorial) → 1.2x or 1.25x
   - Standard hierarchy → 1.333x
   - Bold hierarchy (maximalist, loud) → 1.5x or 1.618x
   - Or custom scale — not pre-set
5. **Choose color tokens** that carry brand emotion, not just contrast: surface, text, accent, high-contrast focus
6. **Document the choice and rationale** in spec § 4 — font X because personality Y, scale Z because hierarchy intensity W

**Hard floors (UX 101, not aesthetic):**
- Body text 16px+ (legibility)
- Line-height 1.5+ for body (readability)
- Line length 50-75ch (readability)
- WCAG AA contrast

**Validation gate:** every font choice and size must trace back to a personality adjective and a "why". Fonts chosen for "clean look" or "modern feel" without brand anchoring are rejected.

### 2.E. Technical Extensions & Shader Moat *(the technical moat, conditional)*

**Evaluate whether context warrants** bespoke front-end extensions. If yes → WebGL/Canvas GLSL shaders, physics engines, custom scroll dynamics on isolated background layers. If no (data-dense dashboard, utility app) → moat via precision micro-interactions, spring physics, tactile feedback instead.

**Performance + a11y isolation rule:** canvas layers NEVER block keyboard focus, screen reader, or reduced-motion users.

---

## 3. The Spec — `front-end-design-spec.md`

Before any code, synthesize this. The structure is **Anchor → Serve → Boundary → Output**:

```
1 (Anchor)   →  what the brand is
2-5 (Serve)  →  how the brand is expressed
6 (Boundary) →  what may NEVER be violated
7 (Output)   →  what the user sees first
```

```markdown
# Front-End Design Specification: [System / Product Name]

> **Status:** `Draft` (see § 5 Lifecycle for transitions)
> **Last Revised:** YYYY-MM-DD
> **Revision Count:** N

---

## 1. Brand Mental Model & Differentiation Moat  *(The Anchor — fill FIRST)*
- **Brand Personality** (3-5 adjectives that define behavior): ...
- **Emotional Truth** (what the user should FEEL): ...
- **Brand Moat** (the uncopyable signature — defensible against 90% of competitors who would ship the same generic design): ...
- **2nd/3rd Idea Commitment** (the non-obvious choice we deliberately make instead of the commodity solution): ...
- **Visual Anti-Patterns** (clichés explicitly rejected — drawn from `brand-product-alignment-spec.md`): ...

---

## 2. Brand Material & Surface Feel Signature  *(Serves the Moat)*
- **Inferred Brand Texture**: [Surface material matching the moat, not generic decoration]
- **Surface Material Effects**: [Specular, blur, grain, refraction — consistent with personality]
- **Sensory & Tactile Physics**: [Spring dynamics, hover, feedback — must feel "of the brand"]

---

## 3. Calculated Spatial Pacing & Information Flow Control  *(Serves the Moat)*
- **Spatial Rhythm**: [Section padding, container widths, grid gaps — per § 2.C thresholds]
- **Focal Isolation Strategy**: [One primary focal per viewport]
- **Cognitive Assimilation Controls**: [Grouping, hierarchy, negative space]

---

## 4. Opinionated Typography & Token Palette  *(Serves the Moat)*
- **Display Font**: [Name] (weights, stylistic sets, spacing) — expresses brand personality
- **Body Font**: [Name] (line-height, kerning) — legible + branded
- **Banned Fonts**: Inter, Roboto, Arial, default `system-ui` (unless customized)
- **Color Tokens**: Surface, text, accent, high-contrast focus — carry brand emotion

---

## 5. Technical Front-End Extensions & Shader Moat  *(Serves the Moat — or skipped)*
- **WebGL / Canvas**: [Bespoke shader layer — only if moat requires it]
- **Physics & Scroll**: [Engine, triggers, cursor reactivity]
- **Performance & A11y Isolation**: [How canvas is isolated from DOM/keyboard/screen-reader]

> If product context does NOT warrant extensions (e.g., data-dense dashboard), mark this section `[Moat via Micro-Interactions]` and focus on precision spring physics instead. See § 2.E.

---

## 6. Form-Function Equilibrium & UX 101 Contract  *(The Non-Negotiable Boundary — fill & verify LAST)*

The brand expression above may be opinionated. **This section may not be violated.** No aesthetic, however branded, breaks these:

- **Accessibility**: WCAG AA contrast min (AAA where feasible); full keyboard nav; screen reader semantics; `prefers-reduced-motion` respected; focus indicators visible.
- **Readability**: Body 16px+, line-height 1.5+, line length 50-75ch; hierarchy clear without color; link text distinguishable.
- **Ease of Navigation**: Wayfinding obvious in 3s; primary action dominant per screen; clear path home; breadcrumbs where depth > 2; search discoverable.
- **Function**: Interactions reliable; errors explicit and recoverable; loading states communicated; no dead ends; back/forward predictable.
- **Low Cognitive Overhead**: One primary focal per viewport; clean component boundaries; no decorative noise; progressive disclosure for complexity.

---

## 7. Top-Fold 3-Second First Impression Plan  *(The Output)*
- **Primary Focal Point**: Hero element that anchors the brand moat
- **3-Second Emotional Target**: What user should FEEL after first viewport
- **Brand Materialization at First Glance**: Which texture/typography delivers the moat immediately

---

## Revision History
> Append-only. One line per status change. **Never edited, only appended.**

- YYYY-MM-DD — Status: `Draft` (initial creation)
```

---

## 4. The Workflow

```
┌─ Step 1: INGEST    ─ Read brand-product-alignment-spec.md, extract mental model
├─ Step 2: SYNTHESIZE ─ Fill spec § 1 (anchor) FIRST, then § 2-5 (serve), then § 6 (boundary), then § 7 (output). Present to user.
├─ Step 3: TOKENS     ─ Translate spec to CSS variables (fonts, spacing, materials, motion)
├─ Step 4: BUILD      ─ Implement components per spec
└─ Step 5: VALIDATE   ─ Per-component check (see below). Append iteration entry to progress-map.md.
```

### Step 5 — Per-Component Validation (run for every component shipped)

```
For each component:
  [ ] Section 1 (Anchor): serves brand moat? If not → refactor
  [ ] Section 6 (Boundary): violates UX 101? If yes → refactor
  [ ] Section 7 (Output): contributes to first impression? If no → defer
  [ ] 2nd/3rd idea rule applied? (Not a 1st idea shipping)
  [ ] Hard rules: WCAG AA, 16px+, 1.5+ line-height, keyboard nav — all met
```

If any check fails: **fix before shipping**. Do not move to next component.

---

## 5. The Lifecycle — Status, Transitions, Cascade

Every spec instance carries an explicit Status. Transitions are a state machine.

```mermaid
stateDiagram-v2
    [*] --> Draft
    Draft --> Approved: user sign-off
    Draft --> Draft: iteration
    Approved --> Draft: user changes mind
    Approved --> Locked: implementation starts
    Locked --> Revised: user feedback during impl → CASCADE
    Revised --> Approved: re-audit complete
    Revised --> Draft: major rework needed
    Locked --> Draft: user explicitly requests rollback
```

### Status meanings

| Status | Meaning | Can change? |
|---|---|---|
| `Draft` | Active exploration, user feedback expected | ✅ Freely |
| `Approved` | User signed off, ready for breakdown | ⚠️ Only error fixes, or revert to `Draft` |
| `Locked` | Implementation in progress | ❌ STOP. Cycle to `agentic-dev-loop` for re-scope |
| `Revised` | Updated mid-implementation, cascade triggered | ✅ As part of cascade only |

### Cascade trigger (Locked → Revised)

When transitioning `Locked` → `Revised`, invoke `agentic-dev-loop` "Upstream Cascade & Mid-Flight Re-alignment Protocol":
- Re-open invalidated completed sub-tasks
- Re-audit in-progress work
- Inject corrective sub-tasks into `progress-map.md`
- Append a `## Revision History` line documenting the cascade

---

## 6. Worked Examples — what good looks like

### Example A: High-immersion creative agency brand

> **Status:** `Approved` | **Last Revised:** 2026-07-25

**§ 1 Anchor:**
- Personality: *editorial, sculptural, slow, deliberate, opinionated*
- Emotional Truth: *quiet authority — "we've thought about this longer than you have"*
- Moat: *expressive use of negative space + custom display serif that no template can replicate*
- 2nd/3rd Idea: instead of "big bold hero", we lead with a single quiet word at 30% viewport height
- Anti-Patterns: ❌ stock gradients, ❌ animated stat counters, ❌ "trusted by 5000+ companies"

**§ 2 Material:** Subtle paper-grain texture (3% opacity), warm off-white surface (#FAF7F2), high-contrast accent (#1A1A1A)

**§ 3 Spatial:** 200px section padding, 65ch reading width, single-word focal per viewport

**§ 4 Typography:** Display: Fraunces 144 italic. Body: Söhne 16px. Type scale: 1.333x.

**§ 5 Tech:** Minimal — no shader, but custom cursor physics (slow lerp, 200ms follow)

**§ 6 UX 101:** All baseline met. Body 18px, line-height 1.6, full keyboard nav, WCAG AAA on text/background.

**§ 7 First Impression:** Single word "Studio." in Fraunces italic, centered, taking 30% of viewport. Below: thin rule, then "Independent design practice. Est. 2014."

### Example B: Utility fintech dashboard

> **Status:** `Approved` | **Last Revised:** 2026-07-25

**§ 1 Anchor:**
- Personality: *precise, calm, trustworthy, fast, clinical*
- Emotional Truth: *your money is in good hands — "nothing to worry about"*
- Moat: *micro-interaction precision that makes the data feel alive without being animated*
- 2nd/3rd Idea: instead of "playful illustrations + bold colors" (consumer fintech cliché), we lead with monochrome restraint + microscopic tactile feedback
- Anti-Patterns: ❌ confetti animations, ❌ "🚀" emojis, ❌ rounded-corner-everything, ❌ drop shadows for depth

**§ 2 Material:** Flat (anti-grain), surface #FFFFFF, hairline borders (#E5E5E5), zero shadows

**§ 3 Spatial:** 32px section padding, 12px grid, dense table rows (28px line-height)

**§ 4 Typography:** Display: Inter Display (used surgically for numbers, not generic). Body: Inter 14px. Tabular numbers always.

**§ 5 Tech:** None. Moat via micro-interactions only (200ms precise spring on hover, 80ms on click).

**§ 6 UX 101:** All baseline met. Keyboard shortcuts documented. Screen reader tested with NVDA.

**§ 7 First Impression:** Account balance in 36px Inter Display, last transaction 2 lines below in 14px. Total visual weight: 70% data, 30% chrome.

### Anti-example (DO NOT DO) — generic SaaS

> ❌ **What 90% of competitors ship:** Purple gradient hero, "Welcome to [Product]" headline, "Get started free" CTA, 3-column feature grid with stock icons, customer logos row, "Trusted by 10,000+ teams" footer.

Why this fails: every lens fails (Personality — none; Emotional Truth — generic; Moat — none; Anti-Patterns — every cliché). The agent's job is to **never ship this**.

---

## 7. Failure Modes — decision playbook

When the user pushes back, here's how to respond:

| User says | Agent response |
|---|---|
| "This is too abstract, give me something concrete" | Show § 1 with 3-5 specific personality adjectives + 1 sensory direction ("try: editorial, sculptural, slow, deliberate, opinionated — the hero will be one quiet word"). Don't abandon § 1, make it concrete. |
| "I don't agree with the 2nd/3rd idea commitment" | Curious: "What specifically about it? Is it the type of non-obvious choice, or this specific choice? If the type, we should keep the principle. If this one, suggest an alternative and we re-validate against the 4 lenses." |
| "I changed my mind on the brand moat" | Update § 1, append to `## Revision History`, transition status per § 5 (Draft → Draft, no cascade). If currently `Locked`, treat as cascade trigger. |
| "Just give me a hero, skip the rest" | Inform: "Without § 1 (anchor) and § 6 (boundary), the hero has no brand moat and may break UX 101. 5 minutes on § 1 first, then hero in 10. Sound fair?" |
| "Use Inter like everyone else" | Inform: "Worth knowing — Inter is banned by § 2.D because our brand's typography is one of our moats. If you want a system font, we can customize `system-ui` with letter-spacing and stylistic sets. Want to go that direction?" |
| "Can we add an animation/shader for fun?" | Evaluate against § 2.E. If dashboard (utility), say no. If marketing page (immersive), say yes but reference § 6 isolation. Never add to "make it fun" — only to "serve the moat". |
| "I'm not a designer, just pick something for me" | OK, but **propose 2 options** (both anchored in § 1) and explain trade-offs in plain language. Never make the choice silently. |
| "The moat and the implementation conflict" | Moat wins, refactor implementation. If implementation can't express moat → escalate to `brand-product-alignment` to revise the moat itself. |
| "The implementation conflicts with UX 101" | UX 101 wins, always. Refactor implementation. Document the constraint in § 6 if not already there. |

### When to escalate (out of skill scope)

- **Brand identity conflict** (moat contradicts `brand-product-alignment-spec.md`) → escalate to `brand-product-alignment`
- **Backend constraint conflict** (moat requires tech backend doesn't support) → escalate to `backend-architect`
- **Mid-iteration rollback** (user wants to revert to a previous version of the spec) → use `git revert` per `agentic-dev-loop` Rollback & Fix-Forward Protocol

---

## 8. Git & Completion

### Git

- **Spec Version Control**: Commit `front-end-design-spec.md` to git root or `docs/specs/` using `docs(ui): ...` prefix
- **Feature Branch**: `feat/ui-design-moat` or `feat/component-name`
- **Issue Linkage**: Reference target GitHub Issues (`Closes #123`) in commits and PR descriptions

### Completion Checklist (verify ALL before declaring done)

```
[ ] brand-product-alignment-spec.md ingested (or status acknowledged)
[ ] front-end-design-spec.md § 1 (Brand Mental Model) captured FIRST
[ ] front-end-design-spec.md § 6 (UX 101 Contract) verified intact
[ ] Status: `Approved` (user sign-off) and committed to git
[ ] Opinionated font faces, spacing tokens, material tokens defined and loaded
[ ] Top-fold hero embodies brand moat (NOT generic beauty) + respects § 6
[ ] All components passed Step 5 per-component validation
[ ] No Hard Rules (§ cheat sheet) violated
[ ] If any medium-severity finding from code-review: tracked in progress-map.md
```

---

## Appendix — Anti-sycophancy reminder

This skill exists to serve the brand and the user. It does NOT exist to:
- Make the user feel good about a bad idea
- Agree because the user is confident
- Ship generic beauty because the user said "looks good"
- Soften UX 101 because "we can fix it later"

If the user proposes something that violates § 1, § 6, or the Hard Rules: **say so**, with reason, and propose a brand-anchored alternative.
