--- name: generate description: Generate UI prototypes using consolidated design tokens usage: /workflow:ui-design:generate [--pages ""] [--session ] [--variants ] [--creative-variants ] argument-hint: "[--pages \"dashboard,auth\"] [--session WFS-xxx] [--variants 3] [--creative-variants 3]" examples: - /workflow:ui-design:generate --pages "home,pricing" --variants 2 - /workflow:ui-design:generate --session WFS-auth --pages "dashboard" --creative-variants 4 - /workflow:ui-design:generate --session WFS-auth --variants 3 allowed-tools: TodoWrite(*), Read(*), Write(*), Task(conceptual-planning-agent) --- # UI Generation Command ## Overview Generate production-ready UI prototypes (HTML/CSS) strictly adhering to consolidated design tokens and synthesis specification requirements. ## Core Philosophy - **Dual-Mode Execution**: Standard (consistent) or Creative (exploratory) - **Agent-Driven**: Uses `Task(conceptual-planning-agent)` exclusively - **Token-Driven**: All styles reference design-tokens.json; no hardcoded values - **Production-Ready**: Semantic HTML5, ARIA attributes, responsive design ## Execution Protocol ### Phase 1: Mode Detection & Context Loading ```bash # Detect execution mode IF --creative-variants provided: mode = "creative" # Parallel agents for diverse layouts creative_count = {--creative-variants value} VALIDATE: 1 <= creative_count <= 10 ELSE: mode = "standard" # Single agent, multiple variants variants_count = --variants provided ? {count} : 1 VALIDATE: 1 <= variants_count <= 5 # Detect session mode IF --session: session_mode = "integrated" session_id = {provided_session} base_path = ".workflow/WFS-{session_id}/" ELSE: session_mode = "standalone" # Infer session_id from existing design-session-* directory base_path = "./{detected_design_session}/" # Infer page list if not provided IF --pages provided: page_list = {explicit_pages} ELSE IF session_mode == "integrated": # Read synthesis-specification.md to extract page requirements synthesis_spec = Read({base_path}/.brainstorming/synthesis-specification.md) page_list = extract_pages_from_synthesis(synthesis_spec) ELSE: # Infer from existing prototypes or default page_list = detect_from_prototypes({base_path}/.design/prototypes/) OR ["home"] VALIDATE: page_list not empty # Load design system VERIFY: {base_path}/.design/style-consolidation/design-tokens.json exists design_tokens = Read({base_path}/.design/style-consolidation/design-tokens.json) style_guide = Read({base_path}/.design/style-consolidation/style-guide.md) # Load requirements (if integrated mode) IF session_mode == "integrated": synthesis_spec = Read({base_path}/.brainstorming/synthesis-specification.md) ``` ### Phase 2: UI Generation Execution **Route based on mode**: #### A. Standard Mode (Default) Execute if `mode == "standard"`. Single agent generates multiple variants with consistent layout strategy. ```bash # Create output directory CREATE: {base_path}/.design/prototypes/ # Single agent call generates N variants for all pages Task(conceptual-planning-agent): " [UI_GENERATION] Generate UI prototypes adhering to design tokens ## Context SESSION: {session_id} MODE: standard PAGES: {page_list} VARIANTS_PER_PAGE: {variants_count} OUTPUT: {base_path}/.design/prototypes/ ## Input Files - Design Tokens: {base_path}/.design/style-consolidation/design-tokens.json - Style Guide: {base_path}/.design/style-consolidation/style-guide.md {IF integrated: - Requirements: {base_path}/.brainstorming/synthesis-specification.md} ## Task For each page in [{page_list}], generate {variants_count} variant(s): - {page}-variant-{n}.html (semantic HTML5) - {page}-variant-{n}.css (token-driven, no hardcoded values) - {page}-variant-{n}-notes.md (implementation notes) ## Layout Strategy Use a consistent, modern layout approach across all variants. Variants should differ in: - Component arrangement (e.g., sidebar left vs. right) - Content density (spacious vs. compact) - Navigation style (top-nav vs. side-nav) ## Token Usage Requirements - STRICT adherence to design-tokens.json - All colors: var(--color-brand-primary), var(--color-surface-background), etc. - All spacing: var(--spacing-4), var(--spacing-6), etc. - All typography: var(--font-family-heading), var(--font-size-lg), etc. - NO hardcoded values (e.g., #4F46E5, 16px) allowed ## HTML Requirements - Semantic HTML5 elements (
,