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