maestro-flow 0.5.39 → 0.5.40

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 (102) hide show
  1. package/.codex/agents/cli-explore-agent.toml +181 -0
  2. package/.codex/agents/cross-role-reviewer.toml +165 -0
  3. package/.codex/agents/impeccable-agent.toml +89 -0
  4. package/.codex/agents/role-design-author.toml +213 -0
  5. package/.codex/agents/team-worker.toml +4 -7
  6. package/.codex/agents/ui-design-agent.toml +260 -0
  7. package/.codex/agents/workflow-analyzer.toml +106 -0
  8. package/.codex/agents/workflow-codebase-mapper.toml +69 -0
  9. package/.codex/agents/workflow-collab-planner.toml +140 -0
  10. package/.codex/agents/workflow-debugger.toml +95 -0
  11. package/.codex/agents/workflow-executor.toml +124 -0
  12. package/.codex/agents/workflow-external-researcher.toml +80 -0
  13. package/.codex/agents/workflow-integration-checker.toml +76 -0
  14. package/.codex/agents/workflow-nyquist-auditor.toml +77 -0
  15. package/.codex/agents/workflow-phase-researcher.toml +76 -0
  16. package/.codex/agents/workflow-plan-checker.toml +93 -0
  17. package/.codex/agents/workflow-planner.toml +192 -0
  18. package/.codex/agents/workflow-project-researcher.toml +65 -0
  19. package/.codex/agents/workflow-research-synthesizer.toml +65 -0
  20. package/.codex/agents/workflow-reviewer.toml +75 -0
  21. package/.codex/agents/workflow-roadmapper.toml +75 -0
  22. package/.codex/agents/workflow-verifier.toml +113 -0
  23. package/.codex/skills/maestro/SKILL.md +1 -0
  24. package/.codex/skills/maestro-analyze/SKILL.md +33 -15
  25. package/.codex/skills/maestro-brainstorm/SKILL.md +13 -10
  26. package/.codex/skills/maestro-collab/SKILL.md +30 -75
  27. package/.codex/skills/maestro-execute/SKILL.md +19 -12
  28. package/.codex/skills/maestro-grill/SKILL.md +12 -11
  29. package/.codex/skills/maestro-next/SKILL.md +3 -3
  30. package/.codex/skills/maestro-overlay/SKILL.md +1 -1
  31. package/.codex/skills/maestro-plan/SKILL.md +17 -8
  32. package/.codex/skills/maestro-ralph/SKILL.md +3 -0
  33. package/.codex/skills/maestro-ralph-execute/SKILL.md +1 -0
  34. package/.codex/skills/maestro-roadmap/SKILL.md +14 -8
  35. package/.codex/skills/manage-learn/SKILL.md +1 -1
  36. package/.codex/skills/odyssey-debug/SKILL.md +84 -3
  37. package/.codex/skills/odyssey-improve/SKILL.md +86 -9
  38. package/.codex/skills/odyssey-ui/SKILL.md +105 -28
  39. package/.codex/skills/quality-review/SKILL.md +17 -10
  40. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +6 -12
  41. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +6 -14
  42. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +2 -6
  43. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +6 -14
  44. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +3 -7
  45. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -5
  46. package/.codex/skills/team-review/roles/reviewer/role.md +2 -5
  47. package/.codex/skills/team-review/roles/scanner/role.md +2 -5
  48. package/.codex/skills/team-tech-debt/roles/executor/role.md +3 -7
  49. package/.codex/skills/team-tech-debt/roles/scanner/role.md +2 -5
  50. package/.codex/skills/team-tech-debt/roles/validator/role.md +3 -7
  51. package/.codex/skills/team-testing/roles/executor/role.md +3 -7
  52. package/.codex/skills/team-testing/roles/generator/role.md +3 -7
  53. package/dashboard/dist-server/src/commands/install-backend.js +19 -0
  54. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  55. package/dashboard/dist-server/src/core/manifest.d.ts +5 -0
  56. package/dashboard/dist-server/src/core/manifest.js.map +1 -1
  57. package/dashboard/dist-server/src/core/plugin-bridge.d.ts +59 -0
  58. package/dashboard/dist-server/src/core/plugin-bridge.js +355 -0
  59. package/dashboard/dist-server/src/core/plugin-bridge.js.map +1 -0
  60. package/dist/src/cli.js +19 -1
  61. package/dist/src/cli.js.map +1 -1
  62. package/dist/src/commands/install-backend.d.ts.map +1 -1
  63. package/dist/src/commands/install-backend.js +19 -0
  64. package/dist/src/commands/install-backend.js.map +1 -1
  65. package/dist/src/commands/install.d.ts.map +1 -1
  66. package/dist/src/commands/install.js +17 -1
  67. package/dist/src/commands/install.js.map +1 -1
  68. package/dist/src/commands/plugin.d.ts +3 -0
  69. package/dist/src/commands/plugin.d.ts.map +1 -0
  70. package/dist/src/commands/plugin.js +137 -0
  71. package/dist/src/commands/plugin.js.map +1 -0
  72. package/dist/src/commands/update.d.ts.map +1 -1
  73. package/dist/src/commands/update.js +23 -0
  74. package/dist/src/commands/update.js.map +1 -1
  75. package/dist/src/core/install-executor.d.ts +1 -1
  76. package/dist/src/core/install-executor.d.ts.map +1 -1
  77. package/dist/src/core/install-executor.js +27 -0
  78. package/dist/src/core/install-executor.js.map +1 -1
  79. package/dist/src/core/install-profile.d.ts +5 -0
  80. package/dist/src/core/install-profile.d.ts.map +1 -1
  81. package/dist/src/core/install-profile.js +8 -0
  82. package/dist/src/core/install-profile.js.map +1 -1
  83. package/dist/src/core/manifest.d.ts +5 -0
  84. package/dist/src/core/manifest.d.ts.map +1 -1
  85. package/dist/src/core/manifest.js.map +1 -1
  86. package/dist/src/core/plugin-bridge.d.ts +60 -0
  87. package/dist/src/core/plugin-bridge.d.ts.map +1 -0
  88. package/dist/src/core/plugin-bridge.js +355 -0
  89. package/dist/src/core/plugin-bridge.js.map +1 -0
  90. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  91. package/dist/src/tui/install-ui/InstallFlow.js +43 -14
  92. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  93. package/dist/src/tui/install-ui/types.d.ts +2 -0
  94. package/dist/src/tui/install-ui/types.d.ts.map +1 -1
  95. package/dist/src/tui/install-ui/types.js.map +1 -1
  96. package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
  97. package/dist/src/tui/install-ui/useInstallFlowState.js +13 -1
  98. package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
  99. package/dist/src/utils/update-notices.js +11 -0
  100. package/dist/src/utils/update-notices.js.map +1 -1
  101. package/package.json +1 -1
  102. package/workflows/shell-exec-protocol.md +30 -0
@@ -35,7 +35,7 @@ $ARGUMENTS -- requirement/idea text or @file reference, plus optional flags.
35
35
  </context>
36
36
 
37
37
  <interview_protocol>
38
- Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `--revise`, `--review`, `-c`, or input is already specific (clear requirement + mode).
38
+ Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip ONLY when `-y/--yes`, `--revise`, `--review`, or `-c` is set. Text requirements always require at least scope + strategy confirmation — never auto-classify input as "specific enough" to skip.
39
39
 
40
40
  - One decision per turn via request_user_input with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally at any time.
41
41
  - Search-first when uncertain: before asking, resolve via `state.json`, existing `roadmap.md`, `project.md`, `maestro load --type spec`, `maestro search`, `maestro explore` (preferred, fallback Glob/Grep/Read). Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
@@ -73,8 +73,8 @@ Wave 1: 3 analysis rows (parallel). Wave 2: 1 assembly row.
73
73
  2. **CSV is source of truth**: Master tasks.csv holds all state
74
74
  3. **Context propagation**: prev_context from master CSV, not memory
75
75
  4. **Discovery board append-only**: Never modify/delete discoveries.ndjson
76
- 5. **Graceful degradation**: Wave 1 fails -> Wave 2 proceeds with seed input only. When degradation activates, flag downstream outputs as LOW CONFIDENCE.
77
- 6. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation.
76
+ 5. **Graceful degradation**: Wave 1 fails -> Wave 2 proceeds with seed input only. When degradation activates, flag downstream outputs as LOW CONFIDENCE. Record `degradation_event` in discoveries.ndjson. This is a defined degradation path, not a violation of invariant 6.
77
+ 6. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Defined degradation paths (invariant 5) are not violations.
78
78
  7. **Requirement mapping completeness** — every Active requirement from project.md MUST be mapped to exactly one phase. No circular dependencies in phase ordering.
79
79
  8. **Artifact verification before completion** — .workflow/roadmap.md MUST exist with Milestone > Phase hierarchy and progress table. Artifact MUST be registered in state.json. If missing: DO NOT report completion.
80
80
  </invariants>
@@ -104,10 +104,13 @@ S_CSV_GEN:
104
104
  -> S_WAVE_1 DO: generate analysis CSV
105
105
 
106
106
  S_WAVE_1:
107
- -> S_WAVE_2 DO: A_SPAWN_WAVE_1
107
+ -> S_WAVE_2 WHEN: 1+ completed DO: A_SPAWN_WAVE_1. For failed analysis tasks: exclude from prev_context and append gap_note to W2 instruction listing missing angles.
108
+ -> S_WAVE_1 WHEN: all failed, retry available DO: retry once
109
+ -> S_WAVE_2 WHEN: all failed, retry exhausted DO: proceed with seed input only, flag LOW CONFIDENCE (invariant 5 degradation)
108
110
 
109
111
  S_WAVE_2:
110
- -> S_AGGREGATE DO: A_SPAWN_WAVE_2
112
+ -> S_AGGREGATE WHEN: completed DO: A_SPAWN_WAVE_2
113
+ -> ERROR WHEN: failed DO: abort "Roadmap generation failed"
111
114
 
112
115
  S_AGGREGATE:
113
116
  -> END DO: A_AGGREGATE_RESULTS
@@ -178,7 +181,7 @@ Assembly agent produces roadmap.md with Milestone > Phase hierarchy (goal, depen
178
181
  2. Interactive refinement (max 3 rounds, skip if -y): Approve / Refine / Regenerate
179
182
  3. Generate context.md (summary + analysis findings + roadmap stats)
180
183
  4. Write .workflow/roadmap.md with Milestone > Phase hierarchy
181
- 5. Update state.json milestones + current_milestone
184
+ 5. Update state.json milestones + current_milestone + register RDM artifact
182
185
  6. **Generate context-package.json** (schema `context-package/1.0`):
183
186
  ```jsonc
184
187
  {
@@ -194,7 +197,11 @@ Assembly agent produces roadmap.md with Milestone > Phase hierarchy (goal, depen
194
197
  }
195
198
  ```
196
199
  Register `context_package` path in RDM artifact entry so downstream `--from roadmap:ID` can resolve.
197
- 7. Next-step routing: need analysis -> maestro-analyze; ready to plan -> maestro-plan; UI first -> maestro-impeccable build; need formal specs -> maestro-blueprint
200
+ 7. **Next-step suggestion** (suggest only, NEVER auto-execute): display the recommended next command. The user decides whether to proceed.
201
+ - Need analysis → `maestro-analyze`
202
+ - Ready to plan → `maestro-plan`
203
+ - UI first → `maestro-impeccable build`
204
+ - Need formal specs → `maestro-blueprint`
198
205
 
199
206
  </actions>
200
207
 
@@ -243,4 +250,3 @@ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
243
250
  ```
244
251
  Status verdicts: **DONE** (normal), **DONE_WITH_CONCERNS** (caveats; pass `--concerns`), **NEEDS_RETRY** (transient error), **BLOCKED** (hard blocker; pass `--reason`).
245
252
  </ralph_completion>
246
- </output>
@@ -47,7 +47,7 @@ $manage-learn "\"Zod v4 breaks z.object().strict() API\" --category gotcha --tag
47
47
  </context>
48
48
 
49
49
  <invariants>
50
- 1. **No LLM or CLI calls**: This skill is pure file I/O — parse, infer, append, confirm. No `exec_command`, no `spawn_agent`.
50
+ 1. **No LLM or CLI calls**: This skill is pure file I/O — parse, infer, append, confirm. No `shell_exec`, no `spawn_agent`.
51
51
  2. **Bootstrap on demand**: Create `.workflow/knowhow/` structure on first use; do not require it to exist.
52
52
  3. **Append-only learnings.md**: Never rewrite or delete existing entries.
53
53
  4. **Stable INS-ids**: `INS-{8hex}` from `hash(insightText + timestamp)` — same text at different times gets different ids.
@@ -98,6 +98,36 @@ $ARGUMENTS — issue description and optional flags.
98
98
  | 可复用泛化 pattern | `/spec-add coding "..."` |
99
99
  </context>
100
100
 
101
+ <csv_schema>
102
+ ### Shared Output Schema (all waves)
103
+ ```json
104
+ {
105
+ "type": "object",
106
+ "properties": {
107
+ "id": {"type":"string"}, "result_status": {"type":"string","enum":["completed","failed"]},
108
+ "findings": {"type":"string","maxLength":500}, "evidence": {"type":"string"}, "error": {"type":"string"}
109
+ },
110
+ "required": ["id","result_status","findings"]
111
+ }
112
+ ```
113
+
114
+ **Termination Contract** (embed in every instruction):
115
+ ```
116
+ You MUST call report_agent_job_result EXACTLY ONCE before exiting.
117
+ Success → result_status=completed | Failure → result_status=failed with error | Timeout → completed with partial.
118
+ NEVER continue indefinitely. NEVER exit silently. Read-only — do NOT modify source files.
119
+ Do NOT write to tasks.csv, wave-*.csv, results.csv. Do NOT call spawn_agents_on_csv.
120
+ ```
121
+
122
+ ### tasks.csv
123
+ ```csv
124
+ id,title,description,task_type,deps,wave,status,findings,evidence,error
125
+ ```
126
+ - Wave 1: Archaeology (git-timeline, git-blame) — parallel
127
+ - Wave 2: Generalization (syntax-grep, semantic-scan, structural-match, historical-grep) — parallel, depends on root cause
128
+ - Single-agent stages (explore, diagnose, fix, confirm) remain inline
129
+ </csv_schema>
130
+
101
131
  <self_iteration>
102
132
  适用阶段: S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE
103
133
  </self_iteration>
@@ -152,9 +182,25 @@ S_RECORD → END : A_RECORD complete
152
182
  Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
153
183
 
154
184
  ### A_ARCHAEOLOGY
155
- **2 parallel agents (spawn_agents_on_csv):** Timeline (`git log --oneline -20 -- {files}`) + Blame (top 3 suspicious files `git blame -L {region}`). Append evidence (phase: "archaeology").
185
+ **Step 1 Git archaeology (spawn_agents_on_csv, Wave 1):**
186
+
187
+ Write `tasks.csv` with Wave 1 rows:
188
+ ```csv
189
+ id,title,description,task_type,deps,wave,status,findings,evidence,error
190
+ "arch-timeline","Git Timeline","Run git log --oneline -20 -- {files}. Return [{sha,date,author,message,files_changed}] as JSON.","archaeology","","1","pending","","",""
191
+ "arch-blame","Git Blame","Top 3 suspicious files: git blame -L {region}. Return [{file,line_range,sha,author,date,content}] as JSON.","archaeology","","1","pending","","",""
192
+ ```
193
+
194
+ ```javascript
195
+ spawn_agents_on_csv({ csv_path:"tasks.csv", id_column:"id",
196
+ instruction: ARCHAEOLOGY_INSTRUCTION + TERMINATION_CONTRACT,
197
+ max_concurrency:2, max_runtime_seconds:300,
198
+ output_csv_path:"wave-1-results.csv", output_schema: SHARED_OUTPUT_SCHEMA })
199
+ ```
200
+
201
+ Merge results → evidence.ndjson (phase: "archaeology").
156
202
 
157
- **CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
203
+ **Step 2 — CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
158
204
  - PURPOSE: Review recent modifications related to {issue}
159
205
  - EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
160
206
 
@@ -200,7 +246,42 @@ Increment `diagnosis_retries`. < 3: broaden via `maestro delegate --role analyze
200
246
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): CONFIRM — 修复验证"`
201
247
 
202
248
  ### A_GENERALIZE
203
- base A_GENERALIZE 执行。Pattern 来源: root cause + fix。统计写入 `session.json.generalization_stats`。Mark G4 done.
249
+ Skip if `--skip-generalize`. Pattern 来源: root cause + fix
250
+
251
+ **Step 1 — Multi-layer pattern extraction:**
252
+
253
+ | Layer | Method | Example |
254
+ |-------|--------|---------|
255
+ | Syntax | Regex patterns (direct Grep) | `eval(`, missing `await`, unclosed resource |
256
+ | Semantic | Anti-pattern description (Agent scan) | Unhandled async errors, unvalidated input |
257
+ | Structural | Architecture-level similarity | Same import structure, missing override |
258
+
259
+ Write `session.json.patterns[]`: `[{id, source, layer, signature, description, risk, fix_template}]`
260
+
261
+ **Step 2 — 4-agent scan (spawn_agents_on_csv, Wave 2):**
262
+
263
+ Append Wave 2 rows to `tasks.csv`:
264
+ ```csv
265
+ "gen-syntax","Syntax Grep","Grep syntax-layer signatures '${signature}' across project. Return [{file,line,context,risk_level,layer:'syntax',confidence}].","generalization","","2","pending","","",""
266
+ "gen-semantic","Semantic Scan","Check related modules for anti-pattern: ${description}. Return [{file,line,context,risk_level,layer:'semantic',confidence}].","generalization","","2","pending","","",""
267
+ "gen-structural","Structural Match","Find structurally similar files to ${buggy_files}, check for anti-pattern. Return [{file,line,description,risk,layer:'structural',confidence}].","generalization","","2","pending","","",""
268
+ "gen-historical","Historical Grep","Run git log -S '${signature}' --oneline. Return [{sha,file,date,type:'introduced|fixed',context}].","generalization","","2","pending","","",""
269
+ ```
270
+
271
+ ```javascript
272
+ spawn_agents_on_csv({ csv_path:"tasks.csv", id_column:"id",
273
+ instruction: GENERALIZATION_INSTRUCTION + TERMINATION_CONTRACT,
274
+ max_concurrency:4, max_runtime_seconds:300,
275
+ output_csv_path:"wave-2-results.csv", output_schema: SHARED_OUTPUT_SCHEMA })
276
+ ```
277
+
278
+ **Step 3 — Cross-layer dedup**: same file:line multi-layer → boost confidence | single-layer → `needs_review` | historical fixed → `regression_risk`
279
+
280
+ **Step 4 — Iterative deepening**: module ≥3 hits → targeted deep scan (max 1 round).
281
+
282
+ **Step 5 — Quality Gate** (self-iteration).
283
+
284
+ **Step 6:** Write `session.json.generalization_stats`: `{patterns_extracted, total_hits, cross_layer_confirmed, regression_risks, by_layer, deepening_triggered}`. Update §7. Mark G4 done.
204
285
 
205
286
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): GENERALIZE — 泛化扫描完成"`
206
287
 
@@ -109,6 +109,38 @@ S_RECORD 阶段将可沉淀知识 **写入 understanding.md §9 Learnings**,
109
109
  | 可靠性 pattern | 故障模式 + 处理策略 + 验证手段 | `/spec-add coding "..."` |
110
110
  </context>
111
111
 
112
+ <csv_schema>
113
+
114
+ ### Shared Output Schema (all waves)
115
+ ```json
116
+ {
117
+ "type": "object",
118
+ "properties": {
119
+ "id": { "type": "string" },
120
+ "result_status": { "type": "string", "enum": ["completed", "failed"] },
121
+ "findings": { "type": "string", "maxLength": 500 },
122
+ "evidence": { "type": "string" },
123
+ "error": { "type": "string" }
124
+ },
125
+ "required": ["id", "result_status", "findings"]
126
+ }
127
+ ```
128
+
129
+ **Termination contract:** Call `report_agent_job_result` EXACTLY ONCE. Read-only. Do NOT modify source files, tasks.csv, wave-*.csv, results.csv, or call spawn_agents_on_csv.
130
+
131
+ ### tasks.csv
132
+ ```csv
133
+ id,title,description,task_type,dimension,deps,wave,status,findings,evidence,error
134
+ ```
135
+
136
+ **Waves:**
137
+ | Wave | Tasks | Parallelism |
138
+ |------|-------|-------------|
139
+ | 1 | Survey (dependency-audit, complexity-scan) | 2 agents |
140
+ | 2 | Audit (performance, security, architecture, reliability, observability, maintainability) | 6 agents |
141
+ | 3 | Generalization (syntax-grep, semantic-scan, structural-match, historical-grep) | 4 agents |
142
+ </csv_schema>
143
+
112
144
  Self-iteration 适用阶段: S_SURVEY, S_AUDIT, S_DIAGNOSE, S_GENERALIZE
113
145
 
114
146
  <state_machine>
@@ -181,19 +213,34 @@ S_RECORD → END DO A_RECORD
181
213
  Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
182
214
 
183
215
  ### A_SURVEY
184
- Current state survey — understand what exists before proposing changes.
216
+ **spawn_agents_on_csv (Wave 1):**
217
+
218
+ Write `tasks.csv` with Wave 1 rows:
219
+ ```csv
220
+ "survey-deps","Dependency Audit","Analyze dependencies for {target_files}: package versions, known CVEs, unused deps, circular imports, dep depth. Return [{dep,version,issue_type,severity,detail}].","survey","","","1","pending","","",""
221
+ "survey-complexity","Complexity Scan","Measure complexity for {target_files}: cyclomatic complexity, function length, nesting depth, file size, export count. Return [{file,metric,value,threshold,status}].","survey","","","1","pending","","",""
222
+ ```
223
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:2, max_runtime_seconds:300, output_csv_path:"wave-1-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
185
224
 
186
- 1. Dependency audit (package.json/lock), complexity scan (size/nesting), test coverage map, error handling scan (empty catch, unhandled promise)
187
- 2. **CLI-assisted** (optional): `maestro delegate` with `--role analyze --mode analysis` for dependency health, complexity hotspots, coverage gaps, error patterns. Execute `run_in_background: true`.
188
- 3. Append evidence.ndjson (phase: "survey"). Update `understanding.md` §2. Mark G1 done.
225
+ Merge evidence.ndjson (phase: "survey"). Extract `baseline_metrics` from survey results. Update `understanding.md` §2. Mark G1 done.
189
226
 
190
227
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): SURVEY — 现状调查"`
191
228
 
192
229
  ### A_AUDIT
193
- Spawn 6 parallel agents via `spawn_agents_on_csv` (one per dimension from Dimensions list above, or `--dimensions` subset).
194
- Each returns: `[{title, severity, dimension, file, line, description, suggestion, measurement}]`
195
-
196
- Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result`.
230
+ **spawn_agents_on_csv (Wave 2)** 6 agents (one per dimension, or `--dimensions` subset):
231
+
232
+ Append Wave 2 rows to `tasks.csv`:
233
+ ```csv
234
+ "audit-perf","Performance","Hot paths, N+1 queries, memory allocation, cache strategy, bundle analysis, lazy loading for {target_files}","audit","performance","","2","pending","","",""
235
+ "audit-security","Security","OWASP Top 10: injection, broken auth, data exposure, XXE, access control, misconfig, XSS, deserialization, deps, logging for {target_files}","audit","security","","2","pending","","",""
236
+ "audit-arch","Architecture","Layer boundaries, circular deps, coupling metrics, interface contracts, SRP compliance, dependency direction for {target_files}","audit","architecture","","2","pending","","",""
237
+ "audit-reliability","Reliability","Error handling completeness, retry logic, timeout config, circuit breakers, graceful degradation, resource cleanup for {target_files}","audit","reliability","","2","pending","","",""
238
+ "audit-observability","Observability","Logging coverage, structured logs, metrics emission, trace propagation, error reporting, health endpoints for {target_files}","audit","observability","","2","pending","","",""
239
+ "audit-maintain","Maintainability","Dead code, complex conditionals, test coverage gaps, magic numbers, naming clarity, doc debt for {target_files}","audit","maintainability","","2","pending","","",""
240
+ ```
241
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:6, max_runtime_seconds:600, output_csv_path:"wave-2-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
242
+
243
+ Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result` with dimensions audited, finding count, severity distribution.
197
244
  Update `understanding.md` §3 (findings by dimension + severity matrix). Mark G2 done.
198
245
 
199
246
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): AUDIT — 多维审查"`
@@ -230,7 +277,37 @@ Skip if `--skip-fix`. Implement improvements for diagnosed root causes.
230
277
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): VERIFY — 改进验证"`
231
278
 
232
279
  ### A_GENERALIZE
233
- base A_GENERALIZE 执行。Pattern 来源: diagnoses + fixes。Mark G5 done.
280
+ Skip if `--skip-generalize`. Pattern 来源: diagnoses + fixes。
281
+
282
+ **Step 1 — Multi-layer pattern extraction:**
283
+
284
+ | Layer | Method | Example |
285
+ |-------|--------|---------|
286
+ | Syntax | Regex patterns (direct Grep) | Missing `await`, unclosed resources, `catch {}` empty |
287
+ | Semantic | Agent anti-pattern scan | Unvalidated input, missing error boundary, no timeout |
288
+ | Structural | Architecture-level similarity | Same import structure, identical anti-pattern |
289
+ | Historical | Git log for pattern introduction | When pattern was introduced, if ever fixed |
290
+
291
+ Write `session.json.patterns[]`: `[{id, source_diagnosis, layer, signature, description, risk, fix_template}]`
292
+
293
+ **Step 2 — 4-agent scan (spawn_agents_on_csv, Wave 3):**
294
+
295
+ Append Wave 3 rows to `tasks.csv`:
296
+ ```csv
297
+ "gen-syntax","Syntax Grep","Grep syntax-layer signatures '${signatures}' across project. Return [{file,line,context,risk_level,layer:'syntax',confidence}].","generalization","syntax","","3","pending","","",""
298
+ "gen-semantic","Semantic Scan","Check related modules for anti-pattern: ${description}. Return [{file,line,context,risk_level,layer:'semantic',confidence}].","generalization","semantic","","3","pending","","",""
299
+ "gen-structural","Structural Match","Find structurally similar files to ${diagnosed_files}, check for same anti-pattern. Return [{file,line,description,risk,layer:'structural',confidence}].","generalization","structural","","3","pending","","",""
300
+ "gen-historical","Historical Grep","Run git log -S '${signature}' --oneline. Return [{sha,file,date,type:'introduced|fixed',context}].","generalization","historical","","3","pending","","",""
301
+ ```
302
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:4, max_runtime_seconds:300, output_csv_path:"wave-3-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
303
+
304
+ **Step 3 — Cross-layer dedup**: same file:line multi-layer → boost confidence | single-layer → `needs_review` | historical fixed → `regression_risk`
305
+
306
+ **Step 4 — Iterative deepening**: module ≥3 hits → targeted deep scan (max 1 round).
307
+
308
+ **Step 5 — Quality Gate** (self-iteration).
309
+
310
+ **Step 6:** Write `generalization_stats`: `{patterns_extracted, total_hits, cross_layer_confirmed, regression_risks, by_layer, deepening_triggered}`. Update §6. Mark G5 done.
234
311
 
235
312
  📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-improve({slug}): GENERALIZE — 泛化扫描"`
236
313
 
@@ -83,6 +83,39 @@ ARCHITECTURE.md | `maestro search "<target>" --json` (top 5) | `maestro load --t
83
83
  | 可复用泛化 pattern | pattern 签名 + 应用范围 | `/spec-add coding "..."` |
84
84
  </context>
85
85
 
86
+ <csv_schema>
87
+
88
+ ### Shared Output Schema (all waves)
89
+ ```json
90
+ {
91
+ "type": "object",
92
+ "properties": {
93
+ "id": { "type": "string" },
94
+ "result_status": { "type": "string", "enum": ["completed", "failed"] },
95
+ "findings": { "type": "string", "maxLength": 500 },
96
+ "evidence": { "type": "string" },
97
+ "error": { "type": "string" }
98
+ },
99
+ "required": ["id", "result_status", "findings"]
100
+ }
101
+ ```
102
+
103
+ **Termination contract:** Call `report_agent_job_result` EXACTLY ONCE. Read-only. Do NOT modify source files, tasks.csv, wave-*.csv, results.csv, or call spawn_agents_on_csv.
104
+
105
+ ### tasks.csv
106
+ ```csv
107
+ id,title,description,task_type,dimension,deps,wave,status,findings,evidence,error
108
+ ```
109
+
110
+ **Waves:**
111
+ | Wave | Tasks | Parallelism |
112
+ |------|-------|-------------|
113
+ | 1 | Survey (design-tokens-audit, pattern-inventory) | 2 agents |
114
+ | 2 | Audit (visual-hierarchy, interaction-states, accessibility, responsiveness, micro-interactions, edge-cases) | 6 agents |
115
+ | 3 | Diverge (polish-agent, delight-agent) | 2 agents |
116
+ | 4 | Generalization (syntax-grep, semantic-scan, structural-match, historical-grep) | 4 agents |
117
+ </csv_schema>
118
+
86
119
  <self_iteration>
87
120
  适用阶段: S_SURVEY, S_AUDIT, S_DIVERGE, S_GENERALIZE
88
121
  </self_iteration>
@@ -147,41 +180,58 @@ S_RECORD → END DO A_RECORD
147
180
  Find latest session via Glob → read `session.json` → display summary → jump to `current_state`.
148
181
 
149
182
  ### A_SURVEY
150
- 1. **Design system inventory**: Scan for design tokens, CSS variables, theme imports
151
- 2. **Current state analysis**: Styling patterns, layout strategy, component hierarchy
152
- 3. **spawn_agents_on_csv (Wave 1)** — 2 agents: design-tokens-audit, pattern-inventory
153
- 4. Append evidence (phase: "survey"). Update §2. Mark G1 done.
183
+ **spawn_agents_on_csv (Wave 1):**
184
+
185
+ Write `tasks.csv` with Wave 1 rows:
186
+ ```csv
187
+ "survey-tokens","Design Token Audit","Scan {target_files} for CSS variables, design tokens, theme values. Return [{token,usage_count,consistency,file,line}].","survey","","","1","pending","","",""
188
+ "survey-patterns","Pattern Inventory","Catalog component patterns, layout, spacing, typography in {target_files}. Return [{pattern,files,consistency}].","survey","","","1","pending","","",""
189
+ ```
190
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:2, max_runtime_seconds:300, output_csv_path:"wave-1-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
191
+
192
+ Merge → evidence.ndjson (phase: "survey"). Update §2. Mark G1 done.
154
193
  📌 `git commit -m "odyssey-ui({slug}): SURVEY — 视觉调查"`
155
194
 
156
195
  ### A_AUDIT
157
- **spawn_agents_on_csv (Wave 2)** — 6 parallel agents (one per dimension, or `--dimensions` subset):
158
-
159
- | Dimension | Focus |
160
- |-----------|-------|
161
- | visual_hierarchy | Spacing, typography scale, color contrast, alignment, whitespace, visual weight |
162
- | interaction_states | Hover, focus, active, disabled, loading, error, empty, selected states |
163
- | accessibility | WCAG AA contrast, focus management, aria labels, keyboard nav, screen reader |
164
- | responsiveness | Breakpoints, overflow, touch targets, fluid typography, container queries |
165
- | micro_interactions | Transitions, animations, feedback indicators, loading states, progress |
166
- | edge_cases | Long text truncation, empty data, error states, extreme values, i18n, RTL |
196
+ **spawn_agents_on_csv (Wave 2)** — 6 agents (one per dimension, or `--dimensions` subset):
197
+
198
+ Append Wave 2 rows to `tasks.csv`:
199
+ ```csv
200
+ "audit-hierarchy","Visual Hierarchy","Spacing, typography scale, contrast, alignment, whitespace, visual weight","audit","visual-hierarchy","","2","pending","","",""
201
+ "audit-interaction","Interaction States","hover/focus/active/disabled/loading/error/empty/selected states","audit","interaction-states","","2","pending","","",""
202
+ "audit-a11y","Accessibility","WCAG AA contrast, focus mgmt, aria, keyboard nav, screen reader","audit","accessibility","","2","pending","","",""
203
+ "audit-responsive","Responsiveness","Breakpoints, overflow, touch targets >=44px, fluid typography","audit","responsiveness","","2","pending","","",""
204
+ "audit-motion","Micro-interactions","Transitions, animations, feedback, loading states, scroll behavior","audit","micro-interactions","","2","pending","","",""
205
+ "audit-edge","Edge Cases","Long text, empty data, error states, extreme values, i18n, RTL","audit","edge-cases","","2","pending","","",""
206
+ ```
207
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:6, max_runtime_seconds:600, output_csv_path:"wave-2-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
167
208
 
168
209
  Each returns `[{title, severity, file, line, description, suggestion, dimension}]`.
169
- Merge → evidence (phase: "audit"). Write `audit_result`. Update §3 (severity matrix). Mark G2 done.
210
+ Merge → evidence (phase: "audit"). Write `audit_result` with dimensions, finding count, severity distribution. Update §3 (severity matrix). Mark G2 done.
170
211
  📌 `git commit -m "odyssey-ui({slug}): AUDIT — 多维审查"`
171
212
 
172
213
  ### A_DIVERGE
173
- Goes beyond defect fixing "what would make this delightful?"
174
-
175
- **Step 1 — spawn_agents_on_csv (Wave 3)** — 2 parallel agents:
176
- - **Polish Agent**: Shadows, borders, transitions, hover states, feedback, empty states, skeleton loading, scroll behavior
177
- - **Delight Agent**: Motion design, progressive disclosure, smart defaults, contextual hints, celebratory feedback, personality in copy
178
-
179
- Each returns `[{idea, category (polish|delight), impact, effort, description, inspiration}]`
214
+ **spawn_agents_on_csv (Wave 3)**2 agents:
180
215
 
181
- **Step 2 CLI-assisted** (optional): `maestro delegate` with `--role analyze` — polish opportunities, micro-interactions, visual rhythm, delight moments
216
+ Append Wave 3 rows to `tasks.csv`:
217
+ ```csv
218
+ "diverge-polish","Polish Agent","Missing subtle details: shadows, borders, transitions, hover feedback, empty states, skeleton loading, scroll behavior. Return [{idea,category:'polish',impact,effort,description}].","diverge","","","3","pending","","",""
219
+ "diverge-delight","Delight Agent","What makes this memorable: motion design, progressive disclosure, smart defaults, celebratory feedback, personality. Return [{idea,category:'delight',impact,effort,description}].","diverge","","","3","pending","","",""
220
+ ```
221
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:2, max_runtime_seconds:300, output_csv_path:"wave-3-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
222
+
223
+ **Optional CLI delegate** for creative review:
224
+ ```bash
225
+ maestro delegate "PURPOSE: Creative UI review for: {target}
226
+ TASK: Identify polish opportunities | Suggest delight moments | Evaluate visual rhythm
227
+ MODE: analysis CONTEXT: @{target_files} | Survey: {token_summary} | Audit: {top_findings}
228
+ EXPECTED: JSON [{idea, category, impact, effort, description}]
229
+ CONSTRAINTS: User-perceptible improvements only
230
+ " --role analyze --mode analysis
231
+ ```
232
+ Execute with `run_in_background: true`, then wait for callback.
182
233
 
183
- **Step 3 — Consolidate**: Merge audit findings + divergent ideas → prioritized list (severity x impact x effort).
184
- Append evidence (phase: "diverge"). Update §4. Mark G3 done.
234
+ Consolidate: audit findings + divergent ideas → prioritized improvement list (impact/effort matrix). Write `diverge_result`. Append evidence (phase: "diverge"). Update §4. Mark G3 done.
185
235
  📌 `git commit -m "odyssey-ui({slug}): DIVERGE — 发散探索"`
186
236
 
187
237
  ### A_FIX
@@ -198,9 +248,36 @@ Skip if `--skip-fix`.
198
248
  📌 `git commit -m "odyssey-ui({slug}): VERIFY — 验证"`
199
249
 
200
250
  ### A_GENERALIZE
201
- base A_GENERALIZE 执行。Pattern 来源: audit findings + diverge ideas (severity >= medium OR impact = high)。
202
- **spawn_agents_on_csv (Wave 4)** — 4 agents: syntax-grep, semantic-scan, structural-match, historical-grep.
203
- Mark G5 done.
251
+ Skip if `--skip-generalize`. Pattern 来源: audit findings + diverge ideas (severity >= medium OR impact = high)。
252
+
253
+ **Step 1 — Multi-layer pattern extraction:**
254
+
255
+ | Layer | Method | Example |
256
+ |-------|--------|---------|
257
+ | Syntax | Regex patterns (direct Grep) | Missing `focus-visible`, hardcoded colors, `!important` |
258
+ | Semantic | Agent anti-pattern scan | Missing hover state on interactive element, no empty state |
259
+ | Structural | File/module similarity | Same component structure missing accessibility attrs |
260
+
261
+ Write `session.json.patterns[]`: `[{id, source_finding, layer, signature, description, risk, fix_template}]`
262
+
263
+ **Step 2 — 4-agent scan (spawn_agents_on_csv, Wave 4):**
264
+
265
+ Append Wave 4 rows to `tasks.csv`:
266
+ ```csv
267
+ "gen-syntax","Syntax Grep","Grep CSS/style patterns matching '${signatures}' across project","generalization","syntax","","4","pending","","",""
268
+ "gen-semantic","Semantic Scan","Find components with same interaction pattern but missing states","generalization","semantic","","4","pending","","",""
269
+ "gen-structural","Structural Match","Find structurally similar components, check for same issues","generalization","structural","","4","pending","","",""
270
+ "gen-historical","Historical Grep","git log -S '${signature}' for UI pattern history","generalization","historical","","4","pending","","",""
271
+ ```
272
+ `spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:4, max_runtime_seconds:600, output_csv_path:"wave-4-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
273
+
274
+ **Step 3 — Cross-layer dedup**: Multi-layer hit → boost confidence. Single → `needs_review`. Historical fix → `regression_risk`.
275
+
276
+ **Step 4 — Iterative deepening**: module ≥3 hits → targeted deep scan. Max 1 round.
277
+
278
+ **Step 5 — Quality Gate** (self-iteration).
279
+
280
+ **Step 6:** Write `generalization_stats`. Update §6. Mark G5 done.
204
281
  📌 `git commit -m "odyssey-ui({slug}): GENERALIZE — 泛化扫描"`
205
282
 
206
283
  ### A_DISCOVER
@@ -149,9 +149,9 @@ Each wave generates `wave-{N}.csv` with extra `prev_context` column.
149
149
  3. **CSV is Source of Truth**: Master tasks.csv holds all state
150
150
  4. **Context Propagation**: prev_context built from master CSV, not from memory
151
151
  5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
152
- 6. **Skip on Failure**: If all dimension agents failed, skip aggregation
152
+ 6. **Skip on Failure**: If all dimension agents failed, skip aggregation and flag all downstream outputs as LOW CONFIDENCE. Record `degradation_event` in discoveries.ndjson. **Note**: timed-out workers that report `completed` with empty findings are treated as effectively failed for degradation purposes if `severity_counts` is all-zero AND `findings` is empty. This is a defined degradation path, not a violation of invariant 2.
153
153
  7. **Cleanup Temp Files**: Remove wave-{N}.csv and wave-{N}-results.csv after results are merged
154
- 8. **DO NOT STOP**: Continuous execution until all waves complete
154
+ 8. **Pipeline continuity**: Continuous execution until all waves complete. When invariant 6 (skip on failure) activates, the pipeline continues in degraded mode.
155
155
  </invariants>
156
156
 
157
157
  <execution>
@@ -275,9 +275,9 @@ CONSTRAINTS:
275
275
 
276
276
  #### Wave 2: Aggregation + Deep-Dive
277
277
 
278
- Filter master `tasks.csv` for `wave == 2 AND status == pending`. If all wave 1 tasks failed, skip aggregation.
278
+ Filter master `tasks.csv` for `wave == 2 AND status == pending`. If all wave 1 tasks failed, skip aggregation (invariant 6).
279
279
 
280
- Build `prev_context` from wave 1 findings (format: `[Task N: Title] summary...` per task).
280
+ Build `prev_context` from wave 1 findings (format: `[Task N: Title] summary...` per task). **Failed-dependency handling**: exclude failed task IDs from prev_context. If SOME wave 1 tasks failed, append gap_note listing missing dimensions so the aggregation agent knows its coverage is incomplete.
281
281
  Write `wave-2.csv` with `prev_context` column → execute `spawn_agents_on_csv` with `REVIEW_AGGREGATION_INSTRUCTION` (same termination contract; output_schema returns `result_status` enum [completed|failed], findings, plus `verdict` enum [PASS|WARN|BLOCK]) → merge results into master `tasks.csv` (map `result_status` → master `status` column) → delete both `wave-2.csv` and `wave-2-results.csv`.
282
282
 
283
283
  ### Phase 3: Results Aggregation
@@ -344,7 +344,14 @@ Generate `context.md`:
344
344
  | Medium findings > 5 | WARN |
345
345
  | Otherwise | PASS |
346
346
 
347
- **Issue creation** by level threshold:
347
+ **Side-effect confirmation gate** (skip when `-y/--yes`):
348
+ Before writing to external stores, present a summary to the user via `request_user_input`:
349
+ - Issues to create (count + severity + titles)
350
+ - Phase index update (artifact dir)
351
+ - Artifact registration in state.json
352
+ The user can approve all, selectively exclude, or skip entirely.
353
+
354
+ **Issue creation** (approved items only) by level threshold:
348
355
 
349
356
  | Level | Create Issues For |
350
357
  |-------|------------------|
@@ -354,11 +361,11 @@ Generate `context.md`:
354
361
 
355
362
  **Spec conflict check**: If any finding directly contradicts a loaded spec entry (code behavior ≠ spec rule), suggest `maestro spec conflict mark <file> <line> --note "<evidence>"` on the spec entry. Code is the single source of truth. Log spec conflicts in review.json as `spec_conflicts[]`.
356
363
 
357
- **Phase index update**: Update `{artifact_dir}/index.json` with review status.
364
+ **Phase index update** (after confirmation): Update `{artifact_dir}/index.json` with review status.
358
365
 
359
- **Register artifact**: Append to `state.json.artifacts[]` with `type: "review"`, `id: REV-NNN`, `path: "scratch/{YYYYMMDD}-review-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch, not shared with plan.
366
+ **Register artifact** (after confirmation): Append to `state.json.artifacts[]` with `type: "review"`, `id: REV-NNN`, `path: "scratch/{YYYYMMDD}-review-P{N}-{slug}"`, `depends_on: exec_art.id`. Output directory is independent scratch, not shared with plan.
360
367
 
361
- Display summary. If spec conflicts detected, suggest: `maestro spec conflict list` → `$manage-knowledge-audit --scope spec`.
368
+ Display summary. **Next-step suggestion** (suggest only, NEVER auto-execute): if spec conflicts detected, suggest `maestro spec conflict list` → `$manage-knowledge-audit --scope spec`. The user decides whether to proceed.
362
369
 
363
370
  ### Shared Discovery Board Protocol
364
371
 
@@ -410,8 +417,8 @@ echo '{"ts":"<ISO>","worker":"{id}","type":"vulnerability","data":{"location":"s
410
417
  - [ ] Aggregation + deep-dive executed (wave 2)
411
418
  - [ ] review.json produced with verdict and severity distribution
412
419
  - [ ] context.md produced with full review report
413
- - [ ] Issues auto-created for qualifying severity findings
414
- - [ ] Phase index.json updated with review status
420
+ - [ ] Issues created for qualifying severity findings (after user confirmation in interactive mode; auto in -y mode)
421
+ - [ ] Phase index.json updated with review status (after user confirmation in interactive mode; auto in -y mode)
415
422
  - [ ] discoveries.ndjson append-only throughout
416
423
  - [ ] Ralph-invoked: `maestro ralph complete <idx> --status {STATUS}` called with correct verdict
417
424
  </success_criteria>
@@ -25,15 +25,12 @@
25
25
 
26
26
  2. **Explore domain** (use CLI analysis tools):
27
27
  ```
28
- exec_command({
29
- cmd: `maestro delegate "PURPOSE: Research domain for {requirement}
28
+ shell_exec(`maestro delegate "PURPOSE: Research domain for {requirement}
30
29
  TASK: • Identify problem statement • Define target users • Extract constraints • Map integration points
31
30
  CONTEXT: @**/* | Memory: {requirement}
32
31
  EXPECTED: Structured research context with problem/users/domain/constraints
33
- CONSTRAINTS: Read-only analysis" --role analyze --mode analysis --rule analysis-trace-code-execution`,
34
- yield_time_ms: 30000, max_output_tokens: 6000
35
- })
36
- // ⚠️ If session_id returned → poll write_stdin until completion (see @~/.maestro/workflows/delegate-protocol.codex.md)
32
+ CONSTRAINTS: Read-only analysis" --role analyze --mode analysis --rule analysis-trace-code-execution`, { timeout: 30000 })
33
+ // Execution mapping: @~/.maestro/workflows/shell-exec-protocol.md
37
34
  ```
38
35
 
39
36
  3. **Extract structured context**:
@@ -296,15 +293,12 @@
296
293
 
297
294
  2. **Explore codebase** (use CLI analysis tools):
298
295
  ```
299
- exec_command({
300
- cmd: `maestro delegate "PURPOSE: Explore codebase for {requirement}
296
+ shell_exec(`maestro delegate "PURPOSE: Explore codebase for {requirement}
301
297
  TASK: • Identify relevant files • Find existing patterns • Locate integration points
302
298
  CONTEXT: @**/* | Memory: {requirement}
303
299
  EXPECTED: Exploration findings with file paths and patterns
304
- CONSTRAINTS: Read-only analysis" --role explore --mode analysis --rule analysis-trace-code-execution`,
305
- yield_time_ms: 30000, max_output_tokens: 6000
306
- })
307
- // ⚠️ If session_id returned → poll write_stdin until completion (see @~/.maestro/workflows/delegate-protocol.codex.md)
300
+ CONSTRAINTS: Read-only analysis" --role explore --mode analysis --rule analysis-trace-code-execution`, { timeout: 30000 })
301
+ // Execution mapping: @~/.maestro/workflows/shell-exec-protocol.md
308
302
  ```
309
303
 
310
304
  3. **Generate implementation plan**:
@@ -36,17 +36,13 @@ Research and codebase exploration for context gathering.
36
36
  4. If topic references file (@path or .md/.txt) -> read it
37
37
  5. CLI seed analysis:
38
38
  ```
39
- exec_command({
40
- cmd: `maestro delegate "PURPOSE: Analyze topic, extract structured seed info.
39
+ shell_exec(`maestro delegate "PURPOSE: Analyze topic, extract structured seed info.
41
40
  TASK: * Extract problem statement * Identify target users * Determine domain
42
41
  * List constraints * Identify 3-5 exploration dimensions
43
42
  TOPIC: <topic-content>
44
43
  MODE: analysis
45
- EXPECTED: JSON with: problem_statement, target_users[], domain, constraints[], exploration_dimensions[]" --role analyze --mode analysis`,
46
- yield_time_ms: 30000,
47
- max_output_tokens: 6000
48
- })
49
- // ⚠️ If session_id returned → poll write_stdin until completion (see @~/.maestro/workflows/delegate-protocol.codex.md)
44
+ EXPECTED: JSON with: problem_statement, target_users[], domain, constraints[], exploration_dimensions[]" --role analyze --mode analysis`, { timeout: 30000 })
45
+ // Execution mapping: @~/.maestro/workflows/shell-exec-protocol.md
50
46
  // NEVER skip — seed analysis result is required for context packaging
51
47
  ```
52
48
  6. Parse result JSON
@@ -60,16 +56,12 @@ Research and codebase exploration for context gathering.
60
56
 
61
57
  When project detected:
62
58
  ```
63
- exec_command({
64
- cmd: `maestro delegate "PURPOSE: Explore codebase for context
59
+ shell_exec(`maestro delegate "PURPOSE: Explore codebase for context
65
60
  TASK: * Identify tech stack * Map architecture patterns * Document conventions * List integration points
66
61
  MODE: analysis
67
62
  CONTEXT: @**/*
68
- EXPECTED: JSON with: tech_stack[], architecture_patterns[], conventions[], integration_points[]" --role explore --mode analysis`,
69
- yield_time_ms: 30000,
70
- max_output_tokens: 6000
71
- })
72
- // ⚠️ If session_id returned → poll write_stdin until completion (see @~/.maestro/workflows/delegate-protocol.codex.md)
63
+ EXPECTED: JSON with: tech_stack[], architecture_patterns[], conventions[], integration_points[]" --role explore --mode analysis`, { timeout: 30000 })
64
+ // Execution mapping: @~/.maestro/workflows/shell-exec-protocol.md
73
65
  // NEVER skip — codebase context is required for downstream roles
74
66
  ```
75
67