Skip to main content

Cycle 380: UI Design Skill — Research-First UI Workflow

Priority: MEDIUM Status: IMPLEMENTED Domain: Developer Experience (DX) Dependencies: None Issue: #380 PR: #373

Objective

Build a project-local Claude Code skill (.claude/skills/ui-design/) that enforces a research-first, screenshot-driven UI design workflow for the Flux frontend. The skill fires when building new pages, views, or visually significant features — not for minor tweaks or bug fixes. The skill ensures every significant UI decision is:
  1. Preceded by a delivery mode decision (standalone page vs generative UI vs hybrid)
  2. Backed by SOTA research (3-5 best-in-class references)
  3. Approved by the user before implementation begins
  4. Validated with real Playwright screenshots at mobile and desktop viewports
  5. Documented as durable artifacts in docs/design/cycle-{N}/

Key Decisions

DecisionChoiceRationale
ScopeProject-local skillDeeply Flux-specific — embeds DDD, schema pipeline, component conventions, chat integration
Location.claude/skills/ui-design/Committed with the repo, only fires in Flux
TriggerNarrowResearch + screenshot loop is overkill for “add a tooltip”
Workflow4 phases with exit rampsPhase 0 (delivery mode) → Phase 1 (research) → Phase 2 (build + iterate) → Phase 3 (finalize + artifact)
Preview routeAuthenticated inside (protected)No middleware auth holes — dev-only notFound() guard
API types@/types/api barrel exportNever import from web/generated/api/ directly
ArtifactsScreenshots + design brief + component inventoryFull design spec in docs/design/, cycle doc just links to it

Deliverables

Skill Files (.claude/skills/ui-design/)

FilePurpose
SKILL.md4-phase workflow with trigger rubric, exit ramps, completion checklist (220 lines)
references/flux-stack.mdNext.js 15.5, React 19, shadcn/ui, Tailwind v4, route groups, schema pipeline
references/component-conventions.mdDDD component organization, naming, file placement, loading states, data fetching
references/design-system.mdDesign tokens from globals.css — colors, radii, spacing, typography, dark mode
references/chat-integration.mdThree-tier rich content (artifacts, inline visuals, client-side tools), usePageChatContext, generative UI registry (7 tools), session strategy
templates/design-brief.mdTemplate for design brief artifacts
templates/component-inventory.mdTemplate for component inventory checklist

Infrastructure

FilePurpose
docs/design/.gitkeepOutput directory for design artifacts (one subdirectory per cycle)

Phase 0 — UI Delivery Mode (New)

The key architectural addition. Before any visual design work, the skill forces a delivery mode decision:
  • Standalone page — route under (protected) or (public), user navigates directly
  • Generative UI — rich content AI renders inside chat (artifacts, inline visuals, client-side tools)
  • Sidebar enrichment — page context flows to chat sidebar via usePageChatContext
  • Hybrid — most features: standalone page + enriched sidebar + generative UI
This reflects Flux’s chat-native architecture where every (protected) page has ChatContextProvider, ContextualChatSidebar, and AskAIButton. Building a “page” always means designing its chat integration.

Design Artifact Structure

docs/design/cycle-{N}/
├── design-brief.md                          # References, decisions, rationale
├── component-inventory.md                   # Every component/page with status
└── screenshots/
    ├── mobile-{page-name}-{state}.png       # 375x812 viewport
    └── desktop-{page-name}-{state}.png      # 1280x800 viewport
Cycle docs link to design artifacts with a ## UI Design section:
See [Design Artifacts](../../design/cycle-{N}/design-brief.md) for approved
visual design, component inventory, and screenshots.

Design Process Documentation

  • Spec: docs/superpowers/specs/2026-04-14-ui-design-skill-spec.md
  • Plan: docs/superpowers/plans/2026-04-14-ui-design-skill.md

Verification

  • Skill fires when asking to “build the candidate portal” (new page/view)
  • Skill does NOT fire for “add a tooltip to the candidate card” (minor tweak)
  • Phase 0 forces delivery mode decision before visual research
  • References accurately reflect repo state (generative UI registry, usePageChatContext, design tokens)
  • First real validation: use this skill for Cycle 206 (Candidate Portal)