From 043a3f05ba23022a5233be00ab3cae36bac5858c Mon Sep 17 00:00:00 2001 From: catlog22 Date: Fri, 10 Oct 2025 17:05:11 +0800 Subject: [PATCH] refactor(ui-design): optimize layout planning to prevent architecture homogenization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace exa-code with web-search for diverse layout inspiration - Simplify from keyword pools to direct "common variations" search - Add selection strategy for agents to pick different structural patterns - Support unlimited layout variants with natural diversity Impact: Prevents layout architecture convergence by leveraging web search for real-world layout variations instead of code examples. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../commands/workflow/ui-design/generate-v2.md | 15 ++++++++++----- .claude/commands/workflow/ui-design/generate.md | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.claude/commands/workflow/ui-design/generate-v2.md b/.claude/commands/workflow/ui-design/generate-v2.md index dad6f9ae..3b512196 100644 --- a/.claude/commands/workflow/ui-design/generate-v2.md +++ b/.claude/commands/workflow/ui-design/generate-v2.md @@ -128,19 +128,24 @@ FOR target IN target_list: Task(ui-design-agent): " [TARGET_LAYOUT_PLANNING] - TARGET: {target} | TARGET_TYPE: {target_type} | LAYOUT_ID: {layout_id} + TARGET: {target} | TARGET_TYPE: {target_type} | LAYOUT_ID: {layout_id}/{layout_variants} BASE_PATH: {base_path} {IF synthesis_spec: PROJECT_REQUIREMENTS: {synthesis_spec}} ## Task - Research and generate layout plan JSON for '{target}' ({target_type}). + 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. ## Research (MCP Required) - mcp__exa__get_code_context_exa( - query=\"modern {target} {target_type} layout patterns 2024 2025\", - tokensNum=\"dynamic\" + mcp__exa__web_search_exa( + query=\"common {target} {target_type} layout patterns variations best practices 2024\", + numResults=5 ) + ## 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). + ## Output File Write(\"{base_path}/prototypes/_templates/{target}-layout-{layout_id}.json\", layout_plan_json) diff --git a/.claude/commands/workflow/ui-design/generate.md b/.claude/commands/workflow/ui-design/generate.md index 6cbece70..83cf8e6d 100644 --- a/.claude/commands/workflow/ui-design/generate.md +++ b/.claude/commands/workflow/ui-design/generate.md @@ -119,19 +119,24 @@ FOR target IN target_list: Task(ui-design-agent): " [TARGET_LAYOUT_PLANNING] - TARGET: {target} | TARGET_TYPE: {target_type} | LAYOUT_ID: {layout_id} + TARGET: {target} | TARGET_TYPE: {target_type} | LAYOUT_ID: {layout_id}/{layout_variants} BASE_PATH: {base_path} {IF --session: PROJECT_REQUIREMENTS: .workflow/WFS-{session}/.brainstorming/synthesis-specification.md} ## Task - Research and generate layout plan JSON for '{target}' ({target_type}). + 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. ## Research (MCP Required) - mcp__exa__get_code_context_exa( - query=\"modern {target} {target_type} layout patterns 2024 2025\", - tokensNum=\"dynamic\" + mcp__exa__web_search_exa( + query=\"common {target} {target_type} layout patterns variations best practices 2024\", + numResults=5 ) + ## 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). + ## Output File Write(\"{base_path}/prototypes/_templates/{target}-layout-{layout_id}.json\", layout_plan_json)