claude-code-workflow 6.3.2 → 6.3.5
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/CLAUDE.md +9 -1
- package/.claude/commands/{clean.md → workflow/clean.md} +5 -5
- package/.claude/commands/workflow/docs/analyze.md +1467 -0
- package/.claude/commands/workflow/docs/copyright.md +1265 -0
- package/.claude/commands/workflow/lite-plan.md +1 -1
- package/.claude/commands/workflow/tools/conflict-resolution.md +76 -240
- package/.claude/commands/workflow/tools/task-generate-agent.md +81 -8
- package/.claude/skills/_shared/mermaid-utils.md +584 -0
- package/.claude/skills/copyright-docs/SKILL.md +132 -0
- package/.claude/skills/copyright-docs/phases/01-metadata-collection.md +78 -0
- package/.claude/skills/copyright-docs/phases/02-deep-analysis.md +454 -0
- package/.claude/skills/copyright-docs/phases/02.5-consolidation.md +192 -0
- package/.claude/skills/copyright-docs/phases/04-document-assembly.md +261 -0
- package/.claude/skills/copyright-docs/phases/05-compliance-refinement.md +192 -0
- package/.claude/skills/copyright-docs/specs/cpcc-requirements.md +121 -0
- package/.claude/skills/copyright-docs/templates/agent-base.md +200 -0
- package/.claude/skills/project-analyze/SKILL.md +162 -0
- package/.claude/skills/project-analyze/phases/01-requirements-discovery.md +79 -0
- package/.claude/skills/project-analyze/phases/02-project-exploration.md +75 -0
- package/.claude/skills/project-analyze/phases/03-deep-analysis.md +640 -0
- package/.claude/skills/project-analyze/phases/03.5-consolidation.md +208 -0
- package/.claude/skills/project-analyze/phases/04-report-generation.md +217 -0
- package/.claude/skills/project-analyze/phases/05-iterative-refinement.md +124 -0
- package/.claude/skills/project-analyze/specs/quality-standards.md +115 -0
- package/.claude/skills/project-analyze/specs/writing-style.md +152 -0
- package/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json +79 -65
- package/.claude/workflows/cli-tools-usage.md +515 -516
- package/README.md +11 -1
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +7 -1
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/cli.d.ts +1 -1
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +116 -14
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js +2 -2
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +7 -3
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +31 -17
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
- package/ccw/dist/tools/cli-executor.js +19 -7
- package/ccw/dist/tools/cli-executor.js.map +1 -1
- package/ccw/dist/tools/cli-history-store.d.ts +33 -0
- package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
- package/ccw/dist/tools/cli-history-store.js +89 -5
- package/ccw/dist/tools/cli-history-store.js.map +1 -1
- package/ccw/dist/tools/smart-search.d.ts +25 -0
- package/ccw/dist/tools/smart-search.d.ts.map +1 -1
- package/ccw/dist/tools/smart-search.js +121 -17
- package/ccw/dist/tools/smart-search.js.map +1 -1
- package/ccw/src/cli.ts +264 -258
- package/ccw/src/commands/cli.ts +1009 -884
- package/ccw/src/core/routes/cli-routes.ts +3 -3
- package/ccw/src/templates/dashboard-js/components/cli-history.js +40 -13
- package/ccw/src/templates/dashboard-js/components/cli-status.js +26 -2
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +5 -0
- package/ccw/src/templates/dashboard-js/views/history.js +19 -4
- package/ccw/src/tools/claude-cli-tools.ts +37 -20
- package/ccw/src/tools/cli-executor.ts +20 -7
- package/ccw/src/tools/cli-history-store.ts +125 -5
- package/ccw/src/tools/smart-search.ts +157 -16
- package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/config.py +8 -0
- package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/chain_search.py +71 -1
- package/codex-lens/src/codexlens/search/hybrid_search.py +144 -11
- package/codex-lens/src/codexlens/search/ranking.py +540 -274
- package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/chunker.py +55 -10
- package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/global_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/dir_index.py +1888 -1850
- package/codex-lens/src/codexlens/storage/global_index.py +365 -0
- package/codex-lens/src/codexlens/storage/index_tree.py +83 -10
- package/package.json +2 -2
|
@@ -38,7 +38,7 @@ Phase 1: Task Analysis & Exploration
|
|
|
38
38
|
├─ Parse input (description or .md file)
|
|
39
39
|
├─ intelligent complexity assessment (Low/Medium/High)
|
|
40
40
|
├─ Exploration decision (auto-detect or --explore flag)
|
|
41
|
-
├─
|
|
41
|
+
├─ Context protection: If file reading ≥50k chars → force cli-explore-agent
|
|
42
42
|
└─ Decision:
|
|
43
43
|
├─ needsExploration=true → Launch parallel cli-explore-agents (1-4 based on complexity)
|
|
44
44
|
└─ needsExploration=false → Skip to Phase 2/3
|
|
@@ -124,6 +124,9 @@ Task(subagent_type="cli-execution-agent", run_in_background=false, prompt=`
|
|
|
124
124
|
|
|
125
125
|
## Analysis Steps
|
|
126
126
|
|
|
127
|
+
### 0. Load Output Schema (MANDATORY)
|
|
128
|
+
Execute: cat ~/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json
|
|
129
|
+
|
|
127
130
|
### 1. Load Context
|
|
128
131
|
- Read existing files from conflict_detection.existing_files
|
|
129
132
|
- Load plan from .workflow/active/{session_id}/.process/context-package.json
|
|
@@ -171,123 +174,14 @@ Task(subagent_type="cli-execution-agent", run_in_background=false, prompt=`
|
|
|
171
174
|
|
|
172
175
|
⚠️ Output to conflict-resolution.json (generated in Phase 4)
|
|
173
176
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
{
|
|
178
|
-
"conflicts": [
|
|
179
|
-
{
|
|
180
|
-
"id": "CON-001",
|
|
181
|
-
"brief": "一行中文冲突摘要",
|
|
182
|
-
"severity": "Critical|High|Medium",
|
|
183
|
-
"category": "Architecture|API|Data|Dependency|ModuleOverlap",
|
|
184
|
-
"affected_files": [
|
|
185
|
-
".workflow/active/{session}/.brainstorm/guidance-specification.md",
|
|
186
|
-
".workflow/active/{session}/.brainstorm/system-architect/analysis.md"
|
|
187
|
-
],
|
|
188
|
-
"description": "详细描述冲突 - 什么不兼容",
|
|
189
|
-
"impact": {
|
|
190
|
-
"scope": "影响的模块/组件",
|
|
191
|
-
"compatibility": "Yes|No|Partial",
|
|
192
|
-
"migration_required": true|false,
|
|
193
|
-
"estimated_effort": "人天估计"
|
|
194
|
-
},
|
|
195
|
-
"overlap_analysis": {
|
|
196
|
-
"// NOTE": "仅当 category=ModuleOverlap 时需要此字段",
|
|
197
|
-
"new_module": {
|
|
198
|
-
"name": "新模块名称",
|
|
199
|
-
"scenarios": ["场景1", "场景2", "场景3"],
|
|
200
|
-
"responsibilities": "职责描述"
|
|
201
|
-
},
|
|
202
|
-
"existing_modules": [
|
|
203
|
-
{
|
|
204
|
-
"file": "src/existing/module.ts",
|
|
205
|
-
"name": "现有模块名称",
|
|
206
|
-
"scenarios": ["场景A", "场景B"],
|
|
207
|
-
"overlap_scenarios": ["重叠场景1", "重叠场景2"],
|
|
208
|
-
"responsibilities": "现有模块职责"
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
},
|
|
212
|
-
"strategies": [
|
|
213
|
-
{
|
|
214
|
-
"name": "策略名称(中文)",
|
|
215
|
-
"approach": "实现方法简述",
|
|
216
|
-
"complexity": "Low|Medium|High",
|
|
217
|
-
"risk": "Low|Medium|High",
|
|
218
|
-
"effort": "时间估计",
|
|
219
|
-
"pros": ["优点1", "优点2"],
|
|
220
|
-
"cons": ["缺点1", "缺点2"],
|
|
221
|
-
"clarification_needed": [
|
|
222
|
-
"// NOTE: 仅当需要用户进一步澄清时需要此字段(尤其是 ModuleOverlap)",
|
|
223
|
-
"新模块的核心职责边界是什么?",
|
|
224
|
-
"如何与现有模块 X 协作?",
|
|
225
|
-
"哪些场景应该由新模块处理?"
|
|
226
|
-
],
|
|
227
|
-
"modifications": [
|
|
228
|
-
{
|
|
229
|
-
"file": ".workflow/active/{session}/.brainstorm/guidance-specification.md",
|
|
230
|
-
"section": "## 2. System Architect Decisions",
|
|
231
|
-
"change_type": "update",
|
|
232
|
-
"old_content": "原始内容片段(用于定位)",
|
|
233
|
-
"new_content": "修改后的内容",
|
|
234
|
-
"rationale": "为什么这样改"
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"file": ".workflow/active/{session}/.brainstorm/system-architect/analysis.md",
|
|
238
|
-
"section": "## Design Decisions",
|
|
239
|
-
"change_type": "update",
|
|
240
|
-
"old_content": "原始内容片段",
|
|
241
|
-
"new_content": "修改后的内容",
|
|
242
|
-
"rationale": "修改理由"
|
|
243
|
-
}
|
|
244
|
-
]
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
"name": "策略2名称",
|
|
248
|
-
"approach": "...",
|
|
249
|
-
"complexity": "Medium",
|
|
250
|
-
"risk": "Low",
|
|
251
|
-
"effort": "1-2天",
|
|
252
|
-
"pros": ["优点"],
|
|
253
|
-
"cons": ["缺点"],
|
|
254
|
-
"modifications": [...]
|
|
255
|
-
}
|
|
256
|
-
],
|
|
257
|
-
"recommended": 0,
|
|
258
|
-
"modification_suggestions": [
|
|
259
|
-
"建议1:具体的修改方向或注意事项",
|
|
260
|
-
"建议2:可能需要考虑的边界情况",
|
|
261
|
-
"建议3:相关的最佳实践或模式"
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
],
|
|
265
|
-
"summary": {
|
|
266
|
-
"total": 2,
|
|
267
|
-
"critical": 1,
|
|
268
|
-
"high": 1,
|
|
269
|
-
"medium": 0
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
\`\`\`
|
|
273
|
-
|
|
274
|
-
⚠️ CRITICAL Requirements for modifications field:
|
|
275
|
-
- old_content: Must be exact text from target file (20-100 chars for unique match)
|
|
276
|
-
- new_content: Complete replacement text (maintains formatting)
|
|
277
|
-
- change_type: "update" (replace), "add" (insert), "remove" (delete)
|
|
278
|
-
- file: Full path relative to project root
|
|
279
|
-
- section: Markdown heading for context (helps locate position)
|
|
177
|
+
**Schema Reference**: Execute \`cat ~/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json\` to get full schema
|
|
178
|
+
|
|
179
|
+
Return JSON following the schema above. Key requirements:
|
|
280
180
|
- Minimum 2 strategies per conflict, max 4
|
|
281
|
-
- All text in Chinese for user-facing fields (brief, name, pros, cons)
|
|
282
|
-
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
- Each strategy must have actionable modifications
|
|
286
|
-
- old_content must be precise enough for Edit tool matching
|
|
287
|
-
- new_content preserves markdown formatting and structure
|
|
288
|
-
- Recommended strategy (index) based on lowest complexity + risk
|
|
289
|
-
- modification_suggestions must be specific, actionable, and context-aware
|
|
290
|
-
- Each suggestion should address a specific aspect (compatibility, migration, testing, etc.)
|
|
181
|
+
- All text in Chinese for user-facing fields (brief, name, pros, cons, modification_suggestions)
|
|
182
|
+
- modifications.old_content: 20-100 chars for unique Edit tool matching
|
|
183
|
+
- modifications.new_content: preserves markdown formatting
|
|
184
|
+
- modification_suggestions: 2-5 actionable suggestions for custom handling
|
|
291
185
|
`)
|
|
292
186
|
```
|
|
293
187
|
|
|
@@ -312,143 +206,85 @@ Task(subagent_type="cli-execution-agent", run_in_background=false, prompt=`
|
|
|
312
206
|
8. Return execution log path
|
|
313
207
|
```
|
|
314
208
|
|
|
315
|
-
### Phase 3:
|
|
209
|
+
### Phase 3: User Interaction Loop
|
|
316
210
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
round
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
211
|
+
```javascript
|
|
212
|
+
FOR each conflict:
|
|
213
|
+
round = 0, clarified = false, userClarifications = []
|
|
214
|
+
|
|
215
|
+
WHILE (!clarified && round++ < 10):
|
|
216
|
+
// 1. Display conflict info (text output for context)
|
|
217
|
+
displayConflictSummary(conflict) // id, brief, severity, overlap_analysis if ModuleOverlap
|
|
218
|
+
|
|
219
|
+
// 2. Strategy selection via AskUserQuestion
|
|
220
|
+
AskUserQuestion({
|
|
221
|
+
questions: [{
|
|
222
|
+
question: formatStrategiesForDisplay(conflict.strategies),
|
|
223
|
+
header: "策略选择",
|
|
224
|
+
multiSelect: false,
|
|
225
|
+
options: [
|
|
226
|
+
...conflict.strategies.map((s, i) => ({
|
|
227
|
+
label: `${s.name}${i === conflict.recommended ? ' (推荐)' : ''}`,
|
|
228
|
+
description: `${s.complexity}复杂度 | ${s.risk}风险${s.clarification_needed?.length ? ' | ⚠️需澄清' : ''}`
|
|
229
|
+
})),
|
|
230
|
+
{ label: "自定义修改", description: `建议: ${conflict.modification_suggestions?.slice(0,2).join('; ')}` }
|
|
231
|
+
]
|
|
232
|
+
}]
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
// 3. Handle selection
|
|
236
|
+
if (userChoice === "自定义修改") {
|
|
237
|
+
customConflicts.push({ id, brief, category, suggestions, overlap_analysis })
|
|
238
|
+
break
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
selectedStrategy = findStrategyByName(userChoice)
|
|
242
|
+
|
|
243
|
+
// 4. Clarification (if needed) - batched max 4 per call
|
|
244
|
+
if (selectedStrategy.clarification_needed?.length > 0) {
|
|
245
|
+
for (batch of chunk(selectedStrategy.clarification_needed, 4)) {
|
|
246
|
+
AskUserQuestion({
|
|
247
|
+
questions: batch.map((q, i) => ({
|
|
248
|
+
question: q, header: `澄清${i+1}`, multiSelect: false,
|
|
249
|
+
options: [{ label: "详细说明", description: "提供答案" }]
|
|
250
|
+
}))
|
|
251
|
+
})
|
|
252
|
+
userClarifications.push(...collectAnswers(batch))
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 5. Agent re-analysis
|
|
256
|
+
reanalysisResult = Task({
|
|
257
|
+
subagent_type: "cli-execution-agent",
|
|
258
|
+
run_in_background: false,
|
|
259
|
+
prompt: `Conflict: ${conflict.id}, Strategy: ${selectedStrategy.name}
|
|
260
|
+
User Clarifications: ${JSON.stringify(userClarifications)}
|
|
261
|
+
Output: { uniqueness_confirmed, rationale, updated_strategy, remaining_questions }`
|
|
367
262
|
})
|
|
368
263
|
|
|
369
|
-
|
|
370
|
-
selectedStrategy = updated_strategy
|
|
371
|
-
selectedStrategy.clarifications = userClarifications
|
|
264
|
+
if (reanalysisResult.uniqueness_confirmed) {
|
|
265
|
+
selectedStrategy = { ...reanalysisResult.updated_strategy, clarifications: userClarifications }
|
|
372
266
|
clarified = true
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
267
|
+
} else {
|
|
268
|
+
selectedStrategy.clarification_needed = reanalysisResult.remaining_questions
|
|
269
|
+
}
|
|
270
|
+
} else {
|
|
377
271
|
clarified = true
|
|
272
|
+
}
|
|
378
273
|
|
|
379
|
-
resolvedConflicts.push({conflict, strategy: selectedStrategy})
|
|
274
|
+
if (clarified) resolvedConflicts.push({ conflict, strategy: selectedStrategy })
|
|
380
275
|
END WHILE
|
|
381
276
|
END FOR
|
|
382
277
|
|
|
383
|
-
// Build output
|
|
384
278
|
selectedStrategies = resolvedConflicts.map(r => ({
|
|
385
|
-
conflict_id, strategy, clarifications[]
|
|
279
|
+
conflict_id: r.conflict.id, strategy: r.strategy, clarifications: r.strategy.clarifications || []
|
|
386
280
|
}))
|
|
387
281
|
```
|
|
388
282
|
|
|
389
|
-
**Key
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
id, brief, category,
|
|
395
|
-
suggestions: modification_suggestions[],
|
|
396
|
-
overlap_analysis: { new_module{}, existing_modules[] } // ModuleOverlap only
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// Agent re-analysis prompt output
|
|
400
|
-
{
|
|
401
|
-
uniqueness_confirmed: bool,
|
|
402
|
-
rationale: string,
|
|
403
|
-
updated_strategy: {
|
|
404
|
-
name, approach, complexity, risk, effort,
|
|
405
|
-
modifications: [{file, section, change_type, old_content, new_content, rationale}]
|
|
406
|
-
},
|
|
407
|
-
remaining_questions: string[]
|
|
408
|
-
}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
**Text Output Example** (展示关键字段):
|
|
412
|
-
|
|
413
|
-
```markdown
|
|
414
|
-
============================================================
|
|
415
|
-
冲突 1/3 - 第 1 轮
|
|
416
|
-
============================================================
|
|
417
|
-
【ModuleOverlap】CON-001: 新增用户认证服务与现有模块功能重叠
|
|
418
|
-
严重程度: High | 描述: 计划中的 UserAuthService 与现有 AuthManager 场景重叠
|
|
419
|
-
|
|
420
|
-
--- 场景重叠分析 ---
|
|
421
|
-
新模块: UserAuthService | 场景: 登录, Token验证, 权限, MFA
|
|
422
|
-
现有模块: AuthManager (src/auth/AuthManager.ts) | 重叠: 登录, Token验证
|
|
423
|
-
|
|
424
|
-
--- 解决策略 ---
|
|
425
|
-
1) 合并 (Low复杂度 | Low风险 | 2-3天)
|
|
426
|
-
⚠️ 需澄清: AuthManager是否能承担MFA?
|
|
427
|
-
|
|
428
|
-
2) 拆分边界 (Medium复杂度 | Medium风险 | 4-5天)
|
|
429
|
-
⚠️ 需澄清: 基础/高级认证边界? Token验证归谁?
|
|
430
|
-
|
|
431
|
-
3) 自定义修改
|
|
432
|
-
建议: 评估扩展性; 策略模式分离; 定义接口边界
|
|
433
|
-
|
|
434
|
-
请选择 (1-3): > 2
|
|
435
|
-
|
|
436
|
-
--- 澄清问答 (第1轮) ---
|
|
437
|
-
Q: 基础/高级认证边界?
|
|
438
|
-
A: 基础=密码登录+token验证, 高级=MFA+OAuth+SSO
|
|
439
|
-
|
|
440
|
-
Q: Token验证归谁?
|
|
441
|
-
A: 统一由 AuthManager 负责
|
|
442
|
-
|
|
443
|
-
🔄 重新分析...
|
|
444
|
-
✅ 唯一性已确认 | 理由: 边界清晰 - AuthManager(基础+token), UserAuthService(MFA+OAuth+SSO)
|
|
445
|
-
|
|
446
|
-
============================================================
|
|
447
|
-
冲突 2/3 - 第 1 轮 [下一个冲突]
|
|
448
|
-
============================================================
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
**Loop Characteristics**: 逐个处理 | 无限轮次(max 10) | 动态问题生成 | Agent重新分析判断唯一性 | ModuleOverlap场景边界澄清
|
|
283
|
+
**Key Points**:
|
|
284
|
+
- AskUserQuestion: max 4 questions/call, batch if more
|
|
285
|
+
- Strategy options: 2-4 strategies + "自定义修改"
|
|
286
|
+
- Clarification loop: max 10 rounds, agent判断 uniqueness_confirmed
|
|
287
|
+
- Custom conflicts: 记录 overlap_analysis 供后续手动处理
|
|
452
288
|
|
|
453
289
|
### Phase 4: Apply Modifications
|
|
454
290
|
|
|
@@ -354,19 +354,20 @@ Generate task JSON files for ${module.name} module within workflow session
|
|
|
354
354
|
IMPORTANT: This is PLANNING ONLY - generate task JSONs, NOT implementing code.
|
|
355
355
|
IMPORTANT: Generate Task JSONs ONLY. IMPL_PLAN.md and TODO_LIST.md by Phase 3 Coordinator.
|
|
356
356
|
|
|
357
|
-
CRITICAL: Follow progressive loading strategy in agent specification
|
|
357
|
+
CRITICAL: Follow the progressive loading strategy defined in agent specification (load analysis.md files incrementally due to file size)
|
|
358
358
|
|
|
359
359
|
## MODULE SCOPE
|
|
360
360
|
- Module: ${module.name} (${module.type})
|
|
361
361
|
- Focus Paths: ${module.paths.join(', ')}
|
|
362
362
|
- Task ID Prefix: IMPL-${module.prefix}
|
|
363
|
-
- Task Limit: ≤9 tasks
|
|
364
|
-
- Other Modules: ${otherModules.join(', ')}
|
|
363
|
+
- Task Limit: ≤9 tasks (hard limit for this module)
|
|
364
|
+
- Other Modules: ${otherModules.join(', ')} (reference only, do NOT generate tasks for them)
|
|
365
365
|
|
|
366
366
|
## SESSION PATHS
|
|
367
367
|
Input:
|
|
368
368
|
- Session Metadata: .workflow/active/{session-id}/workflow-session.json
|
|
369
369
|
- Context Package: .workflow/active/{session-id}/.process/context-package.json
|
|
370
|
+
|
|
370
371
|
Output:
|
|
371
372
|
- Task Dir: .workflow/active/{session-id}/.task/
|
|
372
373
|
|
|
@@ -374,21 +375,93 @@ Output:
|
|
|
374
375
|
Session ID: {session-id}
|
|
375
376
|
MCP Capabilities: {exa_code, exa_web, code_index}
|
|
376
377
|
|
|
378
|
+
## USER CONFIGURATION (from Phase 0)
|
|
379
|
+
Execution Method: ${userConfig.executionMethod} // agent|hybrid|cli
|
|
380
|
+
Preferred CLI Tool: ${userConfig.preferredCliTool} // codex|gemini|qwen|auto
|
|
381
|
+
Supplementary Materials: ${userConfig.supplementaryMaterials}
|
|
382
|
+
|
|
383
|
+
## CLI TOOL SELECTION
|
|
384
|
+
Based on userConfig.executionMethod:
|
|
385
|
+
- "agent": No command field in implementation_approach steps
|
|
386
|
+
- "hybrid": Add command field to complex steps only (agent handles simple steps)
|
|
387
|
+
- "cli": Add command field to ALL implementation_approach steps
|
|
388
|
+
|
|
389
|
+
CLI Resume Support (MANDATORY for all CLI commands):
|
|
390
|
+
- Use --resume parameter to continue from previous task execution
|
|
391
|
+
- Read previous task's cliExecutionId from session state
|
|
392
|
+
- Format: ccw cli -p "[prompt]" --resume ${previousCliId} --tool ${tool} --mode write
|
|
393
|
+
|
|
394
|
+
## EXPLORATION CONTEXT (from context-package.exploration_results)
|
|
395
|
+
- Load exploration_results from context-package.json
|
|
396
|
+
- Filter for ${module.name} module: Use aggregated_insights.critical_files matching ${module.paths.join(', ')}
|
|
397
|
+
- Apply module-relevant constraints from aggregated_insights.constraints
|
|
398
|
+
- Reference aggregated_insights.all_patterns applicable to ${module.name}
|
|
399
|
+
- Use aggregated_insights.all_integration_points for precise modification locations within module scope
|
|
400
|
+
- Use conflict_indicators for risk-aware task sequencing
|
|
401
|
+
|
|
402
|
+
## CONFLICT RESOLUTION CONTEXT (if exists)
|
|
403
|
+
- Check context-package.conflict_detection.resolution_file for conflict-resolution.json path
|
|
404
|
+
- If exists, load .process/conflict-resolution.json:
|
|
405
|
+
- Apply planning_constraints relevant to ${module.name} as task constraints
|
|
406
|
+
- Reference resolved_conflicts affecting ${module.name} for implementation approach alignment
|
|
407
|
+
- Handle custom_conflicts with explicit task notes
|
|
408
|
+
|
|
377
409
|
## CROSS-MODULE DEPENDENCIES
|
|
378
|
-
- Use placeholder
|
|
379
|
-
- Example: depends_on: ["CROSS::B::api-endpoint"]
|
|
410
|
+
- For dependencies ON other modules: Use placeholder depends_on: ["CROSS::{module}::{pattern}"]
|
|
411
|
+
- Example: depends_on: ["CROSS::B::api-endpoint"] (this module depends on B's api-endpoint task)
|
|
380
412
|
- Phase 3 Coordinator resolves to actual task IDs
|
|
413
|
+
- For dependencies FROM other modules: Document in task context as "provides_for" annotation
|
|
381
414
|
|
|
382
415
|
## EXPECTED DELIVERABLES
|
|
383
416
|
Task JSON Files (.task/IMPL-${module.prefix}*.json):
|
|
384
|
-
- 6-field schema
|
|
417
|
+
- 6-field schema (id, title, status, context_package_path, meta, context, flow_control)
|
|
385
418
|
- Task ID format: IMPL-${module.prefix}1, IMPL-${module.prefix}2, ...
|
|
419
|
+
- Quantified requirements with explicit counts
|
|
420
|
+
- Artifacts integration from context package (filtered for ${module.name})
|
|
421
|
+
- **focus_paths enhanced with exploration critical_files (module-scoped)**
|
|
422
|
+
- Flow control with pre_analysis steps (include exploration integration_points analysis)
|
|
423
|
+
- **CLI Execution IDs and strategies (MANDATORY)**
|
|
386
424
|
- Focus ONLY on ${module.name} module scope
|
|
387
425
|
|
|
426
|
+
## CLI EXECUTION ID REQUIREMENTS (MANDATORY)
|
|
427
|
+
Each task JSON MUST include:
|
|
428
|
+
- **cli_execution_id**: Unique ID for CLI execution (format: `{session_id}-IMPL-${module.prefix}{seq}`)
|
|
429
|
+
- **cli_execution**: Strategy object based on depends_on:
|
|
430
|
+
- No deps → `{ "strategy": "new" }`
|
|
431
|
+
- 1 dep (single child) → `{ "strategy": "resume", "resume_from": "parent-cli-id" }`
|
|
432
|
+
- 1 dep (multiple children) → `{ "strategy": "fork", "resume_from": "parent-cli-id" }`
|
|
433
|
+
- N deps → `{ "strategy": "merge_fork", "merge_from": ["id1", "id2", ...] }`
|
|
434
|
+
- Cross-module dep → `{ "strategy": "cross_module_fork", "resume_from": "CROSS::{module}::{pattern}" }`
|
|
435
|
+
|
|
436
|
+
**CLI Execution Strategy Rules**:
|
|
437
|
+
1. **new**: Task has no dependencies - starts fresh CLI conversation
|
|
438
|
+
2. **resume**: Task has 1 parent AND that parent has only this child - continues same conversation
|
|
439
|
+
3. **fork**: Task has 1 parent BUT parent has multiple children - creates new branch with parent context
|
|
440
|
+
4. **merge_fork**: Task has multiple parents - merges all parent contexts into new conversation
|
|
441
|
+
5. **cross_module_fork**: Task depends on task from another module - Phase 3 resolves placeholder
|
|
442
|
+
|
|
443
|
+
**Execution Command Patterns**:
|
|
444
|
+
- new: `ccw cli -p "[prompt]" --tool [tool] --mode write --id [cli_execution_id]`
|
|
445
|
+
- resume: `ccw cli -p "[prompt]" --resume [resume_from] --tool [tool] --mode write`
|
|
446
|
+
- fork: `ccw cli -p "[prompt]" --resume [resume_from] --id [cli_execution_id] --tool [tool] --mode write`
|
|
447
|
+
- merge_fork: `ccw cli -p "[prompt]" --resume [merge_from.join(',')] --id [cli_execution_id] --tool [tool] --mode write`
|
|
448
|
+
- cross_module_fork: (Phase 3 resolves placeholder, then uses fork pattern)
|
|
449
|
+
|
|
450
|
+
## QUALITY STANDARDS
|
|
451
|
+
Hard Constraints:
|
|
452
|
+
- Task count <= 9 for this module (hard limit - coordinate with Phase 3 if exceeded)
|
|
453
|
+
- All requirements quantified (explicit counts and enumerated lists)
|
|
454
|
+
- Acceptance criteria measurable (include verification commands)
|
|
455
|
+
- Artifact references mapped from context package (module-scoped filter)
|
|
456
|
+
- Focus paths use absolute paths or clear relative paths from project root
|
|
457
|
+
- Cross-module dependencies use CROSS:: placeholder format
|
|
458
|
+
|
|
388
459
|
## SUCCESS CRITERIA
|
|
389
460
|
- Task JSONs saved to .task/ with IMPL-${module.prefix}* naming
|
|
390
|
-
-
|
|
391
|
-
-
|
|
461
|
+
- All task JSONs include cli_execution_id and cli_execution strategy
|
|
462
|
+
- Cross-module dependencies use CROSS:: placeholder format consistently
|
|
463
|
+
- Focus paths scoped to ${module.paths.join(', ')} only
|
|
464
|
+
- Return: task count, task IDs, dependency summary (internal + cross-module)
|
|
392
465
|
`
|
|
393
466
|
)
|
|
394
467
|
);
|