mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-10 02:24:35 +08:00
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>
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
---
|
||||
name: auto
|
||||
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]
|
||||
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 "<desc>"] [--images "<glob>"] [--pages "<list>"] [--session <id>] [--variants <count>] [--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 "<page_list>"`: Comma-separated list of pages to generate
|
||||
|
||||
**Optional Parameters**:
|
||||
**Optional Parameters** (all have smart defaults):
|
||||
- `--pages "<page_list>"`: Pages to generate (if omitted, inferred from prompt/session)
|
||||
- `--session <session_id>`: Workflow session ID (if omitted, runs in standalone mode)
|
||||
- `--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)
|
||||
- `--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
|
||||
|
||||
@@ -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 "<list>" [--session <id>] [--variants <count>] [--use-agent]
|
||||
argument-hint: "--pages \"dashboard,auth\" [--session WFS-xxx] [--variants 3] [--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]"
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user