claude-code-workflow 7.2.20 → 7.2.22
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/analyze-with-file.md +25 -12
- package/.codex/skills/analyze-with-file/SKILL.md +235 -497
- package/.codex/skills/brainstorm-with-file/SKILL.md +661 -751
- package/.codex/skills/csv-wave-pipeline/SKILL.md +192 -198
- package/.codex/skills/team-arch-opt/SKILL.md +24 -0
- package/.codex/skills/team-arch-opt/roles/coordinator/role.md +22 -0
- package/.codex/skills/team-brainstorm/SKILL.md +24 -0
- package/.codex/skills/team-brainstorm/roles/coordinator/role.md +20 -0
- package/.codex/skills/team-coordinate/SKILL.md +24 -0
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +40 -12
- package/.codex/skills/team-frontend/SKILL.md +24 -0
- package/.codex/skills/team-frontend/roles/coordinator/role.md +20 -0
- package/.codex/skills/team-frontend-debug/SKILL.md +24 -0
- package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +21 -0
- package/.codex/skills/team-issue/SKILL.md +24 -0
- package/.codex/skills/team-issue/roles/coordinator/role.md +19 -0
- package/.codex/skills/team-iterdev/SKILL.md +24 -0
- package/.codex/skills/team-iterdev/roles/coordinator/role.md +20 -0
- package/.codex/skills/team-lifecycle-v4/SKILL.md +24 -0
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +28 -2
- package/.codex/skills/team-perf-opt/SKILL.md +24 -0
- package/.codex/skills/team-perf-opt/roles/coordinator/role.md +20 -0
- package/.codex/skills/team-planex/SKILL.md +24 -0
- package/.codex/skills/team-planex/roles/coordinator/role.md +19 -0
- package/.codex/skills/team-quality-assurance/SKILL.md +24 -0
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +21 -0
- package/.codex/skills/team-review/SKILL.md +24 -0
- package/.codex/skills/team-review/roles/coordinator/role.md +21 -0
- package/.codex/skills/team-roadmap-dev/SKILL.md +24 -0
- package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +19 -0
- package/.codex/skills/team-tech-debt/SKILL.md +24 -0
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +19 -0
- package/.codex/skills/team-testing/SKILL.md +24 -0
- package/.codex/skills/team-testing/roles/coordinator/role.md +21 -0
- package/.codex/skills/team-uidesign/SKILL.md +24 -0
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +20 -0
- package/.codex/skills/team-ultra-analyze/SKILL.md +24 -0
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +20 -0
- package/.codex/skills/team-ux-improve/SKILL.md +24 -0
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +20 -0
- package/package.json +1 -1
- package/.codex/skills/collaborative-plan-with-file/SKILL.md +0 -830
- package/.codex/skills/unified-execute-with-file/SKILL.md +0 -797
|
@@ -19,43 +19,6 @@ Interactive collaborative analysis workflow with **documented discussion process
|
|
|
19
19
|
- **Interactive discussion**: Multi-round Q&A with user feedback and direction adjustments
|
|
20
20
|
- **Plan output**: Generate structured plan checklist for downstream execution (e.g., `$csv-wave-pipeline`)
|
|
21
21
|
|
|
22
|
-
### Decision Recording Protocol
|
|
23
|
-
|
|
24
|
-
**CRITICAL**: During analysis, the following situations **MUST** trigger immediate recording to discussion.md:
|
|
25
|
-
|
|
26
|
-
| Trigger | What to Record | Target Section |
|
|
27
|
-
|---------|---------------|----------------|
|
|
28
|
-
| **Direction choice** | What was chosen, why, what alternatives were discarded | `#### Decision Log` |
|
|
29
|
-
| **Key finding** | Finding content, impact scope, confidence level, hypothesis impact | `#### Key Findings` |
|
|
30
|
-
| **Assumption change** | Old assumption → new understanding, reason, impact | `#### Corrected Assumptions` |
|
|
31
|
-
| **User feedback** | User's original input, rationale for adoption/adjustment | `#### User Input` |
|
|
32
|
-
| **Disagreement & trade-off** | Conflicting viewpoints, trade-off basis, final choice | `#### Decision Log` |
|
|
33
|
-
| **Scope adjustment** | Before/after scope, trigger reason | `#### Decision Log` |
|
|
34
|
-
|
|
35
|
-
**Decision Record Format**:
|
|
36
|
-
```markdown
|
|
37
|
-
> **Decision**: [Description of the decision]
|
|
38
|
-
> - **Context**: [What triggered this decision]
|
|
39
|
-
> - **Options considered**: [Alternatives evaluated]
|
|
40
|
-
> - **Chosen**: [Selected approach] — **Reason**: [Rationale]
|
|
41
|
-
> - **Rejected**: [Why other options were discarded]
|
|
42
|
-
> - **Impact**: [Effect on analysis direction/conclusions]
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Key Finding Record Format**:
|
|
46
|
-
```markdown
|
|
47
|
-
> **Finding**: [Content]
|
|
48
|
-
> - **Confidence**: [High/Medium/Low] — **Why**: [Evidence basis]
|
|
49
|
-
> - **Hypothesis Impact**: [Confirms/Refutes/Modifies] hypothesis "[name]"
|
|
50
|
-
> - **Scope**: [What areas this affects]
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**Recording Principles**:
|
|
54
|
-
- **Immediacy**: Record decisions as they happen, not at the end of a phase
|
|
55
|
-
- **Completeness**: Capture context, options, chosen approach, reason, and rejected alternatives
|
|
56
|
-
- **Traceability**: Later phases must be able to trace back why a decision was made
|
|
57
|
-
- **Depth**: Capture reasoning and hypothesis impact, not just outcomes
|
|
58
|
-
|
|
59
22
|
## Auto Mode
|
|
60
23
|
|
|
61
24
|
When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended analysis angles, skip interactive scoping.
|
|
@@ -80,6 +43,19 @@ When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended analys
|
|
|
80
43
|
|
|
81
44
|
**$TOPIC**
|
|
82
45
|
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
| Flag | Default | Description |
|
|
49
|
+
|------|---------|-------------|
|
|
50
|
+
| `-y, --yes` | false | Auto-confirm all decisions |
|
|
51
|
+
| `--continue` | false | Continue existing session |
|
|
52
|
+
| `--depth` | standard | Analysis depth: quick / standard / deep |
|
|
53
|
+
|
|
54
|
+
**Session ID format**: `ANL-{slug}-{YYYY-MM-DD}`
|
|
55
|
+
- slug: lowercase, alphanumeric + CJK characters, max 40 chars
|
|
56
|
+
- date: YYYY-MM-DD (UTC+8)
|
|
57
|
+
- Auto-detect continue: session folder + discussion.md exists → continue mode
|
|
58
|
+
|
|
83
59
|
## Analysis Flow
|
|
84
60
|
|
|
85
61
|
```
|
|
@@ -126,6 +102,7 @@ Step 3: Interactive Discussion (Multi-Round, max 5)
|
|
|
126
102
|
|
|
127
103
|
Step 4: Synthesis & Conclusion
|
|
128
104
|
├─ Intent Coverage Verification (mandatory gate)
|
|
105
|
+
├─ Findings-to-Recommendations Traceability (mandatory gate)
|
|
129
106
|
├─ Consolidate all insights → conclusions.json (with steps[] per recommendation)
|
|
130
107
|
├─ Update discussion.md with final synthesis
|
|
131
108
|
├─ Interactive Recommendation Review (per-recommendation confirm/modify/reject)
|
|
@@ -136,24 +113,62 @@ Step 5: Plan Generation (Optional - produces plan only, NO code modifications)
|
|
|
136
113
|
└─ Remind user to execute via $csv-wave-pipeline
|
|
137
114
|
```
|
|
138
115
|
|
|
139
|
-
##
|
|
116
|
+
## Recording Protocol
|
|
140
117
|
|
|
141
|
-
|
|
142
|
-
|------|---------|-------------|
|
|
143
|
-
| `-y, --yes` | false | Auto-confirm all decisions |
|
|
144
|
-
| `--continue` | false | Continue existing session |
|
|
145
|
-
| `--depth` | standard | Analysis depth: quick / standard / deep |
|
|
118
|
+
**CRITICAL**: During analysis, the following situations **MUST** trigger immediate recording to discussion.md:
|
|
146
119
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
120
|
+
| Trigger | What to Record | Target Section |
|
|
121
|
+
|---------|---------------|----------------|
|
|
122
|
+
| **Direction choice** | What was chosen, why, what alternatives were discarded | `#### Decision Log` |
|
|
123
|
+
| **Key finding** | Finding content, impact scope, confidence level, hypothesis impact | `#### Key Findings` |
|
|
124
|
+
| **Assumption change** | Old assumption → new understanding, reason, impact | `#### Corrected Assumptions` |
|
|
125
|
+
| **User feedback** | User's original input, rationale for adoption/adjustment | `#### User Input` |
|
|
126
|
+
| **Disagreement & trade-off** | Conflicting viewpoints, trade-off basis, final choice | `#### Decision Log` |
|
|
127
|
+
| **Scope adjustment** | Before/after scope, trigger reason | `#### Decision Log` |
|
|
151
128
|
|
|
152
|
-
|
|
129
|
+
### Decision Record Format
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
> **Decision**: [Description of the decision]
|
|
133
|
+
> - **Context**: [What triggered this decision]
|
|
134
|
+
> - **Options considered**: [Alternatives evaluated]
|
|
135
|
+
> - **Chosen**: [Selected approach] — **Reason**: [Rationale]
|
|
136
|
+
> - **Rejected**: [Why other options were discarded]
|
|
137
|
+
> - **Impact**: [Effect on analysis direction/conclusions]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Key Finding Record Format
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
> **Finding**: [Content]
|
|
144
|
+
> - **Confidence**: [High/Medium/Low] — **Why**: [Evidence basis]
|
|
145
|
+
> - **Hypothesis Impact**: [Confirms/Refutes/Modifies] hypothesis "[name]"
|
|
146
|
+
> - **Scope**: [What areas this affects]
|
|
147
|
+
```
|
|
153
148
|
|
|
154
|
-
###
|
|
149
|
+
### Narrative Synthesis Format
|
|
155
150
|
|
|
156
|
-
|
|
151
|
+
Append after each round update:
|
|
152
|
+
|
|
153
|
+
```markdown
|
|
154
|
+
### Round N: Narrative Synthesis
|
|
155
|
+
**起点**: 基于上一轮的 [conclusions/questions],本轮从 [starting point] 切入。
|
|
156
|
+
**关键进展**: [New findings] [confirmed/refuted/modified] 了之前关于 [hypothesis] 的理解。
|
|
157
|
+
**决策影响**: 用户选择 [feedback type],导致分析方向 [adjusted/deepened/maintained]。
|
|
158
|
+
**当前理解**: 经过本轮,核心认知更新为 [updated understanding]。
|
|
159
|
+
**遗留问题**: [remaining questions driving next round]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Recording Principles
|
|
163
|
+
|
|
164
|
+
- **Immediacy**: Record decisions as they happen, not at the end of a phase
|
|
165
|
+
- **Completeness**: Capture context, options, chosen approach, reason, and rejected alternatives
|
|
166
|
+
- **Traceability**: Later phases must be able to trace back why a decision was made
|
|
167
|
+
- **Depth**: Capture reasoning and hypothesis impact, not just outcomes
|
|
168
|
+
|
|
169
|
+
## Implementation Details
|
|
170
|
+
|
|
171
|
+
### Phase 0: Session Initialization
|
|
157
172
|
|
|
158
173
|
```javascript
|
|
159
174
|
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
@@ -186,20 +201,10 @@ Bash(`mkdir -p ${sessionFolder}`)
|
|
|
186
201
|
|
|
187
202
|
##### Step 1.1: Parse Topic & Identify Dimensions
|
|
188
203
|
|
|
189
|
-
Match topic keywords against analysis dimensions:
|
|
204
|
+
Match topic keywords against analysis dimensions (see [Dimensions Reference](#analysis-dimensions)):
|
|
190
205
|
|
|
191
206
|
```javascript
|
|
192
|
-
|
|
193
|
-
architecture: ['架构', 'architecture', 'design', 'structure', '设计', 'pattern'],
|
|
194
|
-
implementation: ['实现', 'implement', 'code', 'coding', '代码', 'logic'],
|
|
195
|
-
performance: ['性能', 'performance', 'optimize', 'bottleneck', '优化', 'speed'],
|
|
196
|
-
security: ['安全', 'security', 'auth', 'permission', '权限', 'vulnerability'],
|
|
197
|
-
concept: ['概念', 'concept', 'theory', 'principle', '原理', 'understand'],
|
|
198
|
-
comparison: ['比较', 'compare', 'vs', 'difference', '区别', 'versus'],
|
|
199
|
-
decision: ['决策', 'decision', 'choice', 'tradeoff', '选择', 'trade-off']
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Match topic text against keyword lists
|
|
207
|
+
// Match topic text against keyword lists from Dimensions Reference
|
|
203
208
|
// If multiple dimensions match, include all
|
|
204
209
|
// If none match, default to "architecture" and "implementation"
|
|
205
210
|
const dimensions = identifyDimensions(topic, ANALYSIS_DIMENSIONS)
|
|
@@ -223,16 +228,13 @@ if (!autoYes && !continueMode) {
|
|
|
223
228
|
})
|
|
224
229
|
|
|
225
230
|
// 2. Analysis perspectives (multi-select, max 4)
|
|
231
|
+
// Options from Perspectives Reference table
|
|
226
232
|
const perspectives = request_user_input({
|
|
227
233
|
questions: [{
|
|
228
234
|
header: "分析视角",
|
|
229
235
|
id: "perspectives",
|
|
230
236
|
question: "Select analysis perspectives (single = focused, multi = broader coverage):",
|
|
231
|
-
options:
|
|
232
|
-
{ label: "Technical", description: "Implementation patterns, code structure, technical feasibility" },
|
|
233
|
-
{ label: "Architectural", description: "System design, scalability, component interactions" },
|
|
234
|
-
{ label: "Security", description: "Vulnerabilities, authentication, access control" }
|
|
235
|
-
]
|
|
237
|
+
options: perspectiveOptions // See Perspectives Reference
|
|
236
238
|
}]
|
|
237
239
|
})
|
|
238
240
|
|
|
@@ -294,9 +296,8 @@ Write(`${sessionFolder}/discussion.md`, discussionMd)
|
|
|
294
296
|
|
|
295
297
|
**Success Criteria**:
|
|
296
298
|
- Session folder created with discussion.md initialized
|
|
297
|
-
- Analysis dimensions identified
|
|
298
|
-
-
|
|
299
|
-
- **Initial decisions recorded**: Dimension selection rationale, excluded dimensions with reasons, user preference intent
|
|
299
|
+
- Analysis dimensions identified and user preferences captured
|
|
300
|
+
- **Initial decisions recorded**: Dimension selection rationale, excluded dimensions with reasons
|
|
300
301
|
|
|
301
302
|
### Phase 2: Exploration
|
|
302
303
|
|
|
@@ -304,8 +305,6 @@ Write(`${sessionFolder}/discussion.md`, discussionMd)
|
|
|
304
305
|
|
|
305
306
|
##### Step 2.1: Detect Codebase & Explore
|
|
306
307
|
|
|
307
|
-
Search the codebase directly using available tools:
|
|
308
|
-
|
|
309
308
|
```javascript
|
|
310
309
|
const hasCodebase = Bash(`
|
|
311
310
|
test -f package.json && echo "nodejs" ||
|
|
@@ -325,12 +324,7 @@ if (hasCodebase !== 'none') {
|
|
|
325
324
|
|
|
326
325
|
// 2. Search codebase for relevant content
|
|
327
326
|
// Use: Grep, Glob, Read, or mcp__ace-tool__search_context
|
|
328
|
-
//
|
|
329
|
-
// Focus on:
|
|
330
|
-
// - Modules/components related to the topic
|
|
331
|
-
// - Existing patterns and code structure
|
|
332
|
-
// - Integration points and constraints
|
|
333
|
-
// - Relevant configuration and dependencies
|
|
327
|
+
// Focus on: modules/components, patterns/structure, integration points, config/dependencies
|
|
334
328
|
|
|
335
329
|
// 3. Write findings
|
|
336
330
|
Write(`${sessionFolder}/exploration-codebase.json`, JSON.stringify({
|
|
@@ -345,22 +339,17 @@ if (hasCodebase !== 'none') {
|
|
|
345
339
|
}
|
|
346
340
|
```
|
|
347
341
|
|
|
348
|
-
##### Step 2.2: Multi-Perspective Analysis
|
|
342
|
+
##### Step 2.2: Multi-Perspective Analysis
|
|
349
343
|
|
|
350
|
-
Analyze
|
|
344
|
+
Analyze from each selected perspective. All analysis done inline by the AI.
|
|
351
345
|
|
|
352
346
|
**Single perspective** (default):
|
|
353
|
-
|
|
354
347
|
```javascript
|
|
355
348
|
// Analyze comprehensively across all identified dimensions
|
|
356
349
|
// Use exploration-codebase.json as context
|
|
357
|
-
// Focus on: patterns, anti-patterns, potential issues, opportunities
|
|
358
|
-
|
|
359
350
|
const findings = {
|
|
360
|
-
session_id: sessionId,
|
|
361
|
-
|
|
362
|
-
topic: topic,
|
|
363
|
-
dimensions: dimensions,
|
|
351
|
+
session_id: sessionId, timestamp: getUtc8ISOString(),
|
|
352
|
+
topic, dimensions,
|
|
364
353
|
sources: [...], // [{type, file, summary}]
|
|
365
354
|
key_findings: [...], // Main insights
|
|
366
355
|
discussion_points: [...], // Questions for user engagement
|
|
@@ -370,25 +359,13 @@ Write(`${sessionFolder}/explorations.json`, JSON.stringify(findings, null, 2))
|
|
|
370
359
|
```
|
|
371
360
|
|
|
372
361
|
**Multi-perspective** (2-4 perspectives, serial):
|
|
373
|
-
|
|
374
362
|
```javascript
|
|
375
|
-
// Analyze each perspective sequentially
|
|
376
|
-
// For each perspective:
|
|
377
|
-
// 1. Focus search/analysis on that perspective's concern area
|
|
378
|
-
// 2. Generate perspective-specific insights
|
|
379
|
-
// 3. Write individual findings
|
|
380
|
-
|
|
363
|
+
// Analyze each perspective sequentially, write individual findings
|
|
381
364
|
selectedPerspectives.forEach(perspective => {
|
|
382
|
-
// Analyze from this perspective's angle
|
|
383
|
-
// Use exploration-codebase.json + dimension focus
|
|
384
|
-
// Write to explorations/{perspective.name}.json
|
|
385
365
|
Write(`${sessionFolder}/explorations/${perspective.name}.json`, JSON.stringify({
|
|
386
366
|
perspective: perspective.name,
|
|
387
|
-
relevant_files: [...],
|
|
388
|
-
|
|
389
|
-
key_findings: [...],
|
|
390
|
-
perspective_insights: [...],
|
|
391
|
-
open_questions: [...],
|
|
367
|
+
relevant_files: [...], patterns: [...],
|
|
368
|
+
key_findings: [...], perspective_insights: [...], open_questions: [...],
|
|
392
369
|
_metadata: { timestamp: getUtc8ISOString() }
|
|
393
370
|
}, null, 2))
|
|
394
371
|
})
|
|
@@ -399,32 +376,21 @@ selectedPerspectives.forEach(perspective => {
|
|
|
399
376
|
```javascript
|
|
400
377
|
// Single perspective → explorations.json already written
|
|
401
378
|
// Multi-perspective → synthesize into perspectives.json
|
|
402
|
-
|
|
403
379
|
if (selectedPerspectives.length > 1) {
|
|
404
380
|
const synthesis = {
|
|
405
|
-
session_id: sessionId,
|
|
406
|
-
timestamp: getUtc8ISOString(),
|
|
407
|
-
topic: topic,
|
|
408
|
-
dimensions: dimensions,
|
|
409
|
-
|
|
410
|
-
// Individual perspective findings
|
|
381
|
+
session_id: sessionId, timestamp: getUtc8ISOString(), topic, dimensions,
|
|
411
382
|
perspectives: selectedPerspectives.map(p => ({
|
|
412
383
|
name: p.name,
|
|
413
384
|
findings: readJson(`${sessionFolder}/explorations/${p.name}.json`).key_findings,
|
|
414
385
|
insights: readJson(`${sessionFolder}/explorations/${p.name}.json`).perspective_insights,
|
|
415
386
|
questions: readJson(`${sessionFolder}/explorations/${p.name}.json`).open_questions
|
|
416
387
|
})),
|
|
417
|
-
|
|
418
|
-
// Cross-perspective synthesis
|
|
419
388
|
synthesis: {
|
|
420
389
|
convergent_themes: [...], // What all perspectives agree on
|
|
421
390
|
conflicting_views: [...], // Where perspectives differ
|
|
422
391
|
unique_contributions: [...] // Insights unique to specific perspectives
|
|
423
392
|
},
|
|
424
|
-
|
|
425
|
-
aggregated_findings: [...], // Main insights across all perspectives
|
|
426
|
-
discussion_points: [...], // Questions for user engagement
|
|
427
|
-
open_questions: [...] // Unresolved questions
|
|
393
|
+
aggregated_findings: [...], discussion_points: [...], open_questions: [...]
|
|
428
394
|
}
|
|
429
395
|
Write(`${sessionFolder}/perspectives.json`, JSON.stringify(synthesis, null, 2))
|
|
430
396
|
}
|
|
@@ -432,32 +398,19 @@ if (selectedPerspectives.length > 1) {
|
|
|
432
398
|
|
|
433
399
|
##### Step 2.4: Update discussion.md
|
|
434
400
|
|
|
435
|
-
Append Round 1 with exploration results
|
|
401
|
+
Append Round 1 with exploration results using the [Round Documentation Pattern](#round-documentation-pattern).
|
|
436
402
|
|
|
437
|
-
**Single perspective
|
|
438
|
-
- Sources analyzed (files, patterns)
|
|
439
|
-
- Key findings with evidence
|
|
440
|
-
- Discussion points for user
|
|
441
|
-
- Open questions
|
|
403
|
+
**Single perspective**: Sources analyzed, key findings with evidence, discussion points, open questions.
|
|
442
404
|
|
|
443
|
-
**Multi-perspective
|
|
444
|
-
- Per-perspective summary (brief)
|
|
445
|
-
- Synthesis section:
|
|
446
|
-
- Convergent themes (what all perspectives agree on)
|
|
447
|
-
- Conflicting views (where perspectives differ)
|
|
448
|
-
- Unique contributions (insights from specific perspectives)
|
|
449
|
-
- Discussion points
|
|
450
|
-
- Open questions
|
|
405
|
+
**Multi-perspective**: Per-perspective summary (brief), then synthesis (convergent themes, conflicting views, unique contributions), discussion points, open questions.
|
|
451
406
|
|
|
452
407
|
##### Step 2.5: Initial Intent Coverage Check
|
|
453
408
|
|
|
454
409
|
Perform the FIRST intent coverage check before entering Phase 3:
|
|
455
410
|
|
|
456
411
|
```javascript
|
|
457
|
-
// Re-read original user intent
|
|
412
|
+
// Re-read original user intent from discussion.md header
|
|
458
413
|
// Check each intent item against Round 1 findings
|
|
459
|
-
// Append to discussion.md:
|
|
460
|
-
|
|
461
414
|
appendToDiscussion(`
|
|
462
415
|
#### Initial Intent Coverage Check (Post-Exploration)
|
|
463
416
|
${originalIntents.map((intent, i) => {
|
|
@@ -467,44 +420,27 @@ ${originalIntents.map((intent, i) => {
|
|
|
467
420
|
|
|
468
421
|
> 接下来的讨论将重点关注未覆盖 (❌) 和进行中 (🔄) 的意图。
|
|
469
422
|
`)
|
|
470
|
-
|
|
471
|
-
// Present to user at beginning of Phase 3 for early course correction
|
|
472
423
|
```
|
|
473
424
|
|
|
474
425
|
**Success Criteria**:
|
|
475
426
|
- exploration-codebase.json created with codebase context (if codebase exists)
|
|
476
427
|
- explorations.json (single) or perspectives.json (multi) created with findings
|
|
477
428
|
- discussion.md updated with Round 1 results
|
|
478
|
-
- **Initial Intent Coverage Check** completed — early drift detection
|
|
479
|
-
- Ready for interactive discussion
|
|
429
|
+
- **Initial Intent Coverage Check** completed — early drift detection
|
|
480
430
|
- **Key findings recorded** with evidence references and confidence levels
|
|
481
431
|
- **Exploration decisions recorded** (why certain perspectives/search strategies were chosen)
|
|
482
432
|
|
|
483
433
|
### Phase 3: Interactive Discussion
|
|
484
434
|
|
|
485
|
-
**Objective**: Iteratively refine understanding through multi-round user-guided discussion cycles.
|
|
486
|
-
|
|
487
|
-
**Max Rounds**: 5 discussion rounds (can exit earlier if user indicates analysis is complete)
|
|
435
|
+
**Objective**: Iteratively refine understanding through multi-round user-guided discussion cycles. **Max Rounds**: 5.
|
|
488
436
|
|
|
489
|
-
##### Step 3.1:
|
|
437
|
+
##### Step 3.1: Present Findings & Gather Direction
|
|
490
438
|
|
|
491
439
|
**Current Understanding Summary** (Round >= 2, BEFORE presenting new findings):
|
|
492
440
|
- Generate 1-2 sentence recap of established consensus and last round's direction
|
|
493
441
|
- Example: "到目前为止,我们已确认 [established facts]。上一轮 [key action/direction]。现在,这是新一轮的发现:"
|
|
494
|
-
- Purpose: Reset context, prevent cognitive overload, make incremental progress visible
|
|
495
|
-
|
|
496
|
-
Display current understanding and gather user direction:
|
|
497
442
|
|
|
498
443
|
```javascript
|
|
499
|
-
// Round >= 2: Display Current Understanding Summary first
|
|
500
|
-
if (round >= 2) {
|
|
501
|
-
// Generate 1-2 sentence recap from previous round's narrative synthesis
|
|
502
|
-
// Display before presenting new findings
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
// Display current findings summary from explorations.json or perspectives.json
|
|
506
|
-
// Show key points, discussion points, open questions
|
|
507
|
-
|
|
508
444
|
if (!autoYes) {
|
|
509
445
|
const feedback = request_user_input({
|
|
510
446
|
questions: [{
|
|
@@ -523,125 +459,35 @@ if (!autoYes) {
|
|
|
523
459
|
|
|
524
460
|
##### Step 3.2: Process User Response
|
|
525
461
|
|
|
526
|
-
**Recording Checkpoint**: Regardless of
|
|
462
|
+
**Recording Checkpoint**: Regardless of option selected, MUST record to discussion.md:
|
|
527
463
|
- User's original choice and expression
|
|
528
|
-
- Impact
|
|
529
|
-
- If direction changed, record a full Decision Record
|
|
464
|
+
- Impact on analysis direction
|
|
465
|
+
- If direction changed, record a full Decision Record (see [Recording Protocol](#recording-protocol))
|
|
530
466
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
// "review from security audit perspective",
|
|
539
|
-
// "explore simpler architectural alternatives"
|
|
540
|
-
// request_user_input with generated options (single-select)
|
|
541
|
-
// Execute selected direction via inline search tools
|
|
542
|
-
// Merge new findings into explorations.json
|
|
543
|
-
// Record: Which assumptions were confirmed, specific angles for deeper exploration
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
**Agree & Suggest** — user provides specific next step:
|
|
547
|
-
```javascript
|
|
548
|
-
// Ask user for their specific direction (free text input)
|
|
549
|
-
const userSuggestion = request_user_input({
|
|
550
|
-
questions: [{
|
|
551
|
-
header: "你的方向",
|
|
552
|
-
id: "your_direction",
|
|
553
|
-
question: "请描述您希望下一步深入的方向:",
|
|
554
|
-
options: [
|
|
555
|
-
{ label: "Code Details", description: "Deeper into implementation specifics" },
|
|
556
|
-
{ label: "Architecture", description: "Broader structural analysis" }
|
|
557
|
-
]
|
|
558
|
-
}]
|
|
559
|
-
})
|
|
560
|
-
// Execute user's specific direction via inline search tools
|
|
561
|
-
// Record: User-driven exploration rationale and findings
|
|
562
|
-
```
|
|
563
|
-
|
|
564
|
-
**Adjust Direction** — new focus area:
|
|
565
|
-
```javascript
|
|
566
|
-
// Ask user for adjusted focus
|
|
567
|
-
const adjustedFocus = request_user_input({
|
|
568
|
-
questions: [{
|
|
569
|
-
header: "新焦点",
|
|
570
|
-
id: "new_focus",
|
|
571
|
-
question: "What should the new analysis focus be?",
|
|
572
|
-
options: [
|
|
573
|
-
{ label: "Code Details", description: "Deeper into implementation specifics" },
|
|
574
|
-
{ label: "Architecture", description: "Broader structural analysis" },
|
|
575
|
-
{ label: "Best Practices", description: "Industry standards and recommendations" }
|
|
576
|
-
]
|
|
577
|
-
}]
|
|
578
|
-
})
|
|
579
|
-
|
|
580
|
-
// Analyze from adjusted perspective using inline search
|
|
581
|
-
// Compare new insights with prior analysis
|
|
582
|
-
// Identify what was missed and why
|
|
583
|
-
// Update explorations.json with adjusted findings
|
|
584
|
-
// Record Decision: Trigger reason for direction adjustment, old vs new direction, expected impact
|
|
585
|
-
```
|
|
586
|
-
|
|
587
|
-
**Specific Questions** — answer directly:
|
|
588
|
-
```javascript
|
|
589
|
-
// Capture user questions via request_user_input
|
|
590
|
-
// Answer each question based on codebase search and analysis
|
|
591
|
-
// Provide evidence and file references
|
|
592
|
-
// Rate confidence for each answer (high/medium/low)
|
|
593
|
-
// Document Q&A in discussion.md
|
|
594
|
-
// Record: Knowledge gaps revealed by the question, new understanding from the answer
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
**Analysis Complete** — exit loop, proceed to Phase 4.
|
|
598
|
-
```javascript
|
|
599
|
-
// Record: Why concluding at this round (sufficient information / scope fully focused / user satisfied)
|
|
600
|
-
```
|
|
467
|
+
| Response | Action |
|
|
468
|
+
|----------|--------|
|
|
469
|
+
| **Deepen** | Generate 2-3 context-driven options (unresolved questions, low-confidence findings, unexplored dimensions) + 1-2 heuristic options that break current frame (e.g., "compare with best practices in [related domain]", "analyze under extreme load scenarios", "review from security audit perspective", "explore simpler architectural alternatives"). Execute selected direction via inline search. Merge new findings. Record confirmed assumptions and exploration angles. |
|
|
470
|
+
| **Agree & Suggest** | Ask user for specific direction (free text). Execute user's direction via inline search. Record user-driven rationale and findings. |
|
|
471
|
+
| **Adjust Direction** | Ask user for new focus. Analyze from adjusted perspective. Compare new insights with prior analysis. Identify what was missed. Record trigger reason, old vs new direction, expected impact. |
|
|
472
|
+
| **Specific Questions** | Capture questions. Answer with codebase search evidence. Rate confidence per answer. Document Q&A. Record knowledge gaps revealed. |
|
|
473
|
+
| **Analysis Complete** | Record why concluding at this round. Exit loop → Phase 4. |
|
|
601
474
|
|
|
602
475
|
##### Step 3.3: Document Each Round
|
|
603
476
|
|
|
604
|
-
Update discussion.md
|
|
477
|
+
Update discussion.md using the [Round Documentation Pattern](#round-documentation-pattern).
|
|
605
478
|
|
|
606
|
-
**Append** to Discussion Timeline:
|
|
479
|
+
**Append** to Discussion Timeline: User Direction, Decision Log, Key Findings, Analysis Results, Corrected Assumptions, Open Items, Narrative Synthesis.
|
|
607
480
|
|
|
608
|
-
|
|
609
|
-
|---------|---------|
|
|
610
|
-
| User Direction | Action taken (deepen/adjust/suggest/questions) and focus area |
|
|
611
|
-
| Decision Log | Decisions made this round using Decision Record format (with rejected alternatives) |
|
|
612
|
-
| Key Findings | Findings using Key Finding Record format (with confidence + hypothesis impact) |
|
|
613
|
-
| Analysis Results | Detailed insights, evidence with file references |
|
|
614
|
-
| Corrected Assumptions | Important wrong→right transformations with explanation |
|
|
615
|
-
| Open Items | Remaining questions or areas for future investigation |
|
|
616
|
-
| **Narrative Synthesis** | Round-end summary connecting this round to overall understanding evolution |
|
|
617
|
-
|
|
618
|
-
**Replace** (not append) these sections:
|
|
481
|
+
**Replace** (not append):
|
|
619
482
|
|
|
620
483
|
| Section | Update Rule |
|
|
621
484
|
|---------|-------------|
|
|
622
|
-
| `## Current Understanding` | Overwrite with latest consolidated understanding. Follow Consolidation Rules
|
|
623
|
-
| `## Table of Contents` | Update links to include new Round N sections
|
|
624
|
-
|
|
625
|
-
**Round Narrative Synthesis** (append after each round update):
|
|
626
|
-
```markdown
|
|
627
|
-
### Round N: Narrative Synthesis
|
|
628
|
-
**起点**: 基于上一轮的 [conclusions/questions],本轮从 [starting point] 切入。
|
|
629
|
-
**关键进展**: [New findings] [confirmed/refuted/modified] 了之前关于 [hypothesis] 的理解。
|
|
630
|
-
**决策影响**: 用户选择 [feedback type],导致分析方向 [adjusted/deepened/maintained]。
|
|
631
|
-
**当前理解**: 经过本轮,核心认知更新为 [updated understanding]。
|
|
632
|
-
**遗留问题**: [remaining questions driving next round]
|
|
633
|
-
```
|
|
634
|
-
|
|
635
|
-
**Documentation Standards**:
|
|
636
|
-
- Clear timestamps for each round
|
|
637
|
-
- Evidence-based findings with file references and confidence levels
|
|
638
|
-
- Explicit tracking of assumption corrections
|
|
639
|
-
- Organized by analysis dimension
|
|
640
|
-
- Narrative synthesis linking rounds into coherent understanding evolution
|
|
485
|
+
| `## Current Understanding` | Overwrite with latest consolidated understanding. Follow [Consolidation Rules](#consolidation-rules). |
|
|
486
|
+
| `## Table of Contents` | Update links to include new Round N sections |
|
|
641
487
|
|
|
642
|
-
##### Step 3.4: Intent Drift Check (every round
|
|
488
|
+
##### Step 3.4: Intent Drift Check (every round >= 2)
|
|
643
489
|
|
|
644
|
-
Re-read
|
|
490
|
+
Re-read original intent from discussion.md header. Compare against the Initial Intent Coverage Check from Phase 2:
|
|
645
491
|
|
|
646
492
|
```markdown
|
|
647
493
|
#### Intent Coverage Check
|
|
@@ -651,29 +497,27 @@ Re-read "User Intent" / "Analysis Context" from discussion.md header. Compare ag
|
|
|
651
497
|
- ❌ Intent 4: [not yet discussed]
|
|
652
498
|
```
|
|
653
499
|
|
|
654
|
-
- If any item is "implicitly absorbed" (⚠️), note
|
|
655
|
-
- If ❌ or ⚠️ items exist → **proactively surface** to user
|
|
500
|
+
- If any item is "implicitly absorbed" (⚠️), note explicitly — absorbed ≠ addressed
|
|
501
|
+
- If ❌ or ⚠️ items exist → **proactively surface** to user: "以下原始意图尚未充分覆盖:[list]。是否需要调整优先级?"
|
|
656
502
|
|
|
657
503
|
**Success Criteria**:
|
|
658
504
|
- User feedback processed for each round
|
|
659
|
-
- discussion.md updated with all
|
|
660
|
-
- Assumptions documented and corrected
|
|
661
|
-
- Exit condition reached (user selects complete or max rounds)
|
|
505
|
+
- discussion.md updated with all rounds, assumptions documented and corrected
|
|
662
506
|
- **All decision points recorded** with Decision Record format
|
|
663
|
-
- **Direction changes documented** with before/after comparison
|
|
507
|
+
- **Direction changes documented** with before/after comparison
|
|
664
508
|
|
|
665
509
|
### Phase 4: Synthesis & Conclusion
|
|
666
510
|
|
|
667
|
-
**Objective**: Consolidate insights
|
|
511
|
+
**Objective**: Consolidate insights, generate conclusions and recommendations.
|
|
668
512
|
|
|
669
|
-
##### Step 4.0: Intent Coverage Verification (MANDATORY
|
|
513
|
+
##### Step 4.0: Intent Coverage Verification (MANDATORY gate)
|
|
670
514
|
|
|
671
|
-
|
|
515
|
+
For EACH original intent item, determine coverage status:
|
|
672
516
|
|
|
673
|
-
- **✅ Addressed**: Explicitly discussed and concluded
|
|
674
|
-
- **🔀 Transformed**: Original intent evolved
|
|
675
|
-
- **⚠️ Absorbed**: Implicitly covered
|
|
676
|
-
- **❌ Missed**: Not discussed — MUST
|
|
517
|
+
- **✅ Addressed**: Explicitly discussed and concluded
|
|
518
|
+
- **🔀 Transformed**: Original intent evolved — document transformation chain
|
|
519
|
+
- **⚠️ Absorbed**: Implicitly covered — flag for confirmation
|
|
520
|
+
- **❌ Missed**: Not discussed — MUST address or explicitly defer
|
|
677
521
|
|
|
678
522
|
Write "Intent Coverage Matrix" to discussion.md:
|
|
679
523
|
|
|
@@ -686,85 +530,73 @@ Write "Intent Coverage Matrix" to discussion.md:
|
|
|
686
530
|
| 3 | [intent text] | ❌ Missed | — | Reason for omission |
|
|
687
531
|
```
|
|
688
532
|
|
|
689
|
-
**Gate**: If any item is ❌ Missed, MUST either
|
|
690
|
-
- (a) Add a dedicated discussion round to address it before continuing, OR
|
|
691
|
-
- (b) Explicitly confirm with user that it is intentionally deferred
|
|
533
|
+
**Gate**: If any item is ❌ Missed, MUST either (a) add a discussion round to address it, or (b) explicitly confirm with user that it is intentionally deferred.
|
|
692
534
|
|
|
693
|
-
##### Step 4.1: Findings-to-Recommendations Traceability (MANDATORY
|
|
535
|
+
##### Step 4.1: Findings-to-Recommendations Traceability (MANDATORY gate)
|
|
694
536
|
|
|
695
|
-
Collect ALL actionable findings from every round and map each to a disposition
|
|
537
|
+
Collect ALL actionable findings from every round and map each to a disposition.
|
|
696
538
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
// | Disposition | Meaning |
|
|
706
|
-
// |-----------------|------------------------------------------------------|
|
|
707
|
-
// | recommendation | Converted to a numbered recommendation |
|
|
708
|
-
// | absorbed | Covered by another recommendation (specify which) |
|
|
709
|
-
// | deferred | Explicitly out-of-scope with reason |
|
|
710
|
-
// | informational | Pure insight, no action needed |
|
|
539
|
+
**Actionable finding sources**: key findings with actionable implications, technical solutions (proposed/validated), identified gaps (API-frontend gaps, missing features, design issues), corrected assumptions that imply fixes.
|
|
540
|
+
|
|
541
|
+
| Disposition | Meaning |
|
|
542
|
+
|-------------|---------|
|
|
543
|
+
| recommendation | Converted to a numbered recommendation |
|
|
544
|
+
| absorbed | Covered by another recommendation (specify which) |
|
|
545
|
+
| deferred | Explicitly out-of-scope with reason |
|
|
546
|
+
| informational | Pure insight, no action needed |
|
|
711
547
|
|
|
548
|
+
```javascript
|
|
712
549
|
const findingsCoverage = allFindings.map(f => ({
|
|
713
|
-
finding: f.summary,
|
|
714
|
-
round: f.round,
|
|
550
|
+
finding: f.summary, round: f.round,
|
|
715
551
|
disposition: null, // MUST be assigned before proceeding
|
|
716
552
|
target: null, // e.g., "Rec #1" or "→ Rec #3" or "Reason: ..."
|
|
717
553
|
reason: null
|
|
718
554
|
}))
|
|
719
555
|
|
|
720
|
-
//
|
|
721
|
-
|
|
722
|
-
// Unmapped findings must be either added as new recommendations or assigned a disposition.
|
|
556
|
+
// Gate: ALL findings MUST have a disposition. Do NOT proceed with any disposition = null.
|
|
557
|
+
```
|
|
723
558
|
|
|
724
|
-
|
|
725
|
-
|
|
559
|
+
Append Findings Coverage Matrix to discussion.md:
|
|
560
|
+
|
|
561
|
+
```markdown
|
|
726
562
|
### Findings Coverage Matrix
|
|
727
563
|
| # | Finding (Round) | Disposition | Target |
|
|
728
564
|
|---|----------------|-------------|--------|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
).join('\n')}
|
|
732
|
-
`)
|
|
565
|
+
| 1 | [finding] (R1) | recommendation | Rec #1 |
|
|
566
|
+
| 2 | [finding] (R2) | absorbed | → Rec #1 |
|
|
733
567
|
```
|
|
734
568
|
|
|
735
569
|
##### Step 4.2: Consolidate Insights
|
|
736
570
|
|
|
737
571
|
```javascript
|
|
738
572
|
const conclusions = {
|
|
739
|
-
session_id: sessionId,
|
|
740
|
-
topic: topic,
|
|
573
|
+
session_id: sessionId, topic,
|
|
741
574
|
completed: getUtc8ISOString(),
|
|
742
575
|
total_rounds: roundCount,
|
|
743
576
|
summary: '...', // Executive summary
|
|
744
577
|
key_conclusions: [ // Main conclusions
|
|
745
578
|
{ point: '...', evidence: '...', confidence: 'high|medium|low' }
|
|
746
579
|
],
|
|
747
|
-
recommendations: [ //
|
|
748
|
-
// MUST include all findings with disposition = 'recommendation' from Step 4.1
|
|
580
|
+
recommendations: [ // MUST include all findings with disposition = 'recommendation'
|
|
749
581
|
{
|
|
750
582
|
action: '...', // What to do (imperative verb + target)
|
|
751
583
|
rationale: '...', // Why this matters
|
|
752
584
|
priority: 'high|medium|low',
|
|
753
|
-
evidence_refs: ['file:line', ...],
|
|
585
|
+
evidence_refs: ['file:line', ...],
|
|
754
586
|
steps: [ // Granular sub-steps for execution
|
|
755
587
|
{ description: '...', target: 'file/module', verification: 'how to verify done' }
|
|
756
588
|
],
|
|
757
|
-
review_status: 'accepted|modified|rejected|pending'
|
|
589
|
+
review_status: 'accepted|modified|rejected|pending'
|
|
758
590
|
}
|
|
759
591
|
],
|
|
760
|
-
open_questions: [...],
|
|
761
|
-
follow_up_suggestions: [
|
|
592
|
+
open_questions: [...],
|
|
593
|
+
follow_up_suggestions: [
|
|
762
594
|
{ type: 'issue|task|research', summary: '...' }
|
|
763
595
|
],
|
|
764
596
|
decision_trail: [ // Consolidated decisions from all phases
|
|
765
597
|
{ round: 1, decision: '...', context: '...', options_considered: [...], chosen: '...', rejected_reasons: '...', reason: '...', impact: '...' }
|
|
766
598
|
],
|
|
767
|
-
narrative_trail: [ // From
|
|
599
|
+
narrative_trail: [ // From Narrative Synthesis per round
|
|
768
600
|
{ round: 1, starting_point: '...', key_progress: '...', hypothesis_impact: '...', updated_understanding: '...', remaining_questions: '...' }
|
|
769
601
|
],
|
|
770
602
|
intent_coverage: [ // From Step 4.0
|
|
@@ -777,15 +609,9 @@ Write(`${sessionFolder}/conclusions.json`, JSON.stringify(conclusions, null, 2))
|
|
|
777
609
|
|
|
778
610
|
##### Step 4.3: Final discussion.md Update
|
|
779
611
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
**Synthesis & Conclusions Section**:
|
|
783
|
-
- **Executive Summary**: Overview of analysis findings
|
|
784
|
-
- **Key Conclusions**: Ranked by confidence level with supporting evidence
|
|
785
|
-
- **Recommendations**: Prioritized action items with rationale
|
|
786
|
-
- **Remaining Open Questions**: Unresolved items for future work
|
|
612
|
+
**Synthesis & Conclusions**: Executive Summary, Key Conclusions (ranked by confidence), Recommendations (prioritized), Remaining Open Questions.
|
|
787
613
|
|
|
788
|
-
**Current Understanding (Final)
|
|
614
|
+
**Current Understanding (Final)**:
|
|
789
615
|
|
|
790
616
|
| Subsection | Content |
|
|
791
617
|
|------------|---------|
|
|
@@ -793,13 +619,11 @@ Append conclusions section and finalize:
|
|
|
793
619
|
| What Was Clarified | Important corrections (~~wrong→right~~) |
|
|
794
620
|
| Key Insights | Valuable learnings for future reference |
|
|
795
621
|
|
|
796
|
-
**
|
|
797
|
-
|
|
798
|
-
**Decision Trail Section**:
|
|
622
|
+
**Decision Trail**:
|
|
799
623
|
|
|
800
624
|
| Subsection | Content |
|
|
801
625
|
|------------|---------|
|
|
802
|
-
| Critical Decisions | Pivotal decisions that shaped the
|
|
626
|
+
| Critical Decisions | Pivotal decisions that shaped the outcome |
|
|
803
627
|
| Direction Changes | Timeline of scope/focus adjustments with rationale |
|
|
804
628
|
| Trade-offs Made | Key trade-offs and why certain paths were chosen |
|
|
805
629
|
|
|
@@ -807,17 +631,10 @@ Append conclusions section and finalize:
|
|
|
807
631
|
|
|
808
632
|
##### Step 4.4: Interactive Recommendation Review (skip in auto mode)
|
|
809
633
|
|
|
810
|
-
Walk through each recommendation one-by-one
|
|
634
|
+
Walk through each recommendation one-by-one (ordered by priority: high → medium → low):
|
|
811
635
|
|
|
812
636
|
```javascript
|
|
813
|
-
// Order recommendations by priority: high → medium → low
|
|
814
|
-
const sortedRecs = conclusions.recommendations.sort(byPriority)
|
|
815
|
-
|
|
816
637
|
for (const [index, rec] of sortedRecs.entries()) {
|
|
817
|
-
// 1. Present recommendation details
|
|
818
|
-
// Display: action, rationale, priority, steps[] (numbered sub-steps with target + verification)
|
|
819
|
-
|
|
820
|
-
// 2. Gather user review
|
|
821
638
|
const review = request_user_input({
|
|
822
639
|
questions: [{
|
|
823
640
|
header: `建议#${index + 1}`,
|
|
@@ -830,23 +647,13 @@ for (const [index, rec] of sortedRecs.entries()) {
|
|
|
830
647
|
]
|
|
831
648
|
}]
|
|
832
649
|
})
|
|
833
|
-
|
|
834
|
-
// 3. Process review decision
|
|
835
|
-
// Accept → rec.review_status = "accepted"
|
|
836
|
-
// Modify → gather modification via free text → update rec → rec.review_status = "modified"
|
|
837
|
-
// Reject → gather reason → rec.review_status = "rejected"
|
|
650
|
+
// Accept → "accepted" | Modify → gather text → "modified" | Reject → gather reason → "rejected"
|
|
838
651
|
// Accept All Remaining → mark all remaining as "accepted", break loop
|
|
839
|
-
|
|
840
|
-
// 4. Record review decision to discussion.md Decision Log
|
|
841
|
-
// 5. Update conclusions.json
|
|
652
|
+
// Record review decision to discussion.md Decision Log + update conclusions.json
|
|
842
653
|
}
|
|
843
|
-
|
|
844
|
-
// Display review summary:
|
|
845
|
-
// Accepted: N | Modified: N | Rejected: N
|
|
846
|
-
// Only accepted/modified recommendations proceed to next step
|
|
847
654
|
```
|
|
848
655
|
|
|
849
|
-
**Review Summary
|
|
656
|
+
**Review Summary** (append to discussion.md):
|
|
850
657
|
```markdown
|
|
851
658
|
### Recommendation Review Summary
|
|
852
659
|
| # | Action | Priority | Steps | Review Status | Notes |
|
|
@@ -858,82 +665,35 @@ for (const [index, rec] of sortedRecs.entries()) {
|
|
|
858
665
|
|
|
859
666
|
##### Step 4.5: Post-Completion Options
|
|
860
667
|
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
```javascript
|
|
864
|
-
// Assess recommendation complexity to decide available options
|
|
865
|
-
const recs = conclusions.recommendations || []
|
|
866
|
-
const complexity = assessComplexity(recs)
|
|
867
|
-
|
|
868
|
-
function assessComplexity(recs) {
|
|
869
|
-
if (recs.length === 0) return 'none'
|
|
870
|
-
if (recs.length <= 2 && recs.every(r => r.priority === 'low')) return 'simple'
|
|
871
|
-
if (recs.length >= 3 || recs.some(r => r.priority === 'high')) return 'complex'
|
|
872
|
-
return 'moderate' // 1-2 medium-priority recommendations
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
// Complexity → available options mapping:
|
|
876
|
-
// none: Done | Create Issue | Export Report
|
|
877
|
-
// simple: Done | Create Issue | Export Report
|
|
878
|
-
// moderate: Generate Plan | Create Issue | Export Report | Done
|
|
879
|
-
// complex: Generate Plan | Create Issue | Export Report | Done
|
|
880
|
-
```
|
|
881
|
-
|
|
882
|
-
```javascript
|
|
883
|
-
if (!autoYes) {
|
|
884
|
-
const options = buildOptionsForComplexity(complexity)
|
|
885
|
-
request_user_input({
|
|
886
|
-
questions: [{
|
|
887
|
-
header: "下一步",
|
|
888
|
-
id: "next_step",
|
|
889
|
-
question: `Analysis complete (${recs.length} recommendations, complexity: ${complexity}). Next step:`,
|
|
890
|
-
options: options
|
|
891
|
-
}]
|
|
892
|
-
})
|
|
893
|
-
} else {
|
|
894
|
-
// Auto mode: generate plan only for moderate/complex, skip for simple/none
|
|
895
|
-
if (complexity === 'complex' || complexity === 'moderate') {
|
|
896
|
-
// → Phase 5 (plan generation only, NO code modifications)
|
|
897
|
-
} else {
|
|
898
|
-
// → Done (conclusions.json is sufficient output)
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
```
|
|
902
|
-
|
|
903
|
-
**Options by Complexity**:
|
|
668
|
+
Assess recommendation complexity, then offer appropriate next steps:
|
|
904
669
|
|
|
905
|
-
| Complexity | Available Options |
|
|
906
|
-
|
|
907
|
-
| `none` | Done, Create Issue, Export Report |
|
|
908
|
-
| `simple` |
|
|
909
|
-
| `moderate` | Generate Plan, Create Issue, Export Report, Done |
|
|
910
|
-
| `complex` | Generate Plan, Create Issue, Export Report, Done |
|
|
670
|
+
| Complexity | Condition | Available Options |
|
|
671
|
+
|------------|-----------|-------------------|
|
|
672
|
+
| `none` | No recommendations | Done, Create Issue, Export Report |
|
|
673
|
+
| `simple` | ≤2 low-priority items | Done, Create Issue, Export Report |
|
|
674
|
+
| `moderate` | 1-2 medium-priority | Generate Plan, Create Issue, Export Report, Done |
|
|
675
|
+
| `complex` | ≥3 or any high-priority | Generate Plan, Create Issue, Export Report, Done |
|
|
911
676
|
|
|
912
677
|
| Selection | Action |
|
|
913
678
|
|-----------|--------|
|
|
914
|
-
| Generate Plan |
|
|
679
|
+
| Generate Plan | → Phase 5 (plan only, NO code modifications) |
|
|
915
680
|
| Create Issue | `Skill(skill="issue:new", args="...")` (only reviewed recs) |
|
|
916
681
|
| Export Report | Copy discussion.md + conclusions.json to user-specified location |
|
|
917
682
|
| Done | Display artifact paths, end |
|
|
918
683
|
|
|
684
|
+
Auto mode: generate plan only for moderate/complex, skip for simple/none.
|
|
685
|
+
|
|
919
686
|
**Success Criteria**:
|
|
920
687
|
- conclusions.json created with complete synthesis including findings_coverage[]
|
|
921
|
-
- **Findings Coverage Matrix**
|
|
922
|
-
-
|
|
923
|
-
- **
|
|
924
|
-
- User offered meaningful next step options
|
|
925
|
-
- **Complete decision trail** documented and traceable from initial scoping to final conclusions
|
|
688
|
+
- **Findings Coverage Matrix** — all actionable findings mapped to disposition
|
|
689
|
+
- **Intent Coverage Matrix** — all original intents accounted for
|
|
690
|
+
- **Complete decision trail** documented and traceable
|
|
926
691
|
|
|
927
692
|
### Phase 5: Plan Generation (Optional — NO code modifications)
|
|
928
693
|
|
|
929
|
-
**
|
|
930
|
-
|
|
931
|
-
**Trigger**: User selects "Generate Plan" in Phase 4. In auto mode, triggered only for `moderate`/`complex` recommendations.
|
|
694
|
+
**Trigger**: User selects "Generate Plan" in Phase 4. In auto mode, triggered only for `moderate`/`complex`.
|
|
932
695
|
|
|
933
696
|
```javascript
|
|
934
|
-
const recs = conclusions.recommendations || []
|
|
935
|
-
|
|
936
|
-
// Build plan checklist from all accepted/modified recommendations
|
|
937
697
|
const planChecklist = recs
|
|
938
698
|
.filter(r => r.review_status !== 'rejected')
|
|
939
699
|
.map((rec, index) => {
|
|
@@ -949,7 +709,6 @@ const planChecklist = recs
|
|
|
949
709
|
- [ ] Ready for execution`
|
|
950
710
|
}).join('\n\n')
|
|
951
711
|
|
|
952
|
-
// Append plan checklist to discussion.md
|
|
953
712
|
appendToDiscussion(`
|
|
954
713
|
## Plan Checklist
|
|
955
714
|
|
|
@@ -973,17 +732,62 @@ $csv-wave-pipeline "${topic}"
|
|
|
973
732
|
`)
|
|
974
733
|
```
|
|
975
734
|
|
|
976
|
-
**Characteristics**:
|
|
977
|
-
- Plan checklist appended directly to `discussion.md`
|
|
978
|
-
- **No code modifications** — plan output only
|
|
979
|
-
- Reminds user to use `$csv-wave-pipeline` for execution
|
|
980
|
-
|
|
981
735
|
**Success Criteria**:
|
|
982
736
|
- Plan checklist in discussion.md with all accepted recommendations
|
|
983
737
|
- User reminded about `$csv-wave-pipeline` for execution
|
|
984
|
-
- **No source code modified**
|
|
738
|
+
- **No source code modified**
|
|
739
|
+
|
|
740
|
+
## Templates
|
|
741
|
+
|
|
742
|
+
### Round Documentation Pattern
|
|
743
|
+
|
|
744
|
+
Each discussion round follows this structure in discussion.md:
|
|
745
|
+
|
|
746
|
+
```markdown
|
|
747
|
+
### Round N - [Deepen|Adjust|Suggest|Q&A] (timestamp)
|
|
748
|
+
|
|
749
|
+
#### User Input
|
|
750
|
+
What the user indicated they wanted to focus on
|
|
751
|
+
|
|
752
|
+
#### Decision Log
|
|
753
|
+
<!-- Use Decision Record Format from Recording Protocol -->
|
|
754
|
+
|
|
755
|
+
#### Key Findings
|
|
756
|
+
<!-- Use Key Finding Record Format from Recording Protocol -->
|
|
757
|
+
|
|
758
|
+
#### Analysis Results
|
|
759
|
+
Detailed findings from this round's analysis
|
|
760
|
+
- Finding 1 (evidence: file:line)
|
|
761
|
+
- Finding 2 (evidence: file:line)
|
|
762
|
+
|
|
763
|
+
#### Corrected Assumptions
|
|
764
|
+
- ~~Previous assumption~~ → Corrected understanding
|
|
765
|
+
- Reason: Why the assumption was wrong
|
|
766
|
+
|
|
767
|
+
#### Open Items
|
|
768
|
+
Remaining questions or areas for investigation
|
|
985
769
|
|
|
986
|
-
|
|
770
|
+
#### Narrative Synthesis
|
|
771
|
+
<!-- Use Narrative Synthesis Format from Recording Protocol -->
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
### discussion.md Evolution Summary
|
|
775
|
+
|
|
776
|
+
- **Header**: Session ID, topic, start time, dimensions
|
|
777
|
+
- **Analysis Context**: Focus areas, perspectives, depth level
|
|
778
|
+
- **Initial Questions**: Key questions to guide the analysis
|
|
779
|
+
- **Initial Decisions**: Why these dimensions and focus areas were selected
|
|
780
|
+
- **Discussion Timeline**: Round-by-round findings
|
|
781
|
+
- Round 1: Exploration Results + Decision Log + Narrative Synthesis
|
|
782
|
+
- Round 2-N: Current Understanding Summary + User feedback + direction adjustments + new insights + Decision Log + Key Findings + Narrative Synthesis
|
|
783
|
+
- **Decision Trail**: Consolidated critical decisions across all rounds
|
|
784
|
+
- **Synthesis & Conclusions**: Summary, key conclusions, recommendations
|
|
785
|
+
- **Current Understanding (Final)**: Consolidated insights
|
|
786
|
+
- **Session Statistics**: Rounds completed, findings count, artifacts generated, decision count
|
|
787
|
+
|
|
788
|
+
## Reference
|
|
789
|
+
|
|
790
|
+
### Output Structure
|
|
987
791
|
|
|
988
792
|
```
|
|
989
793
|
{projectRoot}/.workflow/.analysis/ANL-{slug}-{date}/
|
|
@@ -1002,16 +806,14 @@ $csv-wave-pipeline "${topic}"
|
|
|
1002
806
|
|
|
1003
807
|
| File | Phase | Description |
|
|
1004
808
|
|------|-------|-------------|
|
|
1005
|
-
| `discussion.md` | 1-5 | Session metadata → discussion timeline → conclusions. Plan checklist appended here
|
|
809
|
+
| `discussion.md` | 1-5 | Session metadata → discussion timeline → conclusions. Plan checklist appended here. |
|
|
1006
810
|
| `exploration-codebase.json` | 2 | Codebase context: relevant files, patterns, constraints |
|
|
1007
811
|
| `explorations/*.json` | 2 | Per-perspective exploration results (multi only) |
|
|
1008
812
|
| `explorations.json` | 2 | Single perspective aggregated findings |
|
|
1009
813
|
| `perspectives.json` | 2 | Multi-perspective findings with cross-perspective synthesis |
|
|
1010
814
|
| `conclusions.json` | 4 | Final synthesis: conclusions, recommendations, findings_coverage, open questions |
|
|
1011
815
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
Dimensions guide the scope and focus of analysis:
|
|
816
|
+
### Analysis Dimensions
|
|
1015
817
|
|
|
1016
818
|
| Dimension | Keywords | Description |
|
|
1017
819
|
|-----------|----------|-------------|
|
|
@@ -1023,7 +825,7 @@ Dimensions guide the scope and focus of analysis:
|
|
|
1023
825
|
| comparison | 比较, compare, vs, difference, 区别, versus | Comparing solutions, evaluating alternatives |
|
|
1024
826
|
| decision | 决策, decision, choice, tradeoff, 选择, trade-off | Trade-offs, impact analysis, decision rationale |
|
|
1025
827
|
|
|
1026
|
-
|
|
828
|
+
### Analysis Perspectives
|
|
1027
829
|
|
|
1028
830
|
Optional multi-perspective analysis (single perspective is default, max 4):
|
|
1029
831
|
|
|
@@ -1044,9 +846,9 @@ Optional multi-perspective analysis (single perspective is default, max 4):
|
|
|
1044
846
|
| Standard | Moderate depth with good coverage | Balanced analysis (default) |
|
|
1045
847
|
| Deep | Comprehensive detailed analysis | Thorough multi-round investigation |
|
|
1046
848
|
|
|
1047
|
-
|
|
849
|
+
### Dimension-Direction Mapping
|
|
1048
850
|
|
|
1049
|
-
When user selects focus areas, generate directions dynamically
|
|
851
|
+
When user selects focus areas, generate directions dynamically:
|
|
1050
852
|
|
|
1051
853
|
| Dimension | Possible Directions |
|
|
1052
854
|
|-----------|-------------------|
|
|
@@ -1060,7 +862,7 @@ When user selects focus areas, generate directions dynamically from detected dim
|
|
|
1060
862
|
|
|
1061
863
|
**Implementation**: Present 2-3 top dimension-related directions, allow user to multi-select and add custom directions.
|
|
1062
864
|
|
|
1063
|
-
|
|
865
|
+
### Consolidation Rules
|
|
1064
866
|
|
|
1065
867
|
When updating "Current Understanding" in discussion.md:
|
|
1066
868
|
|
|
@@ -1095,69 +897,7 @@ Good (consolidated):
|
|
|
1095
897
|
- Current architecture supports horizontal scaling
|
|
1096
898
|
```
|
|
1097
899
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
### discussion.md Structure
|
|
1101
|
-
|
|
1102
|
-
The discussion.md file evolves through the analysis:
|
|
1103
|
-
|
|
1104
|
-
- **Header**: Session ID, topic, start time, identified dimensions
|
|
1105
|
-
- **Analysis Context**: Focus areas, perspectives, depth level
|
|
1106
|
-
- **Initial Questions**: Key questions to guide the analysis
|
|
1107
|
-
- **Initial Decisions**: Why these dimensions and focus areas were selected
|
|
1108
|
-
- **Discussion Timeline**: Round-by-round findings with narrative synthesis
|
|
1109
|
-
- Round 1: Initial Understanding + Exploration Results + **Initial Decision Log** + **Narrative Synthesis**
|
|
1110
|
-
- Round 2-N: Current Understanding Summary + User feedback + direction adjustments + new insights + **Decision Log** + **Key Findings** + **Narrative Synthesis**
|
|
1111
|
-
- **Decision Trail**: Consolidated critical decisions across all rounds
|
|
1112
|
-
- **Synthesis & Conclusions**: Summary, key conclusions, recommendations
|
|
1113
|
-
- **Current Understanding (Final)**: Consolidated insights
|
|
1114
|
-
- **Session Statistics**: Rounds completed, findings count, artifacts generated, decision count
|
|
1115
|
-
|
|
1116
|
-
### Round Documentation Pattern
|
|
1117
|
-
|
|
1118
|
-
Each discussion round follows a consistent structure:
|
|
1119
|
-
|
|
1120
|
-
```markdown
|
|
1121
|
-
### Round N - [Deepen|Adjust|Suggest|Q&A] (timestamp)
|
|
1122
|
-
|
|
1123
|
-
#### User Input
|
|
1124
|
-
What the user indicated they wanted to focus on
|
|
1125
|
-
|
|
1126
|
-
#### Decision Log
|
|
1127
|
-
> **Decision**: [Description of direction/scope/approach decision made this round]
|
|
1128
|
-
> - **Context**: [What triggered this decision]
|
|
1129
|
-
> - **Options considered**: [Alternatives evaluated]
|
|
1130
|
-
> - **Chosen**: [Selected approach] — **Reason**: [Rationale]
|
|
1131
|
-
> - **Rejected**: [Why other options were discarded]
|
|
1132
|
-
> - **Impact**: [Effect on analysis direction/conclusions]
|
|
1133
|
-
|
|
1134
|
-
#### Key Findings
|
|
1135
|
-
> **Finding**: [Content]
|
|
1136
|
-
> - **Confidence**: [High/Medium/Low] — **Why**: [Evidence basis]
|
|
1137
|
-
> - **Hypothesis Impact**: [Confirms/Refutes/Modifies] hypothesis "[name]"
|
|
1138
|
-
> - **Scope**: [What areas this affects]
|
|
1139
|
-
|
|
1140
|
-
#### Analysis Results
|
|
1141
|
-
Detailed findings from this round's analysis
|
|
1142
|
-
- Finding 1 (evidence: file:line)
|
|
1143
|
-
- Finding 2 (evidence: file:line)
|
|
1144
|
-
|
|
1145
|
-
#### Corrected Assumptions
|
|
1146
|
-
- ~~Previous assumption~~ → Corrected understanding
|
|
1147
|
-
- Reason: Why the assumption was wrong
|
|
1148
|
-
|
|
1149
|
-
#### Open Items
|
|
1150
|
-
Remaining questions or areas for investigation
|
|
1151
|
-
|
|
1152
|
-
#### Narrative Synthesis
|
|
1153
|
-
**起点**: 基于上一轮的 [conclusions/questions],本轮从 [starting point] 切入。
|
|
1154
|
-
**关键进展**: [New findings] [confirmed/refuted/modified] 了之前关于 [hypothesis] 的理解。
|
|
1155
|
-
**决策影响**: 用户选择 [feedback type],导致分析方向 [adjusted/deepened/maintained]。
|
|
1156
|
-
**当前理解**: 经过本轮,核心认知更新为 [updated understanding]。
|
|
1157
|
-
**遗留问题**: [remaining questions driving next round]
|
|
1158
|
-
```
|
|
1159
|
-
|
|
1160
|
-
## Error Handling
|
|
900
|
+
### Error Handling
|
|
1161
901
|
|
|
1162
902
|
| Situation | Action | Recovery |
|
|
1163
903
|
|-----------|--------|----------|
|
|
@@ -1173,9 +913,12 @@ Remaining questions or areas for investigation
|
|
|
1173
913
|
|
|
1174
914
|
### Core Principles
|
|
1175
915
|
|
|
1176
|
-
1. **No code modifications**: This skill is strictly read-only and plan-only. Phase 5 generates plan checklists
|
|
916
|
+
1. **No code modifications**: This skill is strictly read-only and plan-only. Phase 5 generates plan checklists but does NOT modify source code. Use `$csv-wave-pipeline` for execution.
|
|
917
|
+
2. **Record Decisions Immediately**: Never defer recording — capture decisions as they happen using the Decision Record format
|
|
918
|
+
3. **Evidence-Based**: Every conclusion should reference specific code or patterns with confidence levels
|
|
919
|
+
4. **Embrace Corrections**: Track wrong→right transformations as valuable learnings
|
|
1177
920
|
|
|
1178
|
-
### Before Starting
|
|
921
|
+
### Before Starting
|
|
1179
922
|
|
|
1180
923
|
1. **Clear Topic Definition**: Detailed topics lead to better dimension identification
|
|
1181
924
|
2. **User Context**: Understanding focus preferences helps scope the analysis
|
|
@@ -1186,20 +929,15 @@ Remaining questions or areas for investigation
|
|
|
1186
929
|
|
|
1187
930
|
1. **Review Findings**: Check exploration results before proceeding to discussion
|
|
1188
931
|
2. **Document Assumptions**: Track what you think is true for correction later
|
|
1189
|
-
3. **Use Continue Mode**: Resume sessions to build on previous findings
|
|
1190
|
-
4. **
|
|
1191
|
-
5. **
|
|
1192
|
-
6. **Record Decisions Immediately**: Never defer recording — capture decisions as they happen using the Decision Record format. A decision not recorded in-the-moment is a decision lost
|
|
932
|
+
3. **Use Continue Mode**: Resume sessions to build on previous findings
|
|
933
|
+
4. **Iterate Thoughtfully**: Each discussion round should meaningfully refine understanding
|
|
934
|
+
5. **Link Decisions to Outcomes**: Explicitly reference which decisions led to which outcomes
|
|
1193
935
|
|
|
1194
936
|
### Documentation Practices
|
|
1195
937
|
|
|
1196
|
-
1. **
|
|
1197
|
-
2. **
|
|
1198
|
-
3. **
|
|
1199
|
-
4. **Evolution Tracking**: Document how understanding changed across rounds
|
|
1200
|
-
5. **Action Items**: Generate specific, actionable recommendations
|
|
1201
|
-
6. **Multi-Perspective Synthesis**: When using multiple perspectives, document convergent/conflicting themes
|
|
1202
|
-
7. **Link Decisions to Outcomes**: When writing conclusions, explicitly reference which decisions led to which outcomes — this creates an auditable trail from initial scoping to final recommendations
|
|
938
|
+
1. **Timeline Clarity**: Use clear timestamps for traceability
|
|
939
|
+
2. **Evolution Tracking**: Document how understanding changed across rounds
|
|
940
|
+
3. **Multi-Perspective Synthesis**: When using multiple perspectives, document convergent/conflicting themes
|
|
1203
941
|
|
|
1204
942
|
## When to Use
|
|
1205
943
|
|