claude-code-workflow 6.3.37 → 6.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/workflow/lite-execute.md +2 -0
- package/.codex/agents/action-planning-agent.md +885 -0
- package/.codex/agents/ccw-loop-b-complete.md +227 -0
- package/.codex/agents/ccw-loop-b-debug.md +172 -0
- package/.codex/agents/ccw-loop-b-develop.md +147 -0
- package/.codex/agents/ccw-loop-b-init.md +82 -0
- package/.codex/agents/ccw-loop-b-validate.md +204 -0
- package/.codex/agents/ccw-loop-executor.md +260 -0
- package/.codex/agents/cli-discuss-agent.md +391 -0
- package/.codex/agents/cli-execution-agent.md +333 -0
- package/.codex/agents/cli-explore-agent.md +186 -0
- package/.codex/agents/cli-lite-planning-agent.md +736 -0
- package/.codex/agents/cli-planning-agent.md +562 -0
- package/.codex/agents/code-developer.md +408 -0
- package/.codex/agents/conceptual-planning-agent.md +321 -0
- package/.codex/agents/context-search-agent.md +585 -0
- package/.codex/agents/debug-explore-agent.md +436 -0
- package/.codex/agents/doc-generator.md +334 -0
- package/.codex/agents/issue-plan-agent.md +417 -0
- package/.codex/agents/issue-queue-agent.md +311 -0
- package/.codex/agents/memory-bridge.md +96 -0
- package/.codex/agents/test-context-search-agent.md +402 -0
- package/.codex/agents/test-fix-agent.md +359 -0
- package/.codex/agents/ui-design-agent.md +595 -0
- package/.codex/agents/universal-executor.md +135 -0
- package/.codex/prompts/clean.md +409 -0
- package/.codex/prompts/issue-discover-by-prompt.md +364 -0
- package/.codex/prompts/issue-discover.md +261 -0
- package/.codex/prompts/issue-execute.md +10 -0
- package/.codex/prompts/issue-new.md +285 -0
- package/.codex/prompts/issue-plan.md +161 -63
- package/.codex/prompts/issue-queue.md +298 -288
- package/.codex/prompts/lite-execute.md +627 -133
- package/.codex/prompts/lite-fix.md +670 -0
- package/.codex/prompts/lite-plan-a.md +337 -0
- package/.codex/prompts/lite-plan-b.md +485 -0
- package/.codex/prompts/{lite-plan.md → lite-plan-c.md} +601 -469
- package/.codex/skills/ccw-loop/README.md +171 -0
- package/.codex/skills/ccw-loop/SKILL.md +349 -0
- package/.codex/skills/ccw-loop/phases/actions/action-complete.md +269 -0
- package/.codex/skills/ccw-loop/phases/actions/action-debug.md +286 -0
- package/.codex/skills/ccw-loop/phases/actions/action-develop.md +183 -0
- package/.codex/skills/ccw-loop/phases/actions/action-init.md +164 -0
- package/.codex/skills/ccw-loop/phases/actions/action-menu.md +205 -0
- package/.codex/skills/ccw-loop/phases/actions/action-validate.md +250 -0
- package/.codex/skills/ccw-loop/phases/orchestrator.md +416 -0
- package/.codex/skills/ccw-loop/phases/state-schema.md +388 -0
- package/.codex/skills/ccw-loop/specs/action-catalog.md +182 -0
- package/.codex/skills/ccw-loop-b/README.md +301 -0
- package/.codex/skills/ccw-loop-b/SKILL.md +322 -0
- package/.codex/skills/ccw-loop-b/phases/orchestrator.md +257 -0
- package/.codex/skills/ccw-loop-b/phases/state-schema.md +181 -0
- package/.codex/skills/ccw-loop-b/specs/action-catalog.md +383 -0
- package/.codex/skills/parallel-dev-cycle/README.md +382 -0
- package/.codex/skills/parallel-dev-cycle/SKILL.md +512 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/code-developer.md +242 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/exploration-planner.md +285 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/requirements-analyst.md +285 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/validation-archivist.md +381 -0
- package/.codex/skills/parallel-dev-cycle/phases/orchestrator.md +696 -0
- package/.codex/skills/parallel-dev-cycle/phases/state-schema.md +436 -0
- package/.codex/skills/parallel-dev-cycle/specs/communication-optimization.md +423 -0
- package/.codex/skills/parallel-dev-cycle/specs/coordination-protocol.md +391 -0
- package/.codex/skills/parallel-dev-cycle/specs/versioning-strategy.md +330 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +4 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +39 -8
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +3 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +107 -0
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/commands/upgrade.js +1 -1
- package/ccw/dist/commands/upgrade.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +3 -2
- package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
- package/ccw/dist/core/memory-embedder-bridge.d.ts.map +1 -1
- package/ccw/dist/core/memory-embedder-bridge.js +2 -5
- package/ccw/dist/core/memory-embedder-bridge.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.js +7 -6
- package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js +2 -2
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -1
- package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/graph-routes.js +17 -2
- package/ccw/dist/core/routes/graph-routes.js.map +1 -1
- package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/issue-routes.js +280 -33
- package/ccw/dist/core/routes/issue-routes.js.map +1 -1
- package/ccw/dist/core/routes/loop-v2-routes.d.ts +9 -0
- package/ccw/dist/core/routes/loop-v2-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/loop-v2-routes.js +56 -4
- package/ccw/dist/core/routes/loop-v2-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +3 -2
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +5 -3
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +4 -3
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-config-manager.d.ts +1 -0
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +2 -1
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/codex-lens-lsp.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens-lsp.js +2 -5
- package/ccw/dist/tools/codex-lens-lsp.js.map +1 -1
- package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens.js +22 -32
- package/ccw/dist/tools/codex-lens.js.map +1 -1
- package/ccw/dist/tools/litellm-client.d.ts +6 -0
- package/ccw/dist/tools/litellm-client.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-client.js +15 -2
- package/ccw/dist/tools/litellm-client.js.map +1 -1
- package/ccw/dist/tools/loop-task-manager.d.ts +13 -2
- package/ccw/dist/tools/loop-task-manager.d.ts.map +1 -1
- package/ccw/dist/tools/loop-task-manager.js.map +1 -1
- package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
- package/ccw/dist/tools/native-session-discovery.js +35 -7
- package/ccw/dist/tools/native-session-discovery.js.map +1 -1
- package/ccw/dist/utils/codexlens-path.d.ts +36 -0
- package/ccw/dist/utils/codexlens-path.d.ts.map +1 -0
- package/ccw/dist/utils/codexlens-path.js +56 -0
- package/ccw/dist/utils/codexlens-path.js.map +1 -0
- package/ccw/dist/utils/uv-manager.d.ts.map +1 -1
- package/ccw/dist/utils/uv-manager.js +3 -2
- package/ccw/dist/utils/uv-manager.js.map +1 -1
- package/ccw/src/cli.ts +4 -0
- package/ccw/src/commands/install.ts +51 -8
- package/ccw/src/commands/issue.ts +119 -0
- package/ccw/src/commands/upgrade.ts +1 -1
- package/ccw/src/config/litellm-api-config-manager.ts +3 -2
- package/ccw/src/core/memory-embedder-bridge.ts +2 -6
- package/ccw/src/core/routes/cli-routes.ts +1 -1
- package/ccw/src/core/routes/codexlens/config-handlers.ts +7 -6
- package/ccw/src/core/routes/codexlens/semantic-handlers.ts +2 -2
- package/ccw/src/core/routes/graph-routes.ts +18 -2
- package/ccw/src/core/routes/issue-routes.ts +308 -33
- package/ccw/src/core/routes/loop-v2-routes.ts +64 -6
- package/ccw/src/core/routes/system-routes.ts +3 -2
- package/ccw/src/core/server.ts +6 -3
- package/ccw/src/templates/dashboard-css/02-session.css +2 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +103 -1
- package/ccw/src/templates/dashboard-css/32-issue-manager.css +32 -0
- package/ccw/src/templates/dashboard-js/components/cli-history.js +48 -48
- package/ccw/src/templates/dashboard-js/components/navigation.js +6 -0
- package/ccw/src/templates/dashboard-js/components/notifications.js +6 -0
- package/ccw/src/templates/dashboard-js/components/version-check.js +38 -0
- package/ccw/src/templates/dashboard-js/i18n.js +126 -0
- package/ccw/src/templates/dashboard-js/state.js +2 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +1 -1
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +183 -1
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +55 -11
- package/ccw/src/templates/dashboard-js/views/loop-monitor.js +112 -11
- package/ccw/src/templates/dashboard.html +48 -2
- package/ccw/src/tools/claude-cli-tools.ts +4 -3
- package/ccw/src/tools/cli-config-manager.ts +3 -1
- package/ccw/src/tools/codex-lens-lsp.ts +2 -5
- package/ccw/src/tools/codex-lens.ts +27 -38
- package/ccw/src/tools/litellm-client.ts +16 -2
- package/ccw/src/tools/loop-task-manager.ts +13 -2
- package/ccw/src/tools/native-session-discovery.ts +38 -7
- package/ccw/src/utils/codexlens-path.ts +60 -0
- package/ccw/src/utils/uv-manager.ts +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Lightweight interactive planning workflow with single-agent merged mode for explore → clarify → plan full flow
|
|
3
|
+
argument-hint: TASK="<task description or file.md path>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Lite-Plan-A (Merged Mode)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Single-agent merged mode for lightweight planning. One agent handles exploration, clarification, and planning in a continuous conversation, maximizing context retention and minimizing agent creation overhead.
|
|
11
|
+
|
|
12
|
+
**Core capabilities:**
|
|
13
|
+
- **Single agent dual-role execution** (explorer + planner in one conversation)
|
|
14
|
+
- Context automatically preserved across phases (no serialization loss)
|
|
15
|
+
- Reduced user interaction rounds (1-2 vs 3-4)
|
|
16
|
+
- Best for Low/Medium complexity tasks with single exploration angle
|
|
17
|
+
|
|
18
|
+
## Applicable Scenarios
|
|
19
|
+
|
|
20
|
+
- **Low/Medium complexity tasks**
|
|
21
|
+
- Single exploration angle sufficient
|
|
22
|
+
- Prioritize minimal agent creation and coherent context
|
|
23
|
+
- Clear, well-defined tasks within single module
|
|
24
|
+
|
|
25
|
+
## Core Advantages
|
|
26
|
+
|
|
27
|
+
| Metric | Traditional Separated Mode | Plan-A Merged Mode |
|
|
28
|
+
|--------|---------------------------|-------------------|
|
|
29
|
+
| Agent creation count | 2-5 | **1** |
|
|
30
|
+
| Context transfer | Serialized, lossy | **Automatic retention** |
|
|
31
|
+
| User interaction rounds | 3-4 | **1-2** |
|
|
32
|
+
| Execution time | Multiple spawn/close | **30-50%↓** |
|
|
33
|
+
|
|
34
|
+
## Task Description
|
|
35
|
+
|
|
36
|
+
**Target task**: $TASK
|
|
37
|
+
|
|
38
|
+
## Execution Process
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
42
|
+
│ spawn_agent (dual role: explorer + planner) │
|
|
43
|
+
│ ↓ │
|
|
44
|
+
│ Phase 1: Exploration → output findings + clarification_needs│
|
|
45
|
+
│ ↓ │
|
|
46
|
+
│ wait() → get exploration results │
|
|
47
|
+
│ ↓ │
|
|
48
|
+
│ [If clarification needed] Main process collects user answers│
|
|
49
|
+
│ ↓ │
|
|
50
|
+
│ send_input(clarification_answers + "generate plan") │
|
|
51
|
+
│ ↓ │
|
|
52
|
+
│ Phase 2: Planning → output plan.json │
|
|
53
|
+
│ ↓ │
|
|
54
|
+
│ wait() → get planning results │
|
|
55
|
+
│ ↓ │
|
|
56
|
+
│ close_agent() │
|
|
57
|
+
└─────────────────────────────────────────────────────────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Implementation
|
|
61
|
+
|
|
62
|
+
### Session Setup
|
|
63
|
+
|
|
64
|
+
**Session Setup** (MANDATORY - follow exactly):
|
|
65
|
+
```javascript
|
|
66
|
+
// Helper: Get UTC+8 (China Standard Time) ISO string
|
|
67
|
+
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
68
|
+
|
|
69
|
+
const taskSlug = "$TASK".toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
|
70
|
+
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-11-29
|
|
71
|
+
|
|
72
|
+
const sessionId = `${taskSlug}-${dateStr}` // e.g., "implement-jwt-refresh-2025-11-29"
|
|
73
|
+
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
|
74
|
+
|
|
75
|
+
// Create session folder
|
|
76
|
+
mkdir -p ${sessionFolder}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Complexity Assessment & Angle Selection
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
const complexity = analyzeTaskComplexity("$TASK")
|
|
83
|
+
// Plan-A is suitable for Low/Medium; High complexity should use Plan-B
|
|
84
|
+
|
|
85
|
+
const ANGLE_PRESETS = {
|
|
86
|
+
architecture: ['architecture', 'dependencies'],
|
|
87
|
+
security: ['security', 'auth-patterns'],
|
|
88
|
+
performance: ['performance', 'bottlenecks'],
|
|
89
|
+
bugfix: ['error-handling', 'dataflow'],
|
|
90
|
+
feature: ['patterns', 'integration-points']
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Plan-A selects only 1-2 most relevant angles
|
|
94
|
+
const primaryAngle = selectPrimaryAngle("$TASK")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Phase 1 & 2: Single Agent Dual-Role Execution (Codex Pattern)
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
// ==================== PLAN-A: SINGLE AGENT MERGED MODE ====================
|
|
103
|
+
|
|
104
|
+
// Step 1: Create dual-role agent (role files read by agent itself)
|
|
105
|
+
const agent = spawn_agent({
|
|
106
|
+
message: `
|
|
107
|
+
## TASK ASSIGNMENT
|
|
108
|
+
|
|
109
|
+
### Overview
|
|
110
|
+
You will complete this task in TWO phases using a SINGLE conversation:
|
|
111
|
+
1. **Phase 1**: Explore codebase, output findings and clarification questions
|
|
112
|
+
2. **Phase 2**: After receiving clarification answers, generate implementation plan
|
|
113
|
+
|
|
114
|
+
### Task Description
|
|
115
|
+
${task_description}
|
|
116
|
+
|
|
117
|
+
### Session Info
|
|
118
|
+
- Session ID: ${sessionId}
|
|
119
|
+
- Session Folder: ${sessionFolder}
|
|
120
|
+
- Primary Angle: ${primaryAngle}
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## PHASE 1: EXPLORATION
|
|
125
|
+
|
|
126
|
+
### MANDATORY FIRST STEPS (Agent Execute)
|
|
127
|
+
1. **Read explorer role**: ~/.codex/agents/cli-explore-agent.md (MUST read first)
|
|
128
|
+
2. **Read planner role**: ~/.codex/agents/cli-lite-planning-agent.md (for Phase 2)
|
|
129
|
+
3. Run: ccw tool exec get_modules_by_depth '{}'
|
|
130
|
+
4. Run: rg -l "{keyword_from_task}" --type ts
|
|
131
|
+
5. Read: .workflow/project-tech.json
|
|
132
|
+
6. Read: .workflow/project-guidelines.json
|
|
133
|
+
|
|
134
|
+
### Exploration Focus: ${primaryAngle}
|
|
135
|
+
- Identify relevant files and modules
|
|
136
|
+
- Discover existing patterns and conventions
|
|
137
|
+
- Map dependencies and integration points
|
|
138
|
+
- Note constraints and limitations
|
|
139
|
+
|
|
140
|
+
### Phase 1 Output Format
|
|
141
|
+
|
|
142
|
+
\`\`\`
|
|
143
|
+
## EXPLORATION COMPLETE
|
|
144
|
+
|
|
145
|
+
### Findings Summary
|
|
146
|
+
- [Key finding 1]
|
|
147
|
+
- [Key finding 2]
|
|
148
|
+
- [Key finding 3]
|
|
149
|
+
|
|
150
|
+
### Relevant Files
|
|
151
|
+
| File | Relevance | Rationale |
|
|
152
|
+
|------|-----------|-----------|
|
|
153
|
+
| path/to/file1.ts | 0.9 | [reason] |
|
|
154
|
+
| path/to/file2.ts | 0.8 | [reason] |
|
|
155
|
+
|
|
156
|
+
### Patterns to Follow
|
|
157
|
+
- [Pattern 1 with code example]
|
|
158
|
+
- [Pattern 2 with code example]
|
|
159
|
+
|
|
160
|
+
### Integration Points
|
|
161
|
+
- [file:line] - [description]
|
|
162
|
+
|
|
163
|
+
### Constraints
|
|
164
|
+
- [Constraint 1]
|
|
165
|
+
- [Constraint 2]
|
|
166
|
+
|
|
167
|
+
CLARIFICATION_NEEDED:
|
|
168
|
+
Q1: [question] | Options: [A, B, C] | Recommended: [B]
|
|
169
|
+
Q2: [question] | Options: [A, B] | Recommended: [A]
|
|
170
|
+
\`\`\`
|
|
171
|
+
|
|
172
|
+
**If no clarification needed**, output:
|
|
173
|
+
\`\`\`
|
|
174
|
+
CLARIFICATION_NEEDED: NONE
|
|
175
|
+
|
|
176
|
+
Ready for Phase 2. Send "PROCEED_TO_PLANNING" to continue.
|
|
177
|
+
\`\`\`
|
|
178
|
+
|
|
179
|
+
### Write Exploration File
|
|
180
|
+
Write findings to: ${sessionFolder}/exploration.json
|
|
181
|
+
`
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
// Step 2: Wait for Phase 1 to complete
|
|
185
|
+
const phase1Result = wait({ ids: [agent], timeout_ms: 600000 })
|
|
186
|
+
const phase1Output = phase1Result.status[agent].completed
|
|
187
|
+
|
|
188
|
+
// Step 3: Handle clarification (if needed)
|
|
189
|
+
let clarificationAnswers = null
|
|
190
|
+
|
|
191
|
+
if (phase1Output.includes('CLARIFICATION_NEEDED:') && !phase1Output.includes('CLARIFICATION_NEEDED: NONE')) {
|
|
192
|
+
// Parse questions, collect user answers
|
|
193
|
+
const questions = parseClarificationQuestions(phase1Output)
|
|
194
|
+
|
|
195
|
+
// Display questions to user, collect answers
|
|
196
|
+
console.log(`
|
|
197
|
+
## Clarification Needed
|
|
198
|
+
|
|
199
|
+
${questions.map((q, i) => `
|
|
200
|
+
### Q${i+1}: ${q.question}
|
|
201
|
+
Options: ${q.options.join(', ')}
|
|
202
|
+
Recommended: ${q.recommended}
|
|
203
|
+
`).join('\n')}
|
|
204
|
+
|
|
205
|
+
**Please provide your answers...**
|
|
206
|
+
`)
|
|
207
|
+
|
|
208
|
+
// Wait for user input...
|
|
209
|
+
clarificationAnswers = collectUserAnswers(questions)
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Step 4: Send Phase 2 instruction (continue with same agent)
|
|
213
|
+
send_input({
|
|
214
|
+
id: agent,
|
|
215
|
+
message: `
|
|
216
|
+
## PHASE 2: GENERATE PLAN
|
|
217
|
+
|
|
218
|
+
${clarificationAnswers ? `
|
|
219
|
+
### Clarification Answers
|
|
220
|
+
${clarificationAnswers.map(a => `Q: ${a.question}\nA: ${a.answer}`).join('\n\n')}
|
|
221
|
+
` : '### No clarification needed - proceeding with exploration findings'}
|
|
222
|
+
|
|
223
|
+
### Planning Instructions
|
|
224
|
+
|
|
225
|
+
1. **Read Schema**
|
|
226
|
+
Execute: cat ~/.claude/workflows/cli-templates/schemas/plan-json-schema.json
|
|
227
|
+
|
|
228
|
+
2. **Generate Plan** based on your exploration findings
|
|
229
|
+
- Summary: 2-3 sentence overview
|
|
230
|
+
- Approach: High-level strategy
|
|
231
|
+
- Tasks: 2-7 tasks grouped by feature (NOT by file)
|
|
232
|
+
- Each task needs: id, title, scope, action, description, modification_points, implementation, acceptance, depends_on
|
|
233
|
+
|
|
234
|
+
3. **Task Grouping Rules**
|
|
235
|
+
- Group by feature: All changes for one feature = one task
|
|
236
|
+
- Substantial tasks: 15-60 minutes of work each
|
|
237
|
+
- True dependencies only: Use depends_on sparingly
|
|
238
|
+
- Prefer parallel: Most tasks should be independent
|
|
239
|
+
|
|
240
|
+
4. **Write Output**
|
|
241
|
+
Write: ${sessionFolder}/plan.json
|
|
242
|
+
|
|
243
|
+
### Output Format
|
|
244
|
+
Return brief completion summary after writing plan.json
|
|
245
|
+
`
|
|
246
|
+
})
|
|
247
|
+
|
|
248
|
+
// Step 5: Wait for Phase 2 to complete
|
|
249
|
+
const phase2Result = wait({ ids: [agent], timeout_ms: 600000 })
|
|
250
|
+
|
|
251
|
+
// Step 6: Cleanup
|
|
252
|
+
close_agent({ id: agent })
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### Phase 3: Confirmation
|
|
258
|
+
|
|
259
|
+
```javascript
|
|
260
|
+
const plan = JSON.parse(Read(`${sessionFolder}/plan.json`))
|
|
261
|
+
|
|
262
|
+
console.log(`
|
|
263
|
+
## Implementation Plan
|
|
264
|
+
|
|
265
|
+
**Summary**: ${plan.summary}
|
|
266
|
+
**Approach**: ${plan.approach}
|
|
267
|
+
**Complexity**: ${plan.complexity}
|
|
268
|
+
|
|
269
|
+
**Tasks** (${plan.tasks.length}):
|
|
270
|
+
${plan.tasks.map((t, i) => `${i+1}. ${t.title} (${t.scope})`).join('\n')}
|
|
271
|
+
|
|
272
|
+
**Estimated Time**: ${plan.estimated_time}
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Confirmation Required
|
|
277
|
+
|
|
278
|
+
Please review the plan above and reply with one of the following:
|
|
279
|
+
|
|
280
|
+
- **"Allow"** - Proceed with this plan, output plan.json
|
|
281
|
+
- **"Modify"** - Describe what changes you want to make
|
|
282
|
+
- **"Cancel"** - Abort the planning workflow
|
|
283
|
+
|
|
284
|
+
**WAITING FOR USER CONFIRMATION...**
|
|
285
|
+
`)
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Codex vs Claude Comparison (for merged mode)
|
|
291
|
+
|
|
292
|
+
| Aspect | Claude Code Task | Codex Subagent (Plan-A) |
|
|
293
|
+
|--------|------------------|------------------------|
|
|
294
|
+
| **Creation** | `Task({ subagent_type, prompt })` | `spawn_agent({ message: role + task })` |
|
|
295
|
+
| **Role Loading** | Auto via `subagent_type` | Manual: Agent reads `~/.codex/agents/*.md` |
|
|
296
|
+
| **Multi-phase** | Separate agents or resume | **Single agent + send_input** |
|
|
297
|
+
| **Context Retention** | Lossy (serialization) | **Automatic (same conversation)** |
|
|
298
|
+
| **Follow-up** | `resume` parameter | `send_input({ id, message })` |
|
|
299
|
+
| **Cleanup** | Automatic | **Explicit `close_agent({ id })`** |
|
|
300
|
+
|
|
301
|
+
**Plan-A Advantages**:
|
|
302
|
+
- Zero context loss between phases
|
|
303
|
+
- Single agent lifecycle to manage
|
|
304
|
+
- Minimal overhead for simple tasks
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Session Folder Structure
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
.workflow/.lite-plan/{task-slug}-{YYYY-MM-DD}/
|
|
312
|
+
├── exploration.json # Phase 1 output
|
|
313
|
+
└── plan.json # Phase 2 output (after confirmation)
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Workflow States
|
|
317
|
+
|
|
318
|
+
| State | Action | Next |
|
|
319
|
+
|-------|--------|------|
|
|
320
|
+
| Phase 1 Output | Exploration complete | → Wait for clarification or Phase 2 |
|
|
321
|
+
| Clarification Output | Questions displayed | → Wait for user reply |
|
|
322
|
+
| User Replied | Answers received | → send_input to Phase 2 |
|
|
323
|
+
| Phase 2 Output | Plan generated | → Phase 3 (Confirmation) |
|
|
324
|
+
| User: "Allow" | Confirmed | → Output complete |
|
|
325
|
+
| User: "Modify" | Changes requested | → send_input with revisions |
|
|
326
|
+
| User: "Cancel" | Aborted | → close_agent, end workflow |
|
|
327
|
+
|
|
328
|
+
## Error Handling
|
|
329
|
+
|
|
330
|
+
| Error | Resolution |
|
|
331
|
+
|-------|------------|
|
|
332
|
+
| Phase 1 timeout | Continue wait or send_input to request convergence |
|
|
333
|
+
| Phase 2 timeout | send_input requesting current progress output |
|
|
334
|
+
| Agent unexpectedly closed | Re-spawn, paste previous output in message |
|
|
335
|
+
| User cancels | close_agent, preserve generated files |
|
|
336
|
+
|
|
337
|
+
**Execute task**: $TASK
|