diff --git a/.claude/commands/workflow/ui-design/explore-auto-v2.md b/.claude/commands/workflow/ui-design/explore-auto-v2.md index 3cc3c0ab..b6c5703a 100644 --- a/.claude/commands/workflow/ui-design/explore-auto-v2.md +++ b/.claude/commands/workflow/ui-design/explore-auto-v2.md @@ -24,11 +24,18 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Glob(*), Write(* **Autonomous Flow** (⚠️ CONTINUOUS EXECUTION - DO NOT STOP): 1. User triggers: `/workflow:ui-design:explore-auto-v2 [params]` -2. Phase 1 (style-extract) → **WAIT for completion** → Auto-continues -3. Phase 2 (style-consolidate) → **WAIT for completion** → Auto-continues -4. **Phase 3 (ui-generate-v2)** → **WAIT for completion** → Auto-continues -5. Phase 4 (design-update) → **WAIT for completion** → Auto-continues -6. Phase 5 (batch-plan, optional) → Reports completion +2. Phase 0c: Target confirmation → User confirms → **IMMEDIATELY triggers Phase 1** +3. Phase 1 (style-extract) → **WAIT for completion** → Auto-continues +4. Phase 2 (style-consolidate) → **WAIT for completion** → Auto-continues +5. **Phase 3 (ui-generate-v2)** → **WAIT for completion** → Auto-continues +6. Phase 4 (design-update) → **WAIT for completion** → Auto-continues +7. Phase 5 (batch-plan, optional) → Reports completion + +**Phase Transition Mechanism**: +- **Phase 0c (User Interaction)**: User confirms targets → IMMEDIATELY triggers Phase 1 +- **Phase 1-5 (Autonomous)**: `SlashCommand` is BLOCKING - execution pauses until completion +- Upon each phase completion: Automatically process output and execute next phase +- No additional user interaction after Phase 0c confirmation **Auto-Continue Mechanism**: TodoWrite tracks phase status. Upon each phase completion, you MUST immediately construct and execute the next phase command. No user intervention required. The workflow is NOT complete until reaching Phase 4 (or Phase 5 if --batch-plan). @@ -186,6 +193,10 @@ MATCH user_input: default → proceed with current list STORE: inferred_target_list, target_type, target_inference_source + +# ⚠️ CRITICAL: User confirmation complete, IMMEDIATELY initialize TodoWrite and execute Phase 1 +# This is the only user interaction point in the workflow +# After this point, all subsequent phases execute automatically without user intervention ``` **Helper Function: detect_target_type()** @@ -209,8 +220,8 @@ command = "/workflow:ui-design:extract --base-path \"{base_path}\" " + SlashCommand(command) # Output: {style_variants} style cards with design_attributes -# WAIT for extract command to complete, then IMMEDIATELY continue to Phase 2 -# DO NOT STOP - Phase 2 must execute automatically +# SlashCommand blocks until phase complete +# Upon completion, IMMEDIATELY execute Phase 2 (auto-continue) ``` ### Phase 2: Style Consolidation @@ -220,8 +231,8 @@ command = "/workflow:ui-design:consolidate --base-path \"{base_path}\" " + SlashCommand(command) # Output: {style_variants} independent design systems with tokens.css -# WAIT for consolidate command to complete, then IMMEDIATELY continue to Phase 3 -# DO NOT STOP - Phase 3 must execute automatically +# SlashCommand blocks until phase complete +# Upon completion, IMMEDIATELY execute Phase 3 (auto-continue) ``` ### Phase 3: Style-Centric Matrix UI Generation @@ -241,8 +252,8 @@ REPORT: " → Style-centric generation: Each of {style_variants} agents handle SlashCommand(command) -# WAIT for generate-v2 command to complete, then IMMEDIATELY continue to Phase 4 -# DO NOT STOP - Phase 4 must execute automatically +# SlashCommand blocks until phase complete +# Upon completion, IMMEDIATELY execute Phase 4 (auto-continue) # Output: # - {target}-layout-{l}.json (target-specific layout plans) # - {target}-style-{s}-layout-{l}.html (final prototypes with style-aware structure) @@ -255,9 +266,10 @@ SlashCommand(command) command = "/workflow:ui-design:update" + (--session ? " --session {session_id}" : "") SlashCommand(command) -# WAIT for update command to complete -# If --batch-plan flag present: IMMEDIATELY continue to Phase 5 -# If no --batch-plan: Workflow complete, display final report +# SlashCommand blocks until phase complete +# Upon completion: +# - If --batch-plan flag present: IMMEDIATELY execute Phase 5 (auto-continue) +# - If no --batch-plan: Workflow complete, display final report ``` ### Phase 5: Batch Task Generation (Optional) @@ -270,7 +282,7 @@ IF --batch-plan: ## TodoWrite Pattern ```javascript -// Initialize at workflow start to track multi-phase execution +// Initialize IMMEDIATELY after Phase 0c user confirmation to track multi-phase execution TodoWrite({todos: [ {"content": "Execute style extraction", "status": "in_progress", "activeForm": "Executing..."}, {"content": "Execute style consolidation", "status": "pending", "activeForm": "Executing..."}, @@ -278,10 +290,11 @@ TodoWrite({todos: [ {"content": "Execute design integration", "status": "pending", "activeForm": "Executing..."} ]}) -// ⚠️ CRITICAL: After EACH phase completion, you MUST: -// 1. Update current phase: status → "completed" -// 2. Update next phase: status → "in_progress" -// 3. Continue to execute next phase immediately +// ⚠️ CRITICAL: After EACH SlashCommand completion (Phase 1-5), you MUST: +// 1. SlashCommand blocks and returns when phase is complete +// 2. Update current phase: status → "completed" +// 3. Update next phase: status → "in_progress" +// 4. IMMEDIATELY execute next phase SlashCommand (auto-continue) // This ensures continuous workflow tracking and prevents premature stopping ``` diff --git a/.claude/commands/workflow/ui-design/extract.md b/.claude/commands/workflow/ui-design/extract.md index 729f7ba3..b211a7d2 100644 --- a/.claude/commands/workflow/ui-design/extract.md +++ b/.claude/commands/workflow/ui-design/extract.md @@ -73,7 +73,7 @@ IF extraction_mode == "auto": extraction_mode = (variants_count == 1) ? "imitate" : "explore" REPORT: "🔍 Auto-detected mode: {extraction_mode} (variants_count={variants_count})" -# Skip divergence analysis for imitate mode +# Branch: Skip or Execute divergence analysis IF extraction_mode == "imitate": REPORT: "🎯 IMITATE MODE: High-fidelity single style extraction" REPORT: " → Skipping design space divergence analysis" @@ -82,6 +82,8 @@ IF extraction_mode == "imitate": # Skip to Phase 2 GOTO Phase 2 +# ELSE: REQUIRED execution path for explore mode +# ⚠️ CRITICAL: The following steps (Step 1-3) MUST be executed when extraction_mode == "explore" # Step 1: Load project context (explore mode only) project_context = "" IF exists({base_path}/.brainstorming/synthesis-specification.md): @@ -89,9 +91,12 @@ IF exists({base_path}/.brainstorming/synthesis-specification.md): ELSE IF exists({base_path}/.brainstorming/ui-designer/analysis.md): project_context = Read(ui-designer/analysis.md) -REPORT: "🎨 EXPLORE MODE: Analyzing design space to generate maximally contrasting directions..." +REPORT: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +REPORT: "🎨 EXPLORE MODE: Analyzing design space (REQUIRED)" +REPORT: " → Generating {variants_count} maximally contrasting directions" +REPORT: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -# Step 2: AI-driven divergent direction generation +# Step 2: AI-driven divergent direction generation (REQUIRED) divergence_prompt = """ Analyze user requirements and generate {variants_count} MAXIMALLY CONTRASTING design directions. @@ -132,7 +137,7 @@ RULES: Output ONLY valid JSON, maximize inter-variant distance, ensure each vari occupies distinct aesthetic region, avoid overlapping attributes """ -# Execute AI analysis +# Execute AI analysis (REQUIRED in explore mode) divergent_directions = parse_json(Claude_Native_Analysis(divergence_prompt)) REPORT: "✅ Generated {variants_count} contrasting design directions:" @@ -141,10 +146,17 @@ FOR direction IN divergent_directions.divergent_directions: design_space_analysis = divergent_directions -# Step 3: Save design space analysis for consolidation phase -Write({file_path: "{base_path}/style-extraction/design-space-analysis.json", +# Step 3: Save design space analysis for consolidation phase (REQUIRED) +# ⚠️ CRITICAL: This file MUST be generated in explore mode for downstream consolidation +output_file_path = "{base_path}/style-extraction/design-space-analysis.json" +Write({file_path: output_file_path, content: JSON.stringify(design_space_analysis, null, 2)}) + REPORT: "💾 Saved design space analysis to design-space-analysis.json" + +# Verification step (REQUIRED) +VERIFY: file_exists(output_file_path) == true +REPORT: "✅ Verified: design-space-analysis.json exists ({file_size(output_file_path)} bytes)" ``` ### Phase 2: Variant-Specific Style Synthesis & Direct File Write @@ -232,8 +244,8 @@ REPORT: "💾 Saved {variants_count} style variants to style-cards.json" TodoWrite({todos: [ {content: "Validate inputs and create directories", status: "completed", activeForm: "Validating inputs"}, {content: extraction_mode == "explore" ? "Analyze design space for maximum contrast" : "Skip design space analysis (imitate mode)", status: "completed", activeForm: extraction_mode == "explore" ? "Analyzing design space" : "Skipping analysis"}, - {content: extraction_mode == "explore" ? `Generate ${variants_count} divergent design directions` : "Prepare for high-fidelity extraction", status: "completed", activeForm: extraction_mode == "explore" ? "Generating directions" : "Preparing extraction"}, - {content: extraction_mode == "explore" ? "Save design space analysis for consolidation" : "Skip design space output", status: "completed", activeForm: extraction_mode == "explore" ? "Saving design space analysis" : "Skipping output"}, + {content: extraction_mode == "explore" ? `Generate ${variants_count} divergent design directions (REQUIRED)` : "Prepare for high-fidelity extraction", status: "completed", activeForm: extraction_mode == "explore" ? "Generating directions" : "Preparing extraction"}, + {content: extraction_mode == "explore" ? `Write and verify design-space-analysis.json (REQUIRED)` : "Skip design space output", status: "completed", activeForm: extraction_mode == "explore" ? "Writing and verifying file" : "Skipping output"}, {content: `Generate and write ${variants_count} ${extraction_mode == "explore" ? "contrasting" : "high-fidelity"} style variant${variants_count > 1 ? "s" : ""} to file`, status: "completed", activeForm: "Generating and writing variants"} ]}); ``` diff --git a/.claude/commands/workflow/ui-design/generate-v2.md b/.claude/commands/workflow/ui-design/generate-v2.md index 3b512196..0e1cd255 100644 --- a/.claude/commands/workflow/ui-design/generate-v2.md +++ b/.claude/commands/workflow/ui-design/generate-v2.md @@ -1,6 +1,6 @@ --- name: generate-v2 -description: Generate UI prototypes using style-centric batch generation +description: Generate UI prototypes using target-style-centric batch generation usage: /workflow:ui-design:generate-v2 [--targets ""] [--target-type "page|component"] [--base-path ] [--session ] [--style-variants ] [--layout-variants ] examples: - /workflow:ui-design:generate-v2 --session WFS-auth --targets "dashboard,settings" --style-variants 3 --layout-variants 3 @@ -9,20 +9,21 @@ examples: allowed-tools: TodoWrite(*), Read(*), Write(*), Task(ui-design-agent), Bash(*) --- -# UI Generation Command (Style-Centric Architecture) +# UI Generation Command (Target-Style-Centric Architecture) **Executor**: → @ui-design-agent -**Parallel Generation**: Phase 2 → @ui-design-agent (S tasks, each handling L×T combinations) +**Parallel Generation**: Phase 2 → @ui-design-agent (T×S tasks, each handling L layouts) ## Overview -Generate production-ready UI prototypes (HTML/CSS) using **style-centric batch generation**. Each agent handles all layout × target combinations for one style, ensuring maximum style consistency and optimal performance. +Generate production-ready UI prototypes (HTML/CSS) using **target-style-centric batch generation**. Each agent handles all layout variants for one target × one style combination, ensuring component isolation and focused generation. ## Core Philosophy -- **Style-Centric Batching**: Each of S agents generates ALL L×T prototypes for one style +- **Target-Style-Centric**: Each of T×S agents generates L layouts for one target × one style +- **Component Isolation**: Tasks completely independent, preventing cross-component interference - **Style-Aware Structure**: HTML DOM adapts based on design_attributes (density, visual_weight, etc.) -- **Performance Optimized**: S agent calls for efficient generation -- **Perfect Style Consistency**: All layouts for a style generated by single agent with full context -- **Token-Driven Styling**: All styles reference design-tokens.json via tokens.css +- **Performance Optimized**: T×S agent calls with highly focused scope per agent +- **Layout Inspiration**: Simple text-based research replaces complex JSON planning +- **Self-Contained CSS**: Agent reads design-tokens.json and creates independent CSS (no token.css reference) - **Production-Ready**: Semantic HTML5, ARIA attributes, responsive design ## Execution Protocol @@ -96,7 +97,6 @@ STORE: target_list, target_type # 5. Verify design systems exist FOR style_id IN range(1, style_variants + 1): VERIFY: exists({base_path}/style-consolidation/style-{style_id}/design-tokens.json) - VERIFY: exists({base_path}/style-consolidation/style-{style_id}/tokens.css) # 6. Load design space analysis (for style-aware generation) design_space_path = "{base_path}/style-extraction/design-space-analysis.json" @@ -114,400 +114,222 @@ ELSE: synthesis_spec = null ``` -### Phase 1.5: Target-Specific Layout Planning +### Phase 1.5: Target Layout Inspiration ```bash -REPORT: "📐 Planning {layout_variants} layout strategies for each target..." +REPORT: "💡 Gathering layout inspiration for {len(target_list)} targets..." -CREATE: {base_path}/prototypes/_templates/ +CREATE: {base_path}/prototypes/_inspirations/ -# For each target, plan its specific layouts +# For each target, gather layout inspiration via MCP search FOR target IN target_list: - REPORT: " Planning layouts for '{target}' ({target_type})..." + REPORT: " Researching '{target}' ({target_type}) layout patterns..." - FOR layout_id IN range(1, layout_variants + 1): - Task(ui-design-agent): " - [TARGET_LAYOUT_PLANNING] + # MCP search for layout patterns + search_query = f"common {target} {target_type} layout patterns variations best practices" + search_results = mcp__exa__web_search_exa( + query=search_query, + numResults=5 + ) - TARGET: {target} | TARGET_TYPE: {target_type} | LAYOUT_ID: {layout_id}/{layout_variants} - BASE_PATH: {base_path} - {IF synthesis_spec: PROJECT_REQUIREMENTS: {synthesis_spec}} + # Extract key layout patterns from search results + inspiration_content = f"""Layout Inspiration for '{target}' ({target_type}) +Generated: {current_timestamp()} +Search Query: {search_query} - ## Task - Research common {target} {target_type} layout variations and select the #{layout_id} approach. - Generate layout plan JSON that is STRUCTURALLY DIFFERENT from other layout IDs. +## Layout Patterns Identified - ## Research (MCP Required) - mcp__exa__web_search_exa( - query=\"common {target} {target_type} layout patterns variations best practices 2024\", - numResults=5 - ) +From web research, {layout_variants} distinct layout approaches: - ## Selection Strategy - From search results, identify multiple layout variations and select approach #{layout_id}. - Ensure each layout_id uses a DIFFERENT structural pattern (not just styling differences). +Layout 1: [First structural pattern identified from search] +- Key characteristics: ... +- Structure approach: ... - ## Output File - Write(\"{base_path}/prototypes/_templates/{target}-layout-{layout_id}.json\", layout_plan_json) +Layout 2: [Second structural pattern] +- Key characteristics: ... +- Structure approach: ... - ## JSON Structure (Required Fields) - ```json - {{ - \"id\": \"layout-{layout_id}\", - \"target\": \"{target}\", - \"target_type\": \"{target_type}\", - \"name\": \"Descriptive name (2-4 words)\", - \"description\": \"2-3 sentences\", - \"structure\": {{ - // IF page: type, regions, grid, sidebar, responsive - // IF component: arrangement, alignment, spacing, element_order - }}, - \"semantic_hints\": [...], - \"accessibility_features\": [...], - \"research_references\": [...] - }} - ``` +Layout 3: [Third structural pattern] +- Key characteristics: ... +- Structure approach: ... - ## Requirements - - Research-informed, target-specific, meaningfully different from other layout IDs - - Write file directly (not text output) - " +## Reference Links +{format_search_results_urls(search_results)} -# Wait for all agent tasks to complete -REPORT: "⏳ Waiting for layout planning agents to complete..." +## Implementation Notes +- Each layout should be STRUCTURALLY DIFFERENT (not just CSS variations) +- Consider {target_type}-specific patterns (navigation, content areas, interactions) +- Adapt structure based on design_attributes in Phase 2 +""" -# Verify agent created layout JSON files -REPORT: "📝 Verifying agent file creation..." + # Write simple inspiration file + inspiration_file = f"{base_path}/prototypes/_inspirations/{target}-layout-ideas.txt" + Write(inspiration_file, inspiration_content) -FOR target IN target_list: - FOR layout_id IN range(1, layout_variants + 1): - layout_json_label = f"{target}-layout-{layout_id}.json" - json_path = f"{base_path}/prototypes/_templates/{layout_json_label}" + REPORT: f" ✓ Created: {target}-layout-ideas.txt" - # Verify file exists - VERIFY: exists(json_path), f"Layout JSON not created by agent: {layout_json_label}" - - # Validate JSON structure - TRY: - layout_json_content = Read(json_path) - layout_plan = JSON.parse(layout_json_content) - - # Validate required fields - VALIDATE: layout_plan.id == f"layout-{layout_id}", f"Invalid layout ID in {layout_json_label}" - VALIDATE: layout_plan.target == target, f"Invalid target in {layout_json_label}" - VALIDATE: layout_plan.target_type == target_type, f"Invalid target_type in {layout_json_label}" - VALIDATE: layout_plan.name exists, f"Missing 'name' field in {layout_json_label}" - VALIDATE: layout_plan.structure exists, f"Missing 'structure' field in {layout_json_label}" - - file_size = get_file_size(json_path) - REPORT: f" ✓ Verified: {layout_json_label} - {layout_plan.name} ({file_size} KB)" - CATCH error: - ERROR: f"Validation failed for {layout_json_label}: {error}" - REPORT: f" ⚠️ File exists but validation failed - review agent output" - -REPORT: f"✅ Phase 1.5 complete: Verified {len(target_list) × layout_variants} target-specific layout files" +REPORT: f"✅ Phase 1.5 complete: Gathered inspiration for {len(target_list)} targets" ``` -### Phase 1.6: Convert Design Tokens to CSS -```bash -REPORT: "🎨 Converting design tokens to CSS variables..." +### Phase 2: Target-Style-Centric Batch Generation -# Check for jq dependency -IF NOT command_exists("jq"): - ERROR: "jq is not installed or not in PATH. The conversion script requires jq." - REPORT: "Please install jq: macOS: brew install jq | Linux: apt-get install jq | Windows: https://stedolan.github.io/jq/download/" - EXIT 1 - -# Convert design tokens to CSS for each style variant -FOR style_id IN range(1, style_variants + 1): - tokens_json_path = "{base_path}/style-consolidation/style-${style_id}/design-tokens.json" - tokens_css_path = "{base_path}/style-consolidation/style-${style_id}/tokens.css" - script_path = "~/.claude/scripts/convert_tokens_to_css.sh" - - # Verify input file exists - VERIFY: exists(tokens_json_path), f"Design tokens not found for style-{style_id}" - - # Execute conversion: cat input.json | script.sh > output.css - Bash(cat "${tokens_json_path}" | "${script_path}" > "${tokens_css_path}") - - # Verify output was generated - IF exit_code == 0 AND exists(tokens_css_path): - file_size = get_file_size(tokens_css_path) - REPORT: f" ✓ Generated tokens.css for style-{style_id} ({file_size} KB)" - ELSE: - ERROR: f"Failed to generate tokens.css for style-{style_id}" - EXIT 1 - -REPORT: f"✅ Phase 1.6 complete: Converted {style_variants} design token files to CSS" -``` - -### Phase 1.7: Extract Token Variable Names from CSS -```bash -REPORT: "📋 Extracting actual CSS variable names from tokens.css..." -tokens_css_path = "{base_path}/style-consolidation/style-1/tokens.css" -VERIFY: exists(tokens_css_path), "tokens.css not found. Phase 1.6 may have failed." - -tokens_css_content = Read(tokens_css_path) - -# Extract all CSS variable names from the generated file -# Pattern: --variable-name: value; -all_token_vars = extract_css_variables(tokens_css_content) # Regex: r'--([a-z0-9-_]+):' - -# Categorize variables for better Agent understanding -color_vars = [v for v in all_token_vars if v.startswith('--color-')] -typography_vars = [v for v in all_token_vars if v.startswith(('--font-', '--line-height-', '--letter-spacing-'))] -spacing_vars = [v for v in all_token_vars if v.startswith('--spacing-')] -radius_vars = [v for v in all_token_vars if v.startswith('--border-radius-')] -shadow_vars = [v for v in all_token_vars if v.startswith('--shadow-')] -breakpoint_vars = [v for v in all_token_vars if v.startswith('--breakpoint-')] - -REPORT: f"✅ Extracted {len(all_token_vars)} actual CSS variables from tokens.css" -REPORT: f" Colors: {len(color_vars)} | Typography: {len(typography_vars)} | Spacing: {len(spacing_vars)}" -``` - -### Phase 2: Style-Centric Batch Generation - -**Strategy**: S style-centric agents, each generating L×T prototypes for one style. -**Performance**: S agent calls for parallel execution +**Strategy**: T×S target-style-centric agents, each generating L layouts for one target × one style. +**Performance**: T×S agent calls with component isolation ```bash -REPORT: "🎨 Phase 2: Launching {style_variants} style-centric agents..." -REPORT: " Each agent generates {layout_variants}×{len(target_list)}={layout_variants * len(target_list)} prototypes" +REPORT: "🎨 Phase 2: Launching {len(target_list)}×{style_variants}={len(target_list) * style_variants} target-style agents..." +REPORT: " Each agent generates {layout_variants} layouts for one component" CREATE: {base_path}/prototypes/ -# Launch ONE agent task PER STYLE (parallel execution) -FOR style_id IN range(1, style_variants + 1): - # Load style-specific context - style_tokens_path = "{base_path}/style-consolidation/style-{style_id}/design-tokens.json" - style_css_path = "{base_path}/style-consolidation/style-{style_id}/tokens.css" - style_guide_path = "{base_path}/style-consolidation/style-{style_id}/style-guide.md" +# Launch ONE agent task PER TARGET × STYLE combination (parallel execution) +FOR target IN target_list: + # Load layout inspiration for this target + inspiration_path = f"{base_path}/prototypes/_inspirations/{target}-layout-ideas.txt" - # Extract design attributes for this style (if available) - IF design_space_analysis AND style_id <= len(design_space_analysis.divergent_directions): - design_attributes = design_space_analysis.divergent_directions[style_id - 1] - philosophy_name = design_attributes.philosophy_name - attributes_summary = JSON.stringify({ - density: design_attributes.design_attributes.density, - visual_weight: design_attributes.design_attributes.visual_weight, - formality: design_attributes.design_attributes.formality, - organic_vs_geometric: design_attributes.design_attributes.organic_vs_geometric, - innovation: design_attributes.design_attributes.innovation - }) - ELSE: - design_attributes = null - philosophy_name = f"Style {style_id}" - attributes_summary = "No design attributes available" + FOR style_id IN range(1, style_variants + 1): + # Load style-specific context + style_tokens_path = f"{base_path}/style-consolidation/style-{style_id}/design-tokens.json" + style_guide_path = f"{base_path}/style-consolidation/style-{style_id}/style-guide.md" - Task(ui-design-agent): """ - [STYLE_CENTRIC_UI_BATCH_GENERATION] + # Extract design attributes for this style (if available) + IF design_space_analysis AND style_id <= len(design_space_analysis.divergent_directions): + design_attributes = design_space_analysis.divergent_directions[style_id - 1] + philosophy_name = design_attributes.philosophy_name + attributes_summary = JSON.stringify({ + density: design_attributes.design_attributes.density, + visual_weight: design_attributes.design_attributes.visual_weight, + formality: design_attributes.design_attributes.formality, + organic_vs_geometric: design_attributes.design_attributes.organic_vs_geometric, + innovation: design_attributes.design_attributes.innovation + }) + ELSE: + design_attributes = null + philosophy_name = f"Style {style_id}" + attributes_summary = "No design attributes available" - ## 🎯 Mission - Generate COMPLETE set of UI prototypes for Style-{style_id} across ALL targets and layouts. - Total files to create: {layout_variants × len(target_list) × 2} (HTML + CSS pairs) + Task(ui-design-agent): """ + [TARGET_STYLE_UI_GENERATION] - ## 🎨 Style Context (Your Design Identity) - STYLE_ID: {style_id} - PHILOSOPHY: {philosophy_name} + ## 🎯 Mission + Generate {layout_variants} layout variants for: {target} × Style-{style_id} ({philosophy_name}) + Output: {layout_variants × 2} files ({layout_variants} HTML + {layout_variants} CSS) - {IF design_attributes: - DESIGN_ATTRIBUTES: {attributes_summary} - - density: {design_attributes.design_attributes.density} → Affects spacing, container usage - - visual_weight: {design_attributes.design_attributes.visual_weight} → Affects borders, shadows, nesting - - formality: {design_attributes.design_attributes.formality} → Affects font choices, structure formality - - organic_vs_geometric: {design_attributes.design_attributes.organic_vs_geometric} → Affects border-radius, alignment - - innovation: {design_attributes.design_attributes.innovation} → Affects layout adventurousness - } + ## 🎨 Style Context + PHILOSOPHY: {philosophy_name} + {IF design_attributes: + DESIGN_ATTRIBUTES: {attributes_summary} + Key impacts: + - density → DOM nesting depth, whitespace scale + - visual_weight → wrapper layers, border/shadow strength + - formality → semantic structure choices + - organic_vs_geometric → alignment, edge treatment + - innovation → layout adventurousness + } - STYLE_FILES: - - Design Tokens: {style_tokens_path} - - CSS Variables: {style_css_path} - - Style Guide: {style_guide_path} + ## 📂 Input Resources + **Design System**: + - Design Tokens (JSON): {style_tokens_path} + - Style Guide: {style_guide_path} - ## 📋 Batch Generation Matrix - TARGETS: {target_list} # Example: [dashboard, settings] - LAYOUTS: 1 to {layout_variants} # Example: [1, 2, 3] - TOTAL_COMBINATIONS: {layout_variants × len(target_list)} - TARGET_TYPE: {target_type} + **Layout Inspiration**: {inspiration_path} + Contains {layout_variants} distinct structural patterns - ## 🔄 Required Execution Loop + **Target**: {target} ({target_type}) - You MUST implement this nested loop to generate all combinations: + ## 🔄 Generation Steps (for each layout 1..{layout_variants}) - ```pseudocode - FOR target IN {target_list}: - FOR layout_id IN [1..{layout_variants}]: - # Step 1: Load layout plan - layout_plan_path = "{base_path}/prototypes/_templates/{target}-layout-{layout_id}.json" - layout_plan = Read(layout_plan_path) + **1. Read Inspiration** + - Load: {inspiration_path} + - Apply layout N pattern - # Step 2: Load CSS variables (to know what tokens exist) - tokens_css = Read("{style_css_path}") - available_vars = extract_all_css_variables(tokens_css) # Pattern: --variable-name: + **2. Read Design Tokens** + - Load: {style_tokens_path} + - Parse JSON structure and extract all design token values + - Understand token categories: colors, typography, spacing, shadows, borders, etc. - # Step 3: Generate STYLE-AWARE HTML structure - # ⚠️ CRITICAL: Structure must adapt based on design_attributes! + **3. Generate HTML Structure** + - Complete HTML5 document (, , , ) + - Semantic elements:
,