Compare commits

..

2 Commits

Author SHA1 Message Date
catlog22
451b1a762e feat: intelligent page inference from prompt (v4.0.1)
Features:
- --pages parameter now optional with smart inference
- Auto-extract page names from prompt text
  Example: "blog with home, article pages" → ["home", "article"]
- Fallback to synthesis-specification.md in integrated mode
- Default to ["home"] if nothing specified

Changes:
- auto.md: Add Phase 0 page inference logic, update examples
- ui-generate.md: Add page inference in Phase 1, update examples
- CHANGELOG.md: Add v4.0.1 release notes with page inference

Benefits:
- Simplest command: /workflow:design:auto --prompt "Modern blog with home and article pages"
- No need to manually specify --pages in most cases
- More natural and intuitive user experience

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 22:00:56 +08:00
catlog22
59b4b57537 chore: remove backward compatibility mention in auto.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 21:54:54 +08:00
3 changed files with 113 additions and 49 deletions

View File

@@ -1,12 +1,13 @@
--- ---
name: auto name: auto
description: Orchestrate UI design refinement workflow with interactive checkpoints for user selection description: Orchestrate UI design refinement workflow with interactive checkpoints for user selection
usage: /workflow:design:auto --pages "<list>" [--session <id>] [--images "<glob>"] [--prompt "<desc>"] [--variants <count>] [--use-agent] [--batch-plan] usage: /workflow:design:auto [--prompt "<desc>"] [--images "<glob>"] [--pages "<list>"] [--session <id>] [--variants <count>] [--use-agent] [--batch-plan]
argument-hint: "--pages \"dashboard,auth\" [--session WFS-xxx] [--images \"refs/*.png\"] [--prompt \"Modern SaaS\"] [--variants 3] [--use-agent] [--batch-plan]" argument-hint: "[--prompt \"Modern SaaS\"] [--images \"refs/*.png\"] [--pages \"dashboard,auth\"] [--session WFS-xxx] [--variants 3] [--use-agent]"
examples: examples:
- /workflow:design:auto --pages "login,register" --images "design-refs/*.png" - /workflow:design:auto --prompt "Modern blog with home, article and author pages, dark theme"
- /workflow:design:auto --pages "dashboard" --prompt "Modern minimalist, dark theme" --variants 3 --use-agent - /workflow:design:auto --prompt "SaaS dashboard and settings" --variants 3 --use-agent
- /workflow:design:auto --session WFS-auth --images "refs/*.png" --pages "login" --variants 2 --batch-plan - /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(*) allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Glob(*)
--- ---
@@ -46,13 +47,11 @@ This workflow runs **semi-autonomously** with user checkpoints:
## Parameter Requirements ## Parameter Requirements
**Required Parameters**: **Optional Parameters** (all have smart defaults):
- `--pages "<page_list>"`: Comma-separated list of pages to generate - `--pages "<page_list>"`: Pages to generate (if omitted, inferred from prompt/session)
**Optional Parameters**:
- `--session <session_id>`: Workflow session ID (if omitted, runs in standalone mode) - `--session <session_id>`: Workflow session ID (if omitted, runs in standalone mode)
- `--images "<glob_pattern>"`: Reference image paths (default: `design-refs/*`) - `--images "<glob_pattern>"`: Reference image paths (default: `design-refs/*`)
- `--prompt "<description>"`: Text description of design style - `--prompt "<description>"`: Text description of design style and pages
- `--variants <count>`: Number of style/UI variants to generate (default: 3, range: 1-5) - `--variants <count>`: Number of style/UI variants to generate (default: 3, range: 1-5)
- `--use-agent`: Enable agent-driven creative exploration mode - `--use-agent`: Enable agent-driven creative exploration mode
- `--batch-plan`: Auto-generate implementation tasks after design-update (integrated mode only) - `--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` - Must provide at least one of: `--images` or `--prompt`
- Both can be combined for guided style analysis - 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 ## Execution Modes
### Integrated Mode (with `--session`) ### Integrated Mode (with `--session`)
@@ -88,6 +95,27 @@ ELSE:
## 5-Phase Execution ## 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 ### Phase 1: Style Extraction
**Command Construction**: **Command Construction**:
```bash ```bash
@@ -421,5 +449,3 @@ Return summary to user
- `task-generate` automatically detects `.design/` directory - `task-generate` automatically detects `.design/` directory
- If present, adds design system to task context.artifacts - If present, adds design system to task context.artifacts
- UI tasks automatically include `load_design_tokens` in flow_control - UI tasks automatically include `load_design_tokens` in flow_control
This design ensures backward compatibility while enabling powerful visual design workflows when needed.

View File

@@ -1,12 +1,12 @@
--- ---
name: ui-generate name: ui-generate
description: Generate UI prototypes using consolidated design tokens with conventional or agent mode description: Generate UI prototypes using consolidated design tokens with conventional or agent mode
usage: /workflow:design:ui-generate --pages "<list>" [--session <id>] [--variants <count>] [--use-agent] usage: /workflow:design:ui-generate [--pages "<list>"] [--session <id>] [--variants <count>] [--use-agent]
argument-hint: "--pages \"dashboard,auth\" [--session WFS-xxx] [--variants 3] [--use-agent]" argument-hint: "[--pages \"dashboard,auth\"] [--session WFS-xxx] [--variants 3] [--use-agent]"
examples: examples:
- /workflow:design:ui-generate --pages "login,register" --variants 2 - /workflow:design:ui-generate --variants 2
- /workflow:design:ui-generate --session WFS-auth --pages "dashboard" --variants 3 --use-agent - /workflow:design:ui-generate --session WFS-auth --variants 3 --use-agent
- /workflow:design:ui-generate --pages "home,pricing" --variants 2 - /workflow:design:ui-generate --pages "home,pricing,contact" --variants 2
allowed-tools: TodoWrite(*), Read(*), Write(*), Bash(*), Task(conceptual-planning-agent) allowed-tools: TodoWrite(*), Read(*), Write(*), Bash(*), Task(conceptual-planning-agent)
--- ---
@@ -42,8 +42,19 @@ ELSE:
# Infer session_id from existing design-session-* directory # Infer session_id from existing design-session-* directory
base_path = "./{detected_design_session}/" 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 # Set parameters
PARSE: --pages to page_list[]
variants_count = --variants provided ? {count} : 1 variants_count = --variants provided ? {count} : 1
VALIDATE: 1 <= variants_count <= 5 VALIDATE: 1 <= variants_count <= 5

View File

@@ -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/), 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). 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 ## [4.0.0] - 2025-10-07
### 🚀 UI Design Workflow V2 - Agent Mode & Flexible Inputs ### 🚀 UI Design Workflow V2 - Agent Mode & Flexible Inputs
@@ -17,10 +43,11 @@ This major release introduces agent-driven creative exploration, unified variant
**Required Migration**: **Required Migration**:
- **Old format no longer supported**: Commands using old parameter structure will fail - **Old format no longer supported**: Commands using old parameter structure will fail
- **`--session` parameter**: Now optional, omitting it enables standalone mode - **All parameters now optional**: Smart defaults and inference for all parameters
- **`--images` parameter**: Now optional with default value `design-refs/*` - **`--session`**: Optional, omitting enables standalone mode
- **Removed `--style-overrides`**: Simplified to `--prompt` for text-based guidance - **`--images`**: Optional with default `design-refs/*`
- **New required parameter**: `--pages` is now the only mandatory parameter - **`--pages`**: Optional, inferred from prompt or session (as of v4.0.1)
- **Removed `--style-overrides`**: Use `--prompt` instead
**Migration Guide**: **Migration Guide**:
```bash ```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:style-extract --session WFS-auth --images "design-refs/*.png"
/workflow:design:ui-generate --session WFS-auth --pages "login,register" /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: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) # ✅ Simplest form (pages inferred from prompt)
/workflow:design:auto --pages "dashboard" /workflow:design:auto --prompt "Modern blog with home, article and author pages"
# ✅ With agent mode # ✅ With agent mode and explicit pages
/workflow:design:auto --prompt "Modern SaaS" --pages "home" --variants 3 --use-agent /workflow:design:auto --prompt "Modern SaaS" --pages "dashboard,settings" --variants 3 --use-agent
``` ```
**Deprecated Commands**: **Deprecated Commands**:
@@ -84,46 +111,46 @@ This major release introduces agent-driven creative exploration, unified variant
#### Changed #### Changed
**New Command Interface**: **New Command Interface** (v4.0.1):
- **`/workflow:design:auto`**: - **`/workflow:design:auto`**:
- Required: `--pages <list>` - All parameters optional with smart defaults
- Optional: `--session <id>`, `--images <glob>`, `--prompt <desc>`, `--variants <count>`, `--use-agent` - `--prompt <desc>`: Design description (infers pages automatically)
- Defaults: `--variants 3`, `--images "design-refs/*"` - `--images <glob>`: Reference images (default: `design-refs/*`)
- `--pages <list>`: Explicit page override (auto-inferred if omitted)
- `--session <id>`, `--variants <count>`, `--use-agent`, `--batch-plan`
- Examples: - Examples:
- Minimal: `/workflow:design:auto --pages "login"` - Minimal: `/workflow:design:auto --prompt "Modern blog with home and article pages"`
- Agent Mode: `/workflow:design:auto --prompt "Modern SaaS" --pages "home" --variants 3 --use-agent` - Agent Mode: `/workflow:design:auto --prompt "SaaS dashboard and settings" --variants 3 --use-agent`
- Hybrid: `/workflow:design:auto --images "refs/*.png" --prompt "Linear.app style" --pages "tasks" --use-agent` - Hybrid: `/workflow:design:auto --images "refs/*.png" --prompt "E-commerce: home, product, cart"`
- **`/workflow:design:style-extract`**: - **`/workflow:design:style-extract`**:
- Required: At least one of `--images` or `--prompt` - At least one of `--images` or `--prompt` recommended
- Optional: `--session <id>`, `--variants <count>`, `--use-agent` - All other parameters optional
- Supports: image-only, text-only, or hybrid inputs
- Agent mode: Parallel generation of diverse design directions - Agent mode: Parallel generation of diverse design directions
- **`/workflow:design:ui-generate`**: - **`/workflow:design:ui-generate`**:
- Required: `--pages <list>` - All parameters optional (pages inferred from session or defaults to ["home"])
- Optional: `--session <id>`, `--variants <count>`, `--use-agent` - `--pages <list>`: Optional explicit page list
- Agent mode: Parallel layout exploration (F-Pattern, Grid, Asymmetric) - Agent mode: Parallel layout exploration (F-Pattern, Grid, Asymmetric)
- Conventional mode: Codex-driven generation with minor variations
#### Usage Examples #### Usage Examples
**Standalone Quick Prototyping**: **Standalone Quick Prototyping**:
```bash ```bash
# Pure text, agent exploration # Pure text with page inference (simplest)
/workflow:design:auto --prompt "Modern minimalist blog, dark theme" --pages "home,article" --variants 3 --use-agent /workflow:design:auto --prompt "Modern minimalist blog with home, article and author pages, dark theme" --use-agent
# Pure image, conventional mode # Pure image with inferred pages
/workflow:design:auto --images "refs/*.png" --pages "dashboard" --variants 2 /workflow:design:auto --images "refs/*.png" --variants 2
# Hybrid input # Hybrid input with explicit page override
/workflow:design:auto --images "current-app.png" --prompt "Modernize with Linear.app style" --pages "tasks,settings" --use-agent /workflow:design:auto --images "current-app.png" --prompt "Modernize to Linear.app style" --pages "tasks,settings" --use-agent
``` ```
**Integrated Workflow Enhancement**: **Integrated Workflow Enhancement**:
```bash ```bash
# Within existing workflow session # Within existing workflow (pages inferred from synthesis)
/workflow:design:auto --session WFS-app-refresh --images "refs/*.png" --pages "dashboard" --variants 3 --use-agent /workflow:design:auto --session WFS-app-refresh --images "refs/*.png" --variants 3 --use-agent
``` ```
#### Technical Details #### Technical Details