maestro-flow 0.5.40 → 0.5.42

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 (101) hide show
  1. package/.agents/skills/maestro-analyze/SKILL.md +0 -42
  2. package/.agents/skills/maestro-blueprint/SKILL.md +0 -22
  3. package/.agents/skills/maestro-brainstorm/SKILL.md +4 -24
  4. package/.agents/skills/maestro-execute/SKILL.md +1 -1
  5. package/.agents/skills/maestro-grill/SKILL.md +0 -16
  6. package/.agents/skills/maestro-milestone-audit/SKILL.md +0 -15
  7. package/.agents/skills/maestro-plan/SKILL.md +5 -62
  8. package/.agents/skills/maestro-roadmap/SKILL.md +0 -8
  9. package/.agents/skills/odyssey-debug/SKILL.md +109 -143
  10. package/.agents/skills/odyssey-improve/SKILL.md +127 -141
  11. package/.agents/skills/odyssey-planex/SKILL.md +140 -231
  12. package/.agents/skills/odyssey-review-test-fix/SKILL.md +136 -90
  13. package/.agents/skills/odyssey-ui/SKILL.md +123 -143
  14. package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  15. package/.agents/skills/team-coordinate/specs/role-spec-template.md +197 -198
  16. package/.agents/skills/team-roadmap-dev/SKILL.md +164 -164
  17. package/.agents/skills/team-roadmap-dev/specs/team-config.json +1 -1
  18. package/.agents/skills/team-swarm/roles/analyst/role.md +172 -176
  19. package/.agy/skills/maestro-analyze/SKILL.md +0 -42
  20. package/.agy/skills/maestro-blueprint/SKILL.md +0 -22
  21. package/.agy/skills/maestro-brainstorm/SKILL.md +4 -24
  22. package/.agy/skills/maestro-execute/SKILL.md +1 -1
  23. package/.agy/skills/maestro-grill/SKILL.md +0 -16
  24. package/.agy/skills/maestro-milestone-audit/SKILL.md +0 -15
  25. package/.agy/skills/maestro-plan/SKILL.md +5 -62
  26. package/.agy/skills/maestro-roadmap/SKILL.md +0 -8
  27. package/.agy/skills/odyssey-debug/SKILL.md +109 -143
  28. package/.agy/skills/odyssey-improve/SKILL.md +127 -141
  29. package/.agy/skills/odyssey-planex/SKILL.md +140 -231
  30. package/.agy/skills/odyssey-review-test-fix/SKILL.md +136 -90
  31. package/.agy/skills/odyssey-ui/SKILL.md +123 -143
  32. package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  33. package/.agy/skills/team-coordinate/specs/role-spec-template.md +197 -198
  34. package/.agy/skills/team-roadmap-dev/SKILL.md +141 -153
  35. package/.agy/skills/team-roadmap-dev/specs/team-config.json +1 -1
  36. package/.agy/skills/team-swarm/roles/analyst/role.md +172 -176
  37. package/.claude/commands/maestro-analyze.md +0 -42
  38. package/.claude/commands/maestro-blueprint.md +0 -22
  39. package/.claude/commands/maestro-brainstorm.md +4 -24
  40. package/.claude/commands/maestro-execute.md +1 -1
  41. package/.claude/commands/maestro-grill.md +0 -16
  42. package/.claude/commands/maestro-milestone-audit.md +0 -15
  43. package/.claude/commands/maestro-plan.md +5 -62
  44. package/.claude/commands/maestro-roadmap.md +0 -8
  45. package/.claude/commands/odyssey-debug.md +109 -143
  46. package/.claude/commands/odyssey-improve.md +127 -141
  47. package/.claude/commands/odyssey-planex.md +140 -231
  48. package/.claude/commands/odyssey-review-test-fix.md +136 -90
  49. package/.claude/commands/odyssey-ui.md +123 -143
  50. package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  51. package/.claude/skills/team-coordinate/specs/role-spec-template.md +197 -198
  52. package/.claude/skills/team-roadmap-dev/SKILL.md +169 -169
  53. package/.claude/skills/team-roadmap-dev/specs/team-config.json +1 -1
  54. package/.claude/skills/team-swarm/roles/analyst/role.md +181 -185
  55. package/.codex/skills/odyssey-debug/SKILL.md +114 -169
  56. package/.codex/skills/odyssey-improve/SKILL.md +144 -188
  57. package/.codex/skills/odyssey-planex/SKILL.md +162 -242
  58. package/.codex/skills/odyssey-review-test-fix/SKILL.md +96 -90
  59. package/.codex/skills/odyssey-ui/SKILL.md +128 -173
  60. package/dashboard/dist-server/src/commands/install-backend.js +31 -16
  61. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  62. package/dashboard/dist-server/src/core/component-defs.js +25 -0
  63. package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
  64. package/dashboard/dist-server/src/tools/spec-loader.js +32 -20
  65. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  66. package/dashboard/dist-server/src/tools/spec-seeds.d.ts +8 -0
  67. package/dashboard/dist-server/src/tools/spec-seeds.js +114 -0
  68. package/dashboard/dist-server/src/tools/spec-seeds.js.map +1 -1
  69. package/dist/src/commands/install-backend.d.ts.map +1 -1
  70. package/dist/src/commands/install-backend.js +31 -16
  71. package/dist/src/commands/install-backend.js.map +1 -1
  72. package/dist/src/commands/spec.d.ts.map +1 -1
  73. package/dist/src/commands/spec.js +13 -3
  74. package/dist/src/commands/spec.js.map +1 -1
  75. package/dist/src/core/component-defs.d.ts.map +1 -1
  76. package/dist/src/core/component-defs.js +25 -0
  77. package/dist/src/core/component-defs.js.map +1 -1
  78. package/dist/src/tools/spec-init.d.ts +4 -3
  79. package/dist/src/tools/spec-init.d.ts.map +1 -1
  80. package/dist/src/tools/spec-init.js +9 -5
  81. package/dist/src/tools/spec-init.js.map +1 -1
  82. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  83. package/dist/src/tools/spec-loader.js +32 -20
  84. package/dist/src/tools/spec-loader.js.map +1 -1
  85. package/dist/src/tools/spec-seeds.d.ts +8 -0
  86. package/dist/src/tools/spec-seeds.d.ts.map +1 -1
  87. package/dist/src/tools/spec-seeds.js +114 -0
  88. package/dist/src/tools/spec-seeds.js.map +1 -1
  89. package/dist/src/utils/update-notices.js +11 -0
  90. package/dist/src/utils/update-notices.js.map +1 -1
  91. package/package.json +1 -1
  92. package/workflows/agy-instructions.md +147 -161
  93. package/workflows/claude-instructions.md +100 -48
  94. package/workflows/codex-instructions.md +147 -161
  95. package/workflows/execute.md +4 -3
  96. package/workflows/explore-usage.md +41 -81
  97. package/workflows/grill.md +11 -0
  98. package/workflows/milestone-audit.md +8 -0
  99. package/workflows/odyssey-base-codex.md +305 -0
  100. package/workflows/odyssey-base.md +89 -91
  101. package/workflows/plan.md +6 -0
@@ -5,143 +5,94 @@ argument-hint: "<requirement> [--max-iterations N] [--skip-generalize] [--auto]
5
5
  allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
6
6
  ---
7
7
 
8
- <base>@~/.maestro/workflows/odyssey-base.md</base>
8
+ <base>@~/.maestro/workflows/odyssey-base-codex.md</base>
9
9
 
10
10
  <purpose>
11
- Requirement-to-delivery closed loop: parse requirement define acceptance criteria
12
- plan execute verify fix gaps iterate until ALL criteria pass.
13
-
14
- Core philosophy:
15
- - **Acceptance criteria are sacred** — no "close enough", no manual override
16
- - **Iterate, don't restart** — each fix cycle targets only the failing criteria
17
- - **CLI-assisted verification** — delegate to external tools for objective checks
18
- - **Evidence-based progress** — every iteration logged with pass/fail per criterion
19
-
20
- **三句哲学约束(穷尽迭代):**
21
- 1. **零遗留** — 验收标准必须 ALL pass,不允许"接近通过"
22
- 2. **穷尽迭代** — verify 失败自动修复重试,直到全部通过或明确升级
23
- 3. **改进即标准** — 修复后重新验证同区域,新发现的标准违反继续修
11
+ Requirement-to-delivery closed loop: parse requirement -> define acceptance criteria ->
12
+ plan -> execute -> verify -> fix gaps -> iterate until ALL criteria pass.
24
13
  </purpose>
25
14
 
26
15
  <boundary>
27
- **范围内:** 单一需求的实现闭环从需求解析到验收标准全部通过 + 泛化同类场景
28
- **范围外:** 多需求编排 `/maestro-roadmap` | 深度 debugging `$odyssey-debug` | 代码审查 `$odyssey-review-test-fix` | UI 优化 `$odyssey-ui`
29
- **探索自由度:** 边界内自由探索 — 可自主分解任务、选择实现策略、迭代修复。verify→fix 循环内可尝试不同方案。
30
- **模板支持:** `--template <name>` 从预定义需求模板启动,自动生成匹配的验收标准和任务分解:
31
-
32
- | Template | 预设 criteria 模式 | 适用场景 |
33
- |----------|-------------------|---------|
34
- | `feature` | 用户故事验收 + 边界测试 + UI 验证 | 新功能开发 |
35
- | `bugfix` | 回归测试 + 根因确认 + 边界覆盖 | Bug 修复 |
36
- | `refactor` | 行为不变验证 + 性能基准 + API 兼容 | 重构 |
37
- | `migration` | 数据一致性 + 回滚验证 + 性能对比 | 数据/API 迁移 |
38
- | `api-endpoint` | 请求/响应契约 + 错误处理 + 权限校验 | API 开发 |
16
+ **In scope:** Single requirement full loop from parsing to all acceptance criteria passing + generalization.
17
+ **Out of scope:** Multi-requirement orchestration -> `/maestro-roadmap` | Deep debugging -> `$odyssey-debug` | Code review -> `$odyssey-review-test-fix` | UI optimization -> `$odyssey-ui`
18
+
19
+ **`--template <name>`:**
20
+
21
+ | Template | Preset criteria pattern | Use case |
22
+ |----------|------------------------|----------|
23
+ | `feature` | User story acceptance + boundary tests + UI verification | New feature development |
24
+ | `bugfix` | Regression tests + root cause confirmation + boundary coverage | Bug fixing |
25
+ | `refactor` | Behavior-unchanged verification + perf baseline + API compat | Refactoring |
26
+ | `migration` | Data consistency + rollback verification + perf comparison | Data/API migration |
27
+ | `api-endpoint` | Request/response contract + error handling + auth checks | API development |
39
28
  </boundary>
40
29
 
41
30
  <context>
42
- $ARGUMENTS — requirement description and optional flags.
31
+ $ARGUMENTS
43
32
 
44
33
  **Flags:**
45
34
  | Flag | Description | Default |
46
35
  |------|-------------|---------|
47
- | `--template <name>` | 预定义需求模板 | |
48
- | `--max-iterations N` | Max verifyfix cycles before escalation | 3 |
36
+ | `--template <name>` | Predefined requirement template | -- |
37
+ | `--max-iterations N` | Max verify->fix cycles before escalation | 3 |
49
38
  | `--skip-generalize` | Skip S_GENERALIZE + S_DISCOVER | false |
50
39
  | `--auto` | CLI delegate calls without confirmation | false |
51
40
  | `--method agent\|cli\|auto` | Execution method: Agent tool, CLI delegate, or auto-select | `auto` |
52
41
  | `--executor <tool>` | Explicit executor tool for CLI delegate mode | First enabled in config |
53
42
  | `--skip-verify` | Skip execution post-validation gate | false |
54
43
  | `--heartbeat` | Enable periodic progress heartbeat | false |
55
- | `-y` | Auto-confirm decisions recorded as `deferred` | false |
56
- | `-c` | Resume most recent session | |
44
+ | `-y` | Auto-confirm -- decisions recorded as `deferred` | false |
45
+ | `-c` | Resume most recent session | -- |
57
46
 
58
- **Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-planex-odyssey-{slug}/`
47
+ **Session**: `.workflow/scratch/{YYYYMMDD}-planex-odyssey-{slug}/`
48
+ **Output**: `session.json` | `evidence.ndjson` | `understanding.md`
59
49
 
60
- **Output 3 files:**
61
- ```
62
- SESSION_DIR/
63
- ├── session.json # state + criteria + iterations + plan
64
- ├── evidence.ndjson # append-only log (phase distinguishes origin)
65
- └── understanding.md # evolving narrative (8 sections, one per phase)
66
- ```
67
-
68
- **session.json schema:**
50
+ **session.json -- planex-specific fields:**
69
51
  ```json
70
- {
71
- "session_id": "planex-odyssey-{YYYYMMDD-HHmmss}",
72
- "requirement": "",
73
- "flags": { "max_iterations": 3, "skip_generalize": false, "auto": false, "auto_confirm": false },
74
- "current_state": "S_INTAKE",
75
- "acceptance_criteria": [
76
- {"id":"AC1","criterion":"","verify_method":"test|grep|cli-review|manual","status":"pending","evidence":"","passed_at":null}
77
- ],
78
- "plan": { "tasks": [{"id":"T1","title":"","description":"","criteria_refs":["AC1"],"status":"pending","files_modified":[],"domain":"general","executor":"agent"}], "created_at":"" },
79
- "execution_config": {
80
- "method": "auto",
81
- "default_executor": "",
82
- "domain_routing": { "frontend": "", "backend": "", "default": "agent" },
83
- "code_review_tool": "Skip",
84
- "verification_tool": "Auto",
85
- "confirmed": false
86
- },
87
- "iterations": [
88
- {"iteration":1,"started_at":"","completed_at":"","criteria_before":{"passed":0,"total":0},"criteria_after":{"passed":0,"total":0},"gaps_fixed":[],"files_modified":[]}
89
- ],
52
+ { "requirement": "",
53
+ "acceptance_criteria": [{"id":"AC1","criterion":"","verify_method":"test|grep|cli-review|manual","status":"pending","evidence":"","passed_at":null}],
54
+ "plan": {"tasks":[{"id":"T1","title":"","description":"","criteria_refs":["AC1"],"status":"pending","files_modified":[],"domain":"general","executor":"agent"}],"created_at":""},
55
+ "execution_config": {"method":"auto","default_executor":"","domain_routing":{"frontend":"","backend":"","default":"agent"},"code_review_tool":"Skip","verification_tool":"Auto","confirmed":false},
56
+ "iterations": [{"iteration":1,"started_at":"","completed_at":"","criteria_before":{"passed":0,"total":0},"criteria_after":{"passed":0,"total":0},"gaps_fixed":[],"files_modified":[]}],
90
57
  "current_iteration": 0,
91
- "patterns": [
92
- {"id":"P1","source":"AC1 fix","layer":"syntax|semantic|structural","signature":"","description":"","risk":"","fix_template":""}
93
- ],
94
- "generalization_stats": {"patterns_extracted":0,"total_hits":0,"cross_layer_confirmed":0,"by_layer":{"syntax":0,"semantic":0,"structural":0},"deepening_triggered":false},
95
- "phase_goals": [],
96
- "phase_goals_all_done": false,
97
- "self_iteration_log": [],
98
- "progress_metrics": "→ base",
99
- "directions_tried": "→ base",
100
- "cross_phase_loops": 0, "max_loops": 5,
101
- "created_at": "", "updated_at": ""
102
- }
58
+ "patterns": [], "generalization_stats": null }
103
59
  ```
104
60
 
105
- **evidence.ndjson** one JSON per line, `phase` field = `planning|execution|verification|fix|decision|generalization|discovery|self-iteration`
61
+ **evidence.ndjson phases:** `planning|execution|verification|fix|decision|generalization|discovery|self-iteration`
106
62
 
107
- **understanding.md sections:** §1 Requirement & Criteria ← S_INTAKE, §2 Plan ← S_PLAN, §3 Execution ← S_EXECUTE, §4 Verification (per iter) ← S_VERIFY, §5 Fix Log (per iter) ← S_FIX, §6 Generalization ← S_GENERALIZE, §7 Discoveries ← S_DISCOVER, §8 Learnings ← S_RECORD
63
+ **understanding.md -- 8 sections:**
64
+ 1. Requirement & Criteria <- S_INTAKE | 2. Plan <- S_PLAN | 3. Execution <- S_EXECUTE
65
+ 4. Verification (per iter) <- S_VERIFY | 5. Fix Log (per iter) <- S_FIX | 6. Generalization <- S_GENERALIZE
66
+ 7. Discoveries <- S_DISCOVER | 8. Learnings <- S_RECORD
108
67
 
109
68
  **phase_goals[]:**
110
69
  | ID | Goal | Done When | Phase | Skip When |
111
70
  |----|------|-----------|-------|-----------|
112
- | G1 | Acceptance criteria defined | 1 criterion in acceptance_criteria[] | S_INTAKE | |
113
- | G2 | Plan created | session.json.plan populated | S_PLAN | |
114
- | G3 | Implementation complete | all plan tasks executed | S_EXECUTE | |
115
- | G4 | All criteria pass | all acceptance_criteria[].status == passed | S_VERIFY | |
116
- | G5 | Pattern generalized | patterns[] populated ≥1 entry | S_GENERALIZE | skip_generalize |
71
+ | G1 | Acceptance criteria defined | >=1 criterion in acceptance_criteria[] | S_INTAKE | -- |
72
+ | G2 | Plan created | session.json.plan populated | S_PLAN | -- |
73
+ | G3 | Implementation complete | all plan tasks executed | S_EXECUTE | -- |
74
+ | G4 | All criteria pass | all acceptance_criteria[].status == passed | S_VERIFY | -- |
75
+ | G5 | Pattern generalized | patterns[] >=1 entry | S_GENERALIZE | skip_generalize |
117
76
  | G6 | Discoveries triaged | all scan hits classified | S_DISCOVER | skip_generalize |
118
- | G7 | Learnings persisted | spec entries created OR no actionable | S_RECORD | |
119
-
120
- ### Pre-load(可选,缺失不阻塞)
121
-
122
- | 层级 | 命令 | 作用 |
123
- |------|------|------|
124
- | Codebase docs | Read `.workflow/codebase/ARCHITECTURE.md` | 模块边界,架构约束 |
125
- | Wiki search | `maestro search "<requirement keywords>" --json` | 先前实现、相关决策(取 top 5) |
126
- | Coding specs | `maestro load --type spec --category coding` | 编码规范 + 可发现的 knowhow 工具 |
127
- | UI specs(条件) | 若涉及前端 → `maestro load --type spec --category ui` | UI 规范 |
128
- | Role knowledge | `maestro search --category coding` → 选相关 → `maestro load --type knowhow --id <id>` | 累积实现领域知识 |
129
- | Prior sessions | `Glob(".workflow/scratch/*-planex-odyssey-*")` | 相关 odyssey 会话 |
130
-
131
- ### Knowledge Persistence(S_RECORD 中写入产出文件)
77
+ | G7 | Learnings persisted | spec entries created OR no actionable | S_RECORD | -- |
132
78
 
133
- S_RECORD 阶段将可沉淀知识 **写入 understanding.md §8 Learnings**,按以下分类结构化:
79
+ **Knowledge Persistence (S_RECORD writes to understanding.md S8):**
134
80
 
135
- | 分类 | 写入内容 | 后续建议命令 |
136
- |------|---------|-------------|
137
- | 多轮 fix cycle pattern | 问题场景 + fix 迭代过程 + 最终方案 | `/spec-add debug "..."` |
138
- | 可复用实现模式 | 模式描述 + 适用场景 + 代码模板 | `/spec-add coding "..."` |
139
- | 验收标准模板 | 标准模板 + verify_method 建议 | `/spec-add review "..."` |
140
- | 泛化 pattern | pattern 签名 + 风险说明 + fix 模板 | `/spec-add coding "..."` |
81
+ | Category | Content | Follow-up |
82
+ |----------|---------|-----------|
83
+ | Multi-round fix cycle pattern | Problem scenario + fix iterations + final approach | `/spec-add debug` |
84
+ | Reusable implementation pattern | Pattern description + applicable scope + code template | `/spec-add coding` |
85
+ | Acceptance criteria template | Criteria template + verify_method recommendations | `/spec-add review` |
86
+ | Generalization pattern | Pattern signature + risk + fix template | `/spec-add coding` |
141
87
  </context>
142
88
 
89
+ <invariants>
90
+ Base invariants apply. Additionally:
91
+ 6. **Acceptance criteria are sacred** -- no "close enough", no manual override without explicit escalation
92
+ </invariants>
93
+
143
94
  <self_iteration>
144
- 适用阶段: S_PLAN, S_VERIFY, S_GENERALIZE
95
+ Applies to: **S_PLAN, S_VERIFY, S_GENERALIZE**. Logic in base.
145
96
  </self_iteration>
146
97
 
147
98
  <csv_schema>
@@ -171,64 +122,62 @@ id,title,description,task_type,criterion_refs,deps,wave,status,findings,evidence
171
122
  ```
172
123
 
173
124
  **Waves:**
174
- - Wave 1: Verification agents (one per `cli-review` criterion) parallel
175
- - Wave 2: Generalization agents (syntax-grep, semantic-scan, structural-match, historical-grep) parallel
125
+ - Wave 1: Verification agents (one per `cli-review` criterion) -- parallel
126
+ - Wave 2: Generalization agents (syntax-grep, semantic-scan, structural-match, historical-grep) -- parallel
176
127
  </csv_schema>
177
128
 
178
129
  <state_machine>
179
130
 
180
131
  <states>
181
- S_INTAKE parse requirement, define acceptance criteria PERSIST: session.json + understanding.md §1
182
- S_PLAN decompose tasks, generate execution plan PERSIST: session.json.plan + evidence (planning) + understanding.md §2
183
- S_EXECUTE implement tasks PERSIST: code + evidence (execution) + understanding.md §3
184
- S_VERIFY iron gate: check every acceptance criterion PERSIST: evidence (verification) + understanding.md §4
185
- S_FIX targeted fix for failing criteria (loops to VERIFY) PERSIST: code + evidence (fix) + understanding.md §5
186
- S_GENERALIZE extract patterns, 4-agent scan PERSIST: session.json.patterns + understanding.md §6
187
- S_DISCOVER triage scan hits, route decisions PERSIST: evidence (discovery|decision) + understanding.md §7
188
- S_RECORD persist learnings, final summary PERSIST: understanding.md §8 + spec entries
132
+ S_INTAKE -- parse requirement, define acceptance criteria
133
+ S_PLAN -- decompose tasks, generate execution plan
134
+ S_EXECUTE -- implement tasks
135
+ S_VERIFY -- iron gate: check every acceptance criterion
136
+ S_FIX -- targeted fix for failing criteria (loops to VERIFY)
137
+ S_GENERALIZE -- extract patterns, 4-agent scan
138
+ S_DISCOVER -- triage scan hits, route decisions
139
+ S_RECORD -- persist learnings, final summary
189
140
  </states>
190
141
 
191
142
  <transitions>
192
- S_INTAKE S_INTAKE WHEN -c + session found (resume)
193
- S_INTAKE S_PLAN WHEN requirement + criteria defined
194
- S_INTAKE S_INTAKE WHEN no requirement request_user_input
143
+ S_INTAKE -> S_INTAKE : -c + session found (resume)
144
+ S_INTAKE -> S_PLAN : requirement + criteria defined
145
+ S_INTAKE -> S_INTAKE : no requirement -> request_user_input
195
146
 
196
- S_PLAN S_EXECUTE
197
- S_EXECUTE S_VERIFY
147
+ S_PLAN -> S_EXECUTE
148
+ S_EXECUTE -> S_VERIFY
198
149
 
199
- S_VERIFY S_GENERALIZE WHEN all passed AND NOT skip_generalize
200
- S_VERIFY S_RECORD WHEN all passed AND skip_generalize
201
- S_VERIFY S_FIX WHEN some failed AND iteration < max
202
- S_VERIFY S_PLAN WHEN fundamental plan flaw discovered, loops < max_loops cross_phase_loops++ (重规划)
203
- S_VERIFY S_RECORD WHEN some failed AND iteration >= max (escalate)
150
+ S_VERIFY -> S_GENERALIZE : all passed AND NOT skip_generalize
151
+ S_VERIFY -> S_RECORD : all passed AND skip_generalize
152
+ S_VERIFY -> S_FIX : some failed AND iteration < max
153
+ S_VERIFY -> S_PLAN : fundamental plan flaw discovered, loops < max_loops -> cross_phase_loops++ (replan)
154
+ S_VERIFY -> S_RECORD : some failed AND iteration >= max (escalate)
204
155
 
205
- S_FIX S_VERIFY (loop)
156
+ S_FIX -> S_VERIFY (loop)
206
157
 
207
- S_GENERALIZE S_DISCOVER WHEN hits found
208
- S_GENERALIZE S_RECORD WHEN no hits
158
+ S_GENERALIZE -> S_DISCOVER : hits found
159
+ S_GENERALIZE -> S_RECORD : no hits
209
160
 
210
- S_DISCOVER S_EXECUTE : discovery finds area needing same implementation cross_phase_loops++
211
- S_DISCOVER S_RECORD : triage complete AND remaining_actionable == 0
212
- S_DISCOVER S_RECORD : loops >= max_loops MUST log each unfixed item with specific reason (blanket "pre-existing" is forbidden)
161
+ S_DISCOVER -> S_EXECUTE : discovery finds area needing same implementation -> cross_phase_loops++
162
+ S_DISCOVER -> S_RECORD : triage complete AND remaining_actionable == 0
163
+ S_DISCOVER -> S_RECORD : loops >= max_loops -> MUST log per-item reasons
213
164
 
214
- S_RECORD END
165
+ S_RECORD -> END
215
166
  </transitions>
216
167
 
217
168
  <actions>
218
169
 
219
170
  ### A_INTAKE
220
-
221
171
  1. Parse requirement and flags, generate slug, create SESSION_DIR
222
- 2. **Define acceptance criteria** analyze requirement derive testable criteria. Each gets `verify_method`: test | grep | cli-review | manual
172
+ 2. **Define acceptance criteria** -- analyze requirement -> derive testable criteria. Each gets `verify_method`: test | grep | cli-review | manual
223
173
  - **Normal**: request_user_input to confirm/edit
224
174
  - **`-y`**: auto-derive, record `{"phase":"decision","type":"criteria-confirmation","status":"deferred"}`
225
175
  3. Search prior knowledge: `maestro search`, related sessions
226
- 4. Write session.json + understanding.md §1. Mark G1 done. Display Goal Prompt (see Appendix)
176
+ 4. Write session.json + understanding.md S1. Mark G1 done. Display Goal Prompt
227
177
 
228
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): INTAKE 目标解析"`
178
+ Commit: `"odyssey-planex({slug}): INTAKE -- requirement parsed"`
229
179
 
230
180
  ### A_PLAN
231
-
232
181
  1. Decompose requirement into ordered tasks mapped to acceptance criteria
233
182
  2. CLI-assisted planning (optional):
234
183
  ```bash
@@ -239,10 +188,10 @@ S_RECORD → END
239
188
  EXPECTED: JSON [{task_id, title, description, criteria_refs, deps}]
240
189
  " --role analyze --mode analysis
241
190
  ```
242
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
243
- 3. Write session.json.plan, append evidence (planning), update understanding.md §2. Mark G2 done.
191
+ Execute with `run_in_background: true`, wait for callback.
192
+ 3. Write session.json.plan, append evidence (planning), update understanding.md S2. Mark G2 done.
244
193
 
245
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): PLAN 计划制定"`
194
+ Commit: `"odyssey-planex({slug}): PLAN -- tasks decomposed"`
246
195
 
247
196
  ### A_EXECUTE
248
197
 
@@ -250,43 +199,42 @@ S_RECORD → END
250
199
 
251
200
  **Skip if** `-y` flag OR `--method` explicitly set OR `execution_config.confirmed == true` (resume).
252
201
 
253
- Load available tools: `maestro delegate-config show --json` extract enabled tools and domain tags.
202
+ Load available tools: `maestro delegate-config show --json` -> extract enabled tools and domain tags.
254
203
 
255
204
  ```
256
205
  request_user_input({
257
206
  questions: [
258
207
  {
259
- question: "任务如何执行?选择一种方式,或 Other 指定域路由规则(如 '前端agy 后端codex 其余agent'",
208
+ question: "How should tasks be executed? Choose a method, or Other to specify domain routing (e.g. 'frontend agy backend codex rest agent')",
260
209
  header: "Executor",
261
210
  options: [
262
- { label: "Auto (Recommended)", description: "域路由: frontend{frontendTool}, backend{backendTool}, generalagent" },
263
- { label: "Agent", description: "Claude Code Agent 执行所有任务(最快)" },
264
- ...availableTools.map(t => ({ label: t, description: `${t} CLI 执行所有任务` }))
211
+ { label: "Auto (Recommended)", description: "Domain routing: frontend->{frontendTool}, backend->{backendTool}, general->agent" },
212
+ { label: "Agent", description: "Claude Code Agent executes all tasks (fastest)" },
213
+ ...availableTools.map(t => ({ label: t, description: `${t} CLI executes all tasks` }))
265
214
  ]
266
215
  },
267
216
  {
268
- question: "执行后运行代码审查?",
217
+ question: "Run code review after execution?",
269
218
  header: "Review",
270
219
  options: [
271
- { label: "Skip", description: "不审查" },
272
- ...availableTools.map(t => ({ label: `${t} Review`, description: `${t} CLI: git diff 质量审查` }))
220
+ { label: "Skip", description: "No review" },
221
+ ...availableTools.map(t => ({ label: `${t} Review`, description: `${t} CLI: git diff quality review` }))
273
222
  ]
274
223
  },
275
224
  {
276
- question: "验证门控?(外部模型检查收敛 + 结构 + 反模式)",
225
+ question: "Verification gate? (external model checks convergence + structure + anti-patterns)",
277
226
  header: "Verify",
278
227
  options: [
279
- { label: "Auto (Recommended)", description: `Delegate ${availableTools[0]} 做收敛+结构+反模式检查` },
280
- ...availableTools.map(t => ({ label: t, description: `${t}: 验证门控` })),
281
- { label: "Skip", description: "不验证" }
228
+ { label: "Auto (Recommended)", description: `Delegate to ${availableTools[0]} for convergence+structure+anti-pattern check` },
229
+ ...availableTools.map(t => ({ label: t, description: `${t}: verification gate` })),
230
+ { label: "Skip", description: "No verification" }
282
231
  ]
283
232
  }
284
233
  ]
285
234
  })
286
235
  ```
287
236
 
288
- Parse response write `execution_config` to session.json, set `confirmed: true`.
289
-
237
+ Parse response -> write `execution_config` to session.json, set `confirmed: true`.
290
238
  `--skip-verify` flag overrides verification to `"Skip"`.
291
239
 
292
240
  #### Step 2: Executor Resolution
@@ -299,7 +247,7 @@ Per-task domain routing (when method == "auto"):
299
247
  | backend | API, server, database, service, algorithm, worker | .go/.rs/.java/.py/.sql/.proto |
300
248
  | general | mixed, config, tests, unclear | .ts/.js/other |
301
249
 
302
- Resolution: `execution_config.domain_routing[domain]` fallback `domain_routing.default` ("agent").
250
+ Resolution: `execution_config.domain_routing[domain]` -> fallback `domain_routing.default` ("agent").
303
251
 
304
252
  #### Step 3: Task Execution
305
253
 
@@ -309,7 +257,7 @@ Execute tasks per plan order. Independent tasks (no cross-dependency) may run in
309
257
  ```
310
258
  Spawn Agent with:
311
259
  task definition, acceptance criteria refs, prior task summaries, specs_content
312
- Agent implements verifies convergence criteria auto-fix (max 3) returns result
260
+ Agent implements -> verifies convergence criteria -> auto-fix (max 3) -> returns result
313
261
  ```
314
262
 
315
263
  **CLI path (via maestro delegate):**
@@ -335,13 +283,13 @@ ${prior_summaries}
335
283
  " --to ${resolved_executor} --mode write --id planex-${slug}-${task_id}
336
284
  ```
337
285
 
338
- Run CLI delegate with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
286
+ Execute with `run_in_background: true`, wait for callback.
339
287
 
340
- **Deviation Rule** max 3 auto-fix attempts per task:
288
+ **Deviation Rule** -- max 3 auto-fix attempts per task:
341
289
  1. First attempt: normal dispatch
342
290
  2. Retry: `--resume planex-${slug}-${task_id}` with simplified prompt
343
291
  3. Final: fallback to Agent path
344
- 4. All 3 fail mark task `blocked`, record checkpoint, continue remaining tasks
292
+ 4. All 3 fail -> mark task `blocked`, record checkpoint, continue remaining tasks
345
293
 
346
294
  #### Step 4: Per-Task Evidence
347
295
 
@@ -353,15 +301,15 @@ Per completed task:
353
301
 
354
302
  **Skip if** `execution_config.verification_tool == "Skip"` OR `--skip-verify` OR no completed tasks.
355
303
 
356
- **Check 1: Summary Consistency** cross-check task status vs actual file changes (git diff).
304
+ **Check 1: Summary Consistency** -- cross-check task status vs actual file changes (git diff).
357
305
 
358
- **Check 2: CLI Verification Gate** — delegate to external model:
306
+ **Check 2: CLI Verification Gate:**
359
307
  ```bash
360
308
  maestro delegate "PURPOSE: Verify execution output meets acceptance criteria; success = all criteria verified with file:line evidence
361
309
  TASK:
362
310
  1. CONVERGENCE: For each criterion, read actual code, verify behavior exists, report status with evidence
363
311
  2. EXISTENCE: Verify all expected files exist on disk
364
- 3. SUBSTANCE: Verify real implementation flag stubs, placeholders, TODO-only
312
+ 3. SUBSTANCE: Verify real implementation -- flag stubs, placeholders, TODO-only
365
313
  4. ANTI-PATTERNS: Scan for TODO/FIXME/HACK, console.log debug, disabled tests
366
314
  MODE: analysis
367
315
  CONTEXT: @${modified_files}
@@ -376,11 +324,11 @@ ${modified_files.join('\n')}
376
324
  " --to ${execution_config.verification_tool} --mode analysis
377
325
  ```
378
326
 
379
- Execute with `run_in_background: true`, then wait for callback (do NOT halt the Odyssey flow).
327
+ Execute with `run_in_background: true`, wait for callback.
380
328
 
381
329
  On result:
382
- - `overall == "passed"` proceed to S_VERIFY (criteria gate) with boosted confidence
383
- - `overall == "gaps_found"` log findings, proceed to S_VERIFY (criteria will catch failures)
330
+ - `overall == "passed"` -> proceed to S_VERIFY with boosted confidence
331
+ - `overall == "gaps_found"` -> log findings, proceed to S_VERIFY (criteria will catch failures)
384
332
 
385
333
  **Check 3: Code Review** (if `execution_config.code_review_tool != "Skip"`):
386
334
  ```bash
@@ -389,13 +337,13 @@ maestro delegate "Review git diff for correctness, style, bugs" --to ${code_revi
389
337
 
390
338
  #### Step 6: Completion
391
339
 
392
- Update understanding.md §3. Mark G3 done.
340
+ Update understanding.md S3. Mark G3 done.
393
341
 
394
- 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-planex({slug}): EXECUTE 实现执行"`
342
+ Commit: `"odyssey-planex({slug}): EXECUTE -- implementation complete"`
395
343
 
396
344
  ### A_VERIFY
397
345
 
398
- Iron gate every acceptance criterion checked objectively.
346
+ Iron gate -- every acceptance criterion checked objectively.
399
347
 
400
348
  **Verify each criterion by method:**
401
349
  | Method | Action |
@@ -405,7 +353,7 @@ Iron gate — every acceptance criterion checked objectively.
405
353
  | `cli-review` | `spawn_agents_on_csv` Wave 1 (see csv_schema) |
406
354
  | `manual` | **Normal**: request_user_input / **`-y`**: record `deferred` |
407
355
 
408
- **Wave 1 cli-review verification via spawn_agents_on_csv:**
356
+ **Wave 1 -- cli-review verification via spawn_agents_on_csv:**
409
357
  ```csv
410
358
  "verify-AC1","Verify AC1","Review against criterion: {AC1.criterion}","verification","AC1","","1","pending","","",""
411
359
  ```
@@ -418,16 +366,15 @@ spawn_agents_on_csv({ csv_path: "tasks.csv", id_column: "id",
418
366
 
419
367
  Record per criterion: `{"phase":"verification","type":"criterion-check","criterion_id":"AC1","method":"","result":"passed|failed","evidence":"","iteration":N}`. Update acceptance_criteria[].status. Append to iterations[].
420
368
 
421
- Update understanding.md §4 with pass/fail table.
369
+ Update understanding.md S4 with pass/fail table.
422
370
 
423
- **Route:** all passed mark G4 done next state. Some failed + iteration < max S_FIX. Some failed + iteration >= max **Normal**: request_user_input (continue/lower bar/accept) / **`-y`**: `deferred`, proceed S_RECORD.
371
+ **Route:** all passed -> mark G4 done -> next state. Some failed + iteration < max -> S_FIX. Some failed + iteration >= max -> **Normal**: request_user_input (continue/lower bar/accept) / **`-y`**: `deferred`, proceed S_RECORD.
424
372
 
425
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): VERIFY 验收验证"`
373
+ Commit: `"odyssey-planex({slug}): VERIFY -- acceptance check"`
426
374
 
427
375
  ### A_FIX
428
-
429
376
  1. Increment current_iteration
430
- 2. For each failed criterion: diagnose gap targeted code fix
377
+ 2. For each failed criterion: diagnose gap -> targeted code fix
431
378
  3. CLI fix review (optional):
432
379
  ```bash
433
380
  maestro delegate "PURPOSE: Review fixes for failing criteria
@@ -437,15 +384,14 @@ Update understanding.md §4 with pass/fail table.
437
384
  EXPECTED: JSON {verdict, regression_risk, concerns}
438
385
  " --role review --mode analysis
439
386
  ```
440
- 4. Append evidence (fix), update understanding.md §5 S_VERIFY
387
+ 4. Append evidence (fix), update understanding.md S5 -> S_VERIFY
441
388
 
442
- 📌 **Auto-commit**: `git add -A && git commit -m "odyssey-planex({slug}): FIX 修复"`
389
+ Commit: `"odyssey-planex({slug}): FIX -- targeted repair"`
443
390
 
444
391
  ### A_GENERALIZE
445
-
446
- base A_GENERALIZE 执行。
447
-
448
- **Wave 2 — 4-agent scan via spawn_agents_on_csv:**
392
+ Base shared_actions. Planex overrides:
393
+ - Pattern source: implementation patterns
394
+ - **Wave 2 -- 4-agent scan via spawn_agents_on_csv:**
449
395
  ```csv
450
396
  "gen-syntax","Syntax Grep","Grep patterns across project","generalization","syntax","","2","pending","","",""
451
397
  "gen-semantic","Semantic Scan","Check related modules for anti-pattern","generalization","semantic","","2","pending","","",""
@@ -453,70 +399,37 @@ Update understanding.md §4 with pass/fail table.
453
399
  "gen-historical","Historical Grep","git log -S for similar patterns","generalization","historical","","2","pending","","",""
454
400
  ```
455
401
 
456
- Pattern 来源: implementation patterns。Mark G5 done.
457
-
458
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): GENERALIZE — 泛化扫描"`
402
+ Mark G5 done. Commit: `"odyssey-planex({slug}): GENERALIZE -- pattern scan"`
459
403
 
460
404
  ### A_DISCOVER
461
-
462
- 按 base A_DISCOVER 执行。Mark G6 done.
463
-
464
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): DISCOVER — 发现分类"`
405
+ Base shared_actions. Mark G6 done. Commit: `"odyssey-planex({slug}): DISCOVER -- triage complete"`
465
406
 
466
407
  ### A_RECORD
408
+ Base shared_actions. Learnings per Knowledge Persistence table.
467
409
 
468
- 1. Finalize understanding.md §8 — iteration summary, what worked, what needed rework
469
- 2. Write learnings to understanding.md §8: 按 Knowledge Persistence 表分类记录
470
- 3. Pending decisions: **Normal** → request_user_input. **`-y`** → display deferred count.
471
- 4. Goal audit: check all phase_goals[*].completion_confirmed. Mark G7 done.
472
- 5. Output completion summary:
473
- ```
474
- --- PLANEX ODYSSEY COMPLETE ---
475
- Requirement: {requirement}
476
- Criteria: {passed}/{total} passed
477
- Iterations: {N} cycles
478
- Patterns: {patterns_extracted} ({by_layer} distribution)
479
- Scan hits: {total_hits} ({cross_layer_confirmed} cross-layer confirmed)
480
- Issues: {N} created | Decisions: {N} resolved, {M} pending, {K} deferred
481
- Learnings: {N} spec entries
482
- Self-iter: {N} rounds across {M} stages
483
- Goals: {done}/{total} confirmed ({skipped} skipped)
484
- Status: {ALL_PASSED|PARTIAL|ESCALATED}
485
- ---
486
- ```
487
- 6. 其余按 base A_RECORD 执行。
410
+ **Completion summary:**
411
+ ```
412
+ --- PLANEX ODYSSEY COMPLETE ---
413
+ Requirement: {requirement}
414
+ Criteria: {passed}/{total} passed
415
+ Iterations: {N} cycles
416
+ Patterns: {patterns_extracted} ({by_layer} distribution)
417
+ Scan hits: {total_hits} ({cross_layer_confirmed} cross-layer confirmed)
418
+ Issues: {N} created | Decisions: {N} resolved, {M} pending, {K} deferred
419
+ Learnings: {N} spec entries
420
+ Self-iter: {N} rounds across {M} stages
421
+ Goals: {done}/{total} confirmed ({skipped} skipped)
422
+ Status: {ALL_PASSED|PARTIAL|ESCALATED}
423
+ ---
424
+ ```
488
425
 
489
- 📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-planex({slug}): RECORD 会话总结"`
426
+ Commit: `"odyssey-planex({slug}): RECORD -- session summary"`
490
427
 
491
428
  </actions>
492
429
 
493
430
  <appendix>
494
431
 
495
- ### Goal Prompt Template
496
-
497
- **⚠️ 时机守卫:仅在 A_INTAKE 完成后显示一次(session 创建后、开始 Plan 前)。A_RECORD 完成时禁止重新显示。**
498
-
499
- ```
500
- 📋 Planex Odyssey 会话已创建。可随时复制以下 /goal 设定终止条件(执行过程中输入即可):
501
-
502
- /goal 完成以下目标:
503
- {for each G in phase_goals where status != "skipped":}
504
- - {G.id}: {G.goal} — 完成条件: {G.done_when}
505
- {end for}
506
- 验收标准:
507
- {for each AC in acceptance_criteria:}
508
- - {AC.id}: {AC.criterion} (验证方式: {AC.verify_method})
509
- {end for}
510
- 穷尽迭代:直到 acceptance_criteria[*] 全部 status==passed
511
- 且 phase_goals_all_done=true 才停。verify 失败自动 fix→re-verify 循环。
512
- 每轮修复后重新验证,新发现的标准违反继续修,不超过 max_iterations。
513
- 遇到 phase=decision 的 pending 必须 request_user_input,不得自行 resolve。
514
- 不允许"接近通过",验收标准必须 ALL pass。
515
- ```
516
-
517
- 完成时仅输出 completion summary,不重复此提示。
518
-
519
- ### `-y` Auto-Confirm Behavior
432
+ ### `-y` planex-specific points
520
433
 
521
434
  | Decision Point | Normal | `-y` |
522
435
  |----------------|--------|------|
@@ -525,19 +438,26 @@ Pattern 来源: implementation patterns。Mark G5 done.
525
438
  | S_EXECUTE task blocked (3 retries) | request_user_input: continue or stop | auto continue, log blocked |
526
439
  | S_VERIFY manual criterion | request_user_input | `deferred` |
527
440
  | S_VERIFY max iteration reached | request_user_input | auto accept, `deferred` |
528
- | S_DISCOVER classification routing | request_user_input | auto create issue, `deferred` |
529
- | S_DISCOVER ambiguous items | request_user_input | all `deferred` |
530
- | S_RECORD decision list | request_user_input | skip |
531
- | S_RECORD goal audit | request_user_input | auto accept |
441
+
442
+ ### Goal Prompt convergence rules
443
+
444
+ ```
445
+ Stop when acceptance_criteria[*] all status==passed
446
+ AND phase_goals_all_done=true.
447
+ verify failure -> auto fix->re-verify loop.
448
+ Each fix round re-verifies; new criterion violations continue fixing, up to max_iterations.
449
+ phase=decision pending -> must request_user_input, never self-resolve.
450
+ No "close enough" -- all criteria must pass.
451
+ ```
532
452
 
533
453
  ### Iteration Model
534
454
 
535
455
  ```
536
- S_EXECUTE S_VERIFY ──all pass──→ S_GENERALIZE S_DISCOVER S_RECORD
537
-
538
- some fail + iter < max no hits ─→ S_RECORD
539
-
540
- S_FIX ──→ S_VERIFY (loop)
456
+ S_EXECUTE -> S_VERIFY --all pass--> S_GENERALIZE -> S_DISCOVER -> S_RECORD
457
+ | |
458
+ some fail + iter < max no hits -> S_RECORD
459
+ v
460
+ S_FIX --> S_VERIFY (loop)
541
461
  ```
542
462
 
543
463
  Max iterations (default 3) prevents infinite loops. Each iteration records criteria_before, gaps_fixed, criteria_after.
@@ -556,13 +476,13 @@ Max iterations (default 3) prevents infinite loops. Each iteration records crite
556
476
  </error_codes>
557
477
 
558
478
  <success_criteria>
559
- - [ ] Requirement parsed with 1 acceptance criterion (verify_method assigned)
479
+ - [ ] Requirement parsed with >=1 acceptance criterion (verify_method assigned)
560
480
  - [ ] Plan tasks mapped to criteria; execution options confirmed
561
481
  - [ ] Tasks dispatched via resolved executor with deviation rule (max 3 retries)
562
482
  - [ ] Post-execution validation gate run (unless --skip-verify)
563
- - [ ] Every criterion verified per method; failing targeted fix (not re-implementation)
483
+ - [ ] Every criterion verified per method; failing -> targeted fix (not re-implementation)
564
484
  - [ ] Iteration count tracked and max respected; unfixed criteria individually classified
565
- - [ ] understanding.md §1-§8 updated per phase; phase_goals G1-G7 audited
485
+ - [ ] understanding.md S1-S8 updated per phase; phase_goals G1-G7 audited
566
486
  - [ ] Generalization + discovery completed (unless --skip-generalize)
567
487
  - [ ] Quality Gate self-iteration triggered when insufficient
568
488
  - [ ] Goal Prompt displayed once after intake; `-y` mode: no blocking prompts