maestro-flow 0.3.46 → 0.3.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/ui-design-agent.md +1 -0
- package/.claude/agents/workflow-executor.md +3 -0
- package/.claude/commands/learn-decompose.md +91 -146
- package/.claude/commands/learn-follow.md +102 -137
- package/.claude/commands/learn-investigate.md +102 -167
- package/.claude/commands/learn-retro.md +100 -243
- package/.claude/commands/learn-second-opinion.md +95 -135
- package/.claude/commands/maestro-amend.md +95 -232
- package/.claude/commands/maestro-analyze.md +1 -6
- package/.claude/commands/maestro-collab.md +104 -265
- package/.claude/commands/maestro-composer.md +113 -293
- package/.claude/commands/maestro-execute.md +10 -17
- package/.claude/commands/maestro-impeccable.md +89 -0
- package/.claude/commands/maestro-plan.md +1 -6
- package/.claude/commands/maestro-player.md +111 -340
- package/.claude/commands/maestro-quick.md +9 -0
- package/.claude/commands/maestro-ralph-execute.md +167 -210
- package/.claude/commands/maestro-ralph.md +245 -426
- package/.claude/commands/maestro-ui-codify.md +13 -0
- package/.claude/commands/maestro-ui-craft.md +364 -0
- package/.claude/commands/maestro-ui-design.md +12 -1
- package/.claude/commands/maestro-verify.md +12 -13
- package/.claude/commands/maestro.md +142 -72
- package/.claude/commands/manage-knowhow-capture.md +45 -170
- package/.claude/commands/quality-auto-test.md +9 -0
- package/.claude/commands/quality-debug.md +11 -25
- package/.claude/commands/quality-refactor.md +9 -0
- package/.claude/commands/quality-review.md +5 -14
- package/.claude/commands/spec-add.md +1 -1
- package/.claude/commands/spec-load.md +3 -2
- package/.claude/skills/maestro-impeccable/SKILL.md +169 -0
- package/.codex/skills/learn-decompose/SKILL.md +1 -1
- package/.codex/skills/learn-investigate/SKILL.md +2 -1
- package/.codex/skills/maestro/SKILL.md +420 -313
- package/.codex/skills/maestro-analyze/SKILL.md +126 -417
- package/.codex/skills/maestro-brainstorm/SKILL.md +129 -451
- package/.codex/skills/maestro-collab/SKILL.md +134 -547
- package/.codex/skills/maestro-execute/SKILL.md +3 -1
- package/.codex/skills/maestro-impeccable/SKILL.md +112 -0
- package/.codex/skills/maestro-plan/SKILL.md +88 -437
- package/.codex/skills/maestro-player/SKILL.md +191 -333
- package/.codex/skills/maestro-quick/SKILL.md +2 -0
- package/.codex/skills/maestro-ralph/SKILL.md +327 -710
- package/.codex/skills/maestro-roadmap/SKILL.md +201 -518
- package/.codex/skills/maestro-ui-codify/SKILL.md +1 -0
- package/.codex/skills/maestro-ui-craft/SKILL.md +341 -0
- package/.codex/skills/maestro-ui-design/SKILL.md +10 -0
- package/.codex/skills/maestro-verify/SKILL.md +116 -409
- package/.codex/skills/quality-auto-test/SKILL.md +145 -443
- package/.codex/skills/quality-refactor/SKILL.md +1 -1
- package/.codex/skills/quality-test/SKILL.md +229 -517
- package/.codex/skills/spec-add/SKILL.md +1 -1
- package/README.md +4 -1
- package/README.zh-CN.md +3 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +3 -0
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/install.js +110 -1
- package/dashboard/dist-server/dashboard/src/server/routes/install.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/settings.js +56 -0
- package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +2 -0
- package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +2 -2
- package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +2 -0
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +3 -1
- package/dashboard/dist-server/dashboard/src/shared/constants.d.ts +2 -0
- package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
- package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +1 -3
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/agents/cli-history-store.d.ts +5 -0
- package/dist/src/agents/cli-history-store.d.ts.map +1 -1
- package/dist/src/agents/cli-history-store.js +65 -13
- package/dist/src/agents/cli-history-store.js.map +1 -1
- package/dist/src/cli.js +13 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/command-help.d.ts +3 -0
- package/dist/src/commands/command-help.d.ts.map +1 -0
- package/dist/src/commands/command-help.js +60 -0
- package/dist/src/commands/command-help.js.map +1 -0
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +17 -0
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +12 -2
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/impeccable.d.ts +10 -0
- package/dist/src/commands/impeccable.d.ts.map +1 -0
- package/dist/src/commands/impeccable.js +181 -0
- package/dist/src/commands/impeccable.js.map +1 -0
- package/dist/src/commands/spec.js +1 -1
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/commands/wiki.d.ts.map +1 -1
- package/dist/src/commands/wiki.js +5 -1
- package/dist/src/commands/wiki.js.map +1 -1
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js +10 -7
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/dist/src/core/addon-registry.d.ts +31 -0
- package/dist/src/core/addon-registry.d.ts.map +1 -0
- package/dist/src/core/addon-registry.js +28 -0
- package/dist/src/core/addon-registry.js.map +1 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -0
- package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
- package/dist/src/hooks/spec-injector.js +2 -2
- package/dist/src/hooks/spec-injector.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools/impeccable/critique-storage.d.ts +28 -0
- package/dist/src/tools/impeccable/critique-storage.d.ts.map +1 -0
- package/dist/src/tools/impeccable/critique-storage.js +120 -0
- package/dist/src/tools/impeccable/critique-storage.js.map +1 -0
- package/dist/src/tools/impeccable/design-parser.d.ts +90 -0
- package/dist/src/tools/impeccable/design-parser.d.ts.map +1 -0
- package/dist/src/tools/impeccable/design-parser.js +696 -0
- package/dist/src/tools/impeccable/design-parser.js.map +1 -0
- package/dist/src/tools/impeccable/detect-csp.d.ts +6 -0
- package/dist/src/tools/impeccable/detect-csp.d.ts.map +1 -0
- package/dist/src/tools/impeccable/detect-csp.js +130 -0
- package/dist/src/tools/impeccable/detect-csp.js.map +1 -0
- package/dist/src/tools/impeccable/is-generated.d.ts +4 -0
- package/dist/src/tools/impeccable/is-generated.d.ts.map +1 -0
- package/dist/src/tools/impeccable/is-generated.js +56 -0
- package/dist/src/tools/impeccable/is-generated.js.map +1 -0
- package/dist/src/tools/impeccable/live/accept.d.ts +50 -0
- package/dist/src/tools/impeccable/live/accept.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/accept.js +556 -0
- package/dist/src/tools/impeccable/live/accept.js.map +1 -0
- package/dist/src/tools/impeccable/live/bootstrap.d.ts +2 -0
- package/dist/src/tools/impeccable/live/bootstrap.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/bootstrap.js +244 -0
- package/dist/src/tools/impeccable/live/bootstrap.js.map +1 -0
- package/dist/src/tools/impeccable/live/complete.d.ts +7 -0
- package/dist/src/tools/impeccable/live/complete.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/complete.js +67 -0
- package/dist/src/tools/impeccable/live/complete.js.map +1 -0
- package/dist/src/tools/impeccable/live/completion.d.ts +24 -0
- package/dist/src/tools/impeccable/live/completion.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/completion.js +26 -0
- package/dist/src/tools/impeccable/live/completion.js.map +1 -0
- package/dist/src/tools/impeccable/live/inject.d.ts +41 -0
- package/dist/src/tools/impeccable/live/inject.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/inject.js +394 -0
- package/dist/src/tools/impeccable/live/inject.js.map +1 -0
- package/dist/src/tools/impeccable/live/poll.d.ts +24 -0
- package/dist/src/tools/impeccable/live/poll.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/poll.js +180 -0
- package/dist/src/tools/impeccable/live/poll.js.map +1 -0
- package/dist/src/tools/impeccable/live/resume.d.ts +5 -0
- package/dist/src/tools/impeccable/live/resume.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/resume.js +30 -0
- package/dist/src/tools/impeccable/live/resume.js.map +1 -0
- package/dist/src/tools/impeccable/live/server.d.ts +6 -0
- package/dist/src/tools/impeccable/live/server.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/server.js +867 -0
- package/dist/src/tools/impeccable/live/server.js.map +1 -0
- package/dist/src/tools/impeccable/live/session-store.d.ts +72 -0
- package/dist/src/tools/impeccable/live/session-store.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/session-store.js +281 -0
- package/dist/src/tools/impeccable/live/session-store.js.map +1 -0
- package/dist/src/tools/impeccable/live/static/live-browser-session.js +123 -0
- package/dist/src/tools/impeccable/live/static/live-browser.js +4860 -0
- package/dist/src/tools/impeccable/live/static/modern-screenshot.umd.js +14 -0
- package/dist/src/tools/impeccable/live/status.d.ts +2 -0
- package/dist/src/tools/impeccable/live/status.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/status.js +52 -0
- package/dist/src/tools/impeccable/live/status.js.map +1 -0
- package/dist/src/tools/impeccable/live/wrap.d.ts +33 -0
- package/dist/src/tools/impeccable/live/wrap.d.ts.map +1 -0
- package/dist/src/tools/impeccable/live/wrap.js +572 -0
- package/dist/src/tools/impeccable/live/wrap.js.map +1 -0
- package/dist/src/tools/impeccable/load-context.d.ts +13 -0
- package/dist/src/tools/impeccable/load-context.d.ts.map +1 -0
- package/dist/src/tools/impeccable/load-context.js +79 -0
- package/dist/src/tools/impeccable/load-context.js.map +1 -0
- package/dist/src/tools/impeccable/paths.d.ts +34 -0
- package/dist/src/tools/impeccable/paths.d.ts.map +1 -0
- package/dist/src/tools/impeccable/paths.js +102 -0
- package/dist/src/tools/impeccable/paths.js.map +1 -0
- package/dist/src/tools/spec-entry-parser.d.ts +1 -1
- package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
- package/dist/src/tools/spec-entry-parser.js +1 -1
- package/dist/src/tools/spec-entry-parser.js.map +1 -1
- package/dist/src/tools/spec-init.d.ts.map +1 -1
- package/dist/src/tools/spec-init.js +26 -1
- package/dist/src/tools/spec-init.js.map +1 -1
- package/dist/src/tools/spec-loader.d.ts +1 -1
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +2 -0
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/package.json +2 -2
- package/workflows/claude-instructions.md +17 -5
- package/workflows/cli-tools-usage.md +10 -3
- package/workflows/delegate-usage.md +3 -2
- package/workflows/impeccable/adapt.md +190 -0
- package/workflows/impeccable/animate.md +175 -0
- package/workflows/impeccable/audit.md +133 -0
- package/workflows/impeccable/bolder.md +113 -0
- package/workflows/impeccable/brand.md +118 -0
- package/workflows/impeccable/clarify.md +174 -0
- package/workflows/impeccable/codex.md +105 -0
- package/workflows/impeccable/cognitive-load.md +106 -0
- package/workflows/impeccable/color-and-contrast.md +105 -0
- package/workflows/impeccable/colorize.md +154 -0
- package/workflows/impeccable/craft.md +123 -0
- package/workflows/impeccable/critique.md +261 -0
- package/workflows/impeccable/delight.md +302 -0
- package/workflows/impeccable/distill.md +111 -0
- package/workflows/impeccable/document.md +439 -0
- package/workflows/impeccable/extract.md +69 -0
- package/workflows/impeccable/harden.md +347 -0
- package/workflows/impeccable/heuristics-scoring.md +234 -0
- package/workflows/impeccable/interaction-design.md +195 -0
- package/workflows/impeccable/layout.md +141 -0
- package/workflows/impeccable/live.md +622 -0
- package/workflows/impeccable/motion-design.md +109 -0
- package/workflows/impeccable/onboard.md +234 -0
- package/workflows/impeccable/optimize.md +258 -0
- package/workflows/impeccable/overdrive.md +130 -0
- package/workflows/impeccable/personas.md +179 -0
- package/workflows/impeccable/polish.md +242 -0
- package/workflows/impeccable/product.md +62 -0
- package/workflows/impeccable/quieter.md +99 -0
- package/workflows/impeccable/responsive-design.md +114 -0
- package/workflows/impeccable/shape.md +165 -0
- package/workflows/impeccable/spatial-design.md +100 -0
- package/workflows/impeccable/teach.md +168 -0
- package/workflows/impeccable/typeset.md +124 -0
- package/workflows/impeccable/typography.md +159 -0
- package/workflows/impeccable/ux-writing.md +107 -0
- package/workflows/impeccable.md +164 -0
- package/workflows/maestro.md +7 -3
- package/workflows/skill-authoring.md +265 -0
- package/workflows/specs-add.md +3 -2
- package/workflows/specs-load.md +2 -1
- package/workflows/specs-setup.md +21 -1
|
@@ -13,281 +13,238 @@ allowed-tools:
|
|
|
13
13
|
---
|
|
14
14
|
<purpose>
|
|
15
15
|
Single-step executor for ralph (adaptive) and maestro (static) sessions.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Each invocation: locate session → find next pending step → resolve args → execute → update status → hand off to next iteration.
|
|
16
|
+
Each invocation: locate session → find next step → resolve args → execute → update → self-invoke next.
|
|
19
17
|
|
|
20
18
|
Mutual invocation with `/maestro-ralph` forms a self-perpetuating work loop.
|
|
19
|
+
Session: `.workflow/.maestro/*/status.json`
|
|
21
20
|
</purpose>
|
|
22
21
|
|
|
23
22
|
<context>
|
|
24
23
|
$ARGUMENTS — optional `-y` flag + optional session ID.
|
|
25
24
|
|
|
26
|
-
**
|
|
25
|
+
**Parse:**
|
|
27
26
|
```
|
|
28
|
-
-y / --yes → auto = true
|
|
29
|
-
Remaining → session_id (if matches maestro-* or ralph-*
|
|
27
|
+
-y / --yes → auto = true
|
|
28
|
+
Remaining → session_id (if matches maestro-* or ralph-*)
|
|
30
29
|
```
|
|
31
|
-
|
|
32
|
-
Also read `session.auto_mode` from status.json — if `true`, treat as `-y` even without flag.
|
|
33
|
-
|
|
34
|
-
**Session sources:**
|
|
35
|
-
- **ralph** — Adaptive chain with decision nodes (primary)
|
|
36
|
-
- **maestro** — Static chain, internal/external only, no decision callbacks
|
|
30
|
+
Also read `session.auto_mode` from status.json — if true, treat as `-y`.
|
|
37
31
|
|
|
38
32
|
**Node types:**
|
|
39
33
|
|
|
40
34
|
| Type | Execution | Flow after |
|
|
41
35
|
|------|-----------|------------|
|
|
42
|
-
| decision (ralph-only) | `Skill("maestro-ralph")` — ralph re-evaluates
|
|
43
|
-
| internal | `Skill({ skill, args })` — synchronous
|
|
44
|
-
| external | `maestro delegate --to claude
|
|
36
|
+
| decision (ralph-only) | `Skill("maestro-ralph")` — ralph re-evaluates | Execution ends here |
|
|
37
|
+
| internal | `Skill({ skill, args })` — synchronous | Self-invoke next |
|
|
38
|
+
| external | `maestro delegate --to claude --mode write` | STOP → callback → self-invoke |
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
HARD RULE: External nodes ALWAYS append `-y` to skill args inside the prompt — delegate sessions are non-interactive.
|
|
41
|
+
HARD RULE: External nodes ALWAYS delegate to `claude` — only Claude Code can execute slash-command skills.
|
|
42
|
+
</context>
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
<invariants>
|
|
45
|
+
1. **Every step via Skill() or delegate** — never simulate or inline a skill's work
|
|
46
|
+
2. **External → claude only** — `session.cli_tool` is for analysis delegates, NOT execution
|
|
47
|
+
3. **Self-invocation chain** — continues until all steps complete or session paused
|
|
48
|
+
4. **Status.json updated after every change** — resume-safe
|
|
49
|
+
</invariants>
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
<state_machine>
|
|
51
52
|
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
<states>
|
|
54
|
+
S_LOCATE — 定位 session + 找下一个 pending step PERSIST: —
|
|
55
|
+
S_RESOLVE_ARGS — 解析占位符 + 丰富参数 PERSIST: step.args (enriched)
|
|
56
|
+
S_EXECUTE — 执行当前 step PERSIST: step.status = "running", session.current_step
|
|
57
|
+
S_POST_EXEC — 标记完成 + 传播上下文 PERSIST: step.status, session.context
|
|
58
|
+
S_HANDLE_FAIL — 处理失败(重试/跳过/中止) PERSIST: step.status, session.status
|
|
59
|
+
S_COMPLETE — 所有 step 完成 PERSIST: session.status = "completed"
|
|
60
|
+
S_FALLBACK — 无 session 可执行 PERSIST: —
|
|
61
|
+
</states>
|
|
54
62
|
|
|
55
|
-
<
|
|
63
|
+
<transitions>
|
|
56
64
|
|
|
57
|
-
|
|
65
|
+
S_LOCATE:
|
|
66
|
+
→ S_RESOLVE_ARGS WHEN: pending step found DO: A_LOCATE_SESSION
|
|
67
|
+
→ S_COMPLETE WHEN: no pending steps
|
|
68
|
+
→ S_FALLBACK WHEN: no running session
|
|
58
69
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
session_path = .workflow/.maestro/{session_id}/status.json
|
|
62
|
-
Else:
|
|
63
|
-
Scan .workflow/.maestro/*/status.json
|
|
64
|
-
Filter: status == "running"
|
|
65
|
-
Sort: updated_at DESC (or dir mtime DESC)
|
|
66
|
-
Take first
|
|
67
|
-
|
|
68
|
-
If no session found:
|
|
69
|
-
Output: "无运行中的会话。使用 /maestro 或 /maestro-ralph 创建新会话。"
|
|
70
|
-
End.
|
|
71
|
-
```
|
|
70
|
+
S_RESOLVE_ARGS:
|
|
71
|
+
→ S_EXECUTE DO: A_RESOLVE_ARGS
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
S_EXECUTE:
|
|
74
|
+
→ END WHEN: step.type == "decision" DO: A_EXEC_DECISION
|
|
75
|
+
→ S_POST_EXEC WHEN: step.type == "internal" + success DO: A_EXEC_INTERNAL
|
|
76
|
+
→ S_HANDLE_FAIL WHEN: step.type == "internal" + failure DO: A_EXEC_INTERNAL
|
|
77
|
+
→ END WHEN: step.type == "external" DO: A_EXEC_EXTERNAL
|
|
78
|
+
(STOP after background delegate; on callback → S_POST_EXEC or S_HANDLE_FAIL)
|
|
74
79
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
S_POST_EXEC:
|
|
81
|
+
→ S_LOCATE DO: A_MARK_COMPLETE + Skill("maestro-ralph-execute")
|
|
82
|
+
|
|
83
|
+
S_HANDLE_FAIL:
|
|
84
|
+
→ S_LOCATE WHEN: auto + not retried DO: A_RETRY
|
|
85
|
+
→ END WHEN: auto + retried DO: A_PAUSE_SESSION
|
|
86
|
+
→ S_LOCATE WHEN: interactive + user selects retry DO: A_RETRY
|
|
87
|
+
→ S_LOCATE WHEN: interactive + user selects skip DO: A_SKIP_STEP
|
|
88
|
+
→ END WHEN: interactive + user selects abort DO: A_PAUSE_SESSION
|
|
89
|
+
|
|
90
|
+
S_COMPLETE:
|
|
91
|
+
→ END DO: A_COMPLETE_SESSION
|
|
92
|
+
|
|
93
|
+
S_FALLBACK:
|
|
94
|
+
→ END DO: display "无运行中的会话。使用 /maestro 或 /maestro-ralph 创建。"
|
|
95
|
+
|
|
96
|
+
</transitions>
|
|
79
97
|
|
|
80
|
-
|
|
98
|
+
<actions>
|
|
81
99
|
|
|
82
|
-
|
|
100
|
+
### A_LOCATE_SESSION
|
|
101
|
+
|
|
102
|
+
1. If session_id provided → load `.workflow/.maestro/{session_id}/status.json`
|
|
103
|
+
2. Else: scan `.workflow/.maestro/*/status.json`, filter `status == "running"`, sort DESC, take first
|
|
104
|
+
3. Extract: session_id, source, steps[], current_step, phase, milestone, intent, auto_mode, context, cli_tool
|
|
105
|
+
4. Find first step with `status == "pending"` → next step
|
|
106
|
+
|
|
107
|
+
### A_RESOLVE_ARGS
|
|
83
108
|
|
|
84
109
|
**Placeholder substitution:**
|
|
85
110
|
|
|
86
111
|
| Placeholder | Source |
|
|
87
112
|
|-------------|--------|
|
|
88
|
-
| `{phase}` |
|
|
89
|
-
| `{milestone}` |
|
|
90
|
-
| `{intent}` |
|
|
91
|
-
| `{description}` |
|
|
92
|
-
| `{scratch_dir}` |
|
|
93
|
-
| `{plan_dir}` |
|
|
94
|
-
| `{analysis_dir}` |
|
|
95
|
-
| `{issue_id}` |
|
|
96
|
-
| `{milestone_num}` |
|
|
97
|
-
|
|
98
|
-
**Per-skill enrichment** (when args
|
|
113
|
+
| `{phase}` | session.phase |
|
|
114
|
+
| `{milestone}` | session.milestone |
|
|
115
|
+
| `{intent}` | session.intent |
|
|
116
|
+
| `{description}` | session.intent (alias) |
|
|
117
|
+
| `{scratch_dir}` | session.context.scratch_dir or latest artifact path |
|
|
118
|
+
| `{plan_dir}` | session.context.plan_dir |
|
|
119
|
+
| `{analysis_dir}` | session.context.analysis_dir |
|
|
120
|
+
| `{issue_id}` | session.context.issue_id |
|
|
121
|
+
| `{milestone_num}` | session.context.milestone_num |
|
|
122
|
+
|
|
123
|
+
**Per-skill enrichment** (when args empty or minimal):
|
|
99
124
|
|
|
100
125
|
| Skill | Required context | Source |
|
|
101
126
|
|-------|-----------------|--------|
|
|
102
|
-
| maestro-brainstorm | topic
|
|
103
|
-
| maestro-roadmap | description
|
|
104
|
-
| maestro-analyze | phase or topic | `{phase}` or `"{intent}"`
|
|
127
|
+
| maestro-brainstorm | topic | `"{intent}"` |
|
|
128
|
+
| maestro-roadmap | description | `"{intent}"` |
|
|
129
|
+
| maestro-analyze | phase or topic | `{phase}` or `"{intent}"` |
|
|
105
130
|
| maestro-plan | phase or --dir | `{phase}`, or `--dir {scratch_dir}` if standalone |
|
|
106
131
|
| maestro-execute | phase or --dir | `{phase}`, or `--dir {scratch_dir}` if standalone |
|
|
107
|
-
|
|
|
108
|
-
| quality-debug | gap context | Read previous step's error/gap summary from artifact dir |
|
|
132
|
+
| quality-debug | gap context | Read previous step's error/gap from artifact dir |
|
|
109
133
|
| quality-* | phase | `{phase}` |
|
|
110
134
|
|
|
111
|
-
**Artifact dir resolution for --dir
|
|
135
|
+
**Artifact dir resolution for --dir:**
|
|
112
136
|
```
|
|
113
|
-
Read
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
For execute commands: find latest type=="plan" artifact → --dir .workflow/scratch/{path}
|
|
137
|
+
Read state.json → filter artifacts by milestone + phase
|
|
138
|
+
plan commands: latest type=="analyze" → --dir .workflow/scratch/{path}
|
|
139
|
+
execute commands: latest type=="plan" → --dir .workflow/scratch/{path}
|
|
117
140
|
```
|
|
118
141
|
|
|
119
142
|
Write enriched args back to status.json (resume-safe).
|
|
120
143
|
|
|
121
|
-
|
|
144
|
+
### A_EXEC_DECISION
|
|
122
145
|
|
|
123
|
-
Mark step
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
status.current_step = next.index
|
|
128
|
-
status.updated_at = ISO timestamp
|
|
129
|
-
Write status.json
|
|
130
|
-
```
|
|
146
|
+
1. Mark step running, write status.json
|
|
147
|
+
2. Display: `[{index}/{total}] ◆ {skill} [decision] Retry: {retry}/{max}`
|
|
148
|
+
3. `Skill({ skill: "maestro-ralph" })` — ralph detects running decision → evaluates → handoff
|
|
149
|
+
4. **This execution ends here** — ralph handles the handoff back
|
|
131
150
|
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
------------------------------------------------------------
|
|
135
|
-
[{next.index}/{steps.length - 1}] {next.skill} [{next.type}]
|
|
136
|
-
------------------------------------------------------------
|
|
137
|
-
Session: {session_id} [{source}]
|
|
138
|
-
Args: {next.args}
|
|
139
|
-
```
|
|
140
|
-
If decision node: also show `Retry: {retry_count}/{max_retries}`.
|
|
151
|
+
### A_EXEC_INTERNAL
|
|
141
152
|
|
|
142
|
-
|
|
153
|
+
1. Mark step running, write status.json
|
|
154
|
+
2. Display: `[{index}/{total}] {skill} [internal]`
|
|
155
|
+
3. Resolve auto flag: `auto ? (flag_map[skill] || "") : ""`
|
|
156
|
+
4. `Skill({ skill: next.skill, args: effective_args })`
|
|
157
|
+
5. Return success/failure
|
|
143
158
|
|
|
144
|
-
|
|
145
|
-
Skill({ skill: "maestro-ralph" })
|
|
146
|
-
```
|
|
159
|
+
**Auto flag map:** all lifecycle skills → `-y`; `quality-test` → `-y --auto-fix`; unlisted internal → no flag
|
|
147
160
|
|
|
148
|
-
|
|
161
|
+
### A_EXEC_EXTERNAL
|
|
149
162
|
|
|
150
|
-
|
|
163
|
+
1. Mark step running, write status.json
|
|
164
|
+
2. Display: `[{index}/{total}] ⚡ {skill} [external]`
|
|
165
|
+
3. Always append `-y` to skill args (delegates are non-interactive): `flag = flag_map[skill] || "-y"`
|
|
166
|
+
4. Execute:
|
|
167
|
+
```
|
|
168
|
+
Bash({
|
|
169
|
+
command: `maestro delegate "/${skill} ${effective_args}" --to claude --mode write`,
|
|
170
|
+
run_in_background: true, timeout: 600000
|
|
171
|
+
})
|
|
172
|
+
STOP — wait for callback.
|
|
173
|
+
```
|
|
174
|
+
5. On callback: retrieve output → S_POST_EXEC or S_HANDLE_FAIL
|
|
151
175
|
|
|
152
|
-
|
|
176
|
+
### A_MARK_COMPLETE
|
|
153
177
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
178
|
+
1. `step.status = "completed"`, `step.completed_at = now`
|
|
179
|
+
2. Scan output for context signals:
|
|
180
|
+
- `PHASE: N` → session.phase
|
|
181
|
+
- `scratch_dir: path` → context.scratch_dir
|
|
182
|
+
- `SPEC-xxx` → context.spec_session_id
|
|
183
|
+
3. Write status.json
|
|
184
|
+
4. Display: `[{index}/{total}] ✓ {skill} completed`
|
|
157
185
|
|
|
158
|
-
|
|
159
|
-
```
|
|
186
|
+
### A_RETRY
|
|
160
187
|
|
|
161
|
-
|
|
188
|
+
1. `step.retried = true`, `step.status = "pending"`, `step.error = null`
|
|
189
|
+
2. Write status.json
|
|
162
190
|
|
|
163
|
-
###
|
|
191
|
+
### A_SKIP_STEP
|
|
164
192
|
|
|
165
|
-
|
|
193
|
+
1. `step.status = "skipped"`
|
|
194
|
+
2. Write status.json
|
|
166
195
|
|
|
167
|
-
|
|
168
|
-
// Always append -y to skill args inside the prompt — delegate sessions cannot confirm
|
|
169
|
-
flag = auto_flag_map[next.skill] || "-y"
|
|
170
|
-
effective_args = `${next.args} ${flag}`
|
|
196
|
+
### A_PAUSE_SESSION
|
|
171
197
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
run_in_background: true,
|
|
175
|
-
timeout: 600000
|
|
176
|
-
})
|
|
198
|
+
1. `session.status = "paused"`, write status.json
|
|
199
|
+
2. Display: `[{index}/{total}] ✗ {skill} 失败,会话已暂停。/maestro-ralph continue 恢复。`
|
|
177
200
|
|
|
178
|
-
|
|
179
|
-
```
|
|
201
|
+
### A_COMPLETE_SESSION
|
|
180
202
|
|
|
181
|
-
|
|
182
|
-
|
|
203
|
+
1. `session.status = "completed"`, write status.json
|
|
204
|
+
2. Display completion report:
|
|
205
|
+
```
|
|
206
|
+
============================================================
|
|
207
|
+
SESSION COMPLETE
|
|
208
|
+
============================================================
|
|
209
|
+
Session: {session_id} [{source}]
|
|
210
|
+
Steps: {completed}/{total}
|
|
183
211
|
|
|
184
|
-
|
|
212
|
+
[✓] 0. maestro-plan 1 [internal]
|
|
213
|
+
[✓] 1. ⚡ maestro-execute 1 [external]
|
|
214
|
+
[✓] 2. maestro-verify 1 [internal]
|
|
215
|
+
[✓] 3. ◆ post-verify [decision]
|
|
216
|
+
...
|
|
217
|
+
============================================================
|
|
218
|
+
```
|
|
219
|
+
Icons: `✓` completed, `—` skipped, `✗` failed, `◆` decision, `⚡` external
|
|
185
220
|
|
|
186
|
-
|
|
221
|
+
</actions>
|
|
187
222
|
|
|
188
|
-
|
|
189
|
-
next.status = "completed"
|
|
190
|
-
next.completed_at = ISO timestamp
|
|
223
|
+
</state_machine>
|
|
191
224
|
|
|
192
|
-
|
|
193
|
-
PHASE: N → status.phase
|
|
194
|
-
scratch_dir: path → context.scratch_dir
|
|
195
|
-
SPEC-xxx → context.spec_session_id
|
|
225
|
+
<appendix>
|
|
196
226
|
|
|
197
|
-
|
|
198
|
-
Display: [{next.index}/{total}] ✓ {next.skill} completed {next.type == "external" ? "[external]" : ""}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
→ `Skill({ skill: "maestro-ralph-execute" })` (next iteration)
|
|
202
|
-
|
|
203
|
-
### 4b. Handle Failure
|
|
204
|
-
|
|
205
|
-
```
|
|
206
|
-
next.status = "failed"
|
|
207
|
-
next.error = "{error message}"
|
|
208
|
-
next.completed_at = ISO timestamp
|
|
209
|
-
Write status.json
|
|
210
|
-
|
|
211
|
-
Display: [{next.index}/{total}] ✗ {next.skill} failed: {error}
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Auto mode:**
|
|
215
|
-
```
|
|
216
|
-
If not next.retried:
|
|
217
|
-
next.retried = true, next.status = "pending", next.error = null
|
|
218
|
-
Write status.json → Skill("maestro-ralph-execute") // retry once
|
|
219
|
-
Else:
|
|
220
|
-
status.status = "paused"
|
|
221
|
-
Write status.json
|
|
222
|
-
Display: [{next.index}/{total}] ✗ {next.skill} 重试后仍失败,会话已暂停。请检查后 /maestro-ralph continue 恢复。
|
|
223
|
-
End.
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
**Interactive mode:**
|
|
227
|
-
```
|
|
228
|
-
AskUserQuestion: "retry / skip / abort"
|
|
229
|
-
retry → next.status = "pending", next.error = null → Skill("maestro-ralph-execute")
|
|
230
|
-
skip → next.status = "skipped" → Skill("maestro-ralph-execute")
|
|
231
|
-
abort → status.status = "paused" → Write status.json → End.
|
|
232
|
-
```
|
|
227
|
+
### Error Codes
|
|
233
228
|
|
|
234
|
-
## Step 5: Complete Session
|
|
235
|
-
|
|
236
|
-
When no pending steps remain:
|
|
237
|
-
|
|
238
|
-
```
|
|
239
|
-
status.status = "completed"
|
|
240
|
-
status.updated_at = ISO timestamp
|
|
241
|
-
Write status.json
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
Display completion report:
|
|
245
|
-
```
|
|
246
|
-
============================================================
|
|
247
|
-
SESSION COMPLETE
|
|
248
|
-
============================================================
|
|
249
|
-
Session: {session_id} [{source}]
|
|
250
|
-
Chain: {chain_name}
|
|
251
|
-
Phase: {phase}
|
|
252
|
-
Steps: {completed}/{total}
|
|
253
|
-
|
|
254
|
-
[✓] 0. maestro-plan 1 [internal]
|
|
255
|
-
[✓] 1. ⚡ maestro-execute 1 [external]
|
|
256
|
-
[✓] 2. maestro-verify 1 [internal]
|
|
257
|
-
[✓] 3. ◆ post-verify [decision]
|
|
258
|
-
[—] 4. quality-auto-test 1 [internal] (skipped)
|
|
259
|
-
...
|
|
260
|
-
============================================================
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
Status icons: `✓` completed, `—` skipped, `✗` failed, ` ` pending.
|
|
264
|
-
Type badges: `◆` decision, `⚡` external, (none) internal.
|
|
265
|
-
|
|
266
|
-
**End.**
|
|
267
|
-
|
|
268
|
-
</execution>
|
|
269
|
-
|
|
270
|
-
<error_codes>
|
|
271
229
|
| Code | Severity | Description | Recovery |
|
|
272
230
|
|------|----------|-------------|----------|
|
|
273
231
|
| E001 | error | No running session found | Suggest /maestro or /maestro-ralph |
|
|
274
|
-
| E002 | error |
|
|
275
|
-
| E003 | error |
|
|
232
|
+
| E002 | error | status.json corrupt | Show path, suggest manual check |
|
|
233
|
+
| E003 | error | Delegate failed + user abort | Mark paused, suggest resume |
|
|
276
234
|
| W001 | warning | Step completed with warnings | Log and continue |
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
- [ ] Session discovery
|
|
281
|
-
- [ ] `-y`
|
|
282
|
-
- [ ]
|
|
283
|
-
- [ ] Per-skill enrichment provides correct args
|
|
284
|
-
- [ ]
|
|
285
|
-
- [ ]
|
|
286
|
-
- [ ]
|
|
287
|
-
- [ ]
|
|
288
|
-
- [ ]
|
|
289
|
-
- [ ]
|
|
290
|
-
- [ ]
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
</success_criteria>
|
|
235
|
+
|
|
236
|
+
### Success Criteria
|
|
237
|
+
|
|
238
|
+
- [ ] Session discovery covers both maestro-* and ralph-*
|
|
239
|
+
- [ ] `-y` parsed from args OR inherited from session.auto_mode
|
|
240
|
+
- [ ] Placeholders resolved from session context
|
|
241
|
+
- [ ] Per-skill enrichment provides correct args
|
|
242
|
+
- [ ] Decision nodes hand off to maestro-ralph via Skill()
|
|
243
|
+
- [ ] Internal nodes execute via Skill() with auto flag
|
|
244
|
+
- [ ] External nodes delegate to claude with `-y` in prompt args, run_in_background + STOP
|
|
245
|
+
- [ ] Context signals propagate to status.json
|
|
246
|
+
- [ ] Auto mode: retry once then pause
|
|
247
|
+
- [ ] Interactive: AskUserQuestion retry/skip/abort
|
|
248
|
+
- [ ] Self-invocation continues until complete or paused
|
|
249
|
+
|
|
250
|
+
</appendix>
|