maestro-flow-one 0.2.34 → 0.2.35

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.
Files changed (54) hide show
  1. package/maestro-flow/commands/learn/investigate.md +151 -152
  2. package/maestro-flow/commands/learn/second-opinion.md +118 -122
  3. package/maestro-flow/commands/lifecycle/analyze.md +215 -266
  4. package/maestro-flow/commands/lifecycle/blueprint.md +189 -204
  5. package/maestro-flow/commands/lifecycle/brainstorm.md +209 -213
  6. package/maestro-flow/commands/lifecycle/companion.md +531 -531
  7. package/maestro-flow/commands/lifecycle/composer.md +188 -179
  8. package/maestro-flow/commands/lifecycle/execute.md +183 -184
  9. package/maestro-flow/commands/lifecycle/fork.md +111 -110
  10. package/maestro-flow/commands/lifecycle/grill.md +175 -176
  11. package/maestro-flow/commands/lifecycle/guard.md +103 -102
  12. package/maestro-flow/commands/lifecycle/impeccable.md +311 -268
  13. package/maestro-flow/commands/lifecycle/init.md +130 -131
  14. package/maestro-flow/commands/lifecycle/merge.md +87 -80
  15. package/maestro-flow/commands/lifecycle/next.md +253 -257
  16. package/maestro-flow/commands/lifecycle/overlay.md +188 -178
  17. package/maestro-flow/commands/lifecycle/plan.md +225 -211
  18. package/maestro-flow/commands/lifecycle/quick.md +83 -77
  19. package/maestro-flow/commands/lifecycle/roadmap.md +173 -186
  20. package/maestro-flow/commands/lifecycle/swarm-workflow.md +243 -264
  21. package/maestro-flow/commands/lifecycle/tools-execute.md +122 -117
  22. package/maestro-flow/commands/lifecycle/tools-register.md +162 -157
  23. package/maestro-flow/commands/lifecycle/ui-codify.md +117 -100
  24. package/maestro-flow/commands/lifecycle/universal-workflow.md +548 -561
  25. package/maestro-flow/commands/lifecycle/update.md +122 -119
  26. package/maestro-flow/commands/manage/codebase-rebuild.md +87 -85
  27. package/maestro-flow/commands/manage/harvest.md +97 -95
  28. package/maestro-flow/commands/manage/issue-discover.md +83 -81
  29. package/maestro-flow/commands/manage/issue.md +72 -73
  30. package/maestro-flow/commands/manage/kg-extractors.md +128 -0
  31. package/maestro-flow/commands/manage/knowhow-capture.md +92 -82
  32. package/maestro-flow/commands/manage/knowhow.md +83 -79
  33. package/maestro-flow/commands/manage/knowledge-audit.md +105 -88
  34. package/maestro-flow/commands/manage/status.md +62 -52
  35. package/maestro-flow/commands/manage/wiki.md +82 -71
  36. package/maestro-flow/commands/milestone/audit.md +4 -10
  37. package/maestro-flow/commands/milestone/complete.md +6 -7
  38. package/maestro-flow/commands/milestone/release.md +136 -145
  39. package/maestro-flow/commands/quality/auto-test.md +153 -136
  40. package/maestro-flow/commands/quality/debug.md +159 -120
  41. package/maestro-flow/commands/quality/refactor.md +105 -67
  42. package/maestro-flow/commands/quality/retrospective.md +123 -77
  43. package/maestro-flow/commands/quality/review.md +155 -128
  44. package/maestro-flow/commands/quality/sync.md +88 -52
  45. package/maestro-flow/commands/quality/test.md +147 -117
  46. package/maestro-flow/commands/spec/add.md +77 -70
  47. package/maestro-flow/commands/spec/setup.md +49 -52
  48. package/package.json +1 -1
  49. package/maestro-flow/commands/lifecycle/odyssey-debug.md +0 -473
  50. package/maestro-flow/commands/lifecycle/odyssey-improve.md +0 -505
  51. package/maestro-flow/commands/lifecycle/odyssey-planex.md +0 -601
  52. package/maestro-flow/commands/lifecycle/odyssey-review-test-fix.md +0 -427
  53. package/maestro-flow/commands/lifecycle/odyssey-ui.md +0 -462
  54. package/maestro-flow/commands/lifecycle/security-audit.md +0 -179
@@ -1,427 +0,0 @@
1
- ---
2
- name: odyssey-review-test-fix
3
- description: Deep review + fix cycle — archaeology, exploration, multi-dimensional review, targeted fix, generalization, discovery, and knowledge persistence
4
- argument-hint: "<target> [--dimensions <list>] [--fix-threshold critical|high|medium|low|all] [--skip-fix] [--skip-generalize] [--auto] [-y] [-c]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
- <purpose>
16
- Deep code review with exhaustive fix and generalization: archaeology → explore → multi-dimensional
17
- review → fix ALL findings → confirm → generalize (举一反三) → discover → persist.
18
-
19
- Unlike `quality-review` (pipeline gate verdict), this goes deeper: exhaustive documentation,
20
- automated fix, codebase-wide generalization, decision journal. Use `--skip-fix` for review-only.
21
-
22
- **三句哲学约束(穷尽迭代):**
23
- 1. **零遗留** — 每个 finding 必须是 action item(修复 / issue / 决策),不允许只报告不处理
24
- 2. **穷尽迭代** — 按 severity 从高到低逐轮修复,直到 0 remaining actionable findings 才退出 fix loop
25
- 3. **改进即标准** — 每次修复后重审同区域,发现新问题继续修,直到该区域无可改善
26
-
27
- Core behaviors:
28
- - **Find one, fix one, find all** — every finding triggers fix + codebase-wide scan
29
- - **Record everything** — ambiguous items → decision journal, never silent skip
30
- - **CLI-assisted** — delegate for multi-angle analysis and verification
31
- </purpose>
32
-
33
- <boundary>
34
- **范围内:** 目标代码的多维度深度审查 → 穷尽修复 ALL 发现(按 severity 递降)→ 泛化 pattern 到全项目
35
- **范围外:** 深度根因调查(根因不明时)→ `/odyssey-debug` | 需求实现 → `/odyssey-planex` | UI 视觉优化 → `/odyssey-ui`
36
- **探索自由度:** 边界内自由探索 — 可跨维度关联发现、追溯 git 历史、泛化扫描全项目。修复仅限 critical/high findings。
37
- </boundary>
38
-
39
- <execution_discipline>
40
- **三条铁律(所有阶段适用):**
41
-
42
- 1. **Phase auto-commit** — 每个阶段完成后**自动** `git commit`,无需用户确认
43
- - 代码变更 + understanding.md → `git add` → `git commit -m "odyssey-review({slug}): {phase} — {摘要}"`
44
- - session.json / evidence.ndjson 为运行时状态,不纳入 commit
45
-
46
- 2. **有把握才改** — 仅修改自己有把握的内容;不确定的记录决策等人判断
47
- - 有把握 → 直接修改代码,commit
48
- - 需要决策 → 记录 `evidence.ndjson {"phase":"decision","status":"pending"}` 不改代码
49
- - 禁止猜测性修改
50
-
51
- 3. **多 CLI 辅助** — 利用 `maestro delegate` 调用多个 CLI 工具交叉验证
52
- - 关键判断用不同 `--role`(analyze / review / explore)获取多视角
53
- - 修复前后各做一次 CLI review 确认
54
- </execution_discipline>
55
-
56
- <context>
57
- $ARGUMENTS — target and optional flags.
58
-
59
- **Target resolution:**
60
- | Input | Resolution |
61
- |-------|-----------|
62
- | File/dir path | Review those files |
63
- | `HEAD` / `staged` | `git diff HEAD` / `git diff --staged` |
64
- | Phase number | Resolve via state.json → changed files |
65
- | PR number | `git diff main...HEAD` |
66
-
67
- **Flags:**
68
- | Flag | Effect | Default |
69
- |------|--------|---------|
70
- | `--dimensions <list>` | Comma-separated subset | correctness,security,performance,architecture |
71
- | `--fix-threshold <severity>` | 修复到哪个 severity 为止(all = 全部修复)| `all` |
72
- | `--skip-fix` | Review-only — skip S_FIX and S_CONFIRM | false |
73
- | `--skip-generalize` | Skip S_GENERALIZE and S_DISCOVER | false |
74
- | `--auto` | CLI delegates without confirmation | false |
75
- | `-y` | Auto-confirm at decision points (see appendix) | false |
76
- | `-c` | Resume most recent session | — |
77
-
78
- **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-review-odyssey-{slug}/`
79
-
80
- **Output — 4 files:**
81
- ```
82
- SESSION_DIR/
83
- ├── session.json # state + review_result + confirmation + patterns + phase_goals
84
- ├── evidence.ndjson # ALL evidence (phase: archaeology|explore|review|fix|discovery|decision)
85
- ├── explore.json # CLI exploration snapshot
86
- └── understanding.md # 8-section evolving narrative (§1-§8, one per major phase)
87
- ```
88
-
89
- **session.json schema:**
90
- ```json
91
- {
92
- "session_id": "review-odyssey-{YYYYMMDD-HHmmss}",
93
- "target": "", "dimensions": [],
94
- "flags": { "skip_fix": false, "skip_generalize": false, "fix_threshold": "all", "auto": false, "auto_confirm": false },
95
- "current_state": "S_INTAKE",
96
- "review_result": { "dimensions_reviewed": [], "finding_count": 0, "severity_distribution": { "critical": 0, "high": 0, "medium": 0, "low": 0 }, "remaining_actionable": 0 },
97
- "patterns": [{ "id": "P1", "source_finding": "F1", "layer": "syntax|semantic|structural", "signature": "", "description": "", "risk": "", "fix_template": "", "confidence": "high|medium|low" }],
98
- "confirmation": { "test_result": {}, "cli_review": {}, "overall": "confirmed|needs_rework" },
99
- "generalization_stats": { "patterns_extracted": 0, "total_hits": 0, "true_positives": 0, "false_positives": 0, "uncertain": 0, "cross_layer_confirmed": 0, "regression_risks": 0, "by_layer": {}, "deepening_triggered": false, "self_iteration_rounds": 0 },
100
- "phase_goals": [], "phase_goals_all_done": false,
101
- "self_iteration_log": [],
102
- "cross_phase_loops": 0, "max_loops": 3,
103
- "created_at": "", "updated_at": ""
104
- }
105
- ```
106
-
107
- **evidence.ndjson unified schema:** `{"ts":"","phase":"<phase>","type":"<type>","dimension":"","title":"","severity":"","file":"","line":0,"description":"","suggestion":"","files_modified":[]}`
108
-
109
- **phase_goals[]:**
110
- | ID | Goal | Done When | Phase | skip_when |
111
- |----|------|-----------|-------|-----------|
112
- | G1 | Review completed | all dimensions reviewed, findings logged | S_REVIEW | — |
113
- | G2 | Explore context gathered | explore.json populated | S_EXPLORE | — |
114
- | G3 | Zero remaining: all findings fixed | `remaining_actionable == 0` within fix_threshold | S_CONFIRM | skip_fix |
115
- | G4 | Pattern generalized | patterns[] ≥1 entry | S_GENERALIZE | skip_generalize |
116
- | G5 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
117
- | G6 | Learnings persisted | spec entries created OR no actionable | S_RECORD | — |
118
-
119
- Lifecycle: `pending → done | skipped | failed` (all set `completion_confirmed`)
120
-
121
- ### Pre-load(可选,缺失不阻塞)
122
-
123
- | 层级 | 命令 | 作用 |
124
- |------|------|------|
125
- | Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界,架构约束 |
126
- | Wiki search | `maestro search "<target keywords>" --json` | 先前 review、已知问题(取 top 5) |
127
- | Specs | `maestro spec load --category review` | review 标准、checklist、knowhow 工具 |
128
- | Role knowledge | `maestro search --category review` → 选相关 → `maestro wiki load <id>` | 累积 review 领域知识 |
129
- | Prior sessions | `Glob(".workflow/scratch/*-review-odyssey-*")` | 相关 odyssey 会话 |
130
-
131
- ### Knowledge Persistence(S_RECORD 中写入产出文件)
132
-
133
- S_RECORD 阶段将可沉淀知识 **写入 understanding.md §8 Learnings**,按以下分类结构化:
134
-
135
- | 分类 | 写入内容 | 后续建议命令 |
136
- |------|---------|-------------|
137
- | 跨维度反复 pattern | 模式描述 + 出现维度 + 建议规范 | `/spec-add review "..."` |
138
- | 安全发现 | 漏洞类型 + 触发条件 + 修复方案 | `/spec-add debug "..."` |
139
- | 架构违反 pattern | 违反描述 + 正确边界 + 检查方法 | `/spec-add arch "..."` |
140
- | 可复用泛化 pattern | pattern 签名 + 风险说明 + fix 模板 | `/spec-add coding "..."` |
141
-
142
- **两步模式:** 执行中写入产出文件(临时记录)→ 任务完成后用户通过 next_step_routing 沉淀为永久知识。执行过程中不调用外部 Skill。
143
- </context>
144
-
145
- <self_iteration>
146
- **Quality Gate** — auto-evaluate after each analytical phase. Insufficient → re-enter (max 2 rounds).
147
-
148
- | Dimension | Sufficient | Insufficient |
149
- |-----------|-----------|-------------|
150
- | Coverage | All known related files analyzed | Missed targets discoverable via grep/git log |
151
- | Depth | ≥80% findings have file:line evidence | Most findings lack specifics |
152
- | Actionability | Each conclusion has concrete next action | "Consider reviewing" without action |
153
-
154
- **Expansion:** Round 1 = widen scope (more dirs, deeper git log, extra delegate angles). Round 2 = shift perspective (different CLI tool, reverse trace, manual reading).
155
-
156
- **Log:** `evidence.ndjson ← {"phase":"self-iteration","type":"quality-gate","stage":"S_XXX","round":N,"assessment":{},"expansion":""}`
157
-
158
- **Applicable stages:** S_ARCHAEOLOGY, S_EXPLORE, S_REVIEW, S_FIX, S_GENERALIZE
159
- </self_iteration>
160
-
161
- <state_machine>
162
-
163
- <states>
164
- S_INTAKE — Parse target, load context, resume session PERSIST: session.json + understanding.md §1
165
- S_ARCHAEOLOGY — Git history of target files PERSIST: evidence.ndjson (archaeology) + understanding.md §2
166
- S_EXPLORE — CLI-assisted structure/call-chain exploration PERSIST: explore.json + evidence.ndjson (explore) + understanding.md §3
167
- S_REVIEW — Parallel multi-dimension review (4 Agents) PERSIST: evidence.ndjson (review) + understanding.md §4
168
- S_FIX — Targeted fix for critical/high (skip if --skip-fix) PERSIST: code changes + evidence.ndjson (fix)
169
- S_CONFIRM — Test + CLI review confirmation (skip if --skip-fix) PERSIST: session.json.confirmation + understanding.md §5
170
- S_GENERALIZE — Pattern extraction + 4-agent scan (skip if --skip-generalize) PERSIST: session.json.patterns + understanding.md §6
171
- S_DISCOVER — Classify hits, create issues (skip if --skip-generalize) PERSIST: evidence.ndjson (discovery|decision) + understanding.md §7
172
- S_RECORD — Knowledge persistence + final report PERSIST: understanding.md §8 + spec entries
173
- </states>
174
-
175
- <transitions>
176
- S_INTAKE:
177
- → S_INTAKE WHEN -c + session found DO A_RESUME
178
- → S_ARCHAEOLOGY WHEN target resolved DO A_INTAKE
179
- → S_INTAKE WHEN no target DO AskUserQuestion
180
-
181
- S_ARCHAEOLOGY → S_EXPLORE DO A_ARCHAEOLOGY
182
- S_EXPLORE → S_REVIEW DO A_EXPLORE
183
-
184
- S_REVIEW:
185
- → S_FIX WHEN !skip_fix AND any findings within fix_threshold DO A_REVIEW
186
- → S_GENERALIZE WHEN (skip_fix OR no findings) AND !skip_gen DO A_REVIEW
187
- → S_RECORD WHEN (skip_fix OR no findings) AND skip_gen DO A_REVIEW
188
-
189
- S_FIX → S_CONFIRM DO A_FIX
190
-
191
- S_CONFIRM:
192
- → S_GENERALIZE WHEN confirmed AND !skip_gen DO A_CONFIRM
193
- → S_RECORD WHEN confirmed AND skip_gen DO A_CONFIRM
194
- → S_FIX WHEN needs_rework DO A_CONFIRM
195
-
196
- S_GENERALIZE:
197
- → S_DISCOVER WHEN hits found DO A_GENERALIZE
198
- → S_RECORD WHEN no hits DO A_GENERALIZE
199
-
200
- S_DISCOVER → S_FIX : discovery finds fixable sibling, !skip_fix, loops < max_loops → cross_phase_loops++
201
- S_DISCOVER → S_REVIEW : discovery opens new review target, loops < max_loops → cross_phase_loops++
202
- S_DISCOVER → S_RECORD : triage complete OR loops >= max_loops (剩余项 → issue/decision)
203
-
204
- S_RECORD → END DO A_RECORD
205
- </transitions>
206
-
207
- <actions>
208
-
209
- ### A_INTAKE
210
- Parse target + flags → file list. Create `SESSION_DIR`, derive `phase_goals[]` from flags.
211
- Search prior knowledge: `maestro search`, prior sessions, ARCHITECTURE.md.
212
- Write `session.json` + `understanding.md` §1. Display Goal Prompt (appendix).
213
-
214
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): INTAKE — 目标解析与上下文加载"`
215
-
216
- ### A_ARCHAEOLOGY
217
- `git log --oneline -20 -- {target_files}` + `git blame` on key regions.
218
- CLI delegate `--role analyze --mode analysis` to review past changes.
219
- Append evidence.ndjson (phase: "archaeology"). Update `understanding.md` §2.
220
-
221
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): ARCHAEOLOGY — git 考古分析"`
222
-
223
- ### A_EXPLORE
224
- CLI delegate `--role explore --mode analysis` — call chains, error gaps, similar patterns.
225
- Write `explore.json`, append evidence.ndjson (phase: "explore").
226
- Update `understanding.md` §3. Mark G2 done.
227
-
228
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): EXPLORE — 代码探索完成"`
229
-
230
- ### A_REVIEW
231
- Spawn N parallel Agents (one per dimension, default 4):
232
-
233
- | Agent | Dimension | Focus |
234
- |-------|-----------|-------|
235
- | Correctness | correctness | Logic errors, boundary conditions, null/undefined, race conditions |
236
- | Security | security | Injection, XSS, CSRF, data exposure, auth bypass |
237
- | Performance | performance | Hot paths, N+1, memory leaks, unnecessary recomputation |
238
- | Architecture | architecture | Layer violations, circular deps, interface contracts, SoC |
239
-
240
- Each returns `[{title, severity, file, line, description, suggestion, cwe}]`.
241
- Merge → evidence.ndjson (phase: "review"). Write `session.json.review_result`.
242
- Update `understanding.md` §4 (findings by dimension + severity matrix). Mark G1 done.
243
-
244
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): REVIEW — 多维度审查完成"`
245
-
246
- ### A_FIX
247
-
248
- **穷尽迭代修复** — 按 severity 递降逐轮修复,直到 `remaining_actionable == 0`。
249
-
250
- #### Fix Loop (severity tiers)
251
-
252
- ```
253
- fix_tiers = [critical, high, medium, low].filter(s => severity_order(s) >= severity_order(fix_threshold))
254
- for tier in fix_tiers:
255
- candidates = evidence.filter(phase=="review" AND severity==tier AND status!="fixed")
256
- if candidates.empty: continue
257
- for each candidate:
258
- read context (file:line ±20) → implement fix → append evidence (phase: "fix")
259
- run local re-review on modified area ("改进即标准"):
260
- new_findings in same region? → append to current tier, continue loop
261
- tier complete → auto-commit
262
- ```
263
-
264
- **Re-review gate** ("改进即标准"): 每轮修复后,对修改区域执行轻量 re-review(同维度)。若发现新问题,追加到当前轮继续修复。单轮最多 re-review 2 次,防止无限循环。
265
-
266
- **Normal**: AskUserQuestion 确认每个 tier 的 candidates。**`-y`**: auto-fix all, record `deferred`.
267
-
268
- **Remaining check**: 所有 tiers 完成后,count unfixed findings within fix_threshold → 写入 `review_result.remaining_actionable`。若 > 0 且未超 max_loops → 回到 tier 1 重试。
269
-
270
- 📌 **Auto-commit per tier**: `git add -A && git commit -m "odyssey-review({slug}): FIX-{tier} — {N}项修复"`
271
-
272
- ### A_CONFIRM
273
- Run tests covering modified files. CLI delegate fix review:
274
- ```
275
- maestro delegate "PURPOSE: Verify ALL fixes and confirm zero remaining improvements
276
- TASK: Verify fix correctness | Check regressions | Count remaining unfixed findings | Confirm zero-residual
277
- MODE: analysis
278
- CONTEXT: @{modified_files} | Findings: {all_findings_summary} | Diff: {git_diff}
279
- EXPECTED: JSON {verdict, findings_addressed, remaining_unfixed, regression_risk, new_findings_in_modified_area}
280
- CONSTRAINTS: Focus on correctness AND completeness — flag ANY remaining actionable improvement
281
- " --role review --mode analysis
282
- ```
283
- Run_in_background, STOP, wait.
284
-
285
- **Zero-residual gate:**
286
- - `remaining_unfixed == 0 AND new_findings == 0` → `confirmed`, mark G3 done
287
- - `remaining_unfixed > 0 OR new_findings > 0` → `needs_rework` → S_FIX(追加新发现)
288
- - Regression detected → `needs_rework` → S_FIX
289
-
290
- Write `session.json.confirmation` + update `review_result.remaining_actionable`.
291
- Update `understanding.md` §5.
292
-
293
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): CONFIRM — 零遗留验证"`
294
-
295
- ### A_GENERALIZE
296
- **Multi-layer pattern extraction** from findings (severity >= medium):
297
-
298
- | Layer | Method | Example |
299
- |-------|--------|---------|
300
- | Syntax | Regex → direct Grep | `eval(`, `innerHTML =` |
301
- | Semantic | Agent understands anti-pattern → scans | Missing error handling on async |
302
- | Structural | File/module structure similarity | Same base class missing override |
303
-
304
- Write `session.json.patterns[]`.
305
-
306
- **4-agent parallel scan** (single message):
307
- 1. **Syntax grep** — Grep syntax-layer signatures across project
308
- 2. **Semantic scan** — Check related modules for same anti-patterns
309
- 3. **Structural match** — Find structurally similar files, check for same issues
310
- 4. **Historical grep** — `git log -S "{pattern}"` for introduction/fix history
311
-
312
- **Cross-layer dedup**: Multi-layer hit → boost confidence. Single-layer → `needs_review`. Historical match on fixed code → `regression_risk`.
313
-
314
- **Iterative deepening** (conditional): High-density cluster (≥3 hits in same module) → targeted deep scan on that module. Max 1 round.
315
-
316
- **CLI validation** (optional): Delegate to validate true/false positives.
317
-
318
- Update `understanding.md` §6 (per-pattern summary, cross-layer matrix, risk heatmap).
319
- Write `session.json.generalization_stats`. Mark G4 done.
320
-
321
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): GENERALIZE — 泛化扫描完成"`
322
-
323
- ### A_DISCOVER
324
- Classify each hit: `bug` / `risk` / `safe`.
325
- **Normal**: AskUserQuestion for bug routing. **`-y`**: auto create issue, `deferred`.
326
- Append evidence (phase: discovery + decision). Update `understanding.md` §7. Mark G5 done.
327
-
328
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): DISCOVER — 发现分类完成"`
329
-
330
- ### A_RECORD
331
- Finalize `understanding.md` §8: per-dimension summary, top findings with file:line, generalization results, open decisions.
332
- Write learnings to understanding.md §8: 按 Knowledge Persistence 表分类记录(临时),completion summary 列出建议的 `/spec-add` 命令。
333
- Pending decisions: **Normal** → AskUserQuestion. **`-y`** → skip, display deferred count.
334
- Goal audit: check all `phase_goals[*].completion_confirmed`. Mark G6 done.
335
-
336
- Completion summary:
337
- ```
338
- --- REVIEW-TEST-FIX ODYSSEY COMPLETE ---
339
- Target: {target}
340
- Dimensions: {dimensions_reviewed}
341
- Findings: {C}C {H}H {M}M {L}L
342
- Fix: {fixed} applied, confirmed={confirmed|skipped}
343
- Patterns: {extracted} ({by_layer} distribution)
344
- Scan hits: {total} ({cross_layer} cross-layer confirmed)
345
- Issues: {N} created
346
- Decisions: {N} resolved, {M} pending, {K} deferred
347
- Learnings: {N} spec entries
348
- Self-iter: {N} rounds across {M} stages
349
- Goals: {done}/{total} ({skipped} skipped)
350
- ---
351
- ```
352
-
353
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-review({slug}): RECORD — 会话总结与知识沉淀"`
354
-
355
- </actions>
356
-
357
- <appendix>
358
-
359
- ### Goal Prompt Template
360
- **⚠️ 时机守卫:仅在 A_INTAKE 完成后显示一次(session 创建后、开始考古前)。A_RECORD 完成时禁止重新显示。**
361
-
362
- ```
363
- 📋 Review-Test-Fix Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件(执行过程中输入即可):
364
-
365
- /goal 穷尽迭代:直到 session.json 的 review_result.remaining_actionable == 0
366
- 且 confirmation.verdict == "confirmed" 且 phase_goals_all_done == true 才停。
367
- 修复按 severity 逐轮迭代(critical→high→medium→low),每轮修复后 re-review 修改区域。
368
- 发现新问题追加到当前轮继续。遇到 phase=decision 的 pending 必须 AskUserQuestion。
369
- 不允许"只报告不处理",每个 finding 必须有 action(fix/issue/decision)。
370
- ```
371
-
372
- 完成时仅输出 completion summary,不重复此提示。
373
-
374
- ### `-y` Auto-Confirm (6 decision points)
375
- | Decision Point | Normal | `-y` |
376
- |----------------|--------|------|
377
- | S_FIX tier candidates | AskUserQuestion per tier | auto-fix ALL tiers, `deferred` |
378
- | S_FIX re-review new findings | AskUserQuestion | auto-append and fix |
379
- | S_CONFIRM needs_rework | Display, proceed to S_FIX | auto proceed |
380
- | S_DISCOVER bug routing | AskUserQuestion | auto create issue, `deferred` |
381
- | S_DISCOVER ambiguous | AskUserQuestion | all `deferred` |
382
- | S_RECORD pending decisions | AskUserQuestion | skip |
383
- | S_RECORD goal audit | AskUserQuestion | auto accept |
384
-
385
- </appendix>
386
-
387
- </state_machine>
388
-
389
- <error_codes>
390
- | Code | Severity | Condition | Recovery |
391
- |------|----------|-----------|----------|
392
- | E001 | error | No target specified | Provide target |
393
- | E002 | error | Target path not found | Check path |
394
- | E003 | error | Resume but no session | Start new |
395
- | W001 | warning | No git history for target | Proceed |
396
- | W002 | warning | Some dimension agents failed | Partial coverage |
397
- | W003 | warning | Generalization 0 hits | Skip discovery |
398
- | W004 | warning | Delegate parse failed | Raw output |
399
- </error_codes>
400
-
401
- <success_criteria>
402
- - [ ] Target resolved and session created
403
- - [ ] Git archaeology on target files
404
- - [ ] CLI exploration executed, explore.json written
405
- - [ ] All dimensions reviewed with structured findings
406
- - [ ] Severity matrix produced
407
- - [ ] **ALL findings within fix_threshold fixed** — remaining_actionable == 0 (unless --skip-fix)
408
- - [ ] Per-tier fix with re-review gate: modified area re-reviewed, new findings appended
409
- - [ ] Zero-residual confirmed by CLI external model
410
- - [ ] Pattern generalized with multi-layer scan + deepening (unless --skip-generalize)
411
- - [ ] Quality Gate self-iteration triggered when insufficient
412
- - [ ] Discoveries classified and routed
413
- - [ ] understanding.md §8 finalized
414
- - [ ] phase_goals G1-G6 tracked and audited (G3 = zero remaining)
415
- - [ ] Goal Prompt displayed once
416
- - [ ] `-y`: no blocking prompts, deferred counted
417
- - [ ] Session resumable via -c
418
- </success_criteria>
419
-
420
- <next_step_routing>
421
- | Condition | Next step |
422
- |-----------|-----------|
423
- | Finding needs deeper debug | `/odyssey-debug "<finding>"` |
424
- | Issues created | `/manage-issue list --source review-odyssey` |
425
- | Pattern to document | `/learn-decompose <module>` |
426
- | Plan fixes for findings | `/maestro-plan --gaps` |
427
- </next_step_routing>