mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
refactor(lite-plan): streamline planning execution guidelines and enhance user confirmation process
This commit is contained in:
@@ -265,36 +265,25 @@ else complexity = "High"
|
|||||||
**Planning Execution**:
|
**Planning Execution**:
|
||||||
|
|
||||||
**Option A: Direct Planning (Low Complexity)**
|
**Option A: Direct Planning (Low Complexity)**
|
||||||
```javascript
|
|
||||||
// Current Claude generates plan directly
|
Current Claude generates plan directly following these guidelines:
|
||||||
planObject = {
|
- **Summary**: 2-3 sentence overview of the implementation
|
||||||
summary: "Brief overview of what needs to be done",
|
- **Approach**: High-level implementation strategy
|
||||||
approach: "Step-by-step implementation strategy",
|
- **Task Breakdown**: 3-5 specific, actionable tasks with file paths
|
||||||
tasks: [
|
- **Estimated Time**: Total implementation time estimate
|
||||||
"Task 1: Specific action with file references",
|
- **Recommended Execution**: "Agent" (for Low complexity tasks)
|
||||||
"Task 2: Specific action with file references",
|
|
||||||
// ... 3-5 tasks
|
|
||||||
],
|
|
||||||
complexity: "Low",
|
|
||||||
estimated_time: "15-30 minutes"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Option B: Agent-Based Planning (Medium/High Complexity)**
|
**Option B: Agent-Based Planning (Medium/High Complexity)**
|
||||||
|
|
||||||
|
Delegate to cli-planning-agent with detailed requirements:
|
||||||
```javascript
|
```javascript
|
||||||
// Delegate to cli-planning-agent
|
|
||||||
Task(
|
Task(
|
||||||
subagent_type="cli-planning-agent",
|
subagent_type="cli-planning-agent",
|
||||||
description="Generate detailed implementation plan",
|
description="Generate detailed implementation plan",
|
||||||
prompt=`
|
prompt=`
|
||||||
Task: ${task_description}
|
Task: ${task_description}
|
||||||
|
Exploration Context: ${JSON.stringify(explorationContext, null, 2)}
|
||||||
Exploration Context:
|
User Clarifications: ${JSON.stringify(clarificationContext, null, 2) || "None provided"}
|
||||||
${JSON.stringify(explorationContext, null, 2)}
|
|
||||||
|
|
||||||
User Clarifications:
|
|
||||||
${JSON.stringify(clarificationContext, null, 2) || "None provided"}
|
|
||||||
|
|
||||||
Complexity Level: ${complexity}
|
Complexity Level: ${complexity}
|
||||||
|
|
||||||
Generate a detailed implementation plan with the following components:
|
Generate a detailed implementation plan with the following components:
|
||||||
@@ -302,10 +291,7 @@ Task(
|
|||||||
1. Summary: 2-3 sentence overview of the implementation
|
1. Summary: 2-3 sentence overview of the implementation
|
||||||
2. Approach: High-level implementation strategy
|
2. Approach: High-level implementation strategy
|
||||||
3. Task Breakdown: 5-10 specific, actionable tasks
|
3. Task Breakdown: 5-10 specific, actionable tasks
|
||||||
- Each task should specify:
|
- Each task should specify: What to do, Which files to modify/create, Dependencies on other tasks (if any)
|
||||||
* What to do
|
|
||||||
* Which files to modify/create
|
|
||||||
* Dependencies on other tasks (if any)
|
|
||||||
4. Task Dependencies & Parallelization:
|
4. Task Dependencies & Parallelization:
|
||||||
- Identify independent tasks that can run in parallel (no shared file conflicts or logical dependencies)
|
- Identify independent tasks that can run in parallel (no shared file conflicts or logical dependencies)
|
||||||
- Group tasks by execution order: parallel groups can execute simultaneously, sequential groups must wait for previous completion
|
- Group tasks by execution order: parallel groups can execute simultaneously, sequential groups must wait for previous completion
|
||||||
@@ -314,67 +300,22 @@ Task(
|
|||||||
6. Estimated Time: Total implementation time estimate
|
6. Estimated Time: Total implementation time estimate
|
||||||
7. Recommended Execution: "Agent" or "Codex" based on task complexity
|
7. Recommended Execution: "Agent" or "Codex" based on task complexity
|
||||||
|
|
||||||
Output Format: Return a structured object with these fields:
|
|
||||||
{
|
|
||||||
summary: string,
|
|
||||||
approach: string,
|
|
||||||
tasks: string[],
|
|
||||||
dependencies: string[] (optional),
|
|
||||||
risks: string[] (optional),
|
|
||||||
estimated_time: string,
|
|
||||||
recommended_execution: "Agent" | "Codex"
|
|
||||||
}
|
|
||||||
|
|
||||||
Ensure tasks are specific, with file paths and clear acceptance criteria.
|
Ensure tasks are specific, with file paths and clear acceptance criteria.
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
||||||
// Agent returns detailed plan
|
|
||||||
planObject = agent_output.parse()
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Expected Return Structure**:
|
**Expected Return Structure (Both Options)**:
|
||||||
```javascript
|
```javascript
|
||||||
planObject = {
|
planObject = {
|
||||||
summary: "Implement JWT-based authentication system with middleware integration",
|
summary: string, // 2-3 sentence overview
|
||||||
approach: "Create auth service layer, implement JWT utilities, add middleware, update routes",
|
approach: string, // High-level implementation strategy
|
||||||
tasks: [
|
tasks: string[], // 3-5 tasks (Low) or 5-10 tasks (Medium/High) with file paths
|
||||||
"Create authentication service in src/auth/service.ts with login/logout/verify methods",
|
dependencies: string[], // Task execution order: parallel groups and sequential dependencies (Medium/High only)
|
||||||
"Implement JWT token utilities in src/auth/jwt.ts (generate, verify, refresh)",
|
risks: string[], // Potential issues and mitigation strategies (Medium/High only)
|
||||||
"Add authentication middleware to src/middleware/auth.ts",
|
estimated_time: string, // Total implementation time estimate
|
||||||
"Update API routes in src/routes/*.ts to use auth middleware",
|
recommended_execution: string, // "Agent" (Low) or "Codex" (Medium/High)
|
||||||
"Add integration tests for auth flow in tests/auth.test.ts"
|
complexity: string // "Low" | "Medium" | "High"
|
||||||
],
|
|
||||||
dependencies: [
|
|
||||||
"Group 1 (parallel): Task 1, Task 2 - Independent service and utilities, no file conflicts",
|
|
||||||
"Group 2 (sequential): Task 3 - Depends on Task 2 completion (middleware needs JWT utilities)",
|
|
||||||
"Group 3 (sequential): Task 4 - Depends on Task 3 completion (routes need middleware)",
|
|
||||||
"Group 4 (sequential): Task 5 - Depends on all previous tasks (tests need complete implementation)"
|
|
||||||
],
|
|
||||||
risks: [
|
|
||||||
"Token refresh timing may conflict with existing session logic - test thoroughly",
|
|
||||||
"Breaking change if existing auth is in use - plan migration strategy"
|
|
||||||
],
|
|
||||||
estimated_time: "30-45 minutes",
|
|
||||||
recommended_execution: "Codex" // Based on Medium/High complexity
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Output Structure**:
|
|
||||||
```javascript
|
|
||||||
planObject = {
|
|
||||||
summary: "2-3 sentence overview",
|
|
||||||
approach: "Implementation strategy",
|
|
||||||
tasks: [
|
|
||||||
"Task 1: ...",
|
|
||||||
"Task 2: ...",
|
|
||||||
// ... 3-10 tasks based on complexity
|
|
||||||
],
|
|
||||||
complexity: "Low|Medium|High",
|
|
||||||
dependencies: ["task1 -> task2", ...], // if Medium/High
|
|
||||||
risks: ["risk1", "risk2", ...], // if High
|
|
||||||
estimated_time: "X minutes",
|
|
||||||
recommended_execution: "Agent|Codex" // Based on complexity: Low→Agent, Medium/High→Codex
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -403,69 +344,65 @@ planObject = {
|
|||||||
3. Code review tool (No/Claude/Gemini/Qwen/Codex)
|
3. Code review tool (No/Claude/Gemini/Qwen/Codex)
|
||||||
- Support plan supplements and modifications via "Other" input
|
- Support plan supplements and modifications via "Other" input
|
||||||
|
|
||||||
**Question 1: Task Confirmation (Multi-select)**
|
**Combined Three Questions in Single Call**:
|
||||||
|
- Question 1: Display full plan + task confirmation (multi-select: Allow/Modify/Cancel)
|
||||||
|
- Question 2: Execution method selection (single-select: Agent/Codex/Auto)
|
||||||
|
- Question 3: Code review tool selection (single-select: Gemini/Qwen/Agent/Skip)
|
||||||
|
|
||||||
Display plan to user and ask for confirmation:
|
**Combined AskUserQuestion (Single Call)**:
|
||||||
- Show: summary, approach, task breakdown, dependencies, risks, complexity, estimated time
|
|
||||||
- Options: "Allow" / "Modify" / "Cancel" (multi-select enabled)
|
|
||||||
- User can input plan supplements via "Other" option
|
|
||||||
- If Cancel selected: Exit workflow
|
|
||||||
- Otherwise: Proceed to Question 2
|
|
||||||
|
|
||||||
**Question 2: Execution Method Selection (Single-select)**
|
|
||||||
|
|
||||||
Ask user to select execution method:
|
|
||||||
- Options: "Agent" / "Codex" / "Auto" (single-select)
|
|
||||||
- Agent: Direct execution with @code-developer agent
|
|
||||||
- Codex: Execution with codex CLI tool
|
|
||||||
- Auto: Automatic selection based on task complexity
|
|
||||||
- Low complexity → Agent execution
|
|
||||||
- Medium/High complexity → Codex execution
|
|
||||||
- Store selection for Phase 5 execution
|
|
||||||
|
|
||||||
**Simplified AskUserQuestion Reference**:
|
|
||||||
```javascript
|
```javascript
|
||||||
// Question 1: Task Confirmation (Multi-select)
|
|
||||||
AskUserQuestion({
|
AskUserQuestion({
|
||||||
questions: [{
|
questions: [
|
||||||
question: `[Display plan with all details]\n\nConfirm this plan?`,
|
{
|
||||||
header: "Confirm Plan",
|
question: `## Plan Summary
|
||||||
multiSelect: true,
|
|
||||||
options: [
|
|
||||||
{ label: "Allow", description: "Proceed with plan" },
|
|
||||||
{ label: "Modify", description: "Adjust plan" },
|
|
||||||
{ label: "Cancel", description: "Abort" }
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
|
|
||||||
// Question 2: Execution Method (Single-select)
|
**Summary**: ${planObject.summary}
|
||||||
AskUserQuestion({
|
|
||||||
questions: [{
|
|
||||||
question: `Select execution method:`,
|
|
||||||
header: "Execution Method",
|
|
||||||
multiSelect: false,
|
|
||||||
options: [
|
|
||||||
{ label: "Agent", description: "Execute with @code-developer agent" },
|
|
||||||
{ label: "Codex", description: "Execute with codex CLI tool" },
|
|
||||||
{ label: "Auto", description: `Auto-select: ${planObject.complexity === 'Low' ? 'Agent (Low complexity)' : 'Codex (Medium/High complexity)'}` }
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
})
|
|
||||||
|
|
||||||
// Question 3: Code Review Tool Selection
|
**Approach**: ${planObject.approach}
|
||||||
AskUserQuestion({
|
|
||||||
questions: [{
|
**Task Breakdown**:
|
||||||
question: `Enable code review after execution?`,
|
${planObject.tasks.map((t, i) => `${i+1}. ${t}`).join('\n')}
|
||||||
header: "Code Review",
|
|
||||||
options: [
|
${planObject.dependencies ? `\n**Dependencies**:\n${planObject.dependencies.join('\n')}` : ''}
|
||||||
{ label: "No", description: "Skip code review" },
|
|
||||||
{ label: "Claude (default)", description: "Current Claude agent review" },
|
${planObject.risks ? `\n**Risks**:\n${planObject.risks.join('\n')}` : ''}
|
||||||
{ label: "Gemini", description: "gemini-2.5-pro analysis" },
|
|
||||||
{ label: "Qwen", description: "coder-model analysis" },
|
**Complexity**: ${planObject.complexity}
|
||||||
{ label: "Codex", description: "gpt-5 analysis" }
|
**Estimated Time**: ${planObject.estimated_time}
|
||||||
]
|
|
||||||
}]
|
---
|
||||||
|
|
||||||
|
Confirm this plan? (Multi-select enabled - you can select multiple options and add supplements via "Other")`,
|
||||||
|
header: "Confirm Plan",
|
||||||
|
multiSelect: true,
|
||||||
|
options: [
|
||||||
|
{ label: "Allow", description: "Proceed with plan as-is" },
|
||||||
|
{ label: "Modify", description: "Adjust plan before execution" },
|
||||||
|
{ label: "Cancel", description: "Abort workflow" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: `Select execution method:`,
|
||||||
|
header: "Execution",
|
||||||
|
multiSelect: false,
|
||||||
|
options: [
|
||||||
|
{ label: "Agent", description: "Execute with @code-developer agent" },
|
||||||
|
{ label: "Codex", description: "Execute with codex CLI tool" },
|
||||||
|
{ label: "Auto", description: `Auto-select: ${planObject.complexity === 'Low' ? 'Agent (Low complexity)' : 'Codex (Medium/High complexity)'}` }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: `Enable code review after execution?`,
|
||||||
|
header: "Code Review",
|
||||||
|
multiSelect: false,
|
||||||
|
options: [
|
||||||
|
{ label: "Gemini Review", description: "Review with Gemini CLI tool (gemini-2.5-pro)" },
|
||||||
|
{ label: "Qwen Review", description: "Review with Qwen CLI tool (coder-model)" },
|
||||||
|
{ label: "Agent Review", description: "Review with @code-reviewer agent" },
|
||||||
|
{ label: "Skip", description: "No review needed" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user