refactor(lite-plan): enhance three-dimensional confirmation to support multi-select interactions for task approval, execution method, and code review tool

This commit is contained in:
catlog22
2025-11-15 19:59:38 +08:00
parent 4a5c8490b1
commit a721c50ba3

View File

@@ -21,7 +21,7 @@ Intelligent lightweight planning and execution command with dynamic workflow ada
- **Adaptive Planning**: - **Adaptive Planning**:
- Simple tasks: Direct planning by current Claude - Simple tasks: Direct planning by current Claude
- Complex tasks: Delegates to cli-planning-agent for detailed breakdown - Complex tasks: Delegates to cli-planning-agent for detailed breakdown
- **Three-Dimensional Confirmation**: Single user interaction for task approval + execution method selection + code review tool selection - **Three-Dimensional Confirmation**: Multi-select interaction for task approval + execution method selection + code review tool selection
- **Direct Execution**: Immediate dispatch to selected execution method (agent or CLI) - **Direct Execution**: Immediate dispatch to selected execution method (agent or CLI)
- **Live Progress Tracking**: Real-time TodoWrite updates during execution - **Live Progress Tracking**: Real-time TodoWrite updates during execution
- **Optional Code Review**: Post-execution quality analysis with claude/gemini/qwen/codex (user selectable) - **Optional Code Review**: Post-execution quality analysis with claude/gemini/qwen/codex (user selectable)
@@ -74,12 +74,11 @@ User Input ("/workflow:lite-plan \"task\"")
v v
[Phase 4] Task Confirmation & Execution Selection (User interaction) [Phase 4] Task Confirmation & Execution Selection (User interaction)
-> Display task breakdown and approach -> Display task breakdown and approach
-> AskUserQuestion: Three dimensions -> AskUserQuestion: Three dimensions (all multi-select)
1. Confirm task (Yes/Modify/Cancel) 1. Confirm task: Allow/Modify/Cancel (can supplement via Other)
2. Execution method (Direct/CLI) 2. Execution method: Agent/Provide Plan/CLI (input CLI tool in Other)
3. Code review tool (No/Claude/Gemini/Qwen/Codex) 3. Code review: No/Claude/Gemini/Qwen/Codex
-> If confirmed: Proceed to Phase 5 -> Process selections and proceed to Phase 5
-> If modify: Re-run planning with feedback
-> If cancel: Exit -> If cancel: Exit
| |
v v
@@ -392,58 +391,58 @@ planObject = {
### Phase 4: Task Confirmation & Execution Selection ### Phase 4: Task Confirmation & Execution Selection
**User Interaction Flow**: Three-dimensional confirmation (task + execution method + code review) **User Interaction Flow**: Three-dimensional multi-select confirmation
**Operations**: **Operations**:
- Display plan summary with full task breakdown - Display plan summary with full task breakdown
- Collect three-dimensional user input: Task confirmation + Execution method selection + Code review tool selection - Collect three multi-select inputs:
- Support modification flow if user requests changes 1. Task confirmation (Allow/Modify/Cancel + optional supplements)
2. Execution method (Agent/Provide Plan/CLI + CLI tool specification)
3. Code review tool (No/Claude/Gemini/Qwen/Codex)
- Support plan supplements and modifications via "Other" input
**Question 1: Task Confirmation** **Question 1: Task Confirmation (Multi-select)**
Display plan to user and ask for confirmation: Display plan to user and ask for confirmation:
- Show: summary, approach, task breakdown, dependencies, risks, complexity, estimated time - Show: summary, approach, task breakdown, dependencies, risks, complexity, estimated time
- Options: "Confirm" / "Modify" / "Cancel" - Options: "Allow" / "Modify" / "Cancel" (multi-select enabled)
- If Modify: Collect feedback via "Other" option, re-run Phase 3 with modifications - User can input plan supplements via "Other" option
- If Cancel: Exit workflow - If Cancel selected: Exit workflow
- If Confirm: Proceed to Question 2 - Otherwise: Proceed to Question 2
**Question 2: Execution Method Selection** (Only if task confirmed) **Question 2: Execution Method Selection (Multi-select)**
Ask user to select execution method: Ask user to select execution method:
- Show recommendation from `planObject.recommended_execution` - Options: "Agent Execution" / "Provide Plan" / "CLI Execution" (multi-select enabled)
- Options: - User inputs CLI tool choice (gemini/qwen/codex) via "Other" option if "CLI Execution" selected
- "Direct - Execute with Agent" (@code-developer)
- "CLI - Gemini" (gemini-2.5-pro)
- "CLI - Codex" (gpt-5)
- "CLI - Qwen" (coder-model)
- Store selection for Phase 5 execution - Store selection for Phase 5 execution
**Simplified AskUserQuestion Reference**: **Simplified AskUserQuestion Reference**:
```javascript ```javascript
// Question 1: Task Confirmation // Question 1: Task Confirmation (Multi-select)
AskUserQuestion({ AskUserQuestion({
questions: [{ questions: [{
question: `[Display plan with all details]\n\nDo you confirm this plan?`, question: `[Display plan with all details]\n\nConfirm this plan?`,
header: "Confirm Plan", header: "Confirm Plan",
multiSelect: true,
options: [ options: [
{ label: "Confirm", description: "Proceed to execution" }, { label: "Allow", description: "Proceed with plan" },
{ label: "Modify", description: "Adjust plan" }, { label: "Modify", description: "Adjust plan" },
{ label: "Cancel", description: "Abort" } { label: "Cancel", description: "Abort" }
] ]
}] }]
}) })
// Question 2: Execution Method (if confirmed) // Question 2: Execution Method (Multi-select)
AskUserQuestion({ AskUserQuestion({
questions: [{ questions: [{
question: `Select execution method:\n[Show recommendation and tool descriptions]`, question: `Select execution method (input CLI tool in Other if choosing CLI):`,
header: "Execution Method", header: "Execution Method",
multiSelect: true,
options: [ options: [
{ label: "Direct - Agent", description: "Interactive execution" }, { label: "Agent Execution", description: "Execute with @code-developer" },
{ label: "CLI - Gemini", description: "gemini-2.5-pro" }, { label: "Provide Plan", description: "Return plan only" },
{ label: "CLI - Codex", description: "gpt-5" }, { label: "CLI Execution", description: "Execute with CLI tool (specify in Other)" }
{ label: "CLI - Qwen", description: "coder-model" }
] ]
}] }]
}) })
@@ -466,16 +465,15 @@ AskUserQuestion({
**Decision Flow**: **Decision Flow**:
``` ```
Task Confirmation: Task Confirmation (Multi-select):
├─ Confirm → Execution Method Selection → Code Review Selection → Phase 5 ├─ Allow (+ optional supplements in Other) → Proceed to Execution Method Selection
├─ Modify → Collect feedback → Re-run Phase 3 ├─ Modify (+ optional supplements in Other) → Re-run Phase 3 with modifications
└─ Cancel → Exit (no execution) └─ Cancel → Exit (no execution)
Execution Method Selection: Execution Method Selection (Multi-select):
├─ Direct - Execute with Agent → Launch @code-developer ├─ Agent Execution → Launch @code-developer
├─ CLI - Gemini → Build and execute Gemini command ├─ Provide Plan → Return plan JSON, skip execution
─ CLI - Codex → Build and execute Codex command ─ CLI Execution (+ tool name in Other: gemini/qwen/codex) → Build and execute CLI command
└─ CLI - Qwen → Build and execute Qwen command
Code Review Selection (after execution): Code Review Selection (after execution):
├─ No → Skip review, workflow complete ├─ No → Skip review, workflow complete
@@ -525,6 +523,8 @@ TodoWrite({
**Step 5.2: Launch Execution** **Step 5.2: Launch Execution**
**IMPORTANT**: CLI execution MUST run in foreground (no background execution)
Based on user selection in Phase 4, execute appropriate method: Based on user selection in Phase 4, execute appropriate method:
#### Option A: Direct Execution with Agent #### Option A: Direct Execution with Agent
@@ -763,11 +763,10 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-
**Execution with Progress Tracking**: **Execution with Progress Tracking**:
```javascript ```javascript
// Launch CLI in background // Launch CLI in foreground (NOT background - avoid )
bash_result = Bash( bash_result = Bash(
command=cli_command, command=cli_command,
timeout=600000, // 10 minutes timeout=600000 // 10 minutes
run_in_background=true
) )
// Monitor output and update TodoWrite // Monitor output and update TodoWrite