maestro-flow 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.claude/CLAUDE.md +2 -2
  2. package/.claude/agents/cli-explore-agent.md +1 -1
  3. package/.claude/agents/team-worker.md +237 -237
  4. package/.claude/commands/maestro-coordinate.md +65 -65
  5. package/.claude/commands/maestro-link-coordinate.md +71 -71
  6. package/.claude/commands/manage-issue-execute.md +73 -73
  7. package/.claude/skills/team-coordinate/SKILL.md +266 -266
  8. package/.claude/skills/team-lifecycle-v4/SKILL.md +209 -209
  9. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +94 -94
  10. package/.claude/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -62
  11. package/.claude/skills/team-lifecycle-v4/roles/planner/role.md +85 -85
  12. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +95 -95
  13. package/.claude/skills/team-quality-assurance/SKILL.md +147 -147
  14. package/.claude/skills/team-quality-assurance/roles/scout/role.md +75 -75
  15. package/.claude/skills/team-review/SKILL.md +147 -147
  16. package/.claude/skills/team-review/roles/reviewer/role.md +68 -68
  17. package/.claude/skills/team-review/roles/scanner/role.md +79 -79
  18. package/.claude/skills/team-tech-debt/SKILL.md +128 -128
  19. package/.claude/skills/team-tech-debt/roles/executor/role.md +76 -76
  20. package/.claude/skills/team-tech-debt/roles/scanner/role.md +90 -90
  21. package/.claude/skills/team-tech-debt/roles/validator/role.md +78 -78
  22. package/.claude/skills/team-testing/SKILL.md +143 -143
  23. package/.claude/skills/team-testing/roles/executor/role.md +99 -99
  24. package/.claude/skills/team-testing/roles/generator/role.md +98 -98
  25. package/.codex/skills/maestro-coordinate/SKILL.md +1 -1
  26. package/.codex/skills/manage-issue-analyze/SKILL.md +3 -3
  27. package/.codex/skills/manage-issue-execute/SKILL.md +4 -4
  28. package/.codex/skills/manage-issue-plan/SKILL.md +2 -2
  29. package/.codex/skills/team-coordinate/SKILL.md +7 -7
  30. package/.codex/skills/team-coordinate/roles/coordinator/role.md +1 -1
  31. package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -2
  32. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +2 -2
  33. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  34. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +2 -2
  35. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +1 -1
  36. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +2 -2
  37. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  38. package/.codex/skills/team-quality-assurance/SKILL.md +2 -2
  39. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +2 -2
  40. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -2
  41. package/.codex/skills/team-review/SKILL.md +2 -2
  42. package/.codex/skills/team-review/roles/coordinator/role.md +2 -2
  43. package/.codex/skills/team-review/roles/reviewer/role.md +1 -1
  44. package/.codex/skills/team-review/roles/scanner/role.md +1 -1
  45. package/.codex/skills/team-tech-debt/SKILL.md +2 -2
  46. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +1 -1
  47. package/.codex/skills/team-tech-debt/roles/executor/role.md +1 -1
  48. package/.codex/skills/team-tech-debt/roles/scanner/role.md +1 -1
  49. package/.codex/skills/team-tech-debt/roles/validator/role.md +1 -1
  50. package/.codex/skills/team-testing/SKILL.md +2 -2
  51. package/.codex/skills/team-testing/roles/coordinator/role.md +2 -2
  52. package/.codex/skills/team-testing/roles/executor/role.md +1 -1
  53. package/.codex/skills/team-testing/roles/generator/role.md +1 -1
  54. package/README.md +31 -2
  55. package/README.zh-CN.md +23 -1
  56. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  57. package/dist/src/agents/cli-agent-runner.js +6 -15
  58. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  59. package/dist/src/commands/delegate.d.ts.map +1 -1
  60. package/dist/src/commands/delegate.js +77 -1
  61. package/dist/src/commands/delegate.js.map +1 -1
  62. package/dist/src/commands/hooks.d.ts +15 -0
  63. package/dist/src/commands/hooks.d.ts.map +1 -1
  64. package/dist/src/commands/hooks.js +29 -2
  65. package/dist/src/commands/hooks.js.map +1 -1
  66. package/dist/src/commands/install-backend.d.ts +15 -0
  67. package/dist/src/commands/install-backend.d.ts.map +1 -1
  68. package/dist/src/commands/install-backend.js +67 -0
  69. package/dist/src/commands/install-backend.js.map +1 -1
  70. package/dist/src/commands/install-ui/BackupConfig.d.ts +6 -4
  71. package/dist/src/commands/install-ui/BackupConfig.d.ts.map +1 -1
  72. package/dist/src/commands/install-ui/BackupConfig.js +39 -12
  73. package/dist/src/commands/install-ui/BackupConfig.js.map +1 -1
  74. package/dist/src/commands/install-ui/ConfigPanel.d.ts.map +1 -1
  75. package/dist/src/commands/install-ui/ConfigPanel.js +1 -1
  76. package/dist/src/commands/install-ui/ConfigPanel.js.map +1 -1
  77. package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -0
  78. package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
  79. package/dist/src/commands/install-ui/InstallConfirm.js +5 -1
  80. package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
  81. package/dist/src/commands/install-ui/InstallExecution.d.ts +2 -0
  82. package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
  83. package/dist/src/commands/install-ui/InstallExecution.js +30 -5
  84. package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
  85. package/dist/src/commands/install-ui/InstallFlow.d.ts +1 -1
  86. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  87. package/dist/src/commands/install-ui/InstallFlow.js +31 -6
  88. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  89. package/dist/src/commands/install-ui/InstallHub.d.ts +5 -0
  90. package/dist/src/commands/install-ui/InstallHub.d.ts.map +1 -1
  91. package/dist/src/commands/install-ui/InstallHub.js +24 -0
  92. package/dist/src/commands/install-ui/InstallHub.js.map +1 -1
  93. package/dist/src/commands/install-ui/InstallResult.d.ts.map +1 -1
  94. package/dist/src/commands/install-ui/InstallResult.js +1 -1
  95. package/dist/src/commands/install-ui/InstallResult.js.map +1 -1
  96. package/dist/src/commands/install-ui/StatuslineConfig.d.ts +9 -0
  97. package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -0
  98. package/dist/src/commands/install-ui/StatuslineConfig.js +13 -0
  99. package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -0
  100. package/dist/src/commands/install-ui/index.d.ts +1 -1
  101. package/dist/src/commands/install-ui/index.d.ts.map +1 -1
  102. package/dist/src/commands/install-ui/types.d.ts +6 -0
  103. package/dist/src/commands/install-ui/types.d.ts.map +1 -1
  104. package/dist/src/commands/install-ui/types.js +3 -0
  105. package/dist/src/commands/install-ui/types.js.map +1 -1
  106. package/dist/src/commands/install.d.ts.map +1 -1
  107. package/dist/src/commands/install.js +6 -1
  108. package/dist/src/commands/install.js.map +1 -1
  109. package/dist/src/commands/overlay.d.ts.map +1 -1
  110. package/dist/src/commands/overlay.js +45 -1
  111. package/dist/src/commands/overlay.js.map +1 -1
  112. package/dist/src/commands/team.d.ts +10 -0
  113. package/dist/src/commands/team.d.ts.map +1 -1
  114. package/dist/src/commands/team.js +436 -42
  115. package/dist/src/commands/team.js.map +1 -1
  116. package/dist/src/core/manifest.d.ts.map +1 -1
  117. package/dist/src/core/manifest.js +58 -0
  118. package/dist/src/core/manifest.js.map +1 -1
  119. package/dist/src/core/overlay/applier.d.ts +4 -0
  120. package/dist/src/core/overlay/applier.d.ts.map +1 -1
  121. package/dist/src/core/overlay/applier.js.map +1 -1
  122. package/dist/src/hooks/delegate-monitor.js +1 -1
  123. package/dist/src/hooks/delegate-monitor.js.map +1 -1
  124. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  125. package/dist/src/hooks/plugins/spec-injection-plugin.js +17 -1
  126. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  127. package/dist/src/hooks/spec-injector.d.ts +2 -1
  128. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  129. package/dist/src/hooks/spec-injector.js +19 -2
  130. package/dist/src/hooks/spec-injector.js.map +1 -1
  131. package/dist/src/hooks/team-monitor.d.ts.map +1 -1
  132. package/dist/src/hooks/team-monitor.js +17 -0
  133. package/dist/src/hooks/team-monitor.js.map +1 -1
  134. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  135. package/dist/src/i18n/locales/en.js +25 -1
  136. package/dist/src/i18n/locales/en.js.map +1 -1
  137. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  138. package/dist/src/i18n/locales/zh.js +25 -1
  139. package/dist/src/i18n/locales/zh.js.map +1 -1
  140. package/dist/src/i18n/types.d.ts +22 -0
  141. package/dist/src/i18n/types.d.ts.map +1 -1
  142. package/dist/src/mcp/delegate-channel-relay.d.ts.map +1 -1
  143. package/dist/src/mcp/delegate-channel-relay.js +2 -7
  144. package/dist/src/mcp/delegate-channel-relay.js.map +1 -1
  145. package/dist/src/tools/namespace-guard.d.ts +37 -0
  146. package/dist/src/tools/namespace-guard.d.ts.map +1 -0
  147. package/dist/src/tools/namespace-guard.js +126 -0
  148. package/dist/src/tools/namespace-guard.js.map +1 -0
  149. package/dist/src/tools/spec-loader.d.ts +17 -1
  150. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  151. package/dist/src/tools/spec-loader.js +71 -13
  152. package/dist/src/tools/spec-loader.js.map +1 -1
  153. package/dist/src/tools/team-members.d.ts +16 -0
  154. package/dist/src/tools/team-members.d.ts.map +1 -1
  155. package/dist/src/tools/team-members.js +31 -0
  156. package/dist/src/tools/team-members.js.map +1 -1
  157. package/package.json +1 -1
  158. package/workflows/delegate-usage.md +330 -0
@@ -0,0 +1,330 @@
1
+ # Delegate Execution Specification
2
+
3
+ <purpose>
4
+ Unified reference for `maestro delegate` — async task delegation via detached worker processes, with broker-managed lifecycle, message injection, and MCP notifications. Superset of `maestro cli` with async execution, cancellation, and message chaining.
5
+ </purpose>
6
+
7
+ **References**: `~/.maestro/cli-tools.json` (tool config), `~/.maestro/templates/cli/` (protocol + prompt templates)
8
+
9
+ ---
10
+
11
+ ## 1. Quick Reference
12
+
13
+ <context>
14
+
15
+ ### Command Syntax
16
+
17
+ ```bash
18
+ maestro delegate "<PROMPT>" [options]
19
+ ```
20
+
21
+ ### Options
22
+
23
+ | Option | Description | Default |
24
+ |--------|-------------|---------|
25
+ | `--to <tool>` | Tool: gemini, qwen, codex, claude, opencode | First enabled in config |
26
+ | `--mode <mode>` | `analysis` (read-only) or `write` (create/modify/delete) | `analysis` |
27
+ | `--model <model>` | Model override | Tool's `primaryModel` |
28
+ | `--cd <dir>` | Working directory | Current directory |
29
+ | `--rule <template>` | Load protocol + prompt template | — (optional) |
30
+ | `--id <id>` | Execution ID | Auto: `{prefix}-{HHmmss}-{rand4}` |
31
+ | `--resume [id]` | Resume previous session (last if no id) | — |
32
+ | `--includeDirs <dirs>` | Additional directories (comma-separated) | — |
33
+ | `--session <id>` | MCP session ID for completion notifications | Auto-detected |
34
+ | `--backend <type>` | Adapter backend: `direct` or `terminal` (tmux/wezterm) | `direct` |
35
+ | `--async` | Run in background and return immediately | foreground |
36
+
37
+ ### Mode Definition (Authoritative)
38
+
39
+ | Mode | Permission | Auto-Invoke Safe | Use For |
40
+ |------|-----------|------------------|---------|
41
+ | `analysis` | Read-only | Yes | Review, exploration, diagnosis, architecture analysis |
42
+ | `write` | Create/Modify/Delete | No — requires explicit intent | Implementation, bug fixes, refactoring |
43
+
44
+ > `--mode` is the **authoritative** permission control. The `MODE:` field inside prompt text is a hint for the agent — both should be consistent, but `--mode` governs actual behavior.
45
+ </context>
46
+
47
+ ---
48
+
49
+ ## 2. Configuration
50
+
51
+ <context>
52
+
53
+ ### Config File: `~/.maestro/cli-tools.json`
54
+
55
+ | Field | Description |
56
+ |-------|-------------|
57
+ | `enabled` | Tool availability |
58
+ | `primaryModel` | Default model |
59
+ | `secondaryModel` | Fallback model |
60
+ | `tags` | Capability tags (for caller-side routing) |
61
+ | `type` | `builtin` / `cli-wrapper` / `api-endpoint` |
62
+
63
+ > `api-endpoint` tools support **analysis only** — no file write capability.
64
+
65
+ ### Tool Selection
66
+
67
+ 1. Explicit `--to` specified → use it (validate enabled)
68
+ 2. No `--to` → first enabled tool in config order
69
+
70
+ ### Fallback Chain
71
+
72
+ Primary model fails → `secondaryModel` → next enabled tool → first enabled (default).
73
+
74
+ ### MCP Server Startup
75
+
76
+ ```bash
77
+ # Claude Code — load Maestro as development MCP server
78
+ claude --dangerously-load-development-channels server:maestro --dangerously-skip-permissions
79
+ ```
80
+
81
+ With MCP connected, all delegate tools are available programmatically.
82
+ </context>
83
+
84
+ ---
85
+
86
+ ## 3. Prompt Construction
87
+
88
+ <context>
89
+
90
+ ### Assembly Order
91
+
92
+ `maestro delegate` builds the final prompt identically to `maestro cli`:
93
+
94
+ 1. **Mode protocol** — `~/.maestro/templates/cli/protocols/{mode}-protocol.md`
95
+ 2. **User prompt** — the positional `"<PROMPT>"` value
96
+ 3. **Rule template** — `~/.maestro/templates/cli/prompts/{rule}.txt` (if `--rule` specified)
97
+
98
+ ### Prompt Template (6 Fields)
99
+
100
+ ```
101
+ PURPOSE: [goal] + [why] + [success criteria]
102
+ TASK: [step 1] | [step 2] | [step 3]
103
+ MODE: analysis|write
104
+ CONTEXT: @[file patterns] | Memory: [prior work context]
105
+ EXPECTED: [output format] + [quality criteria]
106
+ CONSTRAINTS: [scope limits] | [special requirements]
107
+ ```
108
+
109
+ - **PURPOSE**: What + Why + Success. Not "Analyze code" but "Identify auth vulnerabilities; success = OWASP Top 10 covered"
110
+ - **TASK**: Specific verbs. Not "Review code" but "Scan for SQL injection | Check XSS | Verify CSRF"
111
+ - **MODE**: Must match `--mode` flag
112
+ - **CONTEXT**: File scope + memory from prior work
113
+ - **EXPECTED**: Deliverable format, not just "Report"
114
+ - **CONSTRAINTS**: Task-specific limits (vs `--rule` which loads generic templates)
115
+
116
+ ### CONTEXT: File Patterns + Directory
117
+
118
+ - `@**/*` — all files in working directory (default)
119
+ - `@src/**/*.ts` — scoped pattern
120
+ - `@../shared/**/*` — sibling directory (**requires `--includeDirs`**)
121
+
122
+ **Rule**: If CONTEXT uses `@../dir/**/*`, must add `--includeDirs ../dir`.
123
+
124
+ ```bash
125
+ maestro delegate "CONTEXT: @**/* @../shared/**/*" --to gemini --mode analysis \
126
+ --cd "src/auth" --includeDirs "../shared"
127
+ ```
128
+
129
+ ### CONTEXT: Memory
130
+
131
+ Include when building on previous work:
132
+
133
+ ```
134
+ Memory: Building on auth refactoring (commit abc123), implementing refresh tokens
135
+ Memory: Integration with auth module, using shared error patterns
136
+ ```
137
+
138
+ ### --rule Templates
139
+
140
+ **Universal**: `universal-rigorous-style`, `universal-creative-style`
141
+
142
+ **Analysis**: `analysis-trace-code-execution`, `analysis-diagnose-bug-root-cause`, `analysis-analyze-code-patterns`, `analysis-analyze-technical-document`, `analysis-review-architecture`, `analysis-review-code-quality`, `analysis-analyze-performance`, `analysis-assess-security-risks`
143
+
144
+ **Planning**: `planning-plan-architecture-design`, `planning-breakdown-task-steps`, `planning-design-component-spec`, `planning-plan-migration-strategy`
145
+
146
+ **Development**: `development-implement-feature`, `development-refactor-codebase`, `development-generate-tests`, `development-implement-component-ui`, `development-debug-runtime-issues`
147
+
148
+ ### Complete Example
149
+
150
+ ```bash
151
+ maestro delegate "PURPOSE: Identify OWASP Top 10 vulnerabilities in auth module; success = all critical/high documented with remediation
152
+ TASK: Scan for injection flaws | Check auth bypass vectors | Evaluate session management | Assess data exposure
153
+ MODE: analysis
154
+ CONTEXT: @src/auth/**/* @src/middleware/auth.ts | Memory: Using bcrypt + JWT
155
+ EXPECTED: Severity matrix, file:line references, remediation snippets, priority ranking
156
+ CONSTRAINTS: Focus on authentication | Ignore test files
157
+ " --to gemini --mode analysis --rule analysis-assess-security-risks --cd "src/auth" --async
158
+ ```
159
+ </context>
160
+
161
+ ---
162
+
163
+ ## 4. Execution
164
+
165
+ <execution>
166
+
167
+ ### Execution ID
168
+
169
+ ID prefix: gemini→`gem`, qwen→`qwn`, codex→`cdx`, claude→`cld`, opencode→`opc`
170
+
171
+ Format: `{prefix}-{HHmmss}-{rand4}` (e.g. `gem-143022-a7f2`)
172
+
173
+ Output to stderr: `[MAESTRO_EXEC_ID=<id>]`
174
+
175
+ ```bash
176
+ maestro delegate "analyze code" --to gemini --async # auto-ID: gem-143022-a7f2
177
+ maestro delegate "fix bug" --to gemini --mode write --id my-task-1 # custom ID
178
+ ```
179
+
180
+ ### Session Resume
181
+
182
+ ```bash
183
+ maestro delegate "continue" --to gemini --resume # last session
184
+ maestro delegate "continue" --to gemini --resume <id> # specific session
185
+ ```
186
+
187
+ Resume auto-assembles previous conversation context. Warning emitted when context exceeds 32KB.
188
+
189
+ ### Subcommands
190
+
191
+ ```bash
192
+ # List executions
193
+ maestro delegate show # recent 20
194
+ maestro delegate show --all # up to 100
195
+
196
+ # Inspect state
197
+ maestro delegate status <id> # broker + history + snapshot preview
198
+ maestro delegate status <id> --events 10 # with more broker events
199
+ maestro delegate tail <id> # recent events + history
200
+ maestro delegate tail <id> --events 20 --history 20
201
+
202
+ # Get result
203
+ maestro delegate output <id> # assistant output
204
+ maestro delegate output <id> --verbose # include timestamps
205
+
206
+ # Lifecycle control
207
+ maestro delegate cancel <id> # request cancellation
208
+
209
+ # Message delivery
210
+ maestro delegate message <id> "text" # inject into running worker
211
+ maestro delegate message <id> "text" --delivery after_complete # chain after done
212
+ maestro delegate messages <id> # list queued messages
213
+ ```
214
+
215
+ ### MCP Tools
216
+
217
+ All subcommands are also available as MCP tools for programmatic access:
218
+
219
+ | CLI Subcommand | MCP Tool | Extra Params |
220
+ |---------------|----------|-------------|
221
+ | `message <id> "text"` | `delegate_message` | `delivery` (inject/after_complete) |
222
+ | `messages <id>` | `delegate_messages` | — |
223
+ | `status <id>` | `delegate_status` | `eventLimit` |
224
+ | `output <id>` | `delegate_output` | — |
225
+ | `tail <id>` | `delegate_tail` | `limit` |
226
+ | `cancel <id>` | `delegate_cancel` | — |
227
+
228
+ ### Snapshot & Preview
229
+
230
+ `delegate status` includes a `Preview:` field showing the agent's latest output — built from `assistant_message`, `tool_use` completions, and `file_change` events. This serves the same purpose as `maestro cli watch` without requiring real-time streaming.
231
+
232
+ ### Job Lifecycle
233
+
234
+ ```
235
+ queued → running → completed
236
+ → failed
237
+ → cancelled
238
+
239
+ input_required
240
+ ```
241
+
242
+ ### Message Delivery
243
+
244
+ | Mode | Behavior | Use For |
245
+ |------|----------|---------|
246
+ | `inject` | Routes to running worker stdin; non-interactive adapters auto cancel + relaunch | Supplementary context, course correction |
247
+ | `after_complete` | Queues message; relaunches delegate with queued message on completion | Chained tasks, post-processing |
248
+
249
+ ### Notification Channels
250
+
251
+ Delegate completion notifies the caller through dual channels:
252
+
253
+ 1. **MCP channel** (primary) — push notification with structured meta (exec_id, event_type, status)
254
+ 2. **Hook fallback** — JSONL file read by `delegate-monitor` PostToolUse hook
255
+
256
+ Throttling: `status_update` at 10s, `snapshot` at 15s.
257
+ </execution>
258
+
259
+ ---
260
+
261
+ ## 5. Auto-Invoke Triggers
262
+
263
+ <execution>
264
+
265
+ Proactively invoke `maestro delegate` when these conditions are met — no user confirmation needed for `analysis` mode:
266
+
267
+ | Trigger | Suggested Rule |
268
+ |---------|---------------|
269
+ | Self-repair fails (1+ attempts) | `analysis-diagnose-bug-root-cause` |
270
+ | Ambiguous requirements | `planning-breakdown-task-steps` |
271
+ | Architecture decisions needed | `planning-plan-architecture-design` |
272
+ | Pattern uncertainty | `analysis-analyze-code-patterns` |
273
+ | Critical/security code paths | `analysis-assess-security-risks` |
274
+
275
+ ### Principles
276
+
277
+ - Default `--mode analysis` (safe, read-only)
278
+ - Use `--async` for non-blocking execution; await MCP notification for result
279
+ - Tool fallback: `gemini` → `qwen` → `codex`
280
+ - Rule suggestions are guidelines — choose the best fit
281
+ - Use `inject` for supplementary context mid-execution; `after_complete` for chained multi-step tasks
282
+ - Check `delegate status` for snapshot preview instead of polling output
283
+ </execution>
284
+
285
+ ---
286
+
287
+ ## 6. Workflows
288
+
289
+ <execution>
290
+
291
+ ### Launch → Monitor → Retrieve
292
+
293
+ ```bash
294
+ maestro delegate "analyze auth module" --to gemini --async
295
+ # → [MAESTRO_EXEC_ID=gem-143022-a7f2]
296
+
297
+ maestro delegate status gem-143022-a7f2
298
+ # → status: running, Preview: "Found 3 potential injection points..."
299
+
300
+ # Await MCP channel notification...
301
+ # → [DELEGATE DONE] gem-143022-a7f2 gemini/analysis completed
302
+
303
+ maestro delegate output gem-143022-a7f2
304
+ # → full analysis result
305
+ ```
306
+
307
+ ### Inject Supplementary Context
308
+
309
+ ```bash
310
+ maestro delegate message gem-143022-a7f2 "Also check src/utils/sanitize.ts"
311
+ # → accepted: true, delivery: inject
312
+ ```
313
+
314
+ ### Chain: Analyze → Auto-Fix
315
+
316
+ ```bash
317
+ maestro delegate "find SQL injection vulnerabilities" --to gemini --async
318
+ maestro delegate message gem-143022-a7f2 "Fix all critical vulnerabilities" --delivery after_complete
319
+ # → queued, auto-relaunches after analysis completes
320
+ ```
321
+
322
+ ### Cancel → Redirect
323
+
324
+ ```bash
325
+ maestro delegate cancel gem-143022-a7f2
326
+ # → cancellation requested
327
+
328
+ maestro delegate "analyze only the payment module" --to gemini --async
329
+ ```
330
+ </execution>