maestro-flow 0.4.14 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/maestro/SKILL.md +22 -42
- package/.agents/skills/maestro-plan/SKILL.md +10 -9
- package/.agents/skills/maestro-ralph/SKILL.md +61 -55
- package/.agents/skills/maestro-ralph-execute/SKILL.md +66 -109
- package/.agents/skills/manage-knowledge-audit/SKILL.md +90 -0
- package/.agy/skills/maestro/SKILL.md +22 -42
- package/.agy/skills/maestro-plan/SKILL.md +10 -9
- package/.agy/skills/maestro-ralph/SKILL.md +61 -55
- package/.agy/skills/maestro-ralph-execute/SKILL.md +66 -109
- package/.agy/skills/manage-knowledge-audit/SKILL.md +90 -0
- package/.claude/commands/maestro-plan.md +10 -9
- package/.claude/commands/maestro-ralph-execute.md +66 -109
- package/.claude/commands/maestro-ralph.md +61 -55
- package/.claude/commands/maestro.md +22 -42
- package/.claude/commands/manage-knowledge-audit.md +88 -0
- package/dist/src/cli.js +1 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/font-guide.d.ts +13 -0
- package/dist/src/commands/font-guide.d.ts.map +1 -0
- package/dist/src/commands/font-guide.js +114 -0
- package/dist/src/commands/font-guide.js.map +1 -0
- package/dist/src/commands/hooks.d.ts +30 -3
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +138 -11
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts +49 -4
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +163 -53
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +50 -10
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/ralph.d.ts +6 -0
- package/dist/src/commands/ralph.d.ts.map +1 -0
- package/dist/src/commands/ralph.js +133 -0
- package/dist/src/commands/ralph.js.map +1 -0
- package/dist/src/commands/uninstall.d.ts.map +1 -1
- package/dist/src/commands/uninstall.js +25 -38
- package/dist/src/commands/uninstall.js.map +1 -1
- package/dist/src/core/manifest.d.ts +45 -0
- package/dist/src/core/manifest.d.ts.map +1 -1
- package/dist/src/core/manifest.js +37 -1
- package/dist/src/core/manifest.js.map +1 -1
- package/dist/src/hooks/statusline.d.ts.map +1 -1
- package/dist/src/hooks/statusline.js +189 -81
- package/dist/src/hooks/statusline.js.map +1 -1
- package/dist/src/ralph/cmd-check.d.ts +9 -0
- package/dist/src/ralph/cmd-check.d.ts.map +1 -0
- package/dist/src/ralph/cmd-check.js +53 -0
- package/dist/src/ralph/cmd-check.js.map +1 -0
- package/dist/src/ralph/cmd-complete.d.ts +10 -0
- package/dist/src/ralph/cmd-complete.d.ts.map +1 -0
- package/dist/src/ralph/cmd-complete.js +91 -0
- package/dist/src/ralph/cmd-complete.js.map +1 -0
- package/dist/src/ralph/cmd-next.d.ts +5 -0
- package/dist/src/ralph/cmd-next.d.ts.map +1 -0
- package/dist/src/ralph/cmd-next.js +158 -0
- package/dist/src/ralph/cmd-next.js.map +1 -0
- package/dist/src/ralph/cmd-session.d.ts +5 -0
- package/dist/src/ralph/cmd-session.d.ts.map +1 -0
- package/dist/src/ralph/cmd-session.js +52 -0
- package/dist/src/ralph/cmd-session.js.map +1 -0
- package/dist/src/ralph/cmd-skills.d.ts +6 -0
- package/dist/src/ralph/cmd-skills.d.ts.map +1 -0
- package/dist/src/ralph/cmd-skills.js +55 -0
- package/dist/src/ralph/cmd-skills.js.map +1 -0
- package/dist/src/ralph/skill-resolver.d.ts +40 -0
- package/dist/src/ralph/skill-resolver.d.ts.map +1 -0
- package/dist/src/ralph/skill-resolver.js +162 -0
- package/dist/src/ralph/skill-resolver.js.map +1 -0
- package/dist/src/ralph/skill-scanner.d.ts +15 -0
- package/dist/src/ralph/skill-scanner.d.ts.map +1 -0
- package/dist/src/ralph/skill-scanner.js +122 -0
- package/dist/src/ralph/skill-scanner.js.map +1 -0
- package/dist/src/ralph/status-checker.d.ts +7 -0
- package/dist/src/ralph/status-checker.d.ts.map +1 -0
- package/dist/src/ralph/status-checker.js +139 -0
- package/dist/src/ralph/status-checker.js.map +1 -0
- package/dist/src/ralph/status-schema.d.ts +94 -0
- package/dist/src/ralph/status-schema.d.ts.map +1 -0
- package/dist/src/ralph/status-schema.js +9 -0
- package/dist/src/ralph/status-schema.js.map +1 -0
- package/dist/src/ralph/status-store.d.ts +20 -0
- package/dist/src/ralph/status-store.d.ts.map +1 -0
- package/dist/src/ralph/status-store.js +70 -0
- package/dist/src/ralph/status-store.js.map +1 -0
- package/dist/src/tui/install-ui/ExecutionView.d.ts.map +1 -1
- package/dist/src/tui/install-ui/ExecutionView.js +14 -5
- package/dist/src/tui/install-ui/ExecutionView.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +89 -45
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +28 -14
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +1 -1
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/dist/src/tui/uninstall-ui/UninstallFlow.d.ts.map +1 -1
- package/dist/src/tui/uninstall-ui/UninstallFlow.js +12 -28
- package/dist/src/tui/uninstall-ui/UninstallFlow.js.map +1 -1
- package/dist/src/utils/update-notices.js +12 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/workflows/knowledge-audit.md +358 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maestro
|
|
3
3
|
description: Auto-route intent to optimal command chain
|
|
4
|
-
argument-hint: "<intent> [-y] [-c] [--dry-run] [--
|
|
4
|
+
argument-hint: "<intent> [-y] [-c] [--dry-run] [--super]"
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- read_file
|
|
7
7
|
- write_file
|
|
@@ -42,22 +42,20 @@ $ARGUMENTS — user intent text, or special keywords.
|
|
|
42
42
|
- `-y` / `--yes` — Auto mode: skip clarification, skip confirmation, auto-skip on errors
|
|
43
43
|
- `-c` / `--continue` — Resume previous session
|
|
44
44
|
- `--dry-run` — Show chain without executing
|
|
45
|
-
- `--exec <mode>` — `auto` (default), `cli`, `internal`
|
|
46
|
-
- `--tool <name>` — CLI tool for delegates (default: claude)
|
|
47
45
|
- `--super` — Read and follow `maestro-super.md`
|
|
48
46
|
</context>
|
|
49
47
|
|
|
50
48
|
<invariants>
|
|
51
49
|
1. **All chains dispatch via maestro-ralph-execute** — maestro never executes steps directly
|
|
52
50
|
2. **Session before execution** — status.json created before any step runs
|
|
53
|
-
3. **Auto
|
|
51
|
+
3. **Auto flag pass-through** — 仅当用户传入 `-y` 时透传 `-y` 到 skill args
|
|
54
52
|
4. **Decomposition contract shared with maestro-ralph** — broad/lifecycle intents run S_DECOMPOSE producing the SAME additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`)。Reference maestro-ralph `A_DECOMPOSE_TASKS`
|
|
55
53
|
5. **status.json 唯一真源** — 不生成 `goal-checklist.md` 或外部清单
|
|
56
|
-
6.
|
|
57
|
-
7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro
|
|
58
|
-
8. **D-007 milestone 反查** — 数字 phase
|
|
59
|
-
9. **每个 step 必须 `completion_confirmed: true`** —
|
|
60
|
-
10. **schema
|
|
54
|
+
6. **执行步骤统一通过 `maestro ralph next` 加载** — `command_scope`/`command_path` 由 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global);decision 节点不走 CLI,走 `invoke_skill("maestro-ralph")` handoff
|
|
55
|
+
7. **Topology awareness** — chain catalog 含 brainstorm / blueprint / analyze-macro / analyze / roadmap / plan(三路径) / execute / verify / ...;scope_verdict 由 ralph 在 `post-analyze-scope` 决定
|
|
56
|
+
8. **D-007 milestone 反查** — 数字 phase 的 `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查
|
|
57
|
+
9. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE|DONE_WITH_CONCERNS` 写入
|
|
58
|
+
10. **schema** — `ralph_protocol_version: "1"` 标记 CLI-driven session;新增字段全部可选
|
|
61
59
|
</invariants>
|
|
62
60
|
|
|
63
61
|
<state_machine>
|
|
@@ -143,7 +141,7 @@ S_FALLBACK:
|
|
|
143
141
|
- 数字 phase 上下文 → `analyze {phase}` → `plan {phase}` → `execute {phase}` → `verify {phase}` → quality pipeline
|
|
144
142
|
- 已有 analyze artifact 想直达执行 → `plan --from analyze:{ANL_ID}` → execute → verify
|
|
145
143
|
- 已有 blueprint artifact → `plan --from blueprint:{BLP_ID}` → execute → verify
|
|
146
|
-
4.
|
|
144
|
+
4. 执行 step:`shell("maestro ralph skills --json --quiet")` 预校验 skill 名,命中写绝对路径到 `command_path`,未命中标 `missing`;同时写 `step.stage` / `step.scope` / `step.source_artifact_ref`。decision 节点不解析 command_path
|
|
147
145
|
|
|
148
146
|
### A_CLARIFY
|
|
149
147
|
|
|
@@ -159,9 +157,9 @@ S_FALLBACK:
|
|
|
159
157
|
3. 派生 `execution_criteria` + `task_decomposition`(每个 sub-goal 含 `done_when` + `evidence` + `lifecycle` + `completion_confirmed: false`)
|
|
160
158
|
4. **status.json 唯一真源**:写入 `boundary_contract` / `execution_criteria` / `task_decomposition`;不生成 markdown 清单
|
|
161
159
|
5. 在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前追加 `decision:post-goal-audit`。ralph-execute 在该节点按需动态生长 `steps[]`
|
|
162
|
-
6. **输出 `/goal`
|
|
160
|
+
6. **输出 `/goal` 绑定提示词(不阻塞,用户可在执行过程中随时输入):**
|
|
163
161
|
```
|
|
164
|
-
📋
|
|
162
|
+
📋 任务分解完成。可随时复制下面一行设定目标(执行过程中输入即可):
|
|
165
163
|
|
|
166
164
|
/goal 目标达成条件: {session_dir}/status.json 中 task_decomposition[*].status == "done" 且 task_decomposition[*].completion_confirmed == true 且 steps[*].completion_confirmed == true。未达成时:阅读 {session_dir}/status.json 取得 execution_criteria / boundary_contract / task_decomposition / steps 作为行动手册,调用 /maestro-ralph continue 推进;严禁手动执行 skill 或越界修改 status.json.boundary_contract.out_of_scope。
|
|
167
165
|
```
|
|
@@ -173,29 +171,28 @@ S_FALLBACK:
|
|
|
173
171
|
```json
|
|
174
172
|
{
|
|
175
173
|
"session_id", "source": "maestro", "intent", "task_type", "chain_name",
|
|
174
|
+
"ralph_protocol_version": "1", "active_step_index": null,
|
|
176
175
|
"phase", "phase_is_new": false, "milestone": "",
|
|
177
176
|
"scope_verdict": null, "analyze_macro_id": null, "blueprint_id": null,
|
|
178
|
-
"auto_mode": false, "
|
|
177
|
+
"auto_mode": false, "cli_tool": "claude",
|
|
179
178
|
"context": { "scratch_dir": null, "plan_dir": null, "analysis_dir": null,
|
|
180
179
|
"brainstorm_dir": null, "blueprint_dir": null, "issue_id": null },
|
|
181
180
|
"steps": [{
|
|
182
|
-
"index": 0, "
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"command_scope": "global|project|missing|null",
|
|
186
|
-
"command_path": "~/.claude/commands/{name}.md | .claude/commands/{name}.md | null",
|
|
181
|
+
"index": 0, "skill": "", "args": "",
|
|
182
|
+
"stage": "", "scope": null, "decision": null,
|
|
183
|
+
"command_scope": "global|project|missing|null", "command_path": "<abs> | null",
|
|
187
184
|
"milestone_id": null, "source_artifact_ref": null,
|
|
188
185
|
"status": "pending", "goal_ref": null,
|
|
189
186
|
"completion_confirmed": false, "completion_status": null,
|
|
190
|
-
"completion_evidence": null, "completed_at": null
|
|
187
|
+
"completion_evidence": null, "completed_at": null,
|
|
188
|
+
"deferred_reads": [], "load": null
|
|
191
189
|
}],
|
|
192
190
|
"waves": [], "current_step": 0, "status": "running",
|
|
193
191
|
"boundary_contract": {}, "execution_criteria": [],
|
|
194
192
|
"task_decomposition": [], "task_decomposition_all_done": false
|
|
195
193
|
}
|
|
196
194
|
```
|
|
197
|
-
|
|
198
|
-
3. Validate: 所有 step 的 `command_scope != "missing"`;否则 raise E005 列出缺失 skill
|
|
195
|
+
3. Validate: 所有 step 的 `command_scope != "missing"`,否则 raise E005 列出缺失 skill
|
|
199
196
|
4. Initialize tracking via `track_tasks`
|
|
200
197
|
5. If `--super`: read `maestro-super.md`, follow it completely
|
|
201
198
|
|
|
@@ -205,25 +202,6 @@ S_FALLBACK:
|
|
|
205
202
|
|
|
206
203
|
<appendix>
|
|
207
204
|
|
|
208
|
-
### Auto-Yes Flag Map
|
|
209
|
-
|
|
210
|
-
| Command | Auto Flag | Effect |
|
|
211
|
-
|---------|-----------|--------|
|
|
212
|
-
| maestro-init | `-y` | Skip interactive questioning |
|
|
213
|
-
| maestro-analyze | `-y` | Skip scoping, auto-deepen |
|
|
214
|
-
| maestro-brainstorm | `-y` | Skip questions, use defaults |
|
|
215
|
-
| maestro-blueprint | `-y` | Skip interview, use recommended defaults |
|
|
216
|
-
| maestro-roadmap | `-y` | Skip questions (create/revise/review) |
|
|
217
|
-
| maestro-impeccable | `-y` | Auto-select design variant + skip confirmations |
|
|
218
|
-
| maestro-plan | `-y` | Skip confirmations and clarification |
|
|
219
|
-
| maestro-execute | `-y` | Skip confirmations, blocked auto-continue |
|
|
220
|
-
| quality-auto-test | `-y` | Skip plan confirmation |
|
|
221
|
-
| quality-test | `-y --auto-fix` | Auto-trigger gap-fix loop |
|
|
222
|
-
| quality-retrospective | `-y` | Accept all routing recommendations |
|
|
223
|
-
| maestro-milestone-complete | `-y` | Skip knowledge promotion |
|
|
224
|
-
|
|
225
|
-
Unlisted commands have no auto flags.
|
|
226
|
-
|
|
227
205
|
### Error Codes
|
|
228
206
|
|
|
229
207
|
| Code | Severity | Description | Recovery |
|
|
@@ -248,8 +226,10 @@ Unlisted commands have no auto flags.
|
|
|
248
226
|
- [ ] status.json 唯一真源;无 markdown 清单;post-goal-audit 节点在 decomposed 时追加;/goal 提示词以 status.json 为判据
|
|
249
227
|
- [ ] Chain selected and confirmed (or auto-confirmed)
|
|
250
228
|
- [ ] Session dir created with status.json before execution; decomposition fields additive-only
|
|
251
|
-
- [ ]
|
|
252
|
-
- [ ]
|
|
229
|
+
- [ ] 执行 step 含 `command_scope` + `command_path` + `completion_confirmed`;decision step 由 `step.decision` 标识
|
|
230
|
+
- [ ] `command_scope`/`command_path` 由 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global)
|
|
231
|
+
- [ ] Session schema 含 `ralph_protocol_version: "1"` + `active_step_index: null` + step.load 占位
|
|
232
|
+
- [ ] 用户传入 `-y` 时透传到 skill args
|
|
253
233
|
- [ ] All chains dispatched via maestro-ralph-execute
|
|
254
234
|
- [ ] Low-complexity intents routed to maestro-quick
|
|
255
235
|
- [ ] (super) Requirements validated before roadmap
|
|
@@ -136,18 +136,19 @@ Next steps:
|
|
|
136
136
|
/maestro-plan {phase} -- Re-plan with modifications
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
**Completion
|
|
139
|
+
**Completion (when invoked from ralph):**
|
|
140
|
+
End the step by calling the CLI (no `--- COMPLETION STATUS ---` text block):
|
|
140
141
|
```
|
|
141
|
-
|
|
142
|
-
STATUS: DONE|NEEDS_CONTEXT
|
|
143
|
-
CONCERNS: {description if applicable}
|
|
144
|
-
NEXT: /maestro-execute
|
|
145
|
-
--- END STATUS ---
|
|
142
|
+
maestro ralph complete <idx> --status DONE [--evidence scratch/{YYYYMMDD}-plan-P{N}-{slug}/plan.json]
|
|
146
143
|
```
|
|
147
144
|
|
|
148
|
-
|
|
149
|
-
- **DONE** — Plan created/revised and confirmed →
|
|
150
|
-
- **
|
|
145
|
+
STATUS verdicts (CLI-enforced enum):
|
|
146
|
+
- **DONE** — Plan created/revised and confirmed → next step picks up automatically
|
|
147
|
+
- **DONE_WITH_CONCERNS** — Plan produced but with explicit caveats; pass `--concerns "..."`
|
|
148
|
+
- **NEEDS_RETRY** — Plan failed (tooling error, transient issue); ralph will retry
|
|
149
|
+
- **BLOCKED** — External hard blocker (e.g., upstream artifact missing, dependency unavailable); pass `--reason "..."`
|
|
150
|
+
|
|
151
|
+
> Ambiguous requirements are NOT a completion status — resolve them in-place via `ask_user` during planning (≤3 rounds), then proceed to DONE. `NEEDS_CONTEXT` has been removed; context shortage is handled by the harness's automatic compaction.
|
|
151
152
|
|
|
152
153
|
### Mode: Revise / Check
|
|
153
154
|
|
|
@@ -19,7 +19,7 @@ Closed-loop decision engine for the maestro workflow lifecycle.
|
|
|
19
19
|
Reads project state → infers position → builds adaptive chain → delegates execution.
|
|
20
20
|
|
|
21
21
|
Entry points:
|
|
22
|
-
- **`/maestro-ralph "intent"`** — New session: infer → decompose → build →
|
|
22
|
+
- **`/maestro-ralph "intent"`** — New session: infer → decompose → build → emit /goal prompt(如有 decomposition)→ dispatch ralph-execute
|
|
23
23
|
- **`/maestro-ralph continue`** — Wrapper; dispatches to ralph-execute(首选直接 `/maestro-ralph-execute` 推进 step)
|
|
24
24
|
- **`/maestro-ralph status`** — Display session progress
|
|
25
25
|
|
|
@@ -27,10 +27,9 @@ Entry points:
|
|
|
27
27
|
|
|
28
28
|
Initial decomposition (S_DECOMPOSE): boundary-clarified via ≤3 questions for broad intents (重构/全面/迁移/重写). 写入 status.json 的 `boundary_contract` / `execution_criteria` / `task_decomposition`,附 `/goal` prompt。
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
- **decision**:
|
|
33
|
-
- **external**: 仅在显式声明时使用(`maestro delegate --to claude`)
|
|
30
|
+
Step kinds:
|
|
31
|
+
- **执行 step**: ralph-execute 调 `shell("maestro ralph next")` 加载 command .md + required_reading 全文,按 stdout 内联执行
|
|
32
|
+
- **decision step**: `step.decision` 字段非空;回 ralph 评估(CLI 只读分析)
|
|
34
33
|
|
|
35
34
|
Key difference from maestro coordinator:
|
|
36
35
|
- maestro: static chain → one-time selection → runs all steps
|
|
@@ -47,9 +46,9 @@ Mutual invocation with `/maestro-ralph-execute` forms a self-perpetuating work l
|
|
|
47
46
|
│ writes status.json
|
|
48
47
|
│ emits /goal prompt
|
|
49
48
|
▼
|
|
50
|
-
ralph-execute ◀─┐
|
|
51
|
-
│ │ decision → invoke_skill("maestro-ralph")
|
|
52
|
-
└─────────┘ writes step.completion_confirmed
|
|
49
|
+
ralph-execute ◀─┐ 执行 step → `maestro ralph next` + inline + `ralph complete`
|
|
50
|
+
│ │ decision step → invoke_skill("maestro-ralph")
|
|
51
|
+
└─────────┘ CLI writes step.completion_confirmed
|
|
53
52
|
loop until all completion_confirmed | paused
|
|
54
53
|
```
|
|
55
54
|
</purpose>
|
|
@@ -72,14 +71,14 @@ Remaining → intent
|
|
|
72
71
|
|
|
73
72
|
<invariants>
|
|
74
73
|
1. **Ralph never executes steps** — only creates sessions and evaluates decisions
|
|
75
|
-
2. **Handoff via invoke_skill("maestro-ralph-execute")** —
|
|
74
|
+
2. **Handoff via invoke_skill("maestro-ralph-execute")** — 创建 session 后始终自动 handoff;decision 评估后始终 handoff
|
|
76
75
|
3. **Decision delegates read-only** — `maestro delegate --role analyze --mode analysis`
|
|
77
|
-
4.
|
|
76
|
+
4. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(详见 invariant 8)
|
|
78
77
|
5. **status.json 是唯一真源** — 不生成 markdown 清单或侧文件
|
|
79
|
-
6. **每个 step 必须 `completion_confirmed: true`** —
|
|
80
|
-
7. **command_path 在 A_BUILD_STEPS 解析** —
|
|
81
|
-
8.
|
|
82
|
-
9. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;`/goal` 用户绑定,ralph
|
|
78
|
+
6. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
|
|
79
|
+
7. **command_path 在 A_BUILD_STEPS 解析** — 通过 `maestro ralph skills --json --quiet` 预校验(project 覆盖 global),命中即写绝对路径到 status.json;未命中标 `command_scope = "missing"`
|
|
80
|
+
8. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成:解析 frontmatter + `<required_reading>` + `<deferred_reading>`,自动读取 required 文件全文并拼入 prompt;缺失 required → 退出码 1(E007),pause session。ralph build 阶段只通过 `maestro ralph skills` 校验路径存在性,不读 .md 内容
|
|
81
|
+
9. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻;`/goal` 用户绑定,ralph 输出提示词后继续 handoff,用户可在执行过程中随时输入 `/goal`
|
|
83
82
|
10. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
|
|
84
83
|
11. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop;字段可选/累加,既有字段不删不改
|
|
85
84
|
</invariants>
|
|
@@ -151,9 +150,8 @@ S_BUILD_CHAIN:
|
|
|
151
150
|
→ S_CREATE_SESSION DO: A_BUILD_STEPS
|
|
152
151
|
|
|
153
152
|
S_CREATE_SESSION:
|
|
154
|
-
→
|
|
155
|
-
→
|
|
156
|
-
→ S_DISPATCH WHEN: auto_confirm AND no decomposition DO: A_CREATE_SESSION
|
|
153
|
+
→ S_CONFIRM WHEN: not auto_confirm DO: A_CREATE_SESSION
|
|
154
|
+
→ S_DISPATCH WHEN: auto_confirm DO: A_CREATE_SESSION
|
|
157
155
|
|
|
158
156
|
S_CONFIRM:
|
|
159
157
|
→ S_DISPATCH WHEN: user selects "Proceed"
|
|
@@ -163,7 +161,7 @@ S_CONFIRM:
|
|
|
163
161
|
S_DISPATCH:
|
|
164
162
|
→ END DO: invoke_skill({ skill: "maestro-ralph-execute" })
|
|
165
163
|
|
|
166
|
-
S_DECISION_EVAL:
|
|
164
|
+
S_DECISION_EVAL: (decision 节点 == `step.decision` 非空,下述 gate 名取自该字段)
|
|
167
165
|
→ S_APPLY_VERDICT WHEN: quality-gate (post-verify, post-business-test, post-review, post-test)
|
|
168
166
|
DO: A_DELEGATE_EVALUATE
|
|
169
167
|
→ S_APPLY_VERDICT WHEN: goal-gate (post-goal-audit)
|
|
@@ -202,7 +200,7 @@ S_FALLBACK:
|
|
|
202
200
|
|
|
203
201
|
1. Find latest ralph session (by created_at)
|
|
204
202
|
2. Display: Session, Status, Position, Progress, Current step
|
|
205
|
-
3. List steps: [✓] completion_confirmed, [▸] current, [ ] pending, [◆] decision
|
|
203
|
+
3. List steps: [✓] completion_confirmed, [▸] current, [ ] pending, [◆] decision(`step.decision` 非空);执行 step 附 `command_scope`(global/project) + `command_path`
|
|
206
204
|
4. If `task_decomposition` present (absent → skip):
|
|
207
205
|
```
|
|
208
206
|
Sub-goals ({done}/{total}) source: {session_dir}/status.json#/task_decomposition
|
|
@@ -382,24 +380,26 @@ narrow → derive defaults from intent + codebase, skip questions.
|
|
|
382
380
|
|
|
383
381
|
Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
384
382
|
|
|
385
|
-
| Stage | invoke_skill(independent) | invoke_skill(unified) |
|
|
386
|
-
|
|
387
|
-
| brainstorm | `maestro-brainstorm "{intent}"` | *(same)* |
|
|
388
|
-
| blueprint | `maestro-blueprint "{intent}"` | *(same)* |
|
|
389
|
-
| init | `maestro-init` | *(same)* |
|
|
390
|
-
| analyze-macro | `maestro-analyze "{intent}"` | *(same)* |
|
|
391
|
-
| roadmap | `maestro-roadmap --from analyze:{analyze_macro_id}` | *(same)* |
|
|
392
|
-
| analyze | `maestro-analyze {phase}` | `maestro-analyze` |
|
|
393
|
-
| plan | `maestro-plan {phase}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` |
|
|
394
|
-
| execute | `maestro-execute {phase}` | `maestro-execute` |
|
|
395
|
-
| verify | `maestro-verify {phase}` | `maestro-verify` |
|
|
396
|
-
| business-test | `quality-auto-test {phase}` | `quality-auto-test` |
|
|
397
|
-
| review | `quality-review {phase}` | `quality-review` |
|
|
398
|
-
| test-gen | `quality-auto-test {phase}` | `quality-auto-test` |
|
|
399
|
-
| test | `quality-test {phase}` | `quality-test` |
|
|
400
|
-
| milestone-audit | `maestro-milestone-audit` | *(same)* |
|
|
401
|
-
| goal-audit | *(decision-only)* | *(same)* |
|
|
402
|
-
| milestone-complete | `maestro-milestone-complete` | *(same)* |
|
|
383
|
+
| Stage | invoke_skill(independent) | invoke_skill(unified) | Decision after | quality_mode |
|
|
384
|
+
|-------|---------------------|-----------------|----------------|--------------|
|
|
385
|
+
| brainstorm | `maestro-brainstorm "{intent}"` | *(same)* | — | all |
|
|
386
|
+
| blueprint | `maestro-blueprint "{intent}"` | *(same)* | — | all |
|
|
387
|
+
| init | `maestro-init` | *(same)* | — | all |
|
|
388
|
+
| analyze-macro | `maestro-analyze "{intent}"` | *(same)* | `post-analyze-scope` | all |
|
|
389
|
+
| roadmap | `maestro-roadmap --from analyze:{analyze_macro_id}` | *(same)* | — | all |
|
|
390
|
+
| analyze | `maestro-analyze {phase}` | `maestro-analyze` | — | all |
|
|
391
|
+
| plan | `maestro-plan {phase}` *(scope=phase)* / `maestro-plan --from analyze:{analyze_macro_id}` *(scope=standalone)* / `maestro-plan --from blueprint:{blueprint_id}` *(scope=standalone)* | `maestro-plan` | — | all |
|
|
392
|
+
| execute | `maestro-execute {phase}` | `maestro-execute` | — | all |
|
|
393
|
+
| verify | `maestro-verify {phase}` | `maestro-verify` | `post-verify` | all |
|
|
394
|
+
| business-test | `quality-auto-test {phase}` | `quality-auto-test` | `post-business-test` | full only |
|
|
395
|
+
| review | `quality-review {phase}` | `quality-review` | `post-review` | all (quick: append `--tier quick`) |
|
|
396
|
+
| test-gen | `quality-auto-test {phase}` | `quality-auto-test` | — | full / standard if coverage<80% |
|
|
397
|
+
| test | `quality-test {phase}` | `quality-test` | `post-test` | full, standard |
|
|
398
|
+
| milestone-audit | `maestro-milestone-audit` | *(same)* | — | all |
|
|
399
|
+
| goal-audit | *(decision-only)* | *(same)* | `post-goal-audit` | all (only if decomposed) |
|
|
400
|
+
| milestone-complete | `maestro-milestone-complete` | *(same)* | `post-milestone` | all |
|
|
401
|
+
|
|
402
|
+
> 所有执行 stage 统一通过 `maestro ralph next` CLI 加载 + 内联执行;decision 节点单独作为独立 step 插入(见规则 4)。
|
|
403
403
|
|
|
404
404
|
**Build rules (按顺序应用):**
|
|
405
405
|
|
|
@@ -407,18 +407,19 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
|
407
407
|
1. **起点**:从 `session.lifecycle_position` 开始
|
|
408
408
|
2. **跳过已完成**:跳过当前 milestone+phase 下已有 completed artifact 的 stage(按 `session.phase` 过滤);unified 按 milestone 过滤
|
|
409
409
|
3. **quality_mode 过滤**:按 `session.quality_mode` 排除不匹配 stage
|
|
410
|
-
4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{
|
|
410
|
+
4. **决策节点**:每个 Decision after 非空的 stage 之后插入 `{ decision: "<gate>", retry_count: 0, max_retries: 2, command_scope: null, command_path: null }`
|
|
411
411
|
5. **goal-audit 插入**:`task_decomposition` 存在时,在最后一个 evidence-producing stage(verify/review/test)之后、`milestone-complete` 之前插入 `decision:post-goal-audit`
|
|
412
412
|
6. **终点硬约束**:chain 以 `milestone-complete` 结尾
|
|
413
413
|
7. **goal_ref 传播**:`task_decomposition` 存在时,每个 step 按 `step.stage ∈ g.lifecycle` 匹配 `step.goal_ref = g.id`(多匹配取字典序最小);decision 节点不打 goal_ref
|
|
414
414
|
8. **占位符**:independent 保留 `{phase}` `{intent}`;unified 不带 `{phase}`
|
|
415
|
-
9. **command_path
|
|
415
|
+
9. **command_path 解析**(每个执行 step,decision 节点跳过):
|
|
416
416
|
- 取 skill 名(args 前的第一个 token)
|
|
417
|
-
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
417
|
+
- **预校验通过 `shell("maestro ralph skills --json --quiet")`** 一次性拉取所有可用 commands + skills(global + project,project 覆盖 global),匹配 skill 名得到:
|
|
418
|
+
- 命中 commands → `command_scope = "global" | "project"`,`command_path = <绝对路径>`
|
|
419
|
+
- 命中 skills → 同上(type=skill)
|
|
420
|
+
- 未命中 → `command_scope = "missing"`, `command_path = null`,A_CREATE_SESSION 报错 E006
|
|
421
|
+
- **不在 build 阶段读取 .md 内容**;`<required_reading>` / `<deferred_reading>` 解析与加载由 `maestro ralph next` CLI 在执行期完成
|
|
422
|
+
10. **每个 step 初始化** `completion_confirmed: false`, `completion_status: null`, `completion_evidence: null`, `deferred_reads: []`, `load: null`(由 `ralph next` 写入)
|
|
422
423
|
11. **scope_verdict gating**(仅当 chain 起点 = `analyze-macro`):
|
|
423
424
|
- `scope_verdict ∈ {medium, small}` → 跳过 `roadmap` + `analyze` 两 stage;`plan` 选 standalone 列(`--from analyze:{analyze_macro_id}`),不带 `{phase}`
|
|
424
425
|
- `scope_verdict == large` → 保留 `roadmap` + `analyze`;`plan` 选 phase 列(`{phase}`)
|
|
@@ -436,7 +437,7 @@ Generate steps from `session.lifecycle_position` to `milestone-complete`.
|
|
|
436
437
|
1. Validate: 所有 step 的 `command_scope != "missing"`;否则 raise E006 + 列出缺失 skill
|
|
437
438
|
2. Write `.workflow/.maestro/ralph-{YYYYMMDD-HHmmss}/status.json` (Appendix: Session Schema)
|
|
438
439
|
3. Display chain overview:每步显示 `{index}. {skill} [{type}] [{command_scope}]`
|
|
439
|
-
4. If `task_decomposition` present: display **Goal Prompt block** (Appendix)
|
|
440
|
+
4. If `task_decomposition` present: display **Goal Prompt block** (Appendix),不阻塞流程,继续 handoff
|
|
440
441
|
|
|
441
442
|
### A_DELEGATE_EVALUATE
|
|
442
443
|
|
|
@@ -597,6 +598,8 @@ Runs only when `task_decomposition` present.
|
|
|
597
598
|
{
|
|
598
599
|
"session_id": "ralph-{YYYYMMDD-HHmmss}",
|
|
599
600
|
"source": "ralph", "status": "running",
|
|
601
|
+
"ralph_protocol_version": "1", // CLI-driven; absent/0 → legacy inline ralph-execute
|
|
602
|
+
"active_step_index": null, // CLI-managed; only one step held at a time
|
|
600
603
|
"intent": "", "lifecycle_position": "",
|
|
601
604
|
"phase": null, "phase_is_new": false,
|
|
602
605
|
"milestone": "", // D-007 反查结果,禁止读 current_milestone
|
|
@@ -611,13 +614,15 @@ Runs only when `task_decomposition` present.
|
|
|
611
614
|
"analysis_dir": null, "brainstorm_dir": null, "blueprint_dir": null },
|
|
612
615
|
"steps": [{
|
|
613
616
|
"index": 0,
|
|
614
|
-
"
|
|
615
|
-
"skill": "",
|
|
617
|
+
"skill": "", // 执行 step 有值;decision 节点为空字符串/null
|
|
616
618
|
"args": "",
|
|
617
619
|
"stage": "", // brainstorm|blueprint|init|analyze-macro|roadmap|analyze|plan|execute|verify|...
|
|
618
620
|
"scope": null, // "phase"|"standalone"|"milestone"|null(plan 等需要)
|
|
619
|
-
"
|
|
620
|
-
"
|
|
621
|
+
"decision": null, // 非 null → decision 节点(值为 gate 名,如 "post-verify");null → 执行 step
|
|
622
|
+
"retry_count": 0, // decision 节点专用
|
|
623
|
+
"max_retries": 2, // decision 节点专用
|
|
624
|
+
"command_scope": "global|project|missing|null", // 执行 step;decision 节点固定 null
|
|
625
|
+
"command_path": "<absolute path resolved by `maestro ralph skills --json --quiet`> | null",
|
|
621
626
|
"milestone_id": null, // D-007 反查注入;仅含 {phase} 占位符的 step 有
|
|
622
627
|
"source_artifact_ref": null, // "analyze:ANL-xxx" | "blueprint:BLP-xxx" | null
|
|
623
628
|
"status": "pending|running|completed|skipped|failed",
|
|
@@ -626,7 +631,8 @@ Runs only when `task_decomposition` present.
|
|
|
626
631
|
"completion_status": null,
|
|
627
632
|
"completion_evidence": null,
|
|
628
633
|
"completed_at": null,
|
|
629
|
-
"deferred_reads": []
|
|
634
|
+
"deferred_reads": [], // 由 ralph next CLI 解析 .md 时填充
|
|
635
|
+
"load": null // { loaded_at, required_files[], deferred_files[], resolve_version } —— 由 ralph next 写入
|
|
630
636
|
}],
|
|
631
637
|
"waves": [], "current_step": 0,
|
|
632
638
|
|
|
@@ -648,7 +654,7 @@ Runs only when `task_decomposition` present.
|
|
|
648
654
|
|
|
649
655
|
### Fix-Loop Templates
|
|
650
656
|
|
|
651
|
-
|
|
657
|
+
所有插入的执行 step 按 A_BUILD_STEPS 规则 9 解析 `command_path` + `command_scope`;`decision:*` 条目为 decision 节点(`step.decision` 字段)。
|
|
652
658
|
|
|
653
659
|
**post-verify:**
|
|
654
660
|
```
|
|
@@ -710,12 +716,12 @@ decision:post-goal-audit {retry+1}
|
|
|
710
716
|
链路概览后逐字显示(仅当 decomposition 已产出):
|
|
711
717
|
|
|
712
718
|
```
|
|
713
|
-
📋
|
|
719
|
+
📋 任务分解完成。可随时复制以下 /goal 设定终止条件(执行过程中输入即可):
|
|
714
720
|
|
|
715
721
|
/goal 直到 {session_dir}/status.json 的 task_decomposition[*] 与 steps[*] 全部 completion_confirmed=true 才停。每轮以 status.json 为唯一行动手册,通过 /maestro-ralph-execute 推进 step;decision 节点由其自动 handoff 回 ralph 评估。禁止手动执行 skill 或修改 boundary_contract.out_of_scope。
|
|
716
722
|
```
|
|
717
723
|
|
|
718
|
-
`/goal` 由用户输入;ralph
|
|
724
|
+
`/goal` 由用户输入;ralph 输出提示词后继续 handoff,不阻塞。
|
|
719
725
|
|
|
720
726
|
### Error Codes
|
|
721
727
|
|
|
@@ -747,8 +753,8 @@ decision:post-goal-audit {retry+1}
|
|
|
747
753
|
- [ ] quality_mode 由 A_DETERMINE_QUALITY_MODE 决定,过滤 build steps
|
|
748
754
|
- [ ] Decomposition: broad intent ≤3 question clarify;narrow auto-derive
|
|
749
755
|
- [ ] status.json 唯一真源:boundary_contract + execution_criteria + task_decomposition;无外部清单
|
|
750
|
-
- [ ]
|
|
751
|
-
- [ ] Ralph build
|
|
756
|
+
- [ ] 执行 step 含 `command_scope` + `command_path`(通过 `maestro ralph skills --json --quiet` 预校验,project 覆盖 global);decision step 通过 `step.decision` 字段标识
|
|
757
|
+
- [ ] Ralph build 阶段只通过 `ralph skills` 校验路径存在性,不读 .md 内容;`<required_reading>` 加载由 `maestro ralph next` CLI 完成
|
|
752
758
|
- [ ] 每个 step 含 `completion_confirmed` + `completion_status` + `completion_evidence` + `deferred_reads`(初始 false/null/[])
|
|
753
759
|
- [ ] 每个 sub-goal 含 `completion_confirmed`(初始 false)
|
|
754
760
|
- [ ] post-goal-audit decision 仅在 decomposed 时插入,位于 milestone-complete 之前
|