maestro-flow 0.3.46 → 0.3.47
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 +278 -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 +307 -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
|
@@ -14,391 +14,162 @@ allowed-tools:
|
|
|
14
14
|
- Skill
|
|
15
15
|
---
|
|
16
16
|
<purpose>
|
|
17
|
-
Load
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Node execution mechanisms:
|
|
21
|
-
- `skill` node → `Skill()` (synchronous)
|
|
22
|
-
- `command` node → `Skill()` with namespace (synchronous)
|
|
23
|
-
- `cli` node → `maestro delegate` (background + wait for callback)
|
|
24
|
-
- `agent` node → `Agent()` (sync or background per config)
|
|
25
|
-
- `checkpoint` node → state save, optional user pause
|
|
26
|
-
|
|
27
|
-
Session state persisted at `.workflow/.maestro/<session_id>/status.json` (same tracking
|
|
28
|
-
location as maestro.md), enabling resume from any checkpoint via `-c`.
|
|
17
|
+
Load workflow template (from maestro-composer) → bind context variables → execute DAG nodes in topological order → persist state at checkpoints → support resume.
|
|
18
|
+
|
|
19
|
+
Session: `.workflow/.maestro/player-{YYYYMMDD-HHmmss}/status.json`
|
|
29
20
|
</purpose>
|
|
30
21
|
|
|
31
22
|
<context>
|
|
32
23
|
$ARGUMENTS — template slug/path, or flags.
|
|
33
24
|
|
|
34
|
-
**Flags
|
|
35
|
-
- `--context key=value
|
|
36
|
-
- `-c
|
|
37
|
-
- `--list
|
|
38
|
-
- `--dry-run
|
|
39
|
-
|
|
40
|
-
**Entry routing:**
|
|
25
|
+
**Flags**:
|
|
26
|
+
- `--context key=value`: Bind context variables (repeatable)
|
|
27
|
+
- `-c [session-id]`: Resume paused/interrupted session
|
|
28
|
+
- `--list`: List available templates from index.json
|
|
29
|
+
- `--dry-run`: Show execution plan without executing
|
|
41
30
|
|
|
42
|
-
|
|
43
|
-
|-----------|-----------|---------|
|
|
44
|
-
| List templates | `--list` in args | handleList |
|
|
45
|
-
| Resume session | `-c [session-id]` | Phase 0: Resume |
|
|
46
|
-
| Dry run | `--dry-run` in args | Phase 1 + 2, print plan, exit |
|
|
47
|
-
| Normal | Template slug/path provided | Phase 1 |
|
|
48
|
-
| No args | Empty args | handleList + AskUserQuestion |
|
|
31
|
+
**Node execution mechanisms**:
|
|
49
32
|
|
|
50
|
-
|
|
33
|
+
| Node type | Mechanism | Blocking |
|
|
34
|
+
|-----------|-----------|----------|
|
|
35
|
+
| skill | `Skill(skill, args)` | sync |
|
|
36
|
+
| command | `Skill(skill, args)` | sync |
|
|
37
|
+
| cli | `maestro delegate --to tool --mode mode` via `Bash(run_in_background: true)` | async, STOP + wait |
|
|
38
|
+
| agent | `Agent(subagent_type, prompt)` | configurable |
|
|
39
|
+
| checkpoint | State save + optional user pause | — |
|
|
51
40
|
|
|
52
|
-
|
|
53
|
-
|----------|-------|
|
|
54
|
-
| Session prefix | `player` |
|
|
55
|
-
| Session dir | `.workflow/.maestro/player-<YYYYMMDD>-<HHmmss>/` |
|
|
56
|
-
| State file | `status.json` |
|
|
57
|
-
| Template dir (global) | `~/.maestro/templates/workflows/` |
|
|
58
|
-
| Template index (global) | `~/.maestro/templates/workflows/index.json` |
|
|
41
|
+
**Runtime reference resolution** in args_template:
|
|
59
42
|
|
|
60
|
-
|
|
43
|
+
| Reference | Resolves to |
|
|
44
|
+
|-----------|-------------|
|
|
45
|
+
| `{variable}` | session context[variable] |
|
|
46
|
+
| `{N-001.session_id}` | node's session_id |
|
|
47
|
+
| `{N-001.output_path}` | node's output_path |
|
|
48
|
+
| `{prev_session_id}` | previous non-checkpoint node's session_id |
|
|
49
|
+
| `{prev_output_path}` | previous non-checkpoint node's output_path |
|
|
61
50
|
|
|
51
|
+
**Session schema** (status.json — must align with maestro.md tracking):
|
|
62
52
|
```json
|
|
63
53
|
{
|
|
64
54
|
"session_id": "player-<YYYYMMDD>-<HHmmss>",
|
|
65
|
-
"
|
|
66
|
-
"intent": "<template_name> with context",
|
|
67
|
-
"task_type": "player",
|
|
68
|
-
"chain_name": "<template_id>",
|
|
55
|
+
"status": "running|paused|completed|failed|aborted",
|
|
69
56
|
"template_id": "wft-<slug>-<date>",
|
|
70
|
-
"template_path": "
|
|
71
|
-
"template_name": "<name>",
|
|
57
|
+
"template_path": "<path>",
|
|
72
58
|
"auto_mode": false,
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"args": "<resolved_args>",
|
|
81
|
-
"type": "skill | cli | command | agent | checkpoint",
|
|
82
|
-
"status": "pending | running | completed | skipped | failed",
|
|
83
|
-
"started_at": null,
|
|
84
|
-
"completed_at": null,
|
|
85
|
-
"session_id": null,
|
|
86
|
-
"output_path": null,
|
|
87
|
-
"artifacts": [],
|
|
88
|
-
"error": null
|
|
89
|
-
}
|
|
90
|
-
],
|
|
59
|
+
"context": { "goal": "..." },
|
|
60
|
+
"steps": [{
|
|
61
|
+
"index": 0, "node_id": "N-001", "skill": "<executor>",
|
|
62
|
+
"args": "<resolved>", "type": "skill|cli|agent|checkpoint",
|
|
63
|
+
"status": "pending|running|completed|skipped|failed",
|
|
64
|
+
"session_id": null, "output_path": null, "artifacts": []
|
|
65
|
+
}],
|
|
91
66
|
"current_step": 0,
|
|
92
|
-
"last_checkpoint": null
|
|
93
|
-
"updated_at": "<ISO>",
|
|
94
|
-
"completed_at": null
|
|
67
|
+
"last_checkpoint": null
|
|
95
68
|
}
|
|
96
69
|
```
|
|
97
|
-
|
|
98
|
-
**Session directory structure (under .workflow/.maestro/):**
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
.workflow/.maestro/player-<YYYYMMDD>-<HHmmss>/
|
|
102
|
-
├── status.json # Main state file (maestro.md compatible)
|
|
103
|
-
├── checkpoints/
|
|
104
|
-
│ ├── CP-01.json
|
|
105
|
-
│ └── CP-02.json
|
|
106
|
-
└── artifacts/
|
|
107
|
-
└── N-001-output.md
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
**Node execution mechanisms:**
|
|
111
|
-
|
|
112
|
-
| Node type | Mechanism | Blocking |
|
|
113
|
-
|-----------|-----------|----------|
|
|
114
|
-
| skill | `Skill(skill=executor, args=resolved_args)` | sync |
|
|
115
|
-
| command | `Skill(skill=executor, args=resolved_args)` | sync |
|
|
116
|
-
| cli | `maestro delegate "prompt" --to tool --mode mode --rule rule` via `Bash(run_in_background: true)` | async, wait for callback |
|
|
117
|
-
| agent | `Agent(subagent_type=executor, prompt=resolved_args)` | configurable |
|
|
118
|
-
| checkpoint | State save + optional user pause | — |
|
|
119
|
-
|
|
120
|
-
**Runtime reference resolution:**
|
|
121
|
-
|
|
122
|
-
Before executing each node, resolve `{ref}` patterns in `args_template`:
|
|
123
|
-
|
|
124
|
-
| Reference | Resolves To |
|
|
125
|
-
|-----------|-------------|
|
|
126
|
-
| `{variable}` | `session_state.context[variable]` |
|
|
127
|
-
| `{N-001.session_id}` | `node_states["N-001"].session_id` |
|
|
128
|
-
| `{N-001.output_path}` | `node_states["N-001"].output_path` |
|
|
129
|
-
| `{prev_session_id}` | session_id of previous non-checkpoint node |
|
|
130
|
-
| `{prev_output_path}` | output_path of previous non-checkpoint node |
|
|
131
|
-
|
|
132
|
-
Fallback: if referenced field is null, substitution results in empty string.
|
|
133
70
|
</context>
|
|
134
71
|
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
### handleList
|
|
138
|
-
|
|
139
|
-
Scan `~/.maestro/templates/workflows/index.json`. Display:
|
|
140
|
-
```
|
|
141
|
-
Available workflow templates:
|
|
142
|
-
feature-tdd-review [feature, complex] 3 work nodes, 2 checkpoints
|
|
143
|
-
quick-bugfix [bugfix, simple] 2 work nodes, 1 checkpoint
|
|
144
|
-
|
|
145
|
-
Run: /maestro-player <slug> --context goal="..."
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
If index not found, output: "No templates found. Create one with /maestro-composer"
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
### Phase 0: Resume — Session Reconciliation
|
|
153
|
-
|
|
154
|
-
**Trigger**: `-c [session-id]`
|
|
155
|
-
|
|
156
|
-
1. If session-id provided: load `.workflow/.maestro/<session-id>/status.json`
|
|
157
|
-
2. If no session-id: scan `.workflow/.maestro/player-*/status.json` for `status = "running" | "paused"`
|
|
158
|
-
3. Multiple found → AskUserQuestion for selection
|
|
159
|
-
4. None found → error E004
|
|
160
|
-
5. Reset any `running` steps back to `pending` (interrupted mid-execution)
|
|
161
|
-
6. Determine next executable step from `steps[]` after `last_checkpoint`
|
|
162
|
-
7. Set `current_step` to resume point
|
|
163
|
-
8. Resume at Phase 3 (Execute Loop) from that step
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
### Phase 1: Load & Bind
|
|
168
|
-
|
|
169
|
-
**Objective**: Load template, collect missing variables, bind all references.
|
|
170
|
-
|
|
171
|
-
**Step 1.1** — Resolve template path:
|
|
172
|
-
1. Absolute path → use as-is
|
|
173
|
-
2. Relative path (`.` prefix) → resolve from cwd
|
|
174
|
-
3. Slug only → look up in `~/.maestro/templates/workflows/index.json`
|
|
175
|
-
4. Partial match → scan index, confirm with user
|
|
176
|
-
5. Not found → show available templates, AskUserQuestion
|
|
177
|
-
|
|
178
|
-
**Step 1.2** — Parse `--context key=value` pairs into `bound_context`.
|
|
179
|
-
|
|
180
|
-
**Step 1.3** — Load and validate template JSON (`template_id`, `nodes`, `edges`, `context_schema` must be present).
|
|
181
|
-
|
|
182
|
-
**Step 1.4** — Collect missing required variables:
|
|
183
|
-
- For each `context_schema` entry where `required: true` and not in `bound_context`:
|
|
184
|
-
AskUserQuestion to collect value
|
|
185
|
-
- For optional variables: use `default` or empty string
|
|
186
|
-
|
|
187
|
-
**Step 1.5** — Bind variables: replace `{variable_name}` with values in all `args_template` strings. Leave `{N-xxx.field}` and `{prev_*}` unresolved (runtime Phase 3).
|
|
188
|
-
|
|
189
|
-
**Step 1.6** — If `--dry-run`: print execution plan and exit:
|
|
190
|
-
```
|
|
191
|
-
Workflow: <template.name>
|
|
192
|
-
Context: goal = "<value>"
|
|
193
|
-
|
|
194
|
-
Execution Plan:
|
|
195
|
-
[1] N-001 [skill] maestro-plan "<goal>"
|
|
196
|
-
[2] CP-01 [checkpoint] After Plan auto-continue
|
|
197
|
-
[3] N-002 [skill] maestro-execute --resume-session {N-001.session_id}
|
|
198
|
-
|
|
199
|
-
To execute: /maestro-player <slug> --context goal="..."
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
### Phase 2: Instantiate — Init Session State
|
|
205
|
-
|
|
206
|
-
**Objective**: Create session directory, init state, compute execution plan.
|
|
207
|
-
|
|
208
|
-
**Step 2.1** — Generate session ID: `player-<YYYYMMDD>-<HHmmss>`. Create directory at `.workflow/.maestro/<session_id>/`.
|
|
209
|
-
|
|
210
|
-
**Step 2.2** — Topological sort via Kahn's algorithm. Flatten nodes into `steps[]` array (maestro.md format). Parallel nodes get same batch index.
|
|
211
|
-
|
|
212
|
-
**Step 2.3** — Init all steps as `status: "pending"`.
|
|
213
|
-
|
|
214
|
-
**Step 2.4** — Write `status.json` (see schema in Context section).
|
|
215
|
-
|
|
216
|
-
**Step 2.5** — Show execution start banner:
|
|
217
|
-
```
|
|
218
|
-
============================================================
|
|
219
|
-
MAESTRO PLAYER
|
|
220
|
-
============================================================
|
|
221
|
-
Template: <template.name>
|
|
222
|
-
Session: <session_id>
|
|
223
|
-
Context: goal="<value>"
|
|
224
|
-
|
|
225
|
-
Pipeline:
|
|
226
|
-
1. N-001 [skill] maestro-plan
|
|
227
|
-
2. CP-01 [checkpoint] After Plan
|
|
228
|
-
3. N-002 [skill] maestro-execute
|
|
229
|
-
============================================================
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
### Phase 3: Execute Loop
|
|
235
|
-
|
|
236
|
-
**Objective**: Execute each step in order. Save state after every step.
|
|
237
|
-
|
|
238
|
-
**CRITICAL**: After each step status change, write `status.json` immediately. This enables resume on interruption.
|
|
239
|
-
|
|
240
|
-
**For each step starting at `current_step`:**
|
|
241
|
-
|
|
242
|
-
**3a. Display step banner** (consistent with maestro.md):
|
|
243
|
-
```
|
|
244
|
-
------------------------------------------------------------
|
|
245
|
-
STEP {i+1}/{total}: {node_id} [{type}] {executor}
|
|
246
|
-
------------------------------------------------------------
|
|
247
|
-
Args: {resolved_args}
|
|
248
|
-
```
|
|
72
|
+
<state_machine>
|
|
249
73
|
|
|
250
|
-
|
|
74
|
+
<states>
|
|
75
|
+
S_ROUTE — 入口路由(list/resume/dry-run/normal) PERSIST: —
|
|
76
|
+
S_RESUME — 恢复已暂停 session PERSIST: —
|
|
77
|
+
S_LOAD — 加载模板、收集变量、绑定引用 PERSIST: —
|
|
78
|
+
S_INIT — 创建 session、拓扑排序、初始化 steps PERSIST: status.json
|
|
79
|
+
S_EXEC_LOOP — 逐步执行(核心循环) PERSIST: status.json (每步更新)
|
|
80
|
+
S_COMPLETE — 标记完成、输出摘要 PERSIST: status.json (final)
|
|
81
|
+
</states>
|
|
251
82
|
|
|
252
|
-
|
|
83
|
+
<transitions>
|
|
253
84
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
85
|
+
S_ROUTE:
|
|
86
|
+
→ handleList WHEN: --list DO: scan index.json, display templates
|
|
87
|
+
→ S_RESUME WHEN: -c flag
|
|
88
|
+
→ S_LOAD WHEN: template slug/path provided
|
|
89
|
+
→ handleList WHEN: no args DO: display templates + AskUserQuestion
|
|
258
90
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
```
|
|
91
|
+
S_RESUME:
|
|
92
|
+
→ S_EXEC_LOOP WHEN: session found DO: A_RESUME_SESSION
|
|
93
|
+
→ ERROR(E004) WHEN: no session found
|
|
263
94
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
resolved_args = resolveArgs(step.args_template, status)
|
|
95
|
+
S_LOAD:
|
|
96
|
+
→ S_INIT DO: A_LOAD_AND_BIND
|
|
267
97
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
})
|
|
98
|
+
S_INIT:
|
|
99
|
+
→ END WHEN: --dry-run DO: display execution plan
|
|
100
|
+
→ S_EXEC_LOOP DO: A_INIT_SESSION (topological sort → steps[], write status.json, display banner)
|
|
272
101
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
102
|
+
S_EXEC_LOOP:
|
|
103
|
+
→ S_EXEC_LOOP WHEN: step completed, more steps DO: A_EXECUTE_STEP → advance current_step
|
|
104
|
+
→ S_COMPLETE WHEN: all steps completed
|
|
105
|
+
→ END WHEN: checkpoint pause DO: set status=paused, display resume command
|
|
106
|
+
→ END WHEN: abort chosen DO: set status=aborted, save progress
|
|
107
|
+
GUARD: cli nodes → Bash(run_in_background: true) + STOP, wait for callback
|
|
108
|
+
GUARD: on failure → on_fail: skip (log, advance) | retry (once) | abort (AskUserQuestion: Retry/Skip/Abort)
|
|
109
|
+
GUARD: after step 3+ → display context hint "可随时 /maestro-player -c 恢复"
|
|
276
110
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
Load status.json
|
|
280
|
-
Find step with status "running"
|
|
281
|
-
Retrieve output: maestro delegate output <exec_id>
|
|
282
|
-
Update step: status="completed", output_path, completed_at
|
|
283
|
-
Write status.json
|
|
284
|
-
Advance to next step
|
|
285
|
-
```
|
|
111
|
+
S_COMPLETE:
|
|
112
|
+
→ END DO: A_COMPLETE_SESSION
|
|
286
113
|
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
resolved_args = resolveArgs(step.args_template, status)
|
|
114
|
+
</transitions>
|
|
290
115
|
|
|
291
|
-
|
|
292
|
-
subagent_type: step.skill,
|
|
293
|
-
prompt: resolved_args,
|
|
294
|
-
run_in_background: step.run_in_background ?? false,
|
|
295
|
-
description: step.node_id
|
|
296
|
-
})
|
|
116
|
+
<actions>
|
|
297
117
|
|
|
298
|
-
|
|
299
|
-
Write status.json
|
|
300
|
-
```
|
|
118
|
+
### A_RESUME_SESSION
|
|
301
119
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
session_id, checkpoint_id, saved_at, steps_snapshot, last_completed_step
|
|
307
|
-
|
|
308
|
-
// 2. Update status.json
|
|
309
|
-
status.last_checkpoint = step.node_id
|
|
310
|
-
Mark step completed, write status.json
|
|
311
|
-
|
|
312
|
-
// 3. If auto_continue == false: pause for user
|
|
313
|
-
AskUserQuestion:
|
|
314
|
-
- Continue → proceed
|
|
315
|
-
- Pause → set status="paused", write status.json, output resume command, EXIT
|
|
316
|
-
- Abort → set status="aborted", EXIT
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
**3d. Handle result** (consistent with maestro.md):
|
|
120
|
+
1. If session-id: load status.json. If none: scan player-*/status.json for running|paused.
|
|
121
|
+
2. Reset any "running" steps to "pending" (interrupted mid-execution)
|
|
122
|
+
3. Set current_step to resume point after last_checkpoint
|
|
123
|
+
4. Enter S_EXEC_LOOP
|
|
320
124
|
|
|
321
|
-
|
|
125
|
+
### A_LOAD_AND_BIND
|
|
322
126
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
retry → retry once, if still fails → fall to abort
|
|
329
|
-
abort → AskUserQuestion: Retry / Skip / Abort
|
|
330
|
-
On Abort: save progress, display: "Resume with: /maestro-player -c"
|
|
331
|
-
```
|
|
127
|
+
1. Resolve template: absolute path → as-is; relative → from cwd; slug → index.json lookup
|
|
128
|
+
2. Parse `--context key=value` pairs
|
|
129
|
+
3. Validate template (template_id, nodes, edges, context_schema required)
|
|
130
|
+
4. Collect missing required variables via AskUserQuestion
|
|
131
|
+
5. Bind {variable} placeholders (leave {N-xxx.field} and {prev_*} for runtime)
|
|
332
132
|
|
|
333
|
-
|
|
334
|
-
```
|
|
335
|
-
⚡ 已执行 {i} 步,上下文较重。可随时 /maestro-player -c 在新上下文中恢复。
|
|
336
|
-
```
|
|
133
|
+
### A_INIT_SESSION
|
|
337
134
|
|
|
338
|
-
|
|
135
|
+
1. Generate session_id: player-{YYYYMMDD-HHmmss}
|
|
136
|
+
2. Topological sort (Kahn's algorithm) → flatten to steps[] (parallel nodes share batch index)
|
|
137
|
+
3. All steps status: "pending"
|
|
138
|
+
4. Write status.json
|
|
339
139
|
|
|
340
|
-
###
|
|
140
|
+
### A_EXECUTE_STEP
|
|
341
141
|
|
|
342
|
-
|
|
142
|
+
1. Resolve runtime references ({N-xxx.field}, {prev_*}) in args
|
|
143
|
+
2. Set step status="running", write status.json
|
|
144
|
+
3. Execute by type:
|
|
145
|
+
- **skill/command**: `Skill(skill, resolved_args)` → extract session_id, output_path, artifacts
|
|
146
|
+
- **cli**: `Bash(run_in_background: true)` → STOP, wait for callback → `maestro delegate output <id>`
|
|
147
|
+
- **agent**: `Agent(subagent_type, resolved_args)`
|
|
148
|
+
- **checkpoint**: write checkpoint snapshot. If auto_continue==false: AskUserQuestion (Continue/Pause/Abort)
|
|
149
|
+
4. Set step status="completed" (or "skipped"/"failed"), write status.json
|
|
343
150
|
|
|
344
|
-
|
|
151
|
+
### A_COMPLETE_SESSION
|
|
345
152
|
|
|
346
|
-
|
|
153
|
+
Set status="completed", completed_at. Display summary: session, template, steps completed, context, per-step results, artifacts, session dir.
|
|
154
|
+
AskUserQuestion: Keep session / Run again / Done.
|
|
347
155
|
|
|
348
|
-
|
|
349
|
-
```
|
|
350
|
-
============================================================
|
|
351
|
-
MAESTRO PLAYER SESSION COMPLETE
|
|
352
|
-
============================================================
|
|
353
|
-
Session: <session_id>
|
|
354
|
-
Template: <template_name> (<template_id>)
|
|
355
|
-
Steps: <completed>/<total> completed
|
|
356
|
-
Context: goal="<value>"
|
|
357
|
-
|
|
358
|
-
Results:
|
|
359
|
-
[✓] 1. N-001 maestro-plan — completed (WFS-plan-xxx)
|
|
360
|
-
[✓] 2. CP-01 After Plan — completed (checkpoint)
|
|
361
|
-
[✓] 3. N-002 maestro-execute — completed (WFS-exec-xxx)
|
|
362
|
-
[✓] 4. N-003 quality-test — completed (WFS-test-xxx)
|
|
363
|
-
|
|
364
|
-
Artifacts:
|
|
365
|
-
- IMPL_PLAN.md (N-001)
|
|
366
|
-
- src/auth/index.ts (N-002)
|
|
367
|
-
- test/auth.test.ts (N-003)
|
|
368
|
-
|
|
369
|
-
Session dir: .workflow/.maestro/<session_id>/
|
|
370
|
-
============================================================
|
|
371
|
-
```
|
|
156
|
+
</actions>
|
|
372
157
|
|
|
373
|
-
|
|
374
|
-
- **Keep session** → leave at current path
|
|
375
|
-
- **Run again** → AskUserQuestion for same/new context, re-enter Phase 1
|
|
376
|
-
- **Nothing** → done
|
|
377
|
-
</execution>
|
|
158
|
+
</state_machine>
|
|
378
159
|
|
|
379
160
|
<error_codes>
|
|
380
|
-
| Code |
|
|
381
|
-
|
|
382
|
-
| E001 |
|
|
383
|
-
| E002 |
|
|
384
|
-
|
|
|
385
|
-
|
|
|
386
|
-
|
|
|
387
|
-
| E006 | error | Node execution failed + abort chosen | Save state, suggest --resume |
|
|
388
|
-
| W001 | warning | Node completed with warnings | Log and continue |
|
|
389
|
-
| W002 | warning | Runtime reference resolved to empty string | Log, executor handles gracefully |
|
|
161
|
+
| Code | Condition | Recovery |
|
|
162
|
+
|------|-----------|----------|
|
|
163
|
+
| E001 | Template not found | Show --list, suggest closest match |
|
|
164
|
+
| E002 | Template JSON invalid (missing template_id/nodes/edges) | Point to template file for fix |
|
|
165
|
+
| E004 | Resume session not found | List available player-*/ sessions |
|
|
166
|
+
| E005 | DAG cycle in template | Point to template, suggest --edit |
|
|
167
|
+
| E006 | Node execution failed + abort chosen | Save state, suggest `-c` resume |
|
|
390
168
|
</error_codes>
|
|
391
169
|
|
|
392
170
|
<success_criteria>
|
|
393
|
-
- [ ] Template loaded
|
|
394
|
-
- [ ]
|
|
395
|
-
- [ ]
|
|
396
|
-
- [ ]
|
|
397
|
-
- [ ] Each step executed with correct mechanism (Skill/delegate/Agent)
|
|
398
|
-
- [ ] Runtime references ({N-xxx.field}, {prev_*}) resolved before each step
|
|
399
|
-
- [ ] `status.json` written after every step status change (resume-safe)
|
|
400
|
-
- [ ] Checkpoints saved with snapshots under `checkpoints/`
|
|
401
|
-
- [ ] CLI nodes use `maestro delegate` with `Bash(run_in_background: true)` + stop pattern
|
|
402
|
-
- [ ] Step banners and completion report match maestro.md format
|
|
403
|
-
- [ ] Resume via `-c` scans `.workflow/.maestro/player-*/status.json`
|
|
171
|
+
- [ ] Template loaded, variables bound, session created with topological steps
|
|
172
|
+
- [ ] status.json written after every step change (resume-safe)
|
|
173
|
+
- [ ] CLI nodes use Bash(run_in_background) + STOP pattern
|
|
174
|
+
- [ ] Checkpoints saved, resume via -c works
|
|
404
175
|
</success_criteria>
|
|
@@ -27,6 +27,15 @@ Parse for:
|
|
|
27
27
|
- `--full` flag -- Enables plan-checking (max 2 iterations) and post-execution verification
|
|
28
28
|
- `--discuss` flag -- Decision extraction before planning (gray areas, Locked/Free/Deferred classification)
|
|
29
29
|
- Remaining text as task description
|
|
30
|
+
|
|
31
|
+
### Pre-load context
|
|
32
|
+
|
|
33
|
+
1. **Coding specs + tools**: Run `maestro spec load --category coding` to load coding conventions and discoverable tools. Apply to implementation.
|
|
34
|
+
2. **UI specs (conditional)**: If the task involves frontend/UI work (description contains component, page, style, layout, CSS, HTML, frontend), also run `maestro spec load --category ui`.
|
|
35
|
+
3. **Role Knowledge**:
|
|
36
|
+
- Browse: `maestro wiki list --category coding`
|
|
37
|
+
- Load task-relevant entries: `maestro wiki load <id1> [id2...]`
|
|
38
|
+
3. All are optional — proceed without if unavailable.
|
|
30
39
|
</context>
|
|
31
40
|
|
|
32
41
|
<execution>
|