diff --git a/.claude/commands/workflow/ui-design/animation-extract.md b/.claude/commands/workflow/ui-design/animation-extract.md index 1b2217a6..75d6a343 100644 --- a/.claude/commands/workflow/ui-design/animation-extract.md +++ b/.claude/commands/workflow/ui-design/animation-extract.md @@ -50,8 +50,10 @@ IF --focus: ELSE: focus_types = ["all"] # Extract all animation types -# Determine base path -bash(find .workflow -type d -name "design-*" | head -1) # Auto-detect +# Determine base path (auto-detect and convert to absolute) +relative_path=$(find .workflow -type d -name "design-run-*" | head -1) +base_path=$(cd "$relative_path" && pwd) +bash(test -d "$base_path" && echo "✓ Base path: $base_path" || echo "✗ Path not found") # OR use --base-path / --session parameters ``` @@ -777,7 +779,7 @@ Next: Animation tokens ready for integration ```bash # Find design directory -bash(find .workflow -type d -name "design-*" | head -1) +bash(find .workflow -type d -name "design-run-*" | head -1) # Create output directories bash(mkdir -p {base_path}/animation-extraction) diff --git a/.claude/commands/workflow/ui-design/batch-generate.md b/.claude/commands/workflow/ui-design/batch-generate.md index aa1db36f..232d3c03 100644 --- a/.claude/commands/workflow/ui-design/batch-generate.md +++ b/.claude/commands/workflow/ui-design/batch-generate.md @@ -42,9 +42,14 @@ target_type = --target-type OR detect_target_type(target_list) IF --base-path: base_path = --base-path ELSE IF --session: - bash(find .workflow/WFS-{session} -type d -name "design-*" -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow/WFS-{session} -type d -name "design-run-*" -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f2) + base_path=$(cd "$relative_path" && pwd) ELSE: - bash(find .workflow -type d -name "design-*" -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f2) + relative_path=$(find .workflow -type d -name "design-run-*" -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f2) + base_path=$(cd "$relative_path" && pwd) + +# Verify absolute path +bash(test -d "$base_path" && echo "✓ Base path: $base_path" || echo "✗ Path not found") # Get variant counts style_variants = --style-variants OR bash(ls {base_path}/style-extraction/style-* -d | wc -l) @@ -274,7 +279,7 @@ Next: /workflow:ui-design:update ### Path Operations ```bash # Find design directory -bash(find .workflow -type d -name "design-*" -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f2) +bash(find .workflow -type d -name "design-run-*" -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f2) # Count style variants bash(ls {base_path}/style-extraction/style-* -d | wc -l) diff --git a/.claude/commands/workflow/ui-design/capture.md b/.claude/commands/workflow/ui-design/capture.md index 7b498afa..f1fa7b0b 100644 --- a/.claude/commands/workflow/ui-design/capture.md +++ b/.claude/commands/workflow/ui-design/capture.md @@ -18,16 +18,18 @@ Batch screenshot tool with MCP-first strategy and multi-tier fallback. Processes ### Step 1: Determine Base Path ```bash # Priority: --base-path > session > standalone -bash(if [ -n "$BASE_PATH" ]; then +relative_path=$(if [ -n "$BASE_PATH" ]; then echo "$BASE_PATH" elif [ -n "$SESSION_ID" ]; then find .workflow/WFS-$SESSION_ID/design-* -type d | head -1 || \ - echo ".workflow/WFS-$SESSION_ID/design-run-$(date +%Y%m%d-%H%M%S)" + echo ".workflow/WFS-$SESSION_ID/design-run-$(date +%Y%m%d)-$RANDOM" else - echo ".workflow/.design/run-$(date +%Y%m%d-%H%M%S)" + echo ".workflow/.design/design-run-$(date +%Y%m%d)-$RANDOM" fi) -bash(mkdir -p $BASE_PATH/screenshots) +# Create directory and convert to absolute path +bash(mkdir -p "$relative_path"/screenshots) +base_path=$(cd "$relative_path" && pwd) ``` ### Step 2: Parse URL Map @@ -187,7 +189,7 @@ bash($chrome --headless --screenshot="$output_file" --window-size=1920,1080 "$ur Failed URLs: home: https://linear.app - Save to: .workflow/.design/run-20250110/screenshots/home.png + Save to: .workflow/.design/design-run-20250110/screenshots/home.png Steps: 1. Visit URL in browser @@ -270,7 +272,7 @@ Next: /workflow:ui-design:extract --images "screenshots/*.png" ### Path Operations ```bash # Find design directory -bash(find .workflow -type d -name "design-*" | head -1) +bash(find .workflow -type d -name "design-run-*" | head -1) # Create screenshot directory bash(mkdir -p $BASE_PATH/screenshots) diff --git a/.claude/commands/workflow/ui-design/explore-auto.md b/.claude/commands/workflow/ui-design/explore-auto.md index c843913f..4b48e7c3 100644 --- a/.claude/commands/workflow/ui-design/explore-auto.md +++ b/.claude/commands/workflow/ui-design/explore-auto.md @@ -203,10 +203,12 @@ STORE: device_type, device_source ### Phase 0b: Run Initialization & Directory Setup ```bash -run_id = "run-$(date +%Y%m%d-%H%M%S)" -base_path = --session ? ".workflow/WFS-{session}/design-${run_id}" : ".workflow/.design/${run_id}" +run_id = "run-$(date +%Y%m%d)-$RANDOM" +relative_base_path = --session ? ".workflow/WFS-{session}/design-${run_id}" : ".workflow/.design/design-${run_id}" -Bash(mkdir -p "${base_path}/{style-extraction,style-consolidation,prototypes}") +# Create directory and convert to absolute path +Bash(mkdir -p "${relative_base_path}/{style-extraction,prototypes}") +base_path=$(cd "${relative_base_path}" && pwd) Write({base_path}/.run-metadata.json): { "run_id": "${run_id}", "session_id": "${session_id}", "timestamp": "...", diff --git a/.claude/commands/workflow/ui-design/explore-layers.md b/.claude/commands/workflow/ui-design/explore-layers.md index 1a334c45..bd09b03c 100644 --- a/.claude/commands/workflow/ui-design/explore-layers.md +++ b/.claude/commands/workflow/ui-design/explore-layers.md @@ -38,17 +38,21 @@ IF depth NOT IN [1, 2, 3, 4, 5]: ### Step 2: Determine Base Path ```bash -bash(if [ -n "$BASE_PATH" ]; then +relative_path=$(if [ -n "$BASE_PATH" ]; then echo "$BASE_PATH" elif [ -n "$SESSION_ID" ]; then find .workflow/WFS-$SESSION_ID/design-* -type d | head -1 || \ - echo ".workflow/WFS-$SESSION_ID/design-layers-$(date +%Y%m%d-%H%M%S)" + echo ".workflow/WFS-$SESSION_ID/design-run-$(date +%Y%m%d)-$RANDOM" else - echo ".workflow/.design/layers-$(date +%Y%m%d-%H%M%S)" + echo ".workflow/.design/design-run-$(date +%Y%m%d)-$RANDOM" fi) +# Create directory structure and convert to absolute path +bash(mkdir -p "$relative_path") +base_path=$(cd "$relative_path" && pwd) + # Create depth directories -bash(for i in $(seq 1 $depth); do mkdir -p $BASE_PATH/screenshots/depth-$i; done) +bash(for i in $(seq 1 $depth); do mkdir -p "$base_path"/screenshots/depth-$i; done) ``` **Output**: `url`, `depth`, `base_path` diff --git a/.claude/commands/workflow/ui-design/generate.md b/.claude/commands/workflow/ui-design/generate.md index 992c997e..1a603157 100644 --- a/.claude/commands/workflow/ui-design/generate.md +++ b/.claude/commands/workflow/ui-design/generate.md @@ -25,11 +25,17 @@ Pure assembler that combines pre-extracted layout templates with design tokens t ### Step 1: Resolve Base Path & Parse Configuration ```bash -# Determine working directory -bash(find .workflow -type d -name "design-*" | head -1) # Auto-detect +# Determine working directory (relative path) +relative_path=$(find .workflow -type d -name "design-run-*" | head -1) + +# Convert to absolute path +base_path=$(cd "$relative_path" && pwd) + +# Verify absolute path +bash(test -d "$base_path" && echo "✓ Base path: $base_path" || echo "✗ Path not found") # Get style count -bash(ls {base_path}/style-extraction/style-* -d | wc -l) +bash(ls "$base_path"/style-extraction/style-* -d | wc -l) # Image reference auto-detected from layout template source_image_path ``` @@ -263,7 +269,7 @@ Next: /workflow:ui-design:update ### Path Operations ```bash # Find design directory -bash(find .workflow -type d -name "design-*" | head -1) +bash(find .workflow -type d -name "design-run-*" | head -1) # Count style variants bash(ls {base_path}/style-extraction/style-* -d | wc -l) diff --git a/.claude/commands/workflow/ui-design/imitate-auto.md b/.claude/commands/workflow/ui-design/imitate-auto.md index 58184913..7ce686ec 100644 --- a/.claude/commands/workflow/ui-design/imitate-auto.md +++ b/.claude/commands/workflow/ui-design/imitate-auto.md @@ -100,20 +100,21 @@ allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Write(*), Bash(*) ```bash # Generate run ID -run_id = "run-$(date +%Y%m%d-%H%M%S)" +run_id = "run-$(date +%Y%m%d)-$RANDOM" # Determine base path and session mode IF --session: session_id = {provided_session} - base_path = ".workflow/WFS-{session_id}/design-{run_id}" + relative_base_path = ".workflow/WFS-{session_id}/design-{run_id}" session_mode = "integrated" ELSE: session_id = null - base_path = ".workflow/.design/{run_id}" + relative_base_path = ".workflow/.design/design-{run_id}" session_mode = "standalone" -# Create base directory -Bash(mkdir -p "{base_path}") +# Create base directory and convert to absolute path +Bash(mkdir -p "{relative_base_path}") +base_path=$(cd "{relative_base_path}" && pwd) # Step 0.1: Intelligent Path Detection code_files_detected = false diff --git a/.claude/commands/workflow/ui-design/layout-extract.md b/.claude/commands/workflow/ui-design/layout-extract.md index bc389f8d..981cfd1e 100644 --- a/.claude/commands/workflow/ui-design/layout-extract.md +++ b/.claude/commands/workflow/ui-design/layout-extract.md @@ -69,8 +69,10 @@ ELSE: # Resolve device type device_type = --device-type OR "responsive" # desktop|mobile|tablet|responsive -# Determine base path -bash(find .workflow -type d -name "design-*" | head -1) # Auto-detect +# Determine base path (auto-detect and convert to absolute) +relative_path=$(find .workflow -type d -name "design-run-*" | head -1) +base_path=$(cd "$relative_path" && pwd) +bash(test -d "$base_path" && echo "✓ Base path: $base_path" || echo "✗ Path not found") # OR use --base-path / --session parameters ``` @@ -589,7 +591,7 @@ Next: /workflow:ui-design:generate will combine these structural templates with ### Path Operations ```bash # Find design directory -bash(find .workflow -type d -name "design-*" | head -1) +bash(find .workflow -type d -name "design-run-*" | head -1) # Create output directories bash(mkdir -p {base_path}/layout-extraction) diff --git a/.claude/commands/workflow/ui-design/style-extract.md b/.claude/commands/workflow/ui-design/style-extract.md index 80aaebbb..3a38ded2 100644 --- a/.claude/commands/workflow/ui-design/style-extract.md +++ b/.claude/commands/workflow/ui-design/style-extract.md @@ -51,8 +51,10 @@ ELSE IF extraction_mode == "explore": variants_count = --variants OR 3 # Default to 3 for explore mode VALIDATE: 1 <= variants_count <= 5 -# Determine base path -bash(find .workflow -type d -name "design-*" | head -1) # Auto-detect +# Determine base path (auto-detect and convert to absolute) +relative_path=$(find .workflow -type d -name "design-run-*" | head -1) +base_path=$(cd "$relative_path" && pwd) +bash(test -d "$base_path" && echo "✓ Base path: $base_path" || echo "✗ Path not found") # OR use --base-path / --session parameters ``` @@ -533,7 +535,7 @@ Next: /workflow:ui-design:layout-extract --session {session_id} --targets "..." ### Path Operations ```bash # Find design directory -bash(find .workflow -type d -name "design-*" | head -1) +bash(find .workflow -type d -name "design-run-*" | head -1) # Expand image pattern bash(ls {images_pattern}) diff --git a/.claude/commands/workflow/ui-design/update.md b/.claude/commands/workflow/ui-design/update.md index cc8ab312..9b4e35a0 100644 --- a/.claude/commands/workflow/ui-design/update.md +++ b/.claude/commands/workflow/ui-design/update.md @@ -28,7 +28,7 @@ Synchronize finalized design system references to brainstorming artifacts, prepa CHECK: .workflow/.active-* marker files; VALIDATE: session_id matches active session # Verify design artifacts in latest design run -latest_design = find_latest_path_matching(".workflow/WFS-{session}/design-*") +latest_design = find_latest_path_matching(".workflow/WFS-{session}/design-run-*") # Detect design system structure IF exists({latest_design}/style-extraction/style-1/design-tokens.json):