Compare commits

..

7 Commits

Author SHA1 Message Date
catlog22
fe0d30256c feat(lite-plan): enhance execution context continuity for multi-call scenarios
Improvements:
1. Add plan summary in confirmation question for quick review
2. Add previousExecutionResults tracking for multi-execution flows
3. Include execution result collection mechanism after each call
4. Update both Agent and Codex execution prompts with context continuity

Benefits:
- Subsequent executions can see what previous calls completed
- Avoid duplicate work across multiple execution calls
- Better dependency management and task flow
- Clear context propagation: executionId, status, tasks, outputs, notes
2025-11-16 23:10:18 +08:00
catlog22
1c416b538d refactor(lite-plan): separate plan display from user confirmation in Phase 4
Change Phase 4 confirmation flow from single-step to two-step process:
- Step 4.1: Display complete plan as readable text output
- Step 4.2: Collect three-dimensional input via AskUserQuestion

Benefits:
- Clearer plan presentation (not embedded in question)
- Simpler question interface focused on user decisions
- Better user experience with logical separation
2025-11-16 22:56:48 +08:00
catlog22
81362c14de refactor(lite-plan): enhance execution call tracking and user interaction clarity 2025-11-16 21:52:09 +08:00
catlog22
fa6257ecae refactor(lite-plan): streamline planning execution guidelines and enhance user confirmation process 2025-11-16 21:35:47 +08:00
catlog22
ccb4490ed4 refactor(cli-tools): remove redundant model parameters for improved command clarity 2025-11-16 21:11:16 +08:00
catlog22
58206f1996 refactor(lite-plan): update execution method options for clarity and complexity-based selection 2025-11-16 21:03:16 +08:00
catlog22
564bcb72ea refactor(lite-plan): simplify command format for Codex and Qwen by removing redundant parameters 2025-11-16 20:58:25 +08:00
9 changed files with 281 additions and 395 deletions

View File

@@ -162,15 +162,15 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)
**Gemini/Qwen (Write)**: **Gemini/Qwen (Write)**:
```bash ```bash
cd {dir} && gemini -p "..." -m gemini-2.5-flash --approval-mode yolo cd {dir} && gemini -p "..." --approval-mode yolo
``` ```
**Codex (Auto)**: **Codex (Auto)**:
```bash ```bash
codex -C {dir} --full-auto exec "..." -m gpt-5 --skip-git-repo-check -s danger-full-access codex -C {dir} --full-auto exec "..." --skip-git-repo-check -s danger-full-access
# Resume: Add 'resume --last' after prompt # Resume: Add 'resume --last' after prompt
codex --full-auto exec "..." resume --last -m gpt-5 --skip-git-repo-check -s danger-full-access codex --full-auto exec "..." resume --last --skip-git-repo-check -s danger-full-access
``` ```
**Cross-Directory** (Gemini/Qwen): **Cross-Directory** (Gemini/Qwen):

View File

@@ -136,7 +136,7 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/{template}) |
- Consider previous iteration failures - Consider previous iteration failures
- Validate fix doesn't introduce new vulnerabilities - Validate fix doesn't introduce new vulnerabilities
- analysis=READ-ONLY - analysis=READ-ONLY
" -m {model} {timeout_flag} " {timeout_flag}
``` ```
**Layer-Specific Guidance Injection**: **Layer-Specific Guidance Injection**:

View File

@@ -21,10 +21,10 @@ 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**: Multi-select interaction for task approval + execution method selection + code review tool selection - **Two-Step Confirmation**: First display complete plan as text, then collect three-dimensional input (task approval + execution method + code review tool)
- **Direct Execution**: Immediate dispatch to selected execution method (agent or CLI) - **Direct Execution**: Immediate dispatch to selected execution method (agent/codex/auto)
- **Live Progress Tracking**: Real-time TodoWrite updates during execution - **Live Progress Tracking**: Real-time TodoWrite updates at execution call level ([Agent-1], [Codex-1], etc.) during execution
- **Optional Code Review**: Post-execution quality analysis with claude/gemini/qwen/codex (user selectable) - **Optional Code Review**: Post-execution quality analysis with gemini/agent or custom tools via "Other" option (e.g., qwen, codex)
## Usage ## Usage
@@ -34,7 +34,6 @@ Intelligent lightweight planning and execution command with dynamic workflow ada
/workflow:lite-plan [FLAGS] <TASK_DESCRIPTION> /workflow:lite-plan [FLAGS] <TASK_DESCRIPTION>
# Flags # Flags
--tool <tool-name> Preset CLI tool (claude|gemini|qwen|codex); if not provided, user selects during confirmation
-e, --explore Force code exploration phase (overrides auto-detection logic) -e, --explore Force code exploration phase (overrides auto-detection logic)
# Arguments # Arguments
@@ -73,20 +72,20 @@ 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 -> Step 4.1: Output complete plan as text to user
-> AskUserQuestion: Three dimensions (all multi-select) -> Step 4.2: AskUserQuestion with three dimensions
1. Confirm task: Allow/Modify/Cancel (can supplement via Other) 1. Confirm task: Allow/Modify/Cancel (multi-select, can supplement via Other)
2. Execution method: Agent/Provide Plan/CLI (input CLI tool in Other) 2. Execution method: Agent/Codex/Auto (single-select, auto: simple→agent, complex→codex)
3. Code review: No/Claude/Gemini/Qwen/Codex 3. Code review: Skip/Gemini/Agent/Other (single-select, can specify custom tool via Other)
-> Process selections and proceed to Phase 5 -> Process selections and proceed to Phase 5
-> If cancel: Exit -> If cancel: Exit
| |
v v
[Phase 5] Execution & Progress Tracking [Phase 5] Execution & Progress Tracking
-> Create TodoWrite task list from breakdown -> Create TodoWrite execution call list (grouped tasks)
-> Launch selected execution (agent or CLI) -> Launch selected execution (agent or CLI)
-> Track progress with TodoWrite updates -> Track execution call progress with TodoWrite updates
-> Real-time status displayed to user -> Real-time call status displayed to user (e.g., "[Agent-1] (Task A + Task B)")
-> If code review enabled: Run selected CLI analysis -> If code review enabled: Run selected CLI analysis
| |
v v
@@ -95,9 +94,10 @@ Execution Complete
### Task Management Pattern ### Task Management Pattern
- TodoWrite creates task list before execution starts (Phase 5) - TodoWrite creates execution call list before execution starts (Phase 5)
- Tasks marked as in_progress/completed during execution - Execution calls ([Agent-1], [Codex-1], etc.) marked as in_progress/completed during execution
- Real-time progress updates visible to user - Each execution call handles multiple related tasks
- Real-time progress updates visible at call level (not individual task level)
- No intermediate file artifacts generated - No intermediate file artifacts generated
## Detailed Phase Execution ## Detailed Phase Execution
@@ -266,36 +266,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:
@@ -303,79 +292,31 @@ 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
- Format: "Group 1 (parallel): Task 1, Task 2 | Group 2 (parallel): Task 3, Task 4 | Task 5 (depends on all)" - Format: "Group 1 (parallel): Task 1, Task 2 | Group 2 (parallel): Task 3, Task 4 | Task 5 (depends on all)"
5. Risks: Potential issues and mitigation strategies (for Medium/High complexity) 5. Risks: Potential issues and mitigation strategies (for Medium/High complexity)
6. Estimated Time: Total implementation time estimate 6. Estimated Time: Total implementation time estimate
7. Recommended Execution: "Direct" (agent) or "CLI" (autonomous tool) 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: "Direct" | "CLI"
}
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: "CLI" // Based on clear requirements and straightforward implementation
}
```
**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: "Direct|CLI"
} }
``` ```
@@ -391,75 +332,94 @@ planObject = {
### Phase 4: Task Confirmation & Execution Selection ### Phase 4: Task Confirmation & Execution Selection
**User Interaction Flow**: Three-dimensional multi-select confirmation **User Interaction Flow**: Two-step confirmation process
**Step 4.1: Display Plan Summary**
First, output the complete plan to the user as regular text:
```
## Implementation Plan
**Summary**: ${planObject.summary}
**Approach**: ${planObject.approach}
**Task Breakdown**:
${planObject.tasks.map((t, i) => `${i+1}. ${t}`).join('\n')}
${planObject.dependencies ? `\n**Dependencies**:\n${planObject.dependencies.join('\n')}` : ''}
${planObject.risks ? `\n**Risks**:\n${planObject.risks.join('\n')}` : ''}
**Complexity**: ${planObject.complexity}
**Estimated Time**: ${planObject.estimated_time}
**Recommended Execution**: ${planObject.recommended_execution}
```
**Step 4.2: Collect User Confirmation**
After displaying the plan, collect three inputs via AskUserQuestion:
**Operations**: **Operations**:
- Display plan summary with full task breakdown - Collect three inputs:
- Collect three multi-select inputs: 1. Task confirmation (multi-select: Allow/Modify/Cancel + optional supplements via "Other")
1. Task confirmation (Allow/Modify/Cancel + optional supplements) 2. Execution method (single-select: Agent/Codex/Auto)
2. Execution method (Agent/Provide Plan/CLI + CLI tool specification) - Agent: Execute with @code-developer
3. Code review tool (No/Claude/Gemini/Qwen/Codex) - Codex: Execute with codex CLI tool
- Support plan supplements and modifications via "Other" input - Auto: Simple tasks (Low complexity) → Agent, Complex tasks (Medium/High) → Codex
3. Code review tool (single-select: Skip/Gemini/Agent + custom tools via "Other")
- Gemini Review: Use gemini CLI for code analysis
- Agent Review: Use @code-reviewer agent
- Other: Specify custom tool (e.g., "qwen", "codex") via text input
- Support plan supplements and custom tool specification via "Other" input
**Question 1: Task Confirmation (Multi-select)** **Three Questions in Single AskUserQuestion Call**:
- Question 1: 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: Skip/Gemini/Agent, custom via "Other")
Display plan to user and ask for confirmation: **AskUserQuestion 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 (Multi-select)**
Ask user to select execution method:
- Options: "Agent Execution" / "Provide Plan" / "CLI Execution" (multi-select enabled)
- User inputs CLI tool choice (gemini/qwen/codex) via "Other" option if "CLI Execution" selected
- 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**: ${planObject.summary}
multiSelect: true,
options: [
{ label: "Allow", description: "Proceed with plan" },
{ label: "Modify", description: "Adjust plan" },
{ label: "Cancel", description: "Abort" }
]
}]
})
// Question 2: Execution Method (Multi-select) **Tasks**: ${planObject.tasks.length} tasks | **Complexity**: ${planObject.complexity} | **Estimated Time**: ${planObject.estimated_time}
AskUserQuestion({
questions: [{
question: `Select execution method (input CLI tool in Other if choosing CLI):`,
header: "Execution Method",
multiSelect: true,
options: [
{ label: "Agent Execution", description: "Execute with @code-developer" },
{ label: "Provide Plan", description: "Return plan only" },
{ label: "CLI Execution", description: "Execute with CLI tool (specify in Other)" }
]
}]
})
// Question 3: Code Review Tool Selection Confirm this plan? (Multi-select enabled - you can select multiple options and add supplements via "Other")`,
AskUserQuestion({ header: "Confirm Plan",
questions: [{ multiSelect: true,
question: `Enable code review after execution?`, options: [
header: "Code Review", { label: "Allow", description: "Proceed with plan as-is" },
options: [ { label: "Modify", description: "Adjust plan before execution" },
{ label: "No", description: "Skip code review" }, { label: "Cancel", description: "Abort workflow" }
{ label: "Claude (default)", description: "Current Claude agent review" }, ]
{ label: "Gemini", description: "gemini-2.5-pro analysis" }, },
{ label: "Qwen", description: "coder-model analysis" }, {
{ label: "Codex", description: "gpt-5 analysis" } 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?
(You can specify other tools like "qwen" or "codex" via "Other" option)`,
header: "Code Review",
multiSelect: false,
options: [
{ label: "Gemini Review", description: "Review with Gemini CLI tool (gemini-2.5-pro)" },
{ label: "Agent Review", description: "Review with @code-reviewer agent" },
{ label: "Skip", description: "No review needed" }
]
}
]
}) })
``` ```
@@ -470,17 +430,18 @@ Task Confirmation (Multi-select):
├─ Modify (+ optional supplements in Other) → Re-run Phase 3 with modifications ├─ Modify (+ optional supplements in Other) → Re-run Phase 3 with modifications
└─ Cancel → Exit (no execution) └─ Cancel → Exit (no execution)
Execution Method Selection (Multi-select): Execution Method Selection (Single-select):
├─ Agent Execution → Launch @code-developer ├─ Agent → Launch @code-developer agent
├─ Provide Plan → Return plan JSON, skip execution ├─ Codex → Execute with codex CLI tool
└─ CLI Execution (+ tool name in Other: gemini/qwen/codex) → Build and execute CLI command └─ Auto → Automatic selection:
├─ If complexity = Low → Launch @code-developer agent
└─ If complexity = Medium/High → Execute with codex CLI tool
Code Review Selection (after execution): Code Review Selection (after execution):
├─ No → Skip review, workflow complete ├─ Skip → Skip review, workflow complete
├─ Claude (default) → Current Claude agent review ├─ Gemini Review → Run gemini code analysis (gemini-2.5-pro)
├─ Gemini → Run gemini code analysis ├─ Agent Review → Current Claude agent review
Qwen → Run qwen code analysis Other → Specify custom tool (e.g., "qwen", "codex") via text input
└─ Codex → Run codex code analysis
``` ```
**Progress Tracking**: **Progress Tracking**:
@@ -494,44 +455,57 @@ Code Review Selection (after execution):
### Phase 5: Execution & Progress Tracking ### Phase 5: Execution & Progress Tracking
**Operations**: **Operations**:
- Create TodoWrite task list from plan breakdown - Create TodoWrite execution call list (grouped tasks by dependencies)
- Launch selected execution method (agent or CLI) - Launch selected execution method (agent or CLI)
- Track execution progress with real-time TodoWrite updates - Track execution call progress with real-time TodoWrite updates (not individual tasks)
- Display status to user - Display execution status to user
**Step 5.1: Create TodoWrite Task List** **Step 5.1: Create TodoWrite Execution List**
**Before execution starts**, create task list: **Before execution starts**, create execution call list (not individual tasks):
```javascript ```javascript
// Group tasks based on dependencies and execution strategy
// Each execution call handles multiple related tasks
executionCalls = groupTasksByExecution(planObject.tasks, planObject.dependencies)
TodoWrite({ TodoWrite({
todos: planObject.tasks.map((task, index) => ({ todos: executionCalls.map((call, index) => ({
content: task, content: `[${call.method}-${index+1}] (${call.taskSummary})`,
status: "pending", status: "pending",
activeForm: task.replace(/^(.*?):/, "$1ing:") // "Implement X" -> "Implementing X" activeForm: `Executing [${call.method}-${index+1}] (${call.taskSummary})`
})) }))
}) })
``` ```
**Example Task List**: **Example Execution List**:
``` ```
[ ] Implement authentication service in src/auth/service.ts [ ] [Agent-1] (Implement auth service + Create JWT utilities)
[ ] Create JWT token utilities in src/auth/jwt.ts [ ] [Agent-2] (Add middleware + Update routes)
[ ] Add authentication middleware to src/middleware/auth.ts [ ] [Codex-1] (Add integration tests for auth flow)
[ ] Update API routes to use authentication
[ ] Add integration tests for auth flow
``` ```
**Task Grouping Logic**:
- Parallel tasks → Single execution call
- Sequential tasks → Separate execution calls
- Complex tasks → May split into multiple calls based on file scope
**Step 5.2: Launch Execution** **Step 5.2: Launch Execution**
**IMPORTANT**: CLI execution MUST run in foreground (no background 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:
- **Agent**: Launch @code-developer agent
- **Codex**: Execute with codex CLI tool
- **Auto**: Automatic selection based on complexity
- Low complexity → Agent execution
- Medium/High complexity → Codex execution
#### Option A: Direct Execution with Agent #### Option A: Direct Execution with Agent
**Operations**: **Operations**:
- Launch @code-developer agent with full plan context - Launch @code-developer agent with full plan context
- Agent receives exploration findings, clarifications, and task breakdown - Agent receives exploration findings, clarifications, and task breakdown
- **For subsequent executions**: Include previous execution results to maintain context continuity
- Agent call format: - Agent call format:
```javascript ```javascript
Task( Task(
@@ -547,6 +521,14 @@ Based on user selection in Phase 4, execute appropriate method:
${planObject.dependencies ? `\nTask Dependencies:\n${planObject.dependencies.join('\n')}` : ''} ${planObject.dependencies ? `\nTask Dependencies:\n${planObject.dependencies.join('\n')}` : ''}
${previousExecutionResults ? `\n## Previous Execution Results\n${previousExecutionResults.map(result => `
[${result.executionId}] ${result.status}
Tasks handled: ${result.tasksSummary}
Completion status: ${result.completionSummary}
Key outputs: ${result.keyOutputs || 'See git diff for details'}
${result.notes ? `Notes: ${result.notes}` : ''}
`).join('\n---\n')}` : ''}
Implementation Approach: Implementation Approach:
${planObject.approach} ${planObject.approach}
@@ -558,92 +540,50 @@ Based on user selection in Phase 4, execute appropriate method:
${planObject.risks ? `\nRisks to Consider:\n${planObject.risks.join('\n')}` : ''} ${planObject.risks ? `\nRisks to Consider:\n${planObject.risks.join('\n')}` : ''}
IMPORTANT Instructions: IMPORTANT Instructions:
- **Context Continuity**: Review previous execution results above to understand what's already completed
- **Build on Previous Work**: Ensure your work integrates with previously completed tasks
- **Avoid Duplication**: Don't redo tasks that are already completed in previous executions
- **Parallel Execution**: Identify independent tasks from dependencies field and execute them in parallel using multiple tool calls in a single message - **Parallel Execution**: Identify independent tasks from dependencies field and execute them in parallel using multiple tool calls in a single message
- **Dependency Respect**: Sequential tasks must wait for dependent tasks to complete before starting - **Dependency Respect**: Sequential tasks must wait for dependent tasks to complete before starting
- **TodoWrite Updates**: Mark tasks as in_progress when starting, completed when finished
- **Intelligent Grouping**: Analyze task dependencies to determine parallel groups - tasks with no file conflicts or logical dependencies can run simultaneously - **Intelligent Grouping**: Analyze task dependencies to determine parallel groups - tasks with no file conflicts or logical dependencies can run simultaneously
- Test functionality as you go - Test functionality as you go
- Handle risks proactively - Handle risks proactively
Note: This agent call handles multiple tasks. TodoWrite tracking is managed at call level by orchestrator.
` `
) )
``` ```
**Agent Responsibilities**: **Agent Responsibilities**:
- Mark tasks as in_progress when starting - Each agent call handles multiple tasks (grouped by dependencies)
- Mark tasks as completed when finished - Agent updates TodoWrite at **call level** (not individual task level)
- Update TodoWrite in real-time for user visibility - Mark execution call as in_progress when starting, completed when all assigned tasks finished
#### Option B: CLI Execution (Gemini/Codex/Qwen) **Execution Result Collection** (for multi-execution scenarios):
- After each execution completes, collect result summary:
```javascript
executionResult = {
executionId: "[Agent-1]" or "[Codex-1]",
status: "completed" or "partial" or "failed",
tasksSummary: "Brief description of tasks handled",
completionSummary: "What was completed",
keyOutputs: "Files created/modified, key changes",
notes: "Any important context for next execution"
}
previousExecutionResults.push(executionResult)
```
- Pass `previousExecutionResults` to subsequent executions for context continuity
#### Option B: CLI Execution (Codex)
**Operations**: **Operations**:
- Build CLI command with comprehensive context - Build codex CLI command with comprehensive context
- Execute CLI tool with write permissions - **For subsequent executions**: Include previous execution results summary
- Execute codex tool with write permissions
- Monitor CLI output and update TodoWrite based on progress indicators - Monitor CLI output and update TodoWrite based on progress indicators
- Parse CLI completion signals to mark tasks as done - Parse CLI completion signals to mark tasks as done
**Command Format (Gemini)** - Full context with exploration and clarifications: **Command Format (Codex)** - Single execution with full context:
```bash
gemini -p "
PURPOSE: Implement planned tasks with full context from exploration and planning
TASK:
${planObject.tasks.map((t, i) => `• ${t}`).join('\n')}
MODE: write
CONTEXT: @**/* | Memory: Implementation plan from lite-plan workflow
## Exploration Findings
${explorationContext ? `
Project Structure:
${explorationContext.project_structure || 'Not available'}
Relevant Files:
${explorationContext.relevant_files?.join('\n') || 'Not specified'}
Current Implementation Patterns:
${explorationContext.patterns || 'Not analyzed'}
Dependencies and Integration Points:
${explorationContext.dependencies || 'Not specified'}
Architecture Constraints:
${explorationContext.constraints || 'None identified'}
` : 'No exploration performed (task did not require codebase context)'}
## User Clarifications
${clarificationContext ? `
The following clarifications were provided by the user after exploration:
${Object.entries(clarificationContext).map(([q, a]) => `Q: ${q}\nA: ${a}`).join('\n\n')}
` : 'No clarifications needed'}
## Implementation Plan Context
Task Summary: ${planObject.summary}
Implementation Approach:
${planObject.approach}
${planObject.dependencies ? `
Task Dependencies (execute in order):
${planObject.dependencies.join('\n')}
` : ''}
${planObject.risks ? `
Identified Risks:
${planObject.risks.join('\n')}
` : ''}
Complexity Level: ${planObject.complexity}
Estimated Time: ${planObject.estimated_time}
EXPECTED: All tasks implemented following the plan approach, with proper error handling and testing
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt) | Follow implementation approach exactly | Handle identified risks proactively | write=CREATE/MODIFY/DELETE
" -m gemini-2.5-pro --approval-mode yolo
```
**Command Format (Codex)** - Session-based with resume support:
**First Execution (Establish Session)**:
```bash ```bash
codex --full-auto exec " codex --full-auto exec "
TASK: ${planObject.summary} TASK: ${planObject.summary}
@@ -653,6 +593,17 @@ ${planObject.tasks.map((t, i) => `${i+1}. ${t}`).join('\n')}
${planObject.dependencies ? `\n## Task Dependencies\n${planObject.dependencies.join('\n')}` : ''} ${planObject.dependencies ? `\n## Task Dependencies\n${planObject.dependencies.join('\n')}` : ''}
${previousExecutionResults ? `\n## Previous Execution Results\n${previousExecutionResults.map(result => `
[${result.executionId}] ${result.status}
Tasks: ${result.tasksSummary}
Status: ${result.completionSummary}
Outputs: ${result.keyOutputs || 'See git diff'}
${result.notes ? `Notes: ${result.notes}` : ''}
`).join('\n---\n')}
IMPORTANT: Review previous results above. Build on completed work. Avoid duplication.
` : ''}
## Implementation Approach ## Implementation Approach
${planObject.approach} ${planObject.approach}
@@ -670,168 +621,96 @@ ${clarificationContext ? `\n## User Clarifications\n${Object.entries(clarificati
${planObject.risks ? `\n## Risks to Handle\n${planObject.risks.join('\n')}` : ''} ${planObject.risks ? `\n## Risks to Handle\n${planObject.risks.join('\n')}` : ''}
## Execution Instructions ## Execution Instructions
- Complete all tasks following the breakdown sequence - Review previous execution results for context continuity
- Build on previous work, don't duplicate completed tasks
- Complete all assigned tasks in single execution
- Test functionality as you implement - Test functionality as you implement
- Handle identified risks proactively - Handle identified risks proactively
- Create session for potential resume if needed
Complexity: ${planObject.complexity} Complexity: ${planObject.complexity}
" -m gpt-5 --skip-git-repo-check -s danger-full-access " --skip-git-repo-check -s danger-full-access
``` ```
**Subsequent Executions (Resume if needed)**: **Note**: Avoid `resume --last` unless task is exceptionally complex or hits timeout. Optimize task breakdown for full completion in single execution.
```bash
# If first execution fails or is interrupted, can resume:
codex --full-auto exec "
Continue implementation from previous session.
Remaining tasks: **Execution Result Collection** (for multi-execution scenarios):
${remaining_tasks.map((t, i) => `${i+1}. ${t}`).join('\n')} - After CLI execution completes, analyze output and collect result summary
- Extract key information: modified files, completion status, important notes
Maintain context from previous execution. - Store in `previousExecutionResults` array for subsequent executions
" resume --last -m gpt-5 --skip-git-repo-check -s danger-full-access - Result structure same as Agent execution (see Option A above)
```
**Codex Session Strategy**:
- First execution establishes full context and creates session
- If execution is interrupted or fails, use `resume --last` to continue
- Resume inherits all context from original execution
- Useful for complex tasks that may hit timeouts or require iteration
**Command Format (Qwen)** - Full context similar to Gemini:
```bash
qwen -p "
PURPOSE: Implement planned tasks with comprehensive context
TASK:
${planObject.tasks.map((t, i) => `• ${t}`).join('\n')}
MODE: write
CONTEXT: @**/* | Memory: Full implementation context from lite-plan
## Code Exploration Results
${explorationContext ? `
Analyzed Project Structure:
${explorationContext.project_structure || 'Standard structure'}
Key Files to Modify:
${explorationContext.relevant_files?.join('\n') || 'To be determined during implementation'}
Existing Code Patterns:
${explorationContext.patterns || 'Follow codebase conventions'}
Dependencies:
${explorationContext.dependencies || 'None specified'}
Constraints:
${explorationContext.constraints || 'None identified'}
` : 'No exploration performed - analyze codebase patterns as you implement'}
## Clarifications from User
${clarificationContext ? `
${Object.entries(clarificationContext).map(([question, answer]) => `
Question: ${question}
Answer: ${answer}
`).join('\n')}
` : 'No additional clarifications provided'}
## Implementation Strategy
Summary: ${planObject.summary}
Approach:
${planObject.approach}
${planObject.dependencies ? `
Task Order (follow sequence):
${planObject.dependencies.join('\n')}
` : ''}
${planObject.risks ? `
Risk Mitigation:
${planObject.risks.join('\n')}
` : ''}
Task Complexity: ${planObject.complexity}
Time Estimate: ${planObject.estimated_time}
EXPECTED: Complete implementation with tests and proper error handling
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt) | Follow approach strictly | Test thoroughly | write=CREATE/MODIFY/DELETE
" -m coder-model --approval-mode yolo
```
**Execution with Progress Tracking**: **Execution with Progress Tracking**:
```javascript ```javascript
// Launch CLI in foreground (NOT background - avoid ) // Launch CLI in foreground (NOT background)
bash_result = Bash( bash_result = Bash(
command=cli_command, command=cli_command,
timeout=600000 // 10 minutes timeout=600000 // 10 minutes
) )
// Monitor output and update TodoWrite // Update TodoWrite when CLI execution call completes
// Parse CLI output for task completion indicators // Mark execution call (e.g., "[Codex-1]") as completed when CLI finishes
// Update TodoWrite when tasks complete // One CLI call may handle multiple tasks - track at call level, not task level
// Example: When CLI outputs "✓ Task 1 complete" -> Mark task 1 as completed
``` ```
**CLI Progress Monitoring**: **CLI Progress Monitoring**:
- Parse CLI output for completion keywords ("done", "complete", "✓", etc.) - Monitor CLI execution at **call level** (not individual task level)
- Update corresponding TodoWrite tasks based on progress - Update TodoWrite when CLI execution call completes (all assigned tasks done)
- Provide real-time visibility to user - Provide real-time visibility of execution call progress to user
**Step 5.3: Track Execution Progress** **Step 5.3: Track Execution Progress**
Track **agent/CLI call level** (not individual tasks):
**Real-time TodoWrite Updates**: **Real-time TodoWrite Updates**:
```javascript ```javascript
// As execution progresses, update task status: // When execution call starts
// Task started
TodoWrite({ TodoWrite({
todos: [ todos: [
{ content: "Implement auth service", status: "in_progress", activeForm: "Implementing auth service" }, { content: "[Agent-1] (Implement auth service + Create JWT utilities)", status: "in_progress", activeForm: "Executing [Agent-1] (Implement auth service + Create JWT utilities)" },
{ content: "Create JWT utilities", status: "pending", activeForm: "Creating JWT utilities" }, { content: "[Agent-2] (Add middleware + Update routes)", status: "pending", activeForm: "Executing [Agent-2] (Add middleware + Update routes)" },
// ... { content: "[Codex-1] (Add integration tests)", status: "pending", activeForm: "Executing [Codex-1] (Add integration tests)" }
] ]
}) })
// Task completed // When execution call completes
TodoWrite({ TodoWrite({
todos: [ todos: [
{ content: "Implement auth service", status: "completed", activeForm: "Implementing auth service" }, { content: "[Agent-1] (Implement auth service + Create JWT utilities)", status: "completed", activeForm: "Executing [Agent-1] (Implement auth service + Create JWT utilities)" },
{ content: "Create JWT utilities", status: "in_progress", activeForm: "Creating JWT utilities" }, { content: "[Agent-2] (Add middleware + Update routes)", status: "in_progress", activeForm: "Executing [Agent-2] (Add middleware + Update routes)" },
// ... { content: "[Codex-1] (Add integration tests)", status: "pending", activeForm: "Executing [Codex-1] (Add integration tests)" }
] ]
}) })
``` ```
**User Visibility**: **User Visibility**:
- User sees real-time task progress - User sees **execution call progress** (not individual task progress)
- Current task highlighted as "in_progress" - Current execution highlighted as "in_progress" (e.g., "[Agent-1] (Task A + Task B)")
- Completed tasks marked with checkmark - Completed executions marked with checkmark
- Pending tasks remain unchecked - Pending executions remain unchecked
- Each execution shows **task summary** for context
**Progress Tracking**: **Progress Tracking**:
- Mark Phase 5 as in_progress throughout execution - Track agent/CLI call completion (not task completion)
- Mark Phase 5 as completed when all tasks done - One execution call may handle multiple tasks simultaneously
- Final status summary displayed to user - Mark Phase 5 as completed when all execution calls done
**Step 5.4: Code Review (Optional)** **Step 5.4: Code Review (Optional)**
**Skip Condition**: Only run if user selected review tool in Phase 4 (not "No") **Skip Condition**: Only run if user selected review tool in Phase 4 (not "Skip")
**Operations**: **Operations**:
- If Claude: Current agent performs direct code review analysis - If "Agent Review": Current agent performs direct code review analysis
- If CLI tool (gemini/qwen/codex): Execute CLI with code review analysis prompt - If "Gemini Review": Execute gemini CLI with code review analysis prompt
- If "Other" (custom tool specified): Execute specified CLI tool (e.g., qwen, codex)
- Review all modified files from execution - Review all modified files from execution
- Generate quality assessment and improvement recommendations - Generate quality assessment and improvement recommendations
**Command Format**: **Command Format**:
```bash ```bash
# Claude (default): Direct agent review (no CLI command needed) # Agent Review: Direct agent review (no CLI command needed)
# Uses analysis prompt and TodoWrite tools directly # Uses analysis prompt and TodoWrite tools directly
# CLI Tools (gemini/qwen/codex): Execute analysis command # Gemini Review / Custom Tool (qwen, codex, etc.): Execute analysis command
{selected_tool} -p " {selected_tool} -p "
PURPOSE: Code review for implemented changes PURPOSE: Code review for implemented changes
TASK: • Analyze code quality • Identify potential issues • Suggest improvements TASK: • Analyze code quality • Identify potential issues • Suggest improvements
@@ -839,7 +718,7 @@ MODE: analysis
CONTEXT: @**/* | Memory: Review changes from lite-plan execution CONTEXT: @**/* | Memory: Review changes from lite-plan execution
EXPECTED: Quality assessment with actionable recommendations EXPECTED: Quality assessment with actionable recommendations
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-review-code-quality.txt) | Focus on recent changes | analysis=READ-ONLY RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-review-code-quality.txt) | Focus on recent changes | analysis=READ-ONLY
" -m {model} "
``` ```
**Expected Duration**: Varies by task complexity and execution method **Expected Duration**: Varies by task complexity and execution method
@@ -877,19 +756,27 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-review-code-q
- High complexity (6+ files): CLI planning agent with risk analysis (thorough, 50-60s) - High complexity (6+ files): CLI planning agent with risk analysis (thorough, 50-60s)
- Balances speed and thoroughness appropriately - Balances speed and thoroughness appropriately
4. **Two-Dimensional Confirmation**: Separate task approval from execution method 4. **Two-Step Confirmation Process**: Clear plan presentation followed by comprehensive control
- First dimension: Confirm/Modify/Cancel plan - **Step 1**: Display complete plan as readable text output (not embedded in question)
- Second dimension: Direct execution vs CLI execution - Shows summary, approach, tasks, dependencies, risks, complexity, time estimate
- Clear separation between plan content and user interaction
- **Step 2**: Collect three-dimensional input via AskUserQuestion
- First dimension: Confirm/Modify/Cancel plan (multi-select with supplement via "Other")
- Second dimension: Execution method selection (Agent/Codex/Auto)
- Third dimension: Code review tool selection (Skip/Gemini/Agent, custom via "Other")
- Allows plan refinement without re-selecting execution method - Allows plan refinement without re-selecting execution method
- Supports iterative planning with user feedback - Supports iterative planning with user feedback
- Auto mode intelligently selects execution method based on complexity
- Custom code review tools (qwen, codex, etc.) can be specified via "Other" option
### Task Management ### Task Management
1. **Live Progress Tracking**: TodoWrite provides real-time execution visibility 1. **Live Progress Tracking**: TodoWrite provides real-time execution call visibility
- Tasks created before execution starts - Execution calls ([Agent-1], [Codex-1], etc.) created before execution starts
- Updated in real-time as work progresses - Updated in real-time as execution calls progress
- User sees current task being worked on - User sees current execution call being worked on (e.g., "[Agent-1] (Task A + Task B)")
- Clear completion status throughout execution - Each execution call shows task summary for context
- Clear completion status at call level (not individual task level)
2. **Phase-Based Organization**: 5 distinct phases with clear transitions 2. **Phase-Based Organization**: 5 distinct phases with clear transitions
- Phase 1: Task Analysis & Exploration (automatic) - Phase 1: Task Analysis & Exploration (automatic)
@@ -942,8 +829,8 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-review-code-q
| Phase 3 Planning Timeout | Planning takes > 90 seconds | Generate simplified direct plan, mark as "Quick Plan", continue to Phase 4 with reduced detail | | Phase 3 Planning Timeout | Planning takes > 90 seconds | Generate simplified direct plan, mark as "Quick Plan", continue to Phase 4 with reduced detail |
| Phase 4 Confirmation Timeout | User no response > 5 minutes | Save plan context to temporary var, display resume instructions, exit gracefully | | Phase 4 Confirmation Timeout | User no response > 5 minutes | Save plan context to temporary var, display resume instructions, exit gracefully |
| Phase 4 Modification Loop | User requests modify > 3 times | Suggest breaking task into smaller pieces or using /workflow:plan for comprehensive planning | | Phase 4 Modification Loop | User requests modify > 3 times | Suggest breaking task into smaller pieces or using /workflow:plan for comprehensive planning |
| Phase 5 CLI Tool Unavailable | Selected CLI tool not installed | Show installation instructions, offer to re-select (Direct execution or different CLI) | | Phase 5 Codex Unavailable | Codex tool not installed | Show installation instructions, offer to re-select (Agent execution or Auto mode) |
| Phase 5 Execution Failure | Agent/CLI crashes or errors | Display error details, save partial progress from TodoWrite, suggest manual recovery or retry | | Phase 5 Execution Failure | Agent/Codex crashes or errors | Display error details, save partial progress from TodoWrite, suggest manual recovery or retry |
## Input/Output ## Input/Output
@@ -956,7 +843,6 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-review-code-q
- "Refactor logging module for better performance" - "Refactor logging module for better performance"
- "Add unit tests for authentication service" - "Add unit tests for authentication service"
- Flags (optional): - Flags (optional):
- `--tool <name>`: Preset execution tool (claude|gemini|codex|qwen)
- `-e` or `--explore`: Force code exploration phase (overrides auto-detection) - `-e` or `--explore`: Force code exploration phase (overrides auto-detection)
### Output Format ### Output Format
@@ -972,7 +858,7 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-review-code-q
// ... 3-7 tasks total // ... 3-7 tasks total
], ],
complexity: "Low|Medium|High", complexity: "Low|Medium|High",
recommended_tool: "Claude|Gemini|Codex|Qwen", recommended_execution: "Agent|Codex", // Based on complexity
estimated_time: "X minutes" estimated_time: "X minutes"
} }
``` ```

View File

@@ -78,7 +78,7 @@ cd src/auth && qwen -p "
追踪用户登录的完整执行流程, 追踪用户登录的完整执行流程,
从 API 入口到数据库查询, 从 API 入口到数据库查询,
列出所有调用的函数和依赖关系 列出所有调用的函数和依赖关系
" -m coder-model "
``` ```
**工具输出**Qwen 理解需求,自动追踪执行路径 **工具输出**Qwen 理解需求,自动追踪执行路径
@@ -278,7 +278,7 @@ codex -C src/auth --full-auto exec "
**方式 1CLI 工具语义调用**(推荐,灵活) **方式 1CLI 工具语义调用**(推荐,灵活)
- **用户输入**`使用 gemini 分析这个项目的架构设计,识别主要模块、依赖关系和架构模式` - **用户输入**`使用 gemini 分析这个项目的架构设计,识别主要模块、依赖关系和架构模式`
- **Claude Code 生成并执行**`cd project-root && gemini -p "..." -m gemini-3-pro-preview-11-2025` - **Claude Code 生成并执行**`cd project-root && gemini -p "..."`
**方式 2Slash 命令** **方式 2Slash 命令**
- **用户输入**`/cli:analyze --tool gemini "分析项目架构"` - **用户输入**`/cli:analyze --tool gemini "分析项目架构"`
@@ -291,7 +291,7 @@ codex -C src/auth --full-auto exec "
**方式 1CLI 工具语义调用** **方式 1CLI 工具语义调用**
- **用户输入**`让 codex 实现用户认证功能:注册(邮箱+密码+验证、登录JWT token、刷新令牌技术栈 Node.js + Express` - **用户输入**`让 codex 实现用户认证功能:注册(邮箱+密码+验证、登录JWT token、刷新令牌技术栈 Node.js + Express`
- **Claude Code 生成并执行**`codex -C src/auth --full-auto exec "..." -m gpt-5 --skip-git-repo-check -s danger-full-access` - **Claude Code 生成并执行**`codex -C src/auth --full-auto exec "..." --skip-git-repo-check -s danger-full-access`
**方式 2Slash 命令**(工作流化) **方式 2Slash 命令**(工作流化)
- **用户输入**`/workflow:plan --agent "实现用户认证功能"``/workflow:execute` - **用户输入**`/workflow:plan --agent "实现用户认证功能"``/workflow:execute`
@@ -304,9 +304,9 @@ codex -C src/auth --full-auto exec "
**方式 1CLI 工具语义调用** **方式 1CLI 工具语义调用**
- **用户输入**`使用 gemini 诊断登录超时问题,分析处理流程、性能瓶颈、数据库查询效率` - **用户输入**`使用 gemini 诊断登录超时问题,分析处理流程、性能瓶颈、数据库查询效率`
- **Claude Code 生成并执行**`cd src/auth && gemini -p "..." -m gemini-3-pro-preview-11-2025` - **Claude Code 生成并执行**`cd src/auth && gemini -p "..."`
- **用户输入**`让 codex 根据上述分析修复登录超时,优化查询、添加缓存` - **用户输入**`让 codex 根据上述分析修复登录超时,优化查询、添加缓存`
- **Claude Code 生成并执行**`codex -C src/auth --full-auto exec "..." -m gpt-5 --skip-git-repo-check -s danger-full-access` - **Claude Code 生成并执行**`codex -C src/auth --full-auto exec "..." --skip-git-repo-check -s danger-full-access`
**方式 2Slash 命令** **方式 2Slash 命令**
- **用户输入**`/cli:mode:bug-diagnosis --tool gemini "诊断登录超时"``/cli:execute --tool codex "修复登录超时"` - **用户输入**`/cli:mode:bug-diagnosis --tool gemini "诊断登录超时"``/cli:execute --tool codex "修复登录超时"`
@@ -319,7 +319,7 @@ codex -C src/auth --full-auto exec "
**方式 1CLI 工具语义调用** **方式 1CLI 工具语义调用**
- **用户输入**`使用 gemini 为 API 模块生成技术文档,包含端点说明、数据模型、使用示例` - **用户输入**`使用 gemini 为 API 模块生成技术文档,包含端点说明、数据模型、使用示例`
- **Claude Code 生成并执行**`cd src/api && gemini -p "..." -m gemini-3-pro-preview-11-2025 --approval-mode yolo` - **Claude Code 生成并执行**`cd src/api && gemini -p "..." --approval-mode yolo`
**方式 2Slash 命令** **方式 2Slash 命令**
- **用户输入**`/memory:docs src/api --tool gemini --mode full` - **用户输入**`/memory:docs src/api --tool gemini --mode full`

View File

@@ -762,7 +762,7 @@ async function executeCLIAnalysis(prompt) {
// Execute gemini with analysis prompt using --include-directories // Execute gemini with analysis prompt using --include-directories
// This allows gemini to access reference docs while maintaining correct file context // This allows gemini to access reference docs while maintaining correct file context
const command = `gemini -p "${escapePrompt(prompt)}" -m gemini-3-pro-preview-11-2025 --include-directories ${referencePath}`; const command = `gemini -p "${escapePrompt(prompt)}" --include-directories ${referencePath}`;
try { try {
const result = await execBash(command, { timeout: 120000 }); // 2 min timeout const result = await execBash(command, { timeout: 120000 }); // 2 min timeout
@@ -770,7 +770,7 @@ async function executeCLIAnalysis(prompt) {
} catch (error) { } catch (error) {
// Fallback to qwen if gemini fails // Fallback to qwen if gemini fails
console.warn('Gemini failed, falling back to qwen'); console.warn('Gemini failed, falling back to qwen');
const fallbackCmd = `qwen -p "${escapePrompt(prompt)}" -m coder-model --include-directories ${referencePath}`; const fallbackCmd = `qwen -p "${escapePrompt(prompt)}" --include-directories ${referencePath}`;
const result = await execBash(fallbackCmd, { timeout: 120000 }); const result = await execBash(fallbackCmd, { timeout: 120000 });
return parseAnalysisResult(result.stdout); return parseAnalysisResult(result.stdout);
} }

View File

@@ -162,15 +162,15 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)
**Gemini/Qwen (Write)**: **Gemini/Qwen (Write)**:
```bash ```bash
cd {dir} && gemini -p "..." -m gemini-2.5-flash --approval-mode yolo cd {dir} && gemini -p "..." --approval-mode yolo
``` ```
**Codex (Auto)**: **Codex (Auto)**:
```bash ```bash
codex -C {dir} --full-auto exec "..." -m gpt-5 --skip-git-repo-check -s danger-full-access codex -C {dir} --full-auto exec "..." --skip-git-repo-check -s danger-full-access
# Resume: Add 'resume --last' after prompt # Resume: Add 'resume --last' after prompt
codex --full-auto exec "..." resume --last -m gpt-5 --skip-git-repo-check -s danger-full-access codex --full-auto exec "..." resume --last --skip-git-repo-check -s danger-full-access
``` ```
**Cross-Directory** (Gemini/Qwen): **Cross-Directory** (Gemini/Qwen):

View File

@@ -136,7 +136,7 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/{template}) |
- Consider previous iteration failures - Consider previous iteration failures
- Validate fix doesn't introduce new vulnerabilities - Validate fix doesn't introduce new vulnerabilities
- analysis=READ-ONLY - analysis=READ-ONLY
" -m {model} {timeout_flag} " {timeout_flag}
``` ```
**Layer-Specific Guidance Injection**: **Layer-Specific Guidance Injection**:

View File

@@ -766,7 +766,7 @@ Time Estimate: ${planObject.estimated_time}
EXPECTED: Complete implementation with tests and proper error handling EXPECTED: Complete implementation with tests and proper error handling
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt) | Follow approach strictly | Test thoroughly | write=CREATE/MODIFY/DELETE RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt) | Follow approach strictly | Test thoroughly | write=CREATE/MODIFY/DELETE
" -m coder-model --approval-mode yolo " --approval-mode yolo
``` ```
**Execution with Progress Tracking**: **Execution with Progress Tracking**:

View File

@@ -333,7 +333,7 @@ codex --full-auto exec "Add JWT refresh token validation" resume --last --skip-g
2. Explicitly reference external files in CONTEXT field with @ patterns 2. Explicitly reference external files in CONTEXT field with @ patterns
3. ⚠️ BOTH steps are MANDATORY 3. ⚠️ BOTH steps are MANDATORY
Example: `cd src/auth && gemini -p "CONTEXT: @**/* @../shared/**/*" -m gemini-2.5-pro --include-directories ../shared` Example: `cd src/auth && gemini -p "CONTEXT: @**/* @../shared/**/*" --include-directories ../shared`
**Rule**: If CONTEXT contains `@../dir/**/*`, command MUST include `--include-directories ../dir` **Rule**: If CONTEXT contains `@../dir/**/*`, command MUST include `--include-directories ../dir`