feat: add --yes flag for auto-confirmation across multiple workflows

- Enhanced lite-execute, lite-fix, lite-lite-lite, lite-plan, multi-cli-plan, plan, replan, session complete, session solidify, and various UI design commands to support a --yes or -y flag for skipping user confirmations and auto-selecting defaults.
- Updated argument hints and examples to reflect new auto mode functionality.
- Implemented auto mode defaults for confirmation, execution methods, and code review options.
- Improved error handling and validation in command parsing and execution processes.
This commit is contained in:
catlog22
2026-01-24 09:23:24 +08:00
parent fd50adf581
commit a293a01d85
36 changed files with 693 additions and 250 deletions

View File

@@ -1,10 +1,14 @@
--- ---
name: issue:discover-by-prompt name: issue:discover-by-prompt
description: Discover issues from user prompt with Gemini-planned iterative multi-agent exploration. Uses ACE semantic search for context gathering and supports cross-module comparison (e.g., frontend vs backend API contracts). description: Discover issues from user prompt with Gemini-planned iterative multi-agent exploration. Uses ACE semantic search for context gathering and supports cross-module comparison (e.g., frontend vs backend API contracts).
argument-hint: "<prompt> [--scope=src/**] [--depth=standard|deep] [--max-iterations=5]" argument-hint: "[-y|--yes] <prompt> [--scope=src/**] [--depth=standard|deep] [--max-iterations=5]"
allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*), mcp__exa__search(*) allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*), mcp__ace-tool__search_context(*), mcp__exa__search(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-continue all iterations, skip confirmations.
# Issue Discovery by Prompt # Issue Discovery by Prompt
## Quick Start ## Quick Start

View File

@@ -1,10 +1,14 @@
--- ---
name: issue:discover name: issue:discover
description: Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives. description: Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices) using CLI explore. Supports Exa external research for security and best-practices perspectives.
argument-hint: "<path-pattern> [--perspectives=bug,ux,...] [--external]" argument-hint: "[-y|--yes] <path-pattern> [--perspectives=bug,ux,...] [--external]"
allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*) allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*), Task(*), AskUserQuestion(*), Glob(*), Grep(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-select all perspectives, skip confirmations.
# Issue Discovery Command # Issue Discovery Command
## Quick Start ## Quick Start

View File

@@ -1,10 +1,14 @@
--- ---
name: execute name: execute
description: Execute queue with DAG-based parallel orchestration (one commit per solution) description: Execute queue with DAG-based parallel orchestration (one commit per solution)
argument-hint: "--queue <queue-id> [--worktree [<existing-path>]]" argument-hint: "[-y|--yes] --queue <queue-id> [--worktree [<existing-path>]]"
allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*) allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm execution, use recommended settings.
# Issue Execute Command (/issue:execute) # Issue Execute Command (/issue:execute)
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: new name: new
description: Create structured issue from GitHub URL or text description description: Create structured issue from GitHub URL or text description
argument-hint: "<github-url | text-description> [--priority 1-5]" argument-hint: "[-y|--yes] <github-url | text-description> [--priority 1-5]"
allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*), mcp__ace-tool__search_context(*) allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*), mcp__ace-tool__search_context(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Skip clarification questions, create issue with inferred details.
# Issue New Command (/issue:new) # Issue New Command (/issue:new)
## Core Principle ## Core Principle

View File

@@ -1,10 +1,14 @@
--- ---
name: plan name: plan
description: Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop) description: Batch plan issue resolution using issue-plan-agent (explore + plan closed-loop)
argument-hint: "--all-pending <issue-id>[,<issue-id>,...] [--batch-size 3] " argument-hint: "[-y|--yes] --all-pending <issue-id>[,<issue-id>,...] [--batch-size 3]"
allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*), Bash(*), Read(*), Write(*) allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*), Bash(*), Read(*), Write(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-bind solutions without confirmation, use recommended settings.
# Issue Plan Command (/issue:plan) # Issue Plan Command (/issue:plan)
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: queue name: queue
description: Form execution queue from bound solutions using issue-queue-agent (solution-level) description: Form execution queue from bound solutions using issue-queue-agent (solution-level)
argument-hint: "[--queues <n>] [--issue <id>]" argument-hint: "[-y|--yes] [--queues <n>] [--issue <id>]"
allowed-tools: TodoWrite(*), Task(*), Bash(*), Read(*), Write(*) allowed-tools: TodoWrite(*), Task(*), Bash(*), Read(*), Write(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm queue formation, use recommended conflict resolutions.
# Issue Queue Command (/issue:queue) # Issue Queue Command (/issue:queue)
## Overview ## Overview

View File

@@ -1,9 +1,13 @@
--- ---
name: breakdown name: breakdown
description: Decompose complex task into subtasks with dependency mapping, creates child task JSONs with parent references and execution order description: Decompose complex task into subtasks with dependency mapping, creates child task JSONs with parent references and execution order
argument-hint: "task-id" argument-hint: "[-y|--yes] task-id"
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm breakdown, use recommended subtask structure.
# Task Breakdown Command (/task:breakdown) # Task Breakdown Command (/task:breakdown)
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: replan name: replan
description: Update task JSON with new requirements or batch-update multiple tasks from verification report, tracks changes in task-changes.json description: Update task JSON with new requirements or batch-update multiple tasks from verification report, tracks changes in task-changes.json
argument-hint: "task-id [\"text\"|file.md] | --batch [verification-report.md]" argument-hint: "[-y|--yes] task-id [\"text\"|file.md] | --batch [verification-report.md]"
allowed-tools: Read(*), Write(*), Edit(*), TodoWrite(*), Glob(*), Bash(*) allowed-tools: Read(*), Write(*), Edit(*), TodoWrite(*), Glob(*), Bash(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm updates, use recommended changes.
# Task Replan Command (/task:replan) # Task Replan Command (/task:replan)
> **⚠️ DEPRECATION NOTICE**: This command is maintained for backward compatibility. For new workflows, use `/workflow:replan` which provides: > **⚠️ DEPRECATION NOTICE**: This command is maintained for backward compatibility. For new workflows, use `/workflow:replan` which provides:

View File

@@ -1,10 +1,14 @@
--- ---
name: artifacts name: artifacts
description: Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis description: Interactive clarification generating confirmed guidance specification through role-based analysis and synthesis
argument-hint: "topic or challenge description [--count N]" argument-hint: "[-y|--yes] topic or challenge description [--count N]"
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), AskUserQuestion(*) allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), AskUserQuestion(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-select recommended roles, skip all clarification questions, use default answers.
## Overview ## Overview
Seven-phase workflow: **Context collection****Topic analysis****Role selection****Role questions****Conflict resolution****Final check****Generate specification** Seven-phase workflow: **Context collection****Topic analysis****Role selection****Role questions****Conflict resolution****Final check****Generate specification**

View File

@@ -1,10 +1,14 @@
--- ---
name: auto-parallel name: auto-parallel
description: Parallel brainstorming automation with dynamic role selection and concurrent execution across multiple perspectives description: Parallel brainstorming automation with dynamic role selection and concurrent execution across multiple perspectives
argument-hint: "topic or challenge description" [--count N] argument-hint: "[-y|--yes] topic or challenge description [--count N]"
allowed-tools: SlashCommand(*), Task(*), TodoWrite(*), Read(*), Write(*), Bash(*), Glob(*) allowed-tools: SlashCommand(*), Task(*), TodoWrite(*), Read(*), Write(*), Bash(*), Glob(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-select recommended roles, skip all clarification questions, use default answers.
# Workflow Brainstorm Parallel Auto Command # Workflow Brainstorm Parallel Auto Command
## Coordinator Role ## Coordinator Role

View File

@@ -1,10 +1,14 @@
--- ---
name: synthesis name: synthesis
description: Clarify and refine role analyses through intelligent Q&A and targeted updates with synthesis agent description: Clarify and refine role analyses through intelligent Q&A and targeted updates with synthesis agent
argument-hint: "[optional: --session session-id]" argument-hint: "[-y|--yes] [optional: --session session-id]"
allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*), AskUserQuestion(*) allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*), AskUserQuestion(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-select all enhancements, skip clarification questions, use default answers.
## Overview ## Overview
Six-phase workflow to eliminate ambiguities and enhance conceptual depth in role analyses: Six-phase workflow to eliminate ambiguities and enhance conceptual depth in role analyses:

View File

@@ -1,7 +1,7 @@
--- ---
name: clean name: clean
description: Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution description: Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution
argument-hint: "[--dry-run] [\"focus area\"]" argument-hint: "[-y|--yes] [--dry-run] [\"focus area\"]"
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Glob(*), Bash(*), Write(*) allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Glob(*), Bash(*), Write(*)
--- ---
@@ -21,8 +21,22 @@ Intelligent cleanup command that explores the codebase to identify the developme
```bash ```bash
/workflow:clean # Full intelligent cleanup (explore → analyze → confirm → execute) /workflow:clean # Full intelligent cleanup (explore → analyze → confirm → execute)
/workflow:clean --yes # Auto mode (use safe defaults, no confirmation)
/workflow:clean --dry-run # Explore and analyze only, no execution /workflow:clean --dry-run # Explore and analyze only, no execution
/workflow:clean "auth module" # Focus cleanup on specific area /workflow:clean -y "auth module" # Auto mode with focus area
```
## Auto Mode Defaults
When `--yes` or `-y` flag is used:
- **Categories to Clean**: Auto-selects `["Sessions"]` only (safest - only workflow sessions)
- **Risk Level**: Auto-selects `"Low only"` (only low-risk items)
- All confirmations skipped, proceeds directly to execution
**Flag Parsing**:
```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const dryRun = $ARGUMENTS.includes('--dry-run')
``` ```
## Execution Process ## Execution Process
@@ -329,39 +343,57 @@ To execute cleanup: /workflow:clean
**Step 3.3: User Confirmation** **Step 3.3: User Confirmation**
```javascript ```javascript
AskUserQuestion({ // Parse --yes flag
questions: [ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
{
question: "Which categories to clean?", let userSelection
header: "Categories",
multiSelect: true, if (autoYes) {
options: [ // Auto mode: Use safe defaults
{ console.log(`[--yes] Auto-selecting safe cleanup defaults:`)
label: "Sessions", console.log(` - Categories: Sessions only`)
description: `${manifest.summary.by_category.stale_sessions} stale workflow sessions` console.log(` - Risk level: Low only`)
},
{ userSelection = {
label: "Documents", categories: ["Sessions"],
description: `${manifest.summary.by_category.drifted_documents} drifted documents` risk: "Low only"
}, }
{ } else {
label: "Dead Code", // Interactive mode: Ask user
description: `${manifest.summary.by_category.dead_code} unused code files` userSelection = AskUserQuestion({
} questions: [
] {
}, question: "Which categories to clean?",
{ header: "Categories",
question: "Risk level to include?", multiSelect: true,
header: "Risk", options: [
multiSelect: false, {
options: [ label: "Sessions",
{ label: "Low only", description: "Safest - only obviously stale items" }, description: `${manifest.summary.by_category.stale_sessions} stale workflow sessions`
{ label: "Low + Medium", description: "Recommended - includes likely unused items" }, },
{ label: "All", description: "Aggressive - includes high-risk items" } {
] label: "Documents",
} description: `${manifest.summary.by_category.drifted_documents} drifted documents`
] },
}) {
label: "Dead Code",
description: `${manifest.summary.by_category.dead_code} unused code files`
}
]
},
{
question: "Risk level to include?",
header: "Risk",
multiSelect: false,
options: [
{ label: "Low only", description: "Safest - only obviously stale items" },
{ label: "Low + Medium", description: "Recommended - includes likely unused items" },
{ label: "All", description: "Aggressive - includes high-risk items" }
]
}
]
})
}
``` ```
--- ---

View File

@@ -1,10 +1,14 @@
--- ---
name: debug-with-file name: debug-with-file
description: Interactive hypothesis-driven debugging with documented exploration, understanding evolution, and Gemini-assisted correction description: Interactive hypothesis-driven debugging with documented exploration, understanding evolution, and Gemini-assisted correction
argument-hint: "\"bug description or error message\"" argument-hint: "[-y|--yes] \"bug description or error message\""
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*) allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm all decisions (hypotheses, fixes, iteration), use recommended settings.
# Workflow Debug-With-File Command (/workflow:debug-with-file) # Workflow Debug-With-File Command (/workflow:debug-with-file)
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: debug name: debug
description: Interactive hypothesis-driven debugging with NDJSON logging, iterative until resolved description: Interactive hypothesis-driven debugging with NDJSON logging, iterative until resolved
argument-hint: "\"bug description or error message\"" argument-hint: "[-y|--yes] \"bug description or error message\""
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*) allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm all decisions (hypotheses, fixes, iteration), use recommended settings.
# Workflow Debug Command (/workflow:debug) # Workflow Debug Command (/workflow:debug)
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: develop-with-file name: develop-with-file
description: Multi-agent development workflow with documented progress, Gemini-guided planning, and incremental iteration support description: Multi-agent development workflow with documented progress, Gemini-guided planning, and incremental iteration support
argument-hint: "\"feature description or task file.md\"" argument-hint: "[-y|--yes] \"feature description or task file.md\""
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*) allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-confirm all decisions (exploration, planning, execution, verification), use recommended settings.
# Workflow Develop-With-File Command (/workflow:develop-with-file) # Workflow Develop-With-File Command (/workflow:develop-with-file)
## Overview ## Overview

View File

@@ -1,7 +1,7 @@
--- ---
name: execute name: execute
description: Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking description: Coordinate agent execution for workflow tasks with automatic session discovery, parallel task processing, and status tracking
argument-hint: "[--resume-session=\"session-id\"]" argument-hint: "[-y|--yes] [--resume-session=\"session-id\"]"
--- ---
# Workflow Execute Command # Workflow Execute Command
@@ -11,6 +11,30 @@ Orchestrates autonomous workflow execution through systematic task discovery, ag
**Resume Mode**: When called with `--resume-session` flag, skips discovery phase and directly enters TodoWrite generation and agent execution for the specified session. **Resume Mode**: When called with `--resume-session` flag, skips discovery phase and directly enters TodoWrite generation and agent execution for the specified session.
## Usage
```bash
# Interactive mode (with confirmations)
/workflow:execute
/workflow:execute --resume-session="WFS-auth"
# Auto mode (skip confirmations, use defaults)
/workflow:execute --yes
/workflow:execute -y
/workflow:execute -y --resume-session="WFS-auth"
```
## Auto Mode Defaults
When `--yes` or `-y` flag is used:
- **Session Selection**: Automatically selects the first (most recent) active session
- **Completion Choice**: Automatically completes session (runs `/workflow:session:complete --yes`)
**Flag Parsing**:
```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
```
## Performance Optimization Strategy ## Performance Optimization Strategy
**Lazy Loading**: Task JSONs read **on-demand** during execution, not upfront. TODO_LIST.md + IMPL_PLAN.md provide metadata for planning. **Lazy Loading**: Task JSONs read **on-demand** during execution, not upfront. TODO_LIST.md + IMPL_PLAN.md provide metadata for planning.
@@ -122,24 +146,38 @@ List sessions with metadata and prompt user selection:
bash(for dir in .workflow/active/WFS-*/; do [ -d "$dir" ] || continue; session=$(basename "$dir"); project=$(jq -r '.project // "Unknown"' "${dir}workflow-session.json" 2>/dev/null || echo "Unknown"); total=$(grep -c '^\- \[' "${dir}TODO_LIST.md" 2>/dev/null || echo 0); completed=$(grep -c '^\- \[x\]' "${dir}TODO_LIST.md" 2>/dev/null || echo 0); if [ "$total" -gt 0 ]; then progress=$((completed * 100 / total)); else progress=0; fi; echo "$session | $project | $completed/$total tasks ($progress%)"; done) bash(for dir in .workflow/active/WFS-*/; do [ -d "$dir" ] || continue; session=$(basename "$dir"); project=$(jq -r '.project // "Unknown"' "${dir}workflow-session.json" 2>/dev/null || echo "Unknown"); total=$(grep -c '^\- \[' "${dir}TODO_LIST.md" 2>/dev/null || echo 0); completed=$(grep -c '^\- \[x\]' "${dir}TODO_LIST.md" 2>/dev/null || echo 0); if [ "$total" -gt 0 ]; then progress=$((completed * 100 / total)); else progress=0; fi; echo "$session | $project | $completed/$total tasks ($progress%)"; done)
``` ```
Use AskUserQuestion to present formatted options (max 4 options shown): **Parse --yes flag**:
```javascript ```javascript
// If more than 4 sessions, show most recent 4 with "Other" option for manual input const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const sessions = getActiveSessions() // sorted by last modified ```
const displaySessions = sessions.slice(0, 4)
AskUserQuestion({ **Conditional Selection**:
questions: [{ ```javascript
question: "Multiple active sessions detected. Select one:", if (autoYes) {
header: "Session", // Auto mode: Select first session (most recent)
multiSelect: false, const firstSession = sessions[0]
options: displaySessions.map(s => ({ console.log(`[--yes] Auto-selecting session: ${firstSession.id}`)
label: s.id, selectedSessionId = firstSession.id
description: `${s.project} | ${s.progress}` // Continue to Phase 2
})) } else {
// Note: User can select "Other" to manually enter session ID // Interactive mode: Use AskUserQuestion to present formatted options (max 4 options shown)
}] // If more than 4 sessions, show most recent 4 with "Other" option for manual input
}) const sessions = getActiveSessions() // sorted by last modified
const displaySessions = sessions.slice(0, 4)
AskUserQuestion({
questions: [{
question: "Multiple active sessions detected. Select one:",
header: "Session",
multiSelect: false,
options: displaySessions.map(s => ({
label: s.id,
description: `${s.project} | ${s.progress}`
}))
// Note: User can select "Other" to manually enter session ID
}]
})
}
``` ```
**Input Validation**: **Input Validation**:
@@ -252,23 +290,33 @@ while (TODO_LIST.md has pending tasks) {
6. **User Choice**: When all tasks finished, ask user to choose next step: 6. **User Choice**: When all tasks finished, ask user to choose next step:
```javascript ```javascript
AskUserQuestion({ // Parse --yes flag
questions: [{ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
question: "All tasks completed. What would you like to do next?",
header: "Next Step", if (autoYes) {
multiSelect: false, // Auto mode: Complete session automatically
options: [ console.log(`[--yes] Auto-selecting: Complete Session`)
{ SlashCommand("/workflow:session:complete --yes")
label: "Enter Review", } else {
description: "Run specialized review (security/architecture/quality/action-items)" // Interactive mode: Ask user
}, AskUserQuestion({
{ questions: [{
label: "Complete Session", question: "All tasks completed. What would you like to do next?",
description: "Archive session and update manifest" header: "Next Step",
} multiSelect: false,
] options: [
}] {
}) label: "Enter Review",
description: "Run specialized review (security/architecture/quality/action-items)"
},
{
label: "Complete Session",
description: "Archive session and update manifest"
}
]
}]
})
}
``` ```
**Based on user selection**: **Based on user selection**:

View File

@@ -1,7 +1,7 @@
--- ---
name: lite-execute name: lite-execute
description: Execute tasks based on in-memory plan, prompt description, or file content description: Execute tasks based on in-memory plan, prompt description, or file content
argument-hint: "[--in-memory] [\"task description\"|file-path]" argument-hint: "[-y|--yes] [--in-memory] [\"task description\"|file-path]"
allowed-tools: TodoWrite(*), Task(*), Bash(*) allowed-tools: TodoWrite(*), Task(*), Bash(*)
--- ---
@@ -62,31 +62,49 @@ Flexible task execution command supporting three input modes: in-memory plan (fr
**User Interaction**: **User Interaction**:
```javascript ```javascript
AskUserQuestion({ // Parse --yes flag
questions: [ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
{
question: "Select execution method:", let userSelection
header: "Execution",
multiSelect: false, if (autoYes) {
options: [ // Auto mode: Use defaults
{ label: "Agent", description: "@code-developer agent" }, console.log(`[--yes] Auto-confirming execution:`)
{ label: "Codex", description: "codex CLI tool" }, console.log(` - Execution method: Auto`)
{ label: "Auto", description: "Auto-select based on complexity" } console.log(` - Code review: Skip`)
]
}, userSelection = {
{ execution_method: "Auto",
question: "Enable code review after execution?", code_review_tool: "Skip"
header: "Code Review", }
multiSelect: false, } else {
options: [ // Interactive mode: Ask user
{ label: "Skip", description: "No review" }, userSelection = AskUserQuestion({
{ label: "Gemini Review", description: "Gemini CLI tool" }, questions: [
{ label: "Codex Review", description: "Git-aware review (prompt OR --uncommitted)" }, {
{ label: "Agent Review", description: "Current agent review" } question: "Select execution method:",
] header: "Execution",
} multiSelect: false,
] options: [
}) { label: "Agent", description: "@code-developer agent" },
{ label: "Codex", description: "codex CLI tool" },
{ label: "Auto", description: "Auto-select based on complexity" }
]
},
{
question: "Enable code review after execution?",
header: "Code Review",
multiSelect: false,
options: [
{ label: "Skip", description: "No review" },
{ label: "Gemini Review", description: "Gemini CLI tool" },
{ label: "Codex Review", description: "Git-aware review (prompt OR --uncommitted)" },
{ label: "Agent Review", description: "Current agent review" }
]
}
]
})
}
``` ```
### Mode 3: File Content ### Mode 3: File Content

View File

@@ -1,7 +1,7 @@
--- ---
name: lite-fix name: lite-fix
description: Lightweight bug diagnosis and fix workflow with intelligent severity assessment and optional hotfix mode for production incidents description: Lightweight bug diagnosis and fix workflow with intelligent severity assessment and optional hotfix mode for production incidents
argument-hint: "[--hotfix] \"bug description or issue reference\"" argument-hint: "[-y|--yes] [--hotfix] \"bug description or issue reference\""
allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*) allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*)
--- ---
@@ -25,10 +25,32 @@ Intelligent lightweight bug fixing command with dynamic workflow adaptation base
/workflow:lite-fix [FLAGS] <BUG_DESCRIPTION> /workflow:lite-fix [FLAGS] <BUG_DESCRIPTION>
# Flags # Flags
-y, --yes Skip all confirmations (auto mode)
--hotfix, -h Production hotfix mode (minimal diagnosis, fast fix) --hotfix, -h Production hotfix mode (minimal diagnosis, fast fix)
# Arguments # Arguments
<bug-description> Bug description, error message, or path to .md file (required) <bug-description> Bug description, error message, or path to .md file (required)
# Examples
/workflow:lite-fix "用户登录失败" # Interactive mode
/workflow:lite-fix --yes "用户登录失败" # Auto mode (no confirmations)
/workflow:lite-fix -y --hotfix "生产环境数据库连接失败" # Auto + hotfix mode
```
## Auto Mode Defaults
When `--yes` or `-y` flag is used:
- **Clarification Questions**: Skipped (no clarification phase)
- **Fix Plan Confirmation**: Auto-selected "Allow"
- **Execution Method**: Auto-selected "Auto"
- **Code Review**: Auto-selected "Skip"
- **Severity**: Uses auto-detected severity (no manual override)
- **Hotfix Mode**: Respects --hotfix flag if present, otherwise normal mode
**Flag Parsing**:
```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const hotfixMode = $ARGUMENTS.includes('--hotfix') || $ARGUMENTS.includes('-h')
``` ```
## Execution Process ## Execution Process
@@ -332,9 +354,17 @@ function deduplicateClarifications(clarifications) {
const uniqueClarifications = deduplicateClarifications(allClarifications) const uniqueClarifications = deduplicateClarifications(allClarifications)
// Multi-round clarification: batch questions (max 4 per round) // Parse --yes flag
// ⚠️ MUST execute ALL rounds until uniqueClarifications exhausted const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
if (uniqueClarifications.length > 0) {
if (autoYes) {
// Auto mode: Skip clarification phase
console.log(`[--yes] Skipping ${uniqueClarifications.length} clarification questions`)
console.log(`Proceeding to fix planning with diagnosis results...`)
// Continue to Phase 3
} else if (uniqueClarifications.length > 0) {
// Interactive mode: Multi-round clarification
// ⚠️ MUST execute ALL rounds until uniqueClarifications exhausted
const BATCH_SIZE = 4 const BATCH_SIZE = 4
const totalRounds = Math.ceil(uniqueClarifications.length / BATCH_SIZE) const totalRounds = Math.ceil(uniqueClarifications.length / BATCH_SIZE)
@@ -600,40 +630,60 @@ ${fixPlan.tasks.map((t, i) => `${i+1}. ${t.title} (${t.scope})`).join('\n')}
**Step 4.2: Collect Confirmation** **Step 4.2: Collect Confirmation**
```javascript ```javascript
AskUserQuestion({ // Parse --yes flag
questions: [ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
{
question: `Confirm fix plan? (${fixPlan.tasks.length} tasks, ${fixPlan.severity} severity)`, let userSelection
header: "Confirm",
multiSelect: true, if (autoYes) {
options: [ // Auto mode: Use defaults
{ label: "Allow", description: "Proceed as-is" }, console.log(`[--yes] Auto-confirming fix plan:`)
{ label: "Modify", description: "Adjust before execution" }, console.log(` - Confirmation: Allow`)
{ label: "Cancel", description: "Abort workflow" } console.log(` - Execution: Auto`)
] console.log(` - Review: Skip`)
},
{ userSelection = {
question: "Execution method:", confirmation: "Allow",
header: "Execution", execution_method: "Auto",
multiSelect: false, code_review_tool: "Skip"
options: [ }
{ label: "Agent", description: "@code-developer agent" }, } else {
{ label: "Codex", description: "codex CLI tool" }, // Interactive mode: Ask user
{ label: "Auto", description: `Auto: ${fixPlan.severity === 'Low' ? 'Agent' : 'Codex'}` } userSelection = AskUserQuestion({
] questions: [
}, {
{ question: `Confirm fix plan? (${fixPlan.tasks.length} tasks, ${fixPlan.severity} severity)`,
question: "Code review after fix?", header: "Confirm",
header: "Review", multiSelect: false,
multiSelect: false, options: [
options: [ { label: "Allow", description: "Proceed as-is" },
{ label: "Gemini Review", description: "Gemini CLI" }, { label: "Modify", description: "Adjust before execution" },
{ label: "Agent Review", description: "@code-reviewer" }, { label: "Cancel", description: "Abort workflow" }
{ label: "Skip", description: "No review" } ]
] },
} {
] question: "Execution method:",
}) header: "Execution",
multiSelect: false,
options: [
{ label: "Agent", description: "@code-developer agent" },
{ label: "Codex", description: "codex CLI tool" },
{ label: "Auto", description: `Auto: ${fixPlan.severity === 'Low' ? 'Agent' : 'Codex'}` }
]
},
{
question: "Code review after fix?",
header: "Review",
multiSelect: false,
options: [
{ label: "Gemini Review", description: "Gemini CLI" },
{ label: "Agent Review", description: "@code-reviewer" },
{ label: "Skip", description: "No review" }
]
}
]
})
}
``` ```
--- ---

View File

@@ -1,10 +1,14 @@
--- ---
name: workflow:lite-lite-lite name: workflow:lite-lite-lite
description: Ultra-lightweight multi-tool analysis and direct execution. No artifacts for simple tasks; auto-creates planning docs in .workflow/.scratchpad/ for complex tasks. Auto tool selection based on task analysis, user-driven iteration via AskUser. description: Ultra-lightweight multi-tool analysis and direct execution. No artifacts for simple tasks; auto-creates planning docs in .workflow/.scratchpad/ for complex tasks. Auto tool selection based on task analysis, user-driven iteration via AskUser.
argument-hint: "<task description>" argument-hint: "[-y|--yes] <task description>"
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), Write(*), mcp__ace-tool__search_context(*), mcp__ccw-tools__write_file(*) allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), Write(*), mcp__ace-tool__search_context(*), mcp__ccw-tools__write_file(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Skip clarification questions, auto-select tools, execute directly with recommended settings.
# Ultra-Lite Multi-Tool Workflow # Ultra-Lite Multi-Tool Workflow
## Quick Start ## Quick Start

View File

@@ -1,7 +1,7 @@
--- ---
name: lite-plan name: lite-plan
description: Lightweight interactive planning workflow with in-memory planning, code exploration, and execution execute to lite-execute after user confirmation description: Lightweight interactive planning workflow with in-memory planning, code exploration, and execution execute to lite-execute after user confirmation
argument-hint: "[-e|--explore] \"task description\"|file.md" argument-hint: "[-y|--yes] [-e|--explore] \"task description\"|file.md"
allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*) allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*)
--- ---
@@ -25,10 +25,30 @@ Intelligent lightweight planning command with dynamic workflow adaptation based
/workflow:lite-plan [FLAGS] <TASK_DESCRIPTION> /workflow:lite-plan [FLAGS] <TASK_DESCRIPTION>
# Flags # Flags
-y, --yes Skip all confirmations (auto mode)
-e, --explore Force code exploration phase (overrides auto-detection) -e, --explore Force code exploration phase (overrides auto-detection)
# Arguments # Arguments
<task-description> Task description or path to .md file (required) <task-description> Task description or path to .md file (required)
# Examples
/workflow:lite-plan "实现JWT认证" # Interactive mode
/workflow:lite-plan --yes "实现JWT认证" # Auto mode (no confirmations)
/workflow:lite-plan -y -e "优化数据库查询性能" # Auto mode + force exploration
```
## Auto Mode Defaults
When `--yes` or `-y` flag is used:
- **Clarification Questions**: Skipped (no clarification phase)
- **Plan Confirmation**: Auto-selected "Allow"
- **Execution Method**: Auto-selected "Auto"
- **Code Review**: Auto-selected "Skip"
**Flag Parsing**:
```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
const forceExplore = $ARGUMENTS.includes('--explore') || $ARGUMENTS.includes('-e')
``` ```
## Execution Process ## Execution Process
@@ -323,8 +343,16 @@ explorations.forEach(exp => {
// - Produce dedupedClarifications with unique intents only // - Produce dedupedClarifications with unique intents only
const dedupedClarifications = intelligentMerge(allClarifications) const dedupedClarifications = intelligentMerge(allClarifications)
// Multi-round clarification: batch questions (max 4 per round) // Parse --yes flag
if (dedupedClarifications.length > 0) { const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
if (autoYes) {
// Auto mode: Skip clarification phase
console.log(`[--yes] Skipping ${dedupedClarifications.length} clarification questions`)
console.log(`Proceeding to planning with exploration results...`)
// Continue to Phase 3
} else if (dedupedClarifications.length > 0) {
// Interactive mode: Multi-round clarification
const BATCH_SIZE = 4 const BATCH_SIZE = 4
const totalRounds = Math.ceil(dedupedClarifications.length / BATCH_SIZE) const totalRounds = Math.ceil(dedupedClarifications.length / BATCH_SIZE)
@@ -497,42 +525,62 @@ ${plan.tasks.map((t, i) => `${i+1}. ${t.title} (${t.file})`).join('\n')}
**Step 4.2: Collect Confirmation** **Step 4.2: Collect Confirmation**
```javascript ```javascript
// Note: Execution "Other" option allows specifying CLI tools from ~/.claude/cli-tools.json // Parse --yes flag
AskUserQuestion({ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
questions: [
{ let userSelection
question: `Confirm plan? (${plan.tasks.length} tasks, ${plan.complexity})`,
header: "Confirm", if (autoYes) {
multiSelect: true, // Auto mode: Use defaults
options: [ console.log(`[--yes] Auto-confirming plan:`)
{ label: "Allow", description: "Proceed as-is" }, console.log(` - Confirmation: Allow`)
{ label: "Modify", description: "Adjust before execution" }, console.log(` - Execution: Auto`)
{ label: "Cancel", description: "Abort workflow" } console.log(` - Review: Skip`)
]
}, userSelection = {
{ confirmation: "Allow",
question: "Execution method:", execution_method: "Auto",
header: "Execution", code_review_tool: "Skip"
multiSelect: false, }
options: [ } else {
{ label: "Agent", description: "@code-developer agent" }, // Interactive mode: Ask user
{ label: "Codex", description: "codex CLI tool" }, // Note: Execution "Other" option allows specifying CLI tools from ~/.claude/cli-tools.json
{ label: "Auto", description: `Auto: ${plan.complexity === 'Low' ? 'Agent' : 'Codex'}` } userSelection = AskUserQuestion({
] questions: [
}, {
{ question: `Confirm plan? (${plan.tasks.length} tasks, ${plan.complexity})`,
question: "Code review after execution?", header: "Confirm",
header: "Review", multiSelect: false,
multiSelect: false, options: [
options: [ { label: "Allow", description: "Proceed as-is" },
{ label: "Gemini Review", description: "Gemini CLI review" }, { label: "Modify", description: "Adjust before execution" },
{ label: "Codex Review", description: "Git-aware review (prompt OR --uncommitted)" }, { label: "Cancel", description: "Abort workflow" }
{ label: "Agent Review", description: "@code-reviewer agent" }, ]
{ label: "Skip", description: "No review" } },
] {
} question: "Execution method:",
] header: "Execution",
}) multiSelect: false,
options: [
{ label: "Agent", description: "@code-developer agent" },
{ label: "Codex", description: "codex CLI tool" },
{ label: "Auto", description: `Auto: ${plan.complexity === 'Low' ? 'Agent' : 'Codex'}` }
]
},
{
question: "Code review after execution?",
header: "Review",
multiSelect: false,
options: [
{ label: "Gemini Review", description: "Gemini CLI review" },
{ label: "Codex Review", description: "Git-aware review (prompt OR --uncommitted)" },
{ label: "Agent Review", description: "@code-reviewer agent" },
{ label: "Skip", description: "No review" }
]
}
]
})
}
``` ```
--- ---

View File

@@ -1,10 +1,14 @@
--- ---
name: workflow:multi-cli-plan name: workflow:multi-cli-plan
description: Multi-CLI collaborative planning workflow with ACE context gathering and iterative cross-verification. Uses cli-discuss-agent for Gemini+Codex+Claude analysis to converge on optimal execution plan. description: Multi-CLI collaborative planning workflow with ACE context gathering and iterative cross-verification. Uses cli-discuss-agent for Gemini+Codex+Claude analysis to converge on optimal execution plan.
argument-hint: "<task description> [--max-rounds=3] [--tools=gemini,codex] [--mode=parallel|serial]" argument-hint: "[-y|--yes] <task description> [--max-rounds=3] [--tools=gemini,codex] [--mode=parallel|serial]"
allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), Write(*), mcp__ace-tool__search_context(*) allowed-tools: TodoWrite(*), Task(*), AskUserQuestion(*), Read(*), Bash(*), Write(*), mcp__ace-tool__search_context(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-approve plan, use recommended solution and execution method (Agent, Skip review).
# Multi-CLI Collaborative Planning Command # Multi-CLI Collaborative Planning Command
## Quick Start ## Quick Start

View File

@@ -1,10 +1,14 @@
--- ---
name: plan name: plan
description: 5-phase planning workflow with action-planning-agent task generation, outputs IMPL_PLAN.md and task JSONs description: 5-phase planning workflow with action-planning-agent task generation, outputs IMPL_PLAN.md and task JSONs
argument-hint: "\"text description\"|file.md" argument-hint: "[-y|--yes] \"text description\"|file.md"
allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*) allowed-tools: SlashCommand(*), TodoWrite(*), Read(*), Bash(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-continue all phases (skip confirmations), use recommended conflict resolutions.
# Workflow Plan Command (/workflow:plan) # Workflow Plan Command (/workflow:plan)
## Coordinator Role ## Coordinator Role

View File

@@ -1,7 +1,7 @@
--- ---
name: replan name: replan
description: Interactive workflow replanning with session-level artifact updates and boundary clarification through guided questioning description: Interactive workflow replanning with session-level artifact updates and boundary clarification through guided questioning
argument-hint: "[--session session-id] [task-id] \"requirements\"|file.md [--interactive]" argument-hint: "[-y|--yes] [--session session-id] [task-id] \"requirements\"|file.md [--interactive]"
allowed-tools: Read(*), Write(*), Edit(*), TodoWrite(*), Glob(*), Bash(*) allowed-tools: Read(*), Write(*), Edit(*), TodoWrite(*), Glob(*), Bash(*)
--- ---
@@ -117,10 +117,48 @@ const taskId = taskIdMatch?.[1]
--- ---
### Auto Mode Support
When `--yes` or `-y` flag is used, the command skips interactive clarification and uses safe defaults:
```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
```
**Auto Mode Defaults**:
- **Modification Scope**: `tasks_only` (safest - only update task details)
- **Affected Modules**: All modules related to the task
- **Task Changes**: `update_only` (no structural changes)
- **Dependency Changes**: `no` (preserve existing dependencies)
- **User Confirmation**: Auto-confirm execution
**Note**: `--interactive` flag overrides `--yes` flag (forces interactive mode).
---
### Phase 2: Interactive Requirement Clarification ### Phase 2: Interactive Requirement Clarification
**Purpose**: Define modification scope through guided questioning **Purpose**: Define modification scope through guided questioning
**Auto Mode Check**:
```javascript
if (autoYes && !interactive) {
// Use defaults and skip to Phase 3
console.log(`[--yes] Using safe defaults for replan:`)
console.log(` - Scope: tasks_only`)
console.log(` - Changes: update_only`)
console.log(` - Dependencies: preserve existing`)
userSelections = {
scope: 'tasks_only',
modules: 'all_affected',
task_changes: 'update_only',
dependency_changes: false
}
// Proceed to Phase 3
}
```
#### Session Mode Questions #### Session Mode Questions
**Q1: Modification Scope** **Q1: Modification Scope**
@@ -228,10 +266,29 @@ interface ImpactAnalysis {
**Step 3.3: User Confirmation** **Step 3.3: User Confirmation**
```javascript ```javascript
Options: // Parse --yes flag
- 确认执行: 开始应用所有修改 const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
- 调整计划: 重新回答问题调整范围
- 取消操作: 放弃本次重规划 if (autoYes) {
// Auto mode: Auto-confirm execution
console.log(`[--yes] Auto-confirming replan execution`)
userConfirmation = '确认执行'
// Proceed to Phase 4
} else {
// Interactive mode: Ask user
AskUserQuestion({
questions: [{
question: "修改计划已生成,请确认操作:",
header: "Confirm",
options: [
{ label: "确认执行", description: "开始应用所有修改" },
{ label: "调整计划", description: "重新回答问题调整范围" },
{ label: "取消操作", description: "放弃本次重规划" }
],
multiSelect: false
}]
})
}
``` ```
**Output**: Modification plan confirmed or adjusted **Output**: Modification plan confirmed or adjusted

View File

@@ -606,5 +606,3 @@ Use `ccw view` to open the workflow dashboard in browser:
```bash ```bash
ccw view ccw view
``` ```

View File

@@ -1,8 +1,10 @@
--- ---
name: complete name: complete
description: Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag description: Mark active workflow session as complete, archive with lessons learned, update manifest, remove active flag
argument-hint: "[-y|--yes] [--detailed]"
examples: examples:
- /workflow:session:complete - /workflow:session:complete
- /workflow:session:complete --yes
- /workflow:session:complete --detailed - /workflow:session:complete --detailed
--- ---
@@ -139,20 +141,41 @@ test -f .workflow/project-tech.json || echo "SKIP"
After successful archival, prompt user to capture learnings: After successful archival, prompt user to capture learnings:
```javascript ```javascript
AskUserQuestion({ // Parse --yes flag
questions: [{ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
question: "Would you like to solidify learnings from this session into project guidelines?",
header: "Solidify", if (autoYes) {
options: [ // Auto mode: Skip solidify
{ label: "Yes, solidify now", description: "Extract learnings and update project-guidelines.json" }, console.log(`[--yes] Auto-selecting: Skip solidify`)
{ label: "Skip", description: "Archive complete, no learnings to capture" } console.log(`Session archived successfully.`)
], // Done - no solidify
multiSelect: false } else {
}] // Interactive mode: Ask user
}) AskUserQuestion({
questions: [{
question: "Would you like to solidify learnings from this session into project guidelines?",
header: "Solidify",
options: [
{ label: "Yes, solidify now", description: "Extract learnings and update project-guidelines.json" },
{ label: "Skip", description: "Archive complete, no learnings to capture" }
],
multiSelect: false
}]
})
// **If "Yes, solidify now"**: Execute `/workflow:session:solidify` with the archived session ID.
}
``` ```
**If "Yes, solidify now"**: Execute `/workflow:session:solidify` with the archived session ID. ## Auto Mode Defaults
When `--yes` or `-y` flag is used:
- **Solidify Learnings**: Auto-selected "Skip" (archive only, no solidify)
**Flag Parsing**:
```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
```
**Output**: **Output**:
``` ```

View File

@@ -1,14 +1,18 @@
--- ---
name: solidify name: solidify
description: Crystallize session learnings and user-defined constraints into permanent project guidelines description: Crystallize session learnings and user-defined constraints into permanent project guidelines
argument-hint: "[--type <convention|constraint|learning>] [--category <category>] \"rule or insight\"" argument-hint: "[-y|--yes] [--type <convention|constraint|learning>] [--category <category>] \"rule or insight\""
examples: examples:
- /workflow:session:solidify "Use functional components for all React code" --type convention - /workflow:session:solidify "Use functional components for all React code" --type convention
- /workflow:session:solidify "No direct DB access from controllers" --type constraint --category architecture - /workflow:session:solidify -y "No direct DB access from controllers" --type constraint --category architecture
- /workflow:session:solidify "Cache invalidation requires event sourcing" --type learning --category architecture - /workflow:session:solidify "Cache invalidation requires event sourcing" --type learning --category architecture
- /workflow:session:solidify --interactive - /workflow:session:solidify --interactive
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-categorize and add guideline without confirmation.
# Session Solidify Command (/workflow:session:solidify) # Session Solidify Command (/workflow:session:solidify)
## Overview ## Overview

View File

@@ -1,12 +1,16 @@
--- ---
name: conflict-resolution name: conflict-resolution
description: Detect and resolve conflicts between plan and existing codebase using CLI-powered analysis with Gemini/Qwen description: Detect and resolve conflicts between plan and existing codebase using CLI-powered analysis with Gemini/Qwen
argument-hint: "--session WFS-session-id --context path/to/context-package.json" argument-hint: "[-y|--yes] --session WFS-session-id --context path/to/context-package.json"
examples: examples:
- /workflow:tools:conflict-resolution --session WFS-auth --context .workflow/active/WFS-auth/.process/context-package.json - /workflow:tools:conflict-resolution --session WFS-auth --context .workflow/active/WFS-auth/.process/context-package.json
- /workflow:tools:conflict-resolution --session WFS-payment --context .workflow/active/WFS-payment/.process/context-package.json - /workflow:tools:conflict-resolution -y --session WFS-payment --context .workflow/active/WFS-payment/.process/context-package.json
--- ---
## Auto Mode
When `--yes` or `-y`: Auto-select recommended strategy for each conflict, skip clarification questions.
# Conflict Resolution Command # Conflict Resolution Command
## Purpose ## Purpose
@@ -209,6 +213,8 @@ Task(subagent_type="cli-execution-agent", run_in_background=false, prompt=`
### Phase 3: User Interaction Loop ### Phase 3: User Interaction Loop
```javascript ```javascript
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
FOR each conflict: FOR each conflict:
round = 0, clarified = false, userClarifications = [] round = 0, clarified = false, userClarifications = []
@@ -216,8 +222,13 @@ FOR each conflict:
// 1. Display conflict info (text output for context) // 1. Display conflict info (text output for context)
displayConflictSummary(conflict) // id, brief, severity, overlap_analysis if ModuleOverlap displayConflictSummary(conflict) // id, brief, severity, overlap_analysis if ModuleOverlap
// 2. Strategy selection via AskUserQuestion // 2. Strategy selection
AskUserQuestion({ if (autoYes) {
console.log(`[--yes] Auto-selecting recommended strategy`)
selectedStrategy = conflict.strategies[conflict.recommended || 0]
clarified = true // Skip clarification loop
} else {
AskUserQuestion({
questions: [{ questions: [{
question: formatStrategiesForDisplay(conflict.strategies), question: formatStrategiesForDisplay(conflict.strategies),
header: "策略选择", header: "策略选择",
@@ -230,18 +241,19 @@ FOR each conflict:
{ label: "自定义修改", description: `建议: ${conflict.modification_suggestions?.slice(0,2).join('; ')}` } { label: "自定义修改", description: `建议: ${conflict.modification_suggestions?.slice(0,2).join('; ')}` }
] ]
}] }]
}) })
// 3. Handle selection // 3. Handle selection
if (userChoice === "自定义修改") { if (userChoice === "自定义修改") {
customConflicts.push({ id, brief, category, suggestions, overlap_analysis }) customConflicts.push({ id, brief, category, suggestions, overlap_analysis })
break break
}
selectedStrategy = findStrategyByName(userChoice)
} }
selectedStrategy = findStrategyByName(userChoice)
// 4. Clarification (if needed) - batched max 4 per call // 4. Clarification (if needed) - batched max 4 per call
if (selectedStrategy.clarification_needed?.length > 0) { if (!autoYes && selectedStrategy.clarification_needed?.length > 0) {
for (batch of chunk(selectedStrategy.clarification_needed, 4)) { for (batch of chunk(selectedStrategy.clarification_needed, 4)) {
AskUserQuestion({ AskUserQuestion({
questions: batch.map((q, i) => ({ questions: batch.map((q, i) => ({

View File

@@ -1,11 +1,16 @@
--- ---
name: task-generate-agent name: task-generate-agent
description: Generate implementation plan documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) using action-planning-agent - produces planning artifacts, does NOT execute code implementation description: Generate implementation plan documents (IMPL_PLAN.md, task JSONs, TODO_LIST.md) using action-planning-agent - produces planning artifacts, does NOT execute code implementation
argument-hint: "--session WFS-session-id" argument-hint: "[-y|--yes] --session WFS-session-id"
examples: examples:
- /workflow:tools:task-generate-agent --session WFS-auth - /workflow:tools:task-generate-agent --session WFS-auth
- /workflow:tools:task-generate-agent -y --session WFS-auth
--- ---
## Auto Mode
When `--yes` or `-y`: Skip user questions, use defaults (no materials, Agent executor, Codex CLI tool).
# Generate Implementation Plan Command # Generate Implementation Plan Command
## Overview ## Overview
@@ -67,9 +72,25 @@ Phase 3: Integration (+1 Coordinator, Multi-Module Only)
**Purpose**: Collect user preferences before task generation to ensure generated tasks match execution expectations. **Purpose**: Collect user preferences before task generation to ensure generated tasks match execution expectations.
**User Questions**: **Auto Mode Check**:
```javascript ```javascript
AskUserQuestion({ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
if (autoYes) {
console.log(`[--yes] Using defaults: No materials, Agent executor, Codex CLI`)
userConfig = {
supplementaryMaterials: { type: "none", content: [] },
executionMethod: "agent",
preferredCliTool: "codex",
enableResume: true
}
// Skip to Phase 1
}
```
**User Questions** (skipped if autoYes):
```javascript
if (!autoYes) AskUserQuestion({
questions: [ questions: [
{ {
question: "Do you have supplementary materials or guidelines to include?", question: "Do you have supplementary materials or guidelines to include?",
@@ -104,11 +125,10 @@ AskUserQuestion({
} }
] ]
}) })
```
**Handle Materials Response**: **Handle Materials Response** (skipped if autoYes):
```javascript ```javascript
if (userConfig.materials === "Provide file paths") { if (!autoYes && userConfig.materials === "Provide file paths") {
// Follow-up question for file paths // Follow-up question for file paths
const pathsResponse = AskUserQuestion({ const pathsResponse = AskUserQuestion({
questions: [{ questions: [{

View File

@@ -1,11 +1,16 @@
--- ---
name: task-generate-tdd name: task-generate-tdd
description: Autonomous TDD task generation using action-planning-agent with Red-Green-Refactor cycles, test-first structure, and cycle validation description: Autonomous TDD task generation using action-planning-agent with Red-Green-Refactor cycles, test-first structure, and cycle validation
argument-hint: "--session WFS-session-id" argument-hint: "[-y|--yes] --session WFS-session-id"
examples: examples:
- /workflow:tools:task-generate-tdd --session WFS-auth - /workflow:tools:task-generate-tdd --session WFS-auth
- /workflow:tools:task-generate-tdd -y --session WFS-auth
--- ---
## Auto Mode
When `--yes` or `-y`: Skip user questions, use defaults (no materials, Agent executor).
# Autonomous TDD Task Generation Command # Autonomous TDD Task Generation Command
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: animation-extract name: animation-extract
description: Extract animation and transition patterns from prompt inference and image references for design system documentation description: Extract animation and transition patterns from prompt inference and image references for design system documentation
argument-hint: "[--design-id <id>] [--session <id>] [--images "<glob>"] [--focus "<types>"] [--interactive] [--refine]" argument-hint: "[-y|--yes] [--design-id <id>] [--session <id>] [--images "<glob>"] [--focus "<types>"] [--interactive] [--refine]"
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Task(ui-design-agent) allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Task(ui-design-agent)
--- ---
## Auto Mode
When `--yes` or `-y`: Skip all clarification questions, use AI-inferred animation decisions.
# Animation Extraction Command # Animation Extraction Command
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: layout-extract name: layout-extract
description: Extract structural layout information from reference images or text prompts using Claude analysis with variant generation or refinement mode description: Extract structural layout information from reference images or text prompts using Claude analysis with variant generation or refinement mode
argument-hint: [--design-id <id>] [--session <id>] [--images "<glob>"] [--prompt "<desc>"] [--targets "<list>"] [--variants <count>] [--device-type <desktop|mobile|tablet|responsive>] [--interactive] [--refine] argument-hint: "[-y|--yes] [--design-id <id>] [--session <id>] [--images "<glob>"] [--prompt "<desc>"] [--targets "<list>"] [--variants <count>] [--device-type <desktop|mobile|tablet|responsive>] [--interactive] [--refine]"
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Task(ui-design-agent), mcp__exa__web_search_exa(*) allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), Bash(*), AskUserQuestion(*), Task(ui-design-agent), mcp__exa__web_search_exa(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Skip all clarification questions, use AI-inferred layout decisions.
# Layout Extraction Command # Layout Extraction Command
## Overview ## Overview

View File

@@ -1,10 +1,14 @@
--- ---
name: style-extract name: style-extract
description: Extract design style from reference images or text prompts using Claude analysis with variant generation or refinement mode description: Extract design style from reference images or text prompts using Claude analysis with variant generation or refinement mode
argument-hint: "[--design-id <id>] [--session <id>] [--images "<glob>"] [--prompt "<desc>"] [--variants <count>] [--interactive] [--refine]" argument-hint: "[-y|--yes] [--design-id <id>] [--session <id>] [--images "<glob>"] [--prompt "<desc>"] [--variants <count>] [--interactive] [--refine]"
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), AskUserQuestion(*) allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*), AskUserQuestion(*)
--- ---
## Auto Mode
When `--yes` or `-y`: Skip all clarification questions, use AI-inferred design decisions.
# Style Extraction Command # Style Extraction Command
## Overview ## Overview

View File

@@ -45,6 +45,7 @@ allowed-tools: Task, AskUserQuestion, Read, Write, Bash, Glob, Grep
5. **执行透明性**: 展示执行进度、结果和可能的错误 5. **执行透明性**: 展示执行进度、结果和可能的错误
6. **会话持久化**: 保存编排会话,支持中途暂停和恢复 6. **会话持久化**: 保存编排会话,支持中途暂停和恢复
7. **智能提示词生成**: 根据任务上下文和前序产物自动生成 ccw cli 提示词 7. **智能提示词生成**: 根据任务上下文和前序产物自动生成 ccw cli 提示词
8. **自动确认**: 所有命令自动添加 `-y` 参数,跳过交互式确认,实现无人值守执行
## Intelligent Prompt Generation ## Intelligent Prompt Generation

View File

@@ -66,8 +66,8 @@ for (let i = current_command_index; i < command_chain.length; i++) {
const prompt = generatePrompt(cmd, state, commandMeta); const prompt = generatePrompt(cmd, state, commandMeta);
try { try {
// 使用 ccw cli 执行 // 使用 ccw cli 执行(添加 -y 参数跳过确认)
const result = Bash(`ccw cli -p "${prompt.replace(/"/g, '\\"')}" ${cmd.command}`, { const result = Bash(`ccw cli -p "${prompt.replace(/"/g, '\\"')}" ${cmd.command} -y`, {
run_in_background: true run_in_background: true
}); });

View File

@@ -254,8 +254,30 @@ function main() {
chain = args[1].split(',').map(s => s.trim()); chain = args[1].split(',').map(s => s.trim());
} else if (args[0] === '--file') { } else if (args[0] === '--file') {
const filePath = args[1]; const filePath = args[1];
const fileContent = JSON.parse(fs.readFileSync(filePath, 'utf8'));
chain = fileContent.chain || fileContent.steps.map(s => s.command); // SEC-001: 路径遍历验证 - 只允许访问工作目录下的文件
const resolvedPath = path.resolve(filePath);
const workDir = path.resolve('.');
if (!resolvedPath.startsWith(workDir)) {
console.error('Error: File path must be within current working directory');
process.exit(1);
}
// CORR-001: JSON 解析错误处理
let fileContent;
try {
fileContent = JSON.parse(fs.readFileSync(resolvedPath, 'utf8'));
} catch (error) {
console.error(`Error: Failed to parse JSON file ${filePath}: ${error.message}`);
process.exit(1);
}
// CORR-002: 嵌套属性 null 检查
chain = fileContent.chain || fileContent.steps?.map(s => s.command) || [];
if (chain.length === 0) {
console.error('Error: No valid chain found in file (expected "chain" array or "steps" with "command" fields)');
process.exit(1);
}
} else { } else {
chain = args; chain = args;
} }

View File

@@ -48,7 +48,19 @@ class CommandRegistry {
} }
/** /**
* 解析 YAML 头 * 解析 YAML 头 (简化版本)
*
* 限制:
* - 只支持简单的 key: value 对 (单行值)
* - 不支持多行值、嵌套对象、复杂列表
* - allowed-tools 字段支持逗号分隔的字符串,自动转为数组
*
* 示例:
* ---
* name: lite-plan
* description: "Lightweight planning workflow"
* allowed-tools: Read, Write, Bash
* ---
*/ */
parseYamlHeader(content) { parseYamlHeader(content) {
// 处理 Windows 行结尾 (\r\n) // 处理 Windows 行结尾 (\r\n)
@@ -58,23 +70,36 @@ class CommandRegistry {
const yamlContent = match[1]; const yamlContent = match[1];
const result = {}; const result = {};
const lines = yamlContent.split(/[\r\n]+/); try {
for (const line of lines) { const lines = yamlContent.split(/[\r\n]+/);
if (!line.trim()) continue; for (const line of lines) {
const trimmed = line.trim();
if (!trimmed || trimmed.startsWith('#')) continue; // 跳过空行和注释
const colonIndex = line.indexOf(':'); const colonIndex = trimmed.indexOf(':');
if (colonIndex === -1) continue; if (colonIndex === -1) continue;
const key = line.substring(0, colonIndex).trim(); const key = trimmed.substring(0, colonIndex).trim();
const value = line.substring(colonIndex + 1).trim(); const value = trimmed.substring(colonIndex + 1).trim();
let cleanValue = value.replace(/^["']|["']$/g, ''); if (!key) continue; // 跳过无效行
if (key === 'allowed-tools') { // 去除引号 (单引号或双引号)
cleanValue = cleanValue.split(',').map(t => t.trim()); let cleanValue = value.replace(/^["']|["']$/g, '');
// allowed-tools 字段特殊处理:转为数组
// 支持格式: "Read, Write, Bash" 或 "Read,Write,Bash"
if (key === 'allowed-tools') {
cleanValue = Array.isArray(cleanValue)
? cleanValue
: cleanValue.split(',').map(t => t.trim()).filter(t => t);
}
result[key] = cleanValue;
} }
} catch (error) {
result[key] = cleanValue; console.error('YAML parsing error:', error.message);
return null;
} }
return result; return result;