diff --git a/.claude/commands/workflow/design/auto.md b/.claude/commands/workflow/design/auto.md index 34ef23d4..90e091eb 100644 --- a/.claude/commands/workflow/design/auto.md +++ b/.claude/commands/workflow/design/auto.md @@ -1,12 +1,13 @@ --- name: auto description: Orchestrate UI design refinement workflow with interactive checkpoints for user selection -usage: /workflow:design:auto --pages "" [--session ] [--images ""] [--prompt ""] [--variants ] [--use-agent] [--batch-plan] -argument-hint: "--pages \"dashboard,auth\" [--session WFS-xxx] [--images \"refs/*.png\"] [--prompt \"Modern SaaS\"] [--variants 3] [--use-agent] [--batch-plan]" +usage: /workflow:design:auto [--prompt ""] [--images ""] [--pages ""] [--session ] [--variants ] [--use-agent] [--batch-plan] +argument-hint: "[--prompt \"Modern SaaS\"] [--images \"refs/*.png\"] [--pages \"dashboard,auth\"] [--session WFS-xxx] [--variants 3] [--use-agent]" examples: - - /workflow:design:auto --pages "login,register" --images "design-refs/*.png" - - /workflow:design:auto --pages "dashboard" --prompt "Modern minimalist, dark theme" --variants 3 --use-agent - - /workflow:design:auto --session WFS-auth --images "refs/*.png" --pages "login" --variants 2 --batch-plan + - /workflow:design:auto --prompt "Modern blog with home, article and author pages, dark theme" + - /workflow:design:auto --prompt "SaaS dashboard and settings" --variants 3 --use-agent + - /workflow:design:auto --images "refs/*.png" --prompt "E-commerce site: home, product, cart" + - /workflow:design:auto --session WFS-auth --images "refs/*.png" --variants 2 allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Glob(*) --- @@ -46,13 +47,11 @@ This workflow runs **semi-autonomously** with user checkpoints: ## Parameter Requirements -**Required Parameters**: -- `--pages ""`: Comma-separated list of pages to generate - -**Optional Parameters**: +**Optional Parameters** (all have smart defaults): +- `--pages ""`: Pages to generate (if omitted, inferred from prompt/session) - `--session `: Workflow session ID (if omitted, runs in standalone mode) - `--images ""`: Reference image paths (default: `design-refs/*`) -- `--prompt ""`: Text description of design style +- `--prompt ""`: Text description of design style and pages - `--variants `: Number of style/UI variants to generate (default: 3, range: 1-5) - `--use-agent`: Enable agent-driven creative exploration mode - `--batch-plan`: Auto-generate implementation tasks after design-update (integrated mode only) @@ -61,6 +60,14 @@ This workflow runs **semi-autonomously** with user checkpoints: - Must provide at least one of: `--images` or `--prompt` - Both can be combined for guided style analysis +**Page Inference Logic**: +1. If `--pages` provided: Use explicit list +2. Else if `--prompt` provided: Extract page names from prompt text + - Example: "dashboard and login page" → ["dashboard", "login"] + - Example: "Modern SaaS app" → ["home", "dashboard", "settings"] +3. Else if `--session` provided (integrated mode): Infer from synthesis-specification.md +4. Else: Default to ["home"] + ## Execution Modes ### Integrated Mode (with `--session`) @@ -88,6 +95,27 @@ ELSE: ## 5-Phase Execution +### Phase 0: Page Inference (if needed) +**Infer page list if not explicitly provided**: +```bash +IF --pages provided: + page_list = {explicit_pages} +ELSE IF --prompt provided: + # Extract page names from prompt using Claude analysis + page_list = extract_page_names_from_prompt({prompt_text}) + # Examples: + # "dashboard and login page" → ["dashboard", "login"] + # "blog with home, article, author pages" → ["home", "article", "author"] + # "Modern SaaS app" → ["home", "dashboard", "settings"] +ELSE IF --session provided: + # Read synthesis-specification.md and extract page requirements + page_list = extract_pages_from_synthesis({session_id}) +ELSE: + page_list = ["home"] # Default fallback + +VALIDATE: page_list not empty +``` + ### Phase 1: Style Extraction **Command Construction**: ```bash diff --git a/.claude/commands/workflow/design/ui-generate.md b/.claude/commands/workflow/design/ui-generate.md index da8c7634..b7bcb1ae 100644 --- a/.claude/commands/workflow/design/ui-generate.md +++ b/.claude/commands/workflow/design/ui-generate.md @@ -1,12 +1,12 @@ --- name: ui-generate description: Generate UI prototypes using consolidated design tokens with conventional or agent mode -usage: /workflow:design:ui-generate --pages "" [--session ] [--variants ] [--use-agent] -argument-hint: "--pages \"dashboard,auth\" [--session WFS-xxx] [--variants 3] [--use-agent]" +usage: /workflow:design:ui-generate [--pages ""] [--session ] [--variants ] [--use-agent] +argument-hint: "[--pages \"dashboard,auth\"] [--session WFS-xxx] [--variants 3] [--use-agent]" examples: - - /workflow:design:ui-generate --pages "login,register" --variants 2 - - /workflow:design:ui-generate --session WFS-auth --pages "dashboard" --variants 3 --use-agent - - /workflow:design:ui-generate --pages "home,pricing" --variants 2 + - /workflow:design:ui-generate --variants 2 + - /workflow:design:ui-generate --session WFS-auth --variants 3 --use-agent + - /workflow:design:ui-generate --pages "home,pricing,contact" --variants 2 allowed-tools: TodoWrite(*), Read(*), Write(*), Bash(*), Task(conceptual-planning-agent) --- @@ -42,8 +42,19 @@ ELSE: # 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 + page_list = extract_pages_from_synthesis({base_path}/.brainstorming/synthesis-specification.md) +ELSE: + # Infer from generated prototypes or default + page_list = detect_from_prototypes({base_path}/.design/prototypes/) OR ["home"] + +VALIDATE: page_list not empty + # Set parameters -PARSE: --pages to page_list[] variants_count = --variants provided ? {count} : 1 VALIDATE: 1 <= variants_count <= 5 diff --git a/CHANGELOG.md b/CHANGELOG.md index ffbb1fe9..3578a228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,32 @@ All notable changes to Claude Code Workflow (CCW) will be documented in this fil The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.0.1] - 2025-10-07 + +### 🎯 Intelligent Page Inference + +**IMPROVEMENT**: `--pages` parameter is now **optional** with smart inference from prompt or session context. + +**Changes**: +- `--pages` parameter: Now optional, intelligently inferred from: + 1. Explicit `--pages` if provided + 2. `--prompt` text analysis (e.g., "blog with home, article pages" → ["home", "article"]) + 3. `--session` synthesis-specification.md extraction + 4. Default: ["home"] + +**New Examples**: +```bash +# Simplest - pages inferred from prompt +/workflow:design:auto --prompt "Modern blog with home, article and author pages" + +# Explicit override if needed +/workflow:design:auto --prompt "SaaS app" --pages "dashboard,settings,billing" +``` + +**Commands Updated**: +- `/workflow:design:auto`: All parameters now optional +- `/workflow:design:ui-generate`: `--pages` optional with smart inference + ## [4.0.0] - 2025-10-07 ### 🚀 UI Design Workflow V2 - Agent Mode & Flexible Inputs @@ -17,10 +43,11 @@ This major release introduces agent-driven creative exploration, unified variant **Required Migration**: - **Old format no longer supported**: Commands using old parameter structure will fail -- **`--session` parameter**: Now optional, omitting it enables standalone mode -- **`--images` parameter**: Now optional with default value `design-refs/*` -- **Removed `--style-overrides`**: Simplified to `--prompt` for text-based guidance -- **New required parameter**: `--pages` is now the only mandatory parameter +- **All parameters now optional**: Smart defaults and inference for all parameters +- **`--session`**: Optional, omitting enables standalone mode +- **`--images`**: Optional with default `design-refs/*` +- **`--pages`**: Optional, inferred from prompt or session (as of v4.0.1) +- **Removed `--style-overrides`**: Use `--prompt` instead **Migration Guide**: ```bash @@ -28,15 +55,15 @@ This major release introduces agent-driven creative exploration, unified variant /workflow:design:style-extract --session WFS-auth --images "design-refs/*.png" /workflow:design:ui-generate --session WFS-auth --pages "login,register" -# ✅ New (v4.0.0+) +# ✅ New (v4.0.1) - All parameters optional /workflow:design:style-extract --images "design-refs/*.png" --variants 3 -/workflow:design:ui-generate --pages "login,register" --variants 2 +/workflow:design:ui-generate --variants 2 -# ✅ Simplest form (using defaults) -/workflow:design:auto --pages "dashboard" +# ✅ Simplest form (pages inferred from prompt) +/workflow:design:auto --prompt "Modern blog with home, article and author pages" -# ✅ With agent mode -/workflow:design:auto --prompt "Modern SaaS" --pages "home" --variants 3 --use-agent +# ✅ With agent mode and explicit pages +/workflow:design:auto --prompt "Modern SaaS" --pages "dashboard,settings" --variants 3 --use-agent ``` **Deprecated Commands**: @@ -84,46 +111,46 @@ This major release introduces agent-driven creative exploration, unified variant #### Changed -**New Command Interface**: +**New Command Interface** (v4.0.1): - **`/workflow:design:auto`**: - - Required: `--pages ` - - Optional: `--session `, `--images `, `--prompt `, `--variants `, `--use-agent` - - Defaults: `--variants 3`, `--images "design-refs/*"` + - All parameters optional with smart defaults + - `--prompt `: Design description (infers pages automatically) + - `--images `: Reference images (default: `design-refs/*`) + - `--pages `: Explicit page override (auto-inferred if omitted) + - `--session `, `--variants `, `--use-agent`, `--batch-plan` - Examples: - - Minimal: `/workflow:design:auto --pages "login"` - - Agent Mode: `/workflow:design:auto --prompt "Modern SaaS" --pages "home" --variants 3 --use-agent` - - Hybrid: `/workflow:design:auto --images "refs/*.png" --prompt "Linear.app style" --pages "tasks" --use-agent` + - Minimal: `/workflow:design:auto --prompt "Modern blog with home and article pages"` + - Agent Mode: `/workflow:design:auto --prompt "SaaS dashboard and settings" --variants 3 --use-agent` + - Hybrid: `/workflow:design:auto --images "refs/*.png" --prompt "E-commerce: home, product, cart"` - **`/workflow:design:style-extract`**: - - Required: At least one of `--images` or `--prompt` - - Optional: `--session `, `--variants `, `--use-agent` - - Supports: image-only, text-only, or hybrid inputs + - At least one of `--images` or `--prompt` recommended + - All other parameters optional - Agent mode: Parallel generation of diverse design directions - **`/workflow:design:ui-generate`**: - - Required: `--pages ` - - Optional: `--session `, `--variants `, `--use-agent` + - All parameters optional (pages inferred from session or defaults to ["home"]) + - `--pages `: Optional explicit page list - Agent mode: Parallel layout exploration (F-Pattern, Grid, Asymmetric) - - Conventional mode: Codex-driven generation with minor variations #### Usage Examples **Standalone Quick Prototyping**: ```bash -# Pure text, agent exploration -/workflow:design:auto --prompt "Modern minimalist blog, dark theme" --pages "home,article" --variants 3 --use-agent +# Pure text with page inference (simplest) +/workflow:design:auto --prompt "Modern minimalist blog with home, article and author pages, dark theme" --use-agent -# Pure image, conventional mode -/workflow:design:auto --images "refs/*.png" --pages "dashboard" --variants 2 +# Pure image with inferred pages +/workflow:design:auto --images "refs/*.png" --variants 2 -# Hybrid input -/workflow:design:auto --images "current-app.png" --prompt "Modernize with Linear.app style" --pages "tasks,settings" --use-agent +# Hybrid input with explicit page override +/workflow:design:auto --images "current-app.png" --prompt "Modernize to Linear.app style" --pages "tasks,settings" --use-agent ``` **Integrated Workflow Enhancement**: ```bash -# Within existing workflow session -/workflow:design:auto --session WFS-app-refresh --images "refs/*.png" --pages "dashboard" --variants 3 --use-agent +# Within existing workflow (pages inferred from synthesis) +/workflow:design:auto --session WFS-app-refresh --images "refs/*.png" --variants 3 --use-agent ``` #### Technical Details