maestro-flow 0.5.35 → 0.5.36

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 (269) hide show
  1. package/.agents/agents/cli-explore-agent.md +71 -68
  2. package/.agents/agents/workflow-analyzer.md +1 -0
  3. package/.agents/agents/workflow-debugger.md +1 -0
  4. package/.agents/agents/workflow-executor.md +1 -0
  5. package/.agents/skills/domain-add/SKILL.md +71 -0
  6. package/.agents/skills/maestro/SKILL.md +7 -6
  7. package/.agents/skills/maestro-amend/SKILL.md +0 -2
  8. package/.agents/skills/maestro-analyze/SKILL.md +9 -0
  9. package/.agents/skills/maestro-brainstorm/SKILL.md +10 -1
  10. package/.agents/skills/maestro-collab/SKILL.md +14 -1
  11. package/.agents/skills/maestro-next/SKILL.md +15 -4
  12. package/.agents/skills/maestro-overlay/SKILL.md +4 -3
  13. package/.agents/skills/maestro-plan/SKILL.md +12 -3
  14. package/.agents/skills/maestro-ralph/SKILL.md +89 -14
  15. package/.agents/skills/maestro-tools-register/SKILL.md +0 -6
  16. package/.agents/skills/maestro-ui-codify/SKILL.md +0 -2
  17. package/.agents/skills/manage-kg-extractors/SKILL.md +0 -2
  18. package/.agents/skills/quality-test/SKILL.md +0 -2
  19. package/.agents/skills/spec-load/SKILL.md +0 -1
  20. package/.agents/skills/spec-setup/SKILL.md +0 -1
  21. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +13 -7
  22. package/.agents/skills/team-quality-assurance/roles/scout/role.md +15 -11
  23. package/.agents/skills/team-tech-debt/roles/scanner/role.md +1 -1
  24. package/.agents/skills/team-ultra-analyze/roles/explorer/role.md +23 -16
  25. package/.agy/agents/cli-explore-agent.md +71 -68
  26. package/.agy/agents/workflow-analyzer.md +1 -0
  27. package/.agy/agents/workflow-debugger.md +1 -0
  28. package/.agy/agents/workflow-executor.md +1 -0
  29. package/.agy/skills/domain-add/SKILL.md +68 -0
  30. package/.agy/skills/maestro/SKILL.md +7 -6
  31. package/.agy/skills/maestro-amend/SKILL.md +0 -2
  32. package/.agy/skills/maestro-analyze/SKILL.md +9 -0
  33. package/.agy/skills/maestro-brainstorm/SKILL.md +10 -1
  34. package/.agy/skills/maestro-collab/SKILL.md +14 -1
  35. package/.agy/skills/maestro-next/SKILL.md +15 -4
  36. package/.agy/skills/maestro-overlay/SKILL.md +4 -3
  37. package/.agy/skills/maestro-plan/SKILL.md +12 -3
  38. package/.agy/skills/maestro-ralph/SKILL.md +89 -14
  39. package/.agy/skills/maestro-tools-register/SKILL.md +0 -6
  40. package/.agy/skills/maestro-ui-codify/SKILL.md +0 -2
  41. package/.agy/skills/manage-kg-extractors/SKILL.md +0 -2
  42. package/.agy/skills/quality-test/SKILL.md +0 -2
  43. package/.agy/skills/spec-load/SKILL.md +0 -1
  44. package/.agy/skills/spec-setup/SKILL.md +0 -1
  45. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +13 -7
  46. package/.agy/skills/team-quality-assurance/roles/scout/role.md +15 -11
  47. package/.agy/skills/team-tech-debt/roles/scanner/role.md +1 -1
  48. package/.agy/skills/team-ultra-analyze/roles/explorer/role.md +23 -16
  49. package/.claude/agents/cli-explore-agent.md +71 -68
  50. package/.claude/agents/workflow-analyzer.md +1 -0
  51. package/.claude/agents/workflow-debugger.md +1 -0
  52. package/.claude/agents/workflow-executor.md +1 -0
  53. package/.claude/commands/domain-add.md +69 -0
  54. package/.claude/commands/maestro-amend.md +0 -2
  55. package/.claude/commands/maestro-analyze.md +9 -0
  56. package/.claude/commands/maestro-brainstorm.md +10 -1
  57. package/.claude/commands/maestro-collab.md +14 -1
  58. package/.claude/commands/maestro-next.md +15 -4
  59. package/.claude/commands/maestro-overlay.md +4 -3
  60. package/.claude/commands/maestro-plan.md +12 -3
  61. package/.claude/commands/maestro-ralph.md +89 -14
  62. package/.claude/commands/maestro-tools-register.md +0 -6
  63. package/.claude/commands/maestro-ui-codify.md +0 -2
  64. package/.claude/commands/maestro.md +7 -6
  65. package/.claude/commands/manage-kg-extractors.md +0 -2
  66. package/.claude/commands/quality-test.md +0 -2
  67. package/.claude/commands/spec-load.md +0 -1
  68. package/.claude/commands/spec-setup.md +0 -1
  69. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +13 -7
  70. package/.claude/skills/team-quality-assurance/roles/scout/role.md +15 -11
  71. package/.claude/skills/team-tech-debt/roles/scanner/role.md +1 -1
  72. package/.claude/skills/team-ultra-analyze/roles/explorer/role.md +23 -16
  73. package/.codex/skills/domain-add/SKILL.md +79 -0
  74. package/.codex/skills/domain-discover/SKILL.md +43 -0
  75. package/.codex/skills/domain-list/SKILL.md +38 -0
  76. package/.codex/skills/learn-follow/SKILL.md +0 -3
  77. package/.codex/skills/learn-investigate/SKILL.md +0 -3
  78. package/.codex/skills/learn-retro/SKILL.md +0 -2
  79. package/.codex/skills/maestro/SKILL.md +17 -11
  80. package/.codex/skills/maestro-amend/SKILL.md +0 -2
  81. package/.codex/skills/maestro-analyze/SKILL.md +16 -3
  82. package/.codex/skills/maestro-blueprint/SKILL.md +0 -4
  83. package/.codex/skills/maestro-brainstorm/SKILL.md +16 -2
  84. package/.codex/skills/maestro-collab/SKILL.md +14 -1
  85. package/.codex/skills/maestro-companion/SKILL.md +0 -2
  86. package/.codex/skills/maestro-fork/SKILL.md +0 -2
  87. package/.codex/skills/maestro-grill/SKILL.md +0 -1
  88. package/.codex/skills/maestro-next/SKILL.md +12 -5
  89. package/.codex/skills/maestro-plan/SKILL.md +17 -2
  90. package/.codex/skills/maestro-ralph/SKILL.md +4 -3
  91. package/.codex/skills/maestro-roadmap/SKILL.md +0 -2
  92. package/.codex/skills/manage-wiki/SKILL.md +0 -2
  93. package/.codex/skills/odyssey-debug/SKILL.md +0 -2
  94. package/.codex/skills/odyssey-improve/SKILL.md +0 -6
  95. package/.codex/skills/odyssey-review-test-fix/SKILL.md +0 -3
  96. package/.codex/skills/odyssey-ui/SKILL.md +0 -3
  97. package/.codex/skills/spec-setup/SKILL.md +0 -2
  98. package/.codex/skills/team-coordinate/SKILL.md +0 -3
  99. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +0 -2
  100. package/chains/_intent-map.json +36 -0
  101. package/chains/blueprint-driven.json +49 -0
  102. package/chains/grill-driven.json +51 -0
  103. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js +4 -0
  104. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js.map +1 -1
  105. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.d.ts +6 -0
  106. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js +36 -0
  107. package/dashboard/dist-server/dashboard/src/server/agents/api-explore-adapter.js.map +1 -0
  108. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.d.ts +1 -1
  109. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  110. package/dashboard/dist-server/dashboard/src/server/wiki/search.d.ts +1 -1
  111. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +13 -0
  112. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  113. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +11 -0
  114. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +492 -1
  115. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  116. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.d.ts +6 -1
  117. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +92 -4
  118. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  119. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  120. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  121. package/dashboard/dist-server/shared/agent-types.d.ts +1 -1
  122. package/dashboard/dist-server/src/commands/hooks.js +49 -1
  123. package/dashboard/dist-server/src/commands/hooks.js.map +1 -1
  124. package/dashboard/dist-server/src/graph/kg/extraction/knowledge/domain-extractor.js +4 -2
  125. package/dashboard/dist-server/src/graph/kg/extraction/knowledge/domain-extractor.js.map +1 -1
  126. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.js +6 -1
  127. package/dashboard/dist-server/src/graph/kg/extraction/knowledge-extractor-registry.js.map +1 -1
  128. package/dashboard/dist-server/src/hooks/session-context.js +37 -1
  129. package/dashboard/dist-server/src/hooks/session-context.js.map +1 -1
  130. package/dashboard/dist-server/src/search/daemon.d.ts +42 -0
  131. package/dashboard/dist-server/src/search/daemon.js +180 -0
  132. package/dashboard/dist-server/src/search/daemon.js.map +1 -0
  133. package/dashboard/dist-server/src/tools/domain-loader.d.ts +4 -1
  134. package/dashboard/dist-server/src/tools/domain-loader.js +56 -25
  135. package/dashboard/dist-server/src/tools/domain-loader.js.map +1 -1
  136. package/dashboard/dist-server/src/tools/domain-schema.d.ts +1 -1
  137. package/dashboard/dist-server/src/tools/domain-schema.js +1 -1
  138. package/dist/shared/agent-types.d.ts +1 -1
  139. package/dist/shared/agent-types.d.ts.map +1 -1
  140. package/dist/src/agents/api-explore/agent-loop.d.ts +14 -0
  141. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -0
  142. package/dist/src/agents/api-explore/agent-loop.js +86 -0
  143. package/dist/src/agents/api-explore/agent-loop.js.map +1 -0
  144. package/dist/src/agents/api-explore/config.d.ts +42 -0
  145. package/dist/src/agents/api-explore/config.d.ts.map +1 -0
  146. package/dist/src/agents/api-explore/config.js +99 -0
  147. package/dist/src/agents/api-explore/config.js.map +1 -0
  148. package/dist/src/agents/api-explore/index.d.ts +2 -0
  149. package/dist/src/agents/api-explore/index.d.ts.map +1 -0
  150. package/dist/src/agents/api-explore/index.js +102 -0
  151. package/dist/src/agents/api-explore/index.js.map +1 -0
  152. package/dist/src/agents/api-explore/llm.d.ts +28 -0
  153. package/dist/src/agents/api-explore/llm.d.ts.map +1 -0
  154. package/dist/src/agents/api-explore/llm.js +48 -0
  155. package/dist/src/agents/api-explore/llm.js.map +1 -0
  156. package/dist/src/agents/api-explore/prompt-parser.d.ts +23 -0
  157. package/dist/src/agents/api-explore/prompt-parser.d.ts.map +1 -0
  158. package/dist/src/agents/api-explore/prompt-parser.js +73 -0
  159. package/dist/src/agents/api-explore/prompt-parser.js.map +1 -0
  160. package/dist/src/agents/api-explore/runner.d.ts +65 -0
  161. package/dist/src/agents/api-explore/runner.d.ts.map +1 -0
  162. package/dist/src/agents/api-explore/runner.js +196 -0
  163. package/dist/src/agents/api-explore/runner.js.map +1 -0
  164. package/dist/src/agents/api-explore/session.d.ts +23 -0
  165. package/dist/src/agents/api-explore/session.d.ts.map +1 -0
  166. package/dist/src/agents/api-explore/session.js +57 -0
  167. package/dist/src/agents/api-explore/session.js.map +1 -0
  168. package/dist/src/agents/api-explore/stream-json-emitter.d.ts +10 -0
  169. package/dist/src/agents/api-explore/stream-json-emitter.d.ts.map +1 -0
  170. package/dist/src/agents/api-explore/stream-json-emitter.js +19 -0
  171. package/dist/src/agents/api-explore/stream-json-emitter.js.map +1 -0
  172. package/dist/src/agents/api-explore/system-prompt.d.ts +2 -0
  173. package/dist/src/agents/api-explore/system-prompt.d.ts.map +1 -0
  174. package/dist/src/agents/api-explore/system-prompt.js +31 -0
  175. package/dist/src/agents/api-explore/system-prompt.js.map +1 -0
  176. package/dist/src/agents/api-explore/tools.d.ts +11 -0
  177. package/dist/src/agents/api-explore/tools.d.ts.map +1 -0
  178. package/dist/src/agents/api-explore/tools.js +168 -0
  179. package/dist/src/agents/api-explore/tools.js.map +1 -0
  180. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  181. package/dist/src/agents/cli-agent-runner.js +3 -0
  182. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  183. package/dist/src/cli.js +3 -0
  184. package/dist/src/cli.js.map +1 -1
  185. package/dist/src/commands/domain.d.ts.map +1 -1
  186. package/dist/src/commands/domain.js +5 -4
  187. package/dist/src/commands/domain.js.map +1 -1
  188. package/dist/src/commands/explore.d.ts +7 -0
  189. package/dist/src/commands/explore.d.ts.map +1 -0
  190. package/dist/src/commands/explore.js +201 -0
  191. package/dist/src/commands/explore.js.map +1 -0
  192. package/dist/src/commands/hooks.d.ts.map +1 -1
  193. package/dist/src/commands/hooks.js +49 -1
  194. package/dist/src/commands/hooks.js.map +1 -1
  195. package/dist/src/commands/search.d.ts +21 -4
  196. package/dist/src/commands/search.d.ts.map +1 -1
  197. package/dist/src/commands/search.js +289 -93
  198. package/dist/src/commands/search.js.map +1 -1
  199. package/dist/src/commands/workspace.d.ts.map +1 -1
  200. package/dist/src/commands/workspace.js +9 -3
  201. package/dist/src/commands/workspace.js.map +1 -1
  202. package/dist/src/config/cli-tools-defaults.json +2 -1
  203. package/dist/src/graph/kg/extraction/knowledge/domain-extractor.d.ts.map +1 -1
  204. package/dist/src/graph/kg/extraction/knowledge/domain-extractor.js +4 -2
  205. package/dist/src/graph/kg/extraction/knowledge/domain-extractor.js.map +1 -1
  206. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.d.ts.map +1 -1
  207. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.js +6 -1
  208. package/dist/src/graph/kg/extraction/knowledge-extractor-registry.js.map +1 -1
  209. package/dist/src/graph/kg/surface/cli.d.ts.map +1 -1
  210. package/dist/src/graph/kg/surface/cli.js +5 -2
  211. package/dist/src/graph/kg/surface/cli.js.map +1 -1
  212. package/dist/src/hooks/session-context.d.ts.map +1 -1
  213. package/dist/src/hooks/session-context.js +37 -1
  214. package/dist/src/hooks/session-context.js.map +1 -1
  215. package/dist/src/ralph/cmd-next.js +64 -1
  216. package/dist/src/ralph/cmd-next.js.map +1 -1
  217. package/dist/src/ralph/status-schema.d.ts +1 -0
  218. package/dist/src/ralph/status-schema.d.ts.map +1 -1
  219. package/dist/src/search/daemon.d.ts +43 -0
  220. package/dist/src/search/daemon.d.ts.map +1 -0
  221. package/dist/src/search/daemon.js +180 -0
  222. package/dist/src/search/daemon.js.map +1 -0
  223. package/dist/src/tools/__tests__/domain-search-debug.js +3 -1
  224. package/dist/src/tools/__tests__/domain-search-debug.js.map +1 -1
  225. package/dist/src/tools/domain-loader.d.ts +4 -1
  226. package/dist/src/tools/domain-loader.d.ts.map +1 -1
  227. package/dist/src/tools/domain-loader.js +56 -25
  228. package/dist/src/tools/domain-loader.js.map +1 -1
  229. package/dist/src/tools/domain-schema.d.ts +1 -1
  230. package/dist/src/tools/domain-schema.js +1 -1
  231. package/dist/src/utils/update-notices.js +12 -0
  232. package/dist/src/utils/update-notices.js.map +1 -1
  233. package/package.json +5 -3
  234. package/shared/agent-types.ts +1 -1
  235. package/templates/search-tools.md +22 -6
  236. package/workflows/agy-instructions.md +0 -4
  237. package/workflows/analyze.md +2 -2
  238. package/workflows/boundary-grill.md +50 -0
  239. package/workflows/brainstorm.md +6 -5
  240. package/workflows/claude-instructions.md +12 -0
  241. package/workflows/codebase-rebuild.md +0 -1
  242. package/workflows/codex-instructions.md +12 -0
  243. package/workflows/debug.md +0 -4
  244. package/workflows/domain-add.md +115 -0
  245. package/workflows/execute.md +7 -0
  246. package/workflows/explore-usage.md +128 -0
  247. package/workflows/finish-work.md +2 -6
  248. package/workflows/fork.md +0 -4
  249. package/workflows/grill.md +14 -1
  250. package/workflows/harvest.md +0 -3
  251. package/workflows/impeccable/audit.md +0 -2
  252. package/workflows/impeccable/codex.md +0 -4
  253. package/workflows/init.md +9 -0
  254. package/workflows/interview-mechanics.md +3 -2
  255. package/workflows/issue-analyze.md +0 -5
  256. package/workflows/issue-gaps-analyze.codex.md +0 -6
  257. package/workflows/knowledge-audit.md +0 -4
  258. package/workflows/learn.md +0 -6
  259. package/workflows/maestro.codex.md +0 -4
  260. package/workflows/maestro.md +31 -18
  261. package/workflows/merge.md +0 -4
  262. package/workflows/milestone-complete.md +0 -4
  263. package/workflows/overlays.md +0 -10
  264. package/workflows/plan.md +0 -2
  265. package/workflows/roadmap-common.md +0 -4
  266. package/workflows/tdd.md +0 -2
  267. package/workflows/tools-spec.md +1 -7
  268. package/workflows/ui-codify-extract.md +0 -2
  269. package/workflows/ui-codify-package.md +0 -2
@@ -17,8 +17,6 @@ allowed-tools:
17
17
 
18
18
  <purpose>
19
19
  Analyze current repository's code patterns to auto-generate `.workflow/kg/extractors.yaml` — a declarative config that teaches MaestroGraph's codegraph extractor to recognize project-specific symbols beyond standard function/class/method declarations.
20
-
21
- Detects: builder/factory API registrations, domain constant patterns, custom decorator conventions, framework-specific patterns, module-level constants.
22
20
  </purpose>
23
21
 
24
22
  <context>
@@ -33,8 +33,6 @@ Flags, artifact context resolution, and output directory format defined in workf
33
33
 
34
34
  ### Frontend Verify Mode (`--frontend-verify`)
35
35
 
36
- 补 ralph 链路缺失的运行时可用性门:确定性验证每个用户可观测能力真正经 UI 可触发,避免"后端绿灯=完成"。
37
-
38
36
  1. **Resolve targets**: 读 phase 的 `plan.json` / `.task/TASK-*.json`,提取所有 `[UI-observable]` convergence.criteria(plan 阶段产出);缺失则枚举后端写端点(POST/PUT/PATCH/DELETE)作为待验证清单。
39
37
  2. **Start app**: `next start`(或从 dashboard/package.json 解析的既有启动脚本);启动失败 → E003。
40
38
  3. **Drive browser**: 用 chrome-devtools MCP(`mcp__claude_dms3-chrome-devtools__*`:navigate / click / fill / take_snapshot / list_network_requests)逐条执行每个 `[UI-observable]` 流程,断言:UI 入口存在且可触发 → 对应写请求返回 2xx → DOM 出现预期结果。
@@ -74,4 +74,3 @@ Follow '~/.maestro/workflows/specs-load.md' completely.
74
74
  - [ ] Legacy entries filtered by text grep fallback
75
75
  - [ ] Results displayed with file:category references
76
76
  </success_criteria>
77
- </output>
@@ -45,4 +45,3 @@ Follow '~/.maestro/workflows/specs-setup.md' completely.
45
45
  - [ ] Workflow recipe knowhow created in `.workflow/knowhow/` for each detected operational workflow (test / debug / build / dev / lint). Each recipe matches the `recipe` schema in `~/.maestro/workflows/knowhow.md` Part B and contains at least one runnable command.
46
46
  - [ ] Report displayed grouped by destination (specs / recipes / skipped / deferred), with `.proposed.md` files surfaced when an existing recipe slug was preserved.
47
47
  </success_criteria>
48
- </output>
@@ -48,15 +48,21 @@ Research and codebase exploration for context gathering.
48
48
  | package.json / Cargo.toml / pyproject.toml / go.mod exists | Explore |
49
49
  | No project files | Skip (codebase_context = null) |
50
50
 
51
- When project detected:
52
- ```
53
- run_command({ command: `maestro delegate "PURPOSE: Explore codebase for context
54
- TASK: • Identify tech stack Map architecture patterns • Document conventions • List integration points
55
- MODE: analysis
56
- CONTEXT: @**/*
57
- EXPECTED: JSON with: tech_stack[], architecture_patterns[], conventions[], integration_points[]" --tool gemini --mode analysis`, run_in_background: false })
51
+ When project detected — prefer `maestro explore` multi-prompt:
52
+ ```bash
53
+ maestro explore \
54
+ "FIND: tech stack and framework detection
55
+ SCOPE: package.json, Cargo.toml, pyproject.toml, go.mod, src/
56
+ EXPECTED: tech_stack list with versions" \
57
+ "FIND: architecture patterns and conventions
58
+ SCOPE: src/
59
+ EXCLUDE: tests, node_modules
60
+ EXPECTED: patterns list with file:line evidence" \
61
+ --max-turns 3 --json
58
62
  ```
59
63
 
64
+ **Fallback**: `maestro delegate "PURPOSE: Explore codebase for context ..." --tool gemini --mode analysis`
65
+
60
66
  ### Tech Profile Scan
61
67
 
62
68
  After codebase exploration, scan results for context-aware trigger signals (based on detected codebase characteristics):
@@ -36,18 +36,22 @@ Scan codebase from multiple perspectives (bug, security, test-coverage, code-qua
36
36
 
37
37
  **Low complexity**: Use `` for quick pattern-based scan.
38
38
 
39
- **Medium/High complexity**: CLI fan-out -- one `maestro delegate --mode analysis` per perspective:
40
-
41
- For each active perspective, build prompt:
42
- ```
43
- PURPOSE: Scan code from <perspective> perspective to discover potential issues
44
- TASK: Analyze code patterns for <perspective> problems, identify anti-patterns, check for common issues
45
- MODE: analysis
46
- CONTEXT: @<scan-scope>
47
- EXPECTED: List of findings with severity (critical/high/medium/low), file:line references, description
48
- CONSTRAINTS: Focus on actionable findings only
39
+ **Medium/High complexity**: Multi-prompt `maestro explore` (preferred for read-only scan):
40
+
41
+ Build one prompt per active perspective:
42
+ ```bash
43
+ maestro explore \
44
+ "FIND: <perspective1> issues and anti-patterns
45
+ SCOPE: <scan-scope>
46
+ ATTENTION: common <perspective1> problems
47
+ EXPECTED: severity + file:line + description" \
48
+ "FIND: <perspective2> issues and anti-patterns
49
+ SCOPE: <scan-scope>
50
+ EXPECTED: severity + file:line + description" \
51
+ --max-turns 3 --json
49
52
  ```
50
- Execute via: `maestro delegate "<prompt>" --role analyze --mode analysis`
53
+
54
+ **Fallback** (when deeper analysis needed per perspective): `maestro delegate "<prompt>" --role analyze --mode analysis`
51
55
 
52
56
  After all perspectives complete:
53
57
  - Parse CLI outputs into structured findings
@@ -55,7 +55,7 @@ Multi-dimension tech debt scanner. Scan codebase across 5 dimensions (code, arch
55
55
  - Classify findings into dimensions
56
56
 
57
57
  **Medium/High Complexity** (Fan-out):
58
- - Fan-out A: CLI exploration (structure, patterns, dependencies angles) via `maestro delegate --role explore --mode analysis`
58
+ - Fan-out A: `maestro explore` multi-prompt parallel (structure, patterns, dependencies angles) preferred over delegate for exploration
59
59
  - Fan-out B: CLI dimension analysis (parallel per dimension -- code, architecture, testing, dependency, documentation) via `--role analyze`
60
60
  - Fan-out C (High only): Multi-perspective analysis (security, performance, code-quality, architecture) via `--role analyze`
61
61
  - Fan-in: Merge results, cross-deduplicate by file:line, boost severity for multi-source findings
@@ -39,24 +39,31 @@ Explore codebase structure through cli-explore-agent, collecting structured cont
39
39
 
40
40
  ## Phase 3: Codebase Exploration
41
41
 
42
- Use CLI tool for codebase exploration:
43
-
44
- ```javascript
45
- run_command({
46
- command: `maestro delegate "PURPOSE: Explore codebase for <topic> from <perspective> perspective; success = structured findings with relevant files and patterns
47
- TASK: • Run module depth analysis • Search for topic-related patterns • Identify key files and their relationships • Extract architectural insights
48
- MODE: analysis
49
- CONTEXT: @**/* | Memory: Session <session-folder>, perspective <perspective>
50
- EXPECTED: JSON output with: relevant_files (path, relevance, summary), patterns, key_findings, module_map, questions_for_analysis, _metadata (perspective, search_queries, timestamp)
51
- CONSTRAINTS: Focus on <perspective> angle - <strategy.focus> | Write to <session>/explorations/exploration-<num>.json
52
- " --tool gemini --mode analysis --rule analysis-analyze-code-patterns`,
53
- run_in_background: false
54
- })
42
+ **Primary: `maestro explore`** (structured multi-prompt):
43
+
44
+ ```bash
45
+ maestro explore \
46
+ "FIND: <topic> patterns and implementations
47
+ SCOPE: src/
48
+ ATTENTION: <perspective>-specific concerns
49
+ EXPECTED: file:line evidence with relevance" \
50
+ "FIND: module boundaries and relationships for <topic>
51
+ SCOPE: src/
52
+ EXCLUDE: tests, generated code
53
+ EXPECTED: dependency pairs and architectural insights" \
54
+ --max-turns 3 --json
55
55
  ```
56
56
 
57
- **ACE fallback** (when CLI produces no output):
58
- ```javascript
59
- ({ project_root_path: ".", query: "<topic> <perspective>" })
57
+ Parse JSON results extract relevant_files, patterns, key_findings.
58
+
59
+ **Fallback: `maestro delegate`** (when explore results insufficient):
60
+
61
+ ```bash
62
+ maestro delegate "PURPOSE: Explore codebase for <topic> from <perspective> perspective
63
+ TASK: Search for topic-related patterns | Identify key files and relationships | Extract architectural insights
64
+ EXPECTED: JSON with relevant_files, patterns, key_findings
65
+ CONSTRAINTS: Focus on <perspective> angle
66
+ " --tool gemini --mode analysis --rule analysis-analyze-code-patterns
60
67
  ```
61
68
 
62
69
  ## Phase 4: Result Validation
@@ -11,96 +11,103 @@ allowed-tools:
11
11
  # CLI Explore Agent
12
12
 
13
13
  ## Role
14
- You are a specialized CLI exploration agent that autonomously analyzes codebases and generates structured outputs. You perform read-only code exploration using dual-source analysis (Bash structural scan + CLI semantic analysis), validate outputs against schemas, and produce structured JSON results.
14
+ Specialized CLI exploration agent. Autonomously analyzes codebases and generates structured outputs. Read-only.
15
15
 
16
16
  **CRITICAL: Mandatory Initial Read**
17
17
  When spawned with `<files_to_read>`, read ALL listed files before any analysis.
18
18
 
19
19
  **Core responsibilities:**
20
- 1. **Structural Analysis** - Module discovery, file patterns, symbol inventory via Bash tools
21
- 2. **Semantic Understanding** - Design intent, architectural patterns via CLI analysis
22
- 3. **Dependency Mapping** - Import/export graphs, circular detection, coupling analysis
23
- 4. **Structured Output** - Schema-compliant JSON generation with validation
20
+ 1. **Structural Analysis** Module discovery, file patterns, symbol inventory
21
+ 2. **Semantic Understanding** Design intent, architectural patterns via CLI analysis
22
+ 3. **Dependency Mapping** Import/export graphs, circular detection, coupling analysis
23
+ 4. **Structured Output** Schema-compliant JSON generation with validation
24
24
 
25
25
  **Analysis Modes**:
26
- - `quick-scan` → Bash only (fast)
27
- - `deep-scan` → Bash + CLI dual-source (thorough)
28
- - `dependency-map` → Graph construction (comprehensive)
26
+ - `quick-scan` → `maestro explore` single prompt (fast)
27
+ - `deep-scan` → `maestro explore` multi-prompt parallel (thorough)
28
+ - `dependency-map` → Multi-prompt + Bash graph construction (comprehensive)
29
29
 
30
30
  ## 4-Phase Execution Workflow
31
31
 
32
32
  ```
33
- Phase 1: Task Understanding
34
- Parse prompt for: analysis scope, output requirements, schema path
35
- Phase 2: Analysis Execution
36
- Bash structural scan + CLI semantic analysis (based on mode)
37
- Phase 3: Schema Validation (MANDATORY if schema specified)
38
- ↓ Read schema → Extract EXACT field names → Validate structure
39
- Phase 4: Output Generation
40
- ↓ Agent report + File output (strictly schema-compliant)
33
+ Phase 1: Task Understanding → parse scope, output requirements, schema
34
+ Phase 2: Analysis Execution maestro explore + Bash structural scan
35
+ Phase 3: Schema Validation → read schema, validate structure
36
+ Phase 4: Output Generation agent report + file output
41
37
  ```
42
38
 
43
39
  ## Phase 1: Task Understanding
44
40
 
45
- ### Autonomous Initialization (execute before any analysis)
46
-
47
41
  1. **Project Structure Discovery**:
48
42
  - Glob `src/**` and top-level directories to map module structure
49
43
  - Read `package.json` / `Cargo.toml` / `go.mod` / `pyproject.toml` for tech stack
50
44
 
51
45
  2. **Output Schema Loading** (if output file path specified in prompt):
52
- - Read schema file and memorize requirements BEFORE any analysis begins
46
+ - Read schema file and memorize requirements BEFORE any analysis
53
47
 
54
48
  3. **Project Context Loading** (from spec system):
55
49
  - Load exploration specs: `maestro spec load --category arch`
56
- - Extract: tech_stack, architecture, key_components, overview
57
- - If no specs returned, proceed with fresh analysis
58
50
 
59
- 4. **Task Keyword Search** (initial file discovery):
60
- - Extract keywords from prompt, detect primary language, run targeted Grep
61
- - Store results as `keyword_files` for Phase 2 scoping
51
+ 4. **Determine analysis depth from prompt keywords**:
52
+ - Quick lookup, structure overview quick-scan
53
+ - Deep analysis, design intent, architecture deep-scan
54
+ - Dependencies, impact analysis, coupling → dependency-map
62
55
 
63
- **Extract from prompt**:
64
- - Analysis target and scope
65
- - Analysis mode (quick-scan / deep-scan / dependency-map)
66
- - Output file path and schema file path (if specified)
56
+ ## Phase 2: Analysis Execution
67
57
 
68
- **Determine analysis depth from prompt keywords**:
69
- - Quick lookup, structure overview → quick-scan
70
- - Deep analysis, design intent, architecture → deep-scan
71
- - Dependencies, impact analysis, coupling → dependency-map
58
+ ### Primary: `maestro explore` (preferred)
72
59
 
73
- ## Phase 2: Analysis Execution
60
+ **Quick-scan** single targeted prompt:
74
61
 
75
- ### Bash Structural Scan
62
+ ```bash
63
+ maestro explore "FIND: <target from prompt>
64
+ SCOPE: src/
65
+ EXCLUDE: test files, node_modules, generated code
66
+ EXPECTED: file:line evidence list" --max-turns 3
67
+ ```
68
+
69
+ **Deep-scan** — multi-prompt parallel for multi-angle coverage:
76
70
 
77
71
  ```bash
78
- # Pattern discovery (adapt based on language)
79
- rg "^export (class|interface|function) " --type ts -n
80
- rg "^(class|def) \w+" --type py -n
81
- rg "^import .* from " -n | head -30
72
+ maestro explore \
73
+ "FIND: <structural patterns>
74
+ SCOPE: src/
75
+ EXPECTED: file:line list" \
76
+ "FIND: <design intent / architecture>
77
+ SCOPE: src/
78
+ EXPECTED: pattern descriptions with file evidence" \
79
+ --max-turns 3 --json
80
+ ```
81
+
82
+ **Dependency-map** — combine explore + Bash:
83
+
84
+ ```bash
85
+ maestro explore "FIND: import/export relationships
86
+ SCOPE: src/
87
+ ATTENTION: circular dependencies, tight coupling
88
+ EXPECTED: dependency pairs with file:line" --max-turns 4 --json
82
89
  ```
83
90
 
84
- ### CLI Semantic Analysis (deep-scan, dependency-map)
91
+ ### Secondary: Bash structural scan (supplement only)
85
92
 
86
93
  ```bash
87
- maestro delegate "
88
- PURPOSE: {from prompt}
89
- TASK: {from prompt}
90
- MODE: analysis
91
- CONTEXT: @**/*
92
- EXPECTED: {from prompt}
93
- " --role explore --mode analysis --cd {dir}
94
+ rg "^export (class|interface|function) " --type ts -n | head -30
95
+ rg "^import .* from " -n | head -30
94
96
  ```
95
97
 
96
- **Fallback Chain**: config-driven via `cli-tools.json` role mappings Bash-only
98
+ Use Bash only when `maestro explore` results need structural verification.
99
+
100
+ ### Fallback: `maestro delegate` (only when explore unavailable)
101
+
102
+ ```bash
103
+ maestro delegate "PURPOSE: {from prompt} TASK: {from prompt} MODE: analysis" --role explore --mode analysis
104
+ ```
97
105
 
98
106
  ### Dual-Source Synthesis
99
107
 
100
- 1. Bash results: Precise file:line locations → `discovery_source: "bash-scan"`
101
- 2. CLI results: Semantic understanding, design intent → `discovery_source: "cli-analysis"`
102
- 3. Dependency tracing: Import/export graph `discovery_source: "dependency-trace"`
103
- 4. Merge with source attribution and generate for each file:
108
+ 1. Explore results: Semantic findings → `discovery_source: "explore"`
109
+ 2. Bash results: Precise file:line locations → `discovery_source: "bash-scan"`
110
+ 3. Merge with source attribution and generate for each file:
104
111
  - `rationale`: WHY the file was selected (specific, >10 chars)
105
112
  - `topic_relation`: HOW the file connects to the exploration angle/topic
106
113
  - `key_code`: Detailed descriptions of key symbols with locations (for relevance >= 0.7)
@@ -112,39 +119,35 @@ EXPECTED: {from prompt}
112
119
  **Step 1: Read Schema FIRST** before generating any output
113
120
 
114
121
  **Step 2: Extract Schema Requirements**
115
- 1. Root structure - Is it array `[...]` or object `{...}`?
116
- 2. Required fields - List all `"required": [...]` arrays
117
- 3. Field names EXACTLY - Copy character-by-character (case-sensitive)
118
- 4. Enum values - Copy exact strings (case-sensitive)
119
- 5. Nested structures - Note flat vs nested requirements
122
+ 1. Root structure array `[...]` or object `{...}`?
123
+ 2. Required fields list all `"required": [...]` arrays
124
+ 3. Field names EXACTLY copy character-by-character (case-sensitive)
125
+ 4. Enum values copy exact strings (case-sensitive)
126
+ 5. Nested structures note flat vs nested requirements
120
127
 
121
128
  **Step 3: File Rationale Validation** (MANDATORY for relevant_files / affected_files)
122
129
 
123
130
  Every file entry MUST have:
124
131
  - `rationale` (required, minLength 10): Specific reason tied to the exploration topic
125
- - GOOD: "Contains AuthService.login() which is the entry point for JWT token generation"
126
- - BAD: "Related to auth"
127
132
  - `role` (required, enum): modify_target / dependency / pattern_reference / test_target / type_definition / integration_point / config / context_only
128
- - `discovery_source` (recommended): bash-scan / cli-analysis / dependency-trace / manual
133
+ - `discovery_source` (recommended): explore / bash-scan / dependency-trace / manual
129
134
  - `key_code` (required for relevance >= 0.7): Array of {symbol, location?, description}
130
135
  - `topic_relation` (required for relevance >= 0.7): Connection from exploration angle perspective
131
136
 
132
137
  **Step 4: Pre-Output Validation Checklist**
133
- - [ ] Root structure matches schema (array vs object)
138
+ - [ ] Root structure matches schema
134
139
  - [ ] ALL required fields present at each level
135
- - [ ] Field names EXACTLY match schema (character-by-character)
136
- - [ ] Enum values EXACTLY match schema (case-sensitive)
140
+ - [ ] Field names EXACTLY match schema
141
+ - [ ] Enum values EXACTLY match schema
137
142
  - [ ] Every file has: path + relevance + rationale + role
138
143
  - [ ] Files with relevance >= 0.7 have key_code and topic_relation
139
144
 
140
145
  ## Phase 4: Output Generation
141
146
 
142
147
  ### Agent Output (return to caller)
143
-
144
148
  Brief summary: task completion status, key findings, generated file paths
145
149
 
146
150
  ### File Output (as specified in prompt)
147
-
148
151
  1. Read schema file BEFORE generating output
149
152
  2. Extract ALL field names from schema
150
153
  3. Build JSON using ONLY schema field names
@@ -170,16 +173,16 @@ Brief summary: task completion status, key findings, generated file paths
170
173
  ## Rules
171
174
 
172
175
  ### ALWAYS
173
- - Read schema file FIRST before generating any output (if schema specified)
176
+ - Prefer `maestro explore` over raw Grep/rg for code search
177
+ - Use structured prompt format (FIND/SCOPE/EXCLUDE/ATTENTION/EXPECTED)
178
+ - Read schema file FIRST before generating output (if schema specified)
174
179
  - Copy field names EXACTLY from schema (case-sensitive)
175
180
  - Include file:line references in findings
176
- - Every file MUST have rationale (specific, not generic) and role
177
181
  - Track discovery source for all findings
178
- - Populate key_code and topic_relation for high-relevance files (>= 0.7)
179
182
  - Use `run_in_background: false` for all Bash/CLI calls
180
183
 
181
184
  ### NEVER
182
185
  - Modify any files (read-only agent)
183
186
  - Skip schema reading step when schema is specified
184
- - Guess field names - ALWAYS copy from schema
187
+ - Guess field names ALWAYS copy from schema
185
188
  - Omit required fields
@@ -40,6 +40,7 @@ You perform structured multi-dimensional analysis of technical topics, proposals
40
40
  - Comparison alternatives (if applicable)
41
41
  - **Codebase docs** (if `.workflow/codebase/` exists) — `ARCHITECTURE.md` and `CONCERNS.md` as evidence sources for feasibility/risk/dependency dimensions
42
42
  - **Wiki prior knowledge** (if `maestro wiki` available) — `maestro wiki search "<subject keywords>"` for prior decisions and analyses on related topics
43
+ - **Codebase search** — prefer `maestro explore "FIND: <analysis target> SCOPE: src/ EXPECTED: file:line evidence"` over raw Grep for gathering multi-file evidence across dimensions
43
44
 
44
45
  ## Output
45
46
  `analysis.md`:
@@ -50,6 +50,7 @@ Each line in evidence.ndjson:
50
50
  - **Project specs** — `maestro spec load --category debug`: known issues, root causes, workarounds. Check before forming hypotheses to avoid re-investigating known problems.
51
51
  - **Codebase docs** (if `.workflow/codebase/` exists) — Read `ARCHITECTURE.md` for module boundaries to scope impact analysis and form better hypotheses
52
52
  - **Wiki prior knowledge** (if `maestro wiki` available) — `maestro wiki search "<symptom keywords>"` for prior investigations on similar issues; skip already-documented root causes
53
+ - **Codebase search** — prefer `maestro explore "FIND: <symptom> SCOPE: src/ ATTENTION: <error context>"` over raw Grep for multi-file evidence gathering
53
54
 
54
55
  ## Output
55
56
  - Debug session directory with:
@@ -67,6 +67,7 @@ You implement a single task from the execution plan. Each task is executed atomi
67
67
  - Codebase access for implementation
68
68
  - **Codebase docs** (if `.workflow/codebase/` exists) — Read `ARCHITECTURE.md` for module boundaries and component relationships before implementing cross-module changes
69
69
  - **Wiki prior knowledge** (if `maestro wiki` available) — `maestro wiki search "<task keywords>"` for related decisions/constraints that may affect implementation approach
70
+ - **Codebase search** — prefer `maestro explore "FIND: <pattern> SCOPE: src/ EXCLUDE: tests"` over raw Grep when searching for implementation patterns or integration points
70
71
 
71
72
  ## Output
72
73
  - Code changes (the actual implementation)
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: domain-add
3
+ description: Register a domain term into project glossary
4
+ argument-hint: "<canonical> \"<definition>\""
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ ---
12
+ <purpose>
13
+ Register a domain term into `.workflow/domain/glossary.yaml`. Domain terms are automatically injected into agent context via hooks (domain-compact for all prompts, domain-expanded on keyword match).
14
+ </purpose>
15
+
16
+ <required_reading>
17
+ @~/.maestro/workflows/domain-add.md
18
+ </required_reading>
19
+
20
+ <context>
21
+ $ARGUMENTS -- expects `<canonical> "<definition>"`
22
+
23
+ **Examples:**
24
+ ```bash
25
+ /domain-add auth-token "Short-lived credential for API authentication"
26
+ /domain-add event-bus "Central pub-sub message broker for cross-module communication"
27
+ /domain-add 会话上下文 "Runtime state container for active workflow session"
28
+ ```
29
+
30
+ Domain term lifecycle: discover/manual → register → active → (optional) deprecated → removed.
31
+
32
+ **Related commands:**
33
+ - `maestro domain list` — list all registered terms
34
+ - `maestro domain discover` — scan codebase for term candidates
35
+ - `maestro domain show <canonical>` — show term details
36
+ - `maestro domain deprecate <canonical> --successor <new>` — deprecate a term
37
+ </context>
38
+
39
+ <execution>
40
+ Follow '~/.maestro/workflows/domain-add.md' completely.
41
+ </execution>
42
+
43
+ <error_codes>
44
+ | Code | Severity | Description | Stage |
45
+ |------|----------|-------------|-------|
46
+ | E001 | fatal | Canonical name and definition are both required | parse_input |
47
+ | E002 | fatal | `.workflow/domain/` not initialized — run `maestro domain init` first | validate |
48
+ | E003 | fatal | Term already registered with same canonical name | duplicate_check |
49
+ | E004 | warning | Near-match found — confirm merge or create new | duplicate_check |
50
+ </error_codes>
51
+
52
+ <success_criteria>
53
+ - [ ] Canonical name and definition parsed and validated
54
+ - [ ] No duplicate term in glossary (or user confirmed near-match)
55
+ - [ ] Aliases and keywords auto-extracted from definition
56
+ - [ ] Term written to glossary.yaml with tier and relationships
57
+ - [ ] Confirmation displayed with term details and verify command
58
+ </success_criteria>
59
+
60
+ <completion>
61
+ ### Next-step routing
62
+
63
+ | Condition | Suggestion |
64
+ |-----------|-----------|
65
+ | Verify term added | `maestro domain show <canonical>` |
66
+ | Add more terms | `/domain-add <canonical> "<definition>"` |
67
+ | Discover candidates | `maestro domain discover` |
68
+ | List all terms | `maestro domain list` |
69
+ </completion>
@@ -12,8 +12,6 @@ allowed-tools:
12
12
  ---
13
13
  <purpose>
14
14
  Signal-driven overlay generator — collect workflow deficiency signals from multiple sources, diagnose which commands need amendment, batch-generate targeted overlays. All amendments use overlay system (`~/.maestro/overlays/*.json`) — non-invasive, idempotent, survives reinstall.
15
-
16
- Differs from `/maestro-overlay` (single explicit intent). This command **discovers** what needs amending by analyzing workflow artifacts.
17
15
  </purpose>
18
16
 
19
17
  <required_reading>
@@ -23,6 +23,7 @@ Multi-dimensional analysis of a proposal, decision, or architecture choice via C
23
23
  <deferred_reading>
24
24
  - [state.json](~/.maestro/templates/state.json) — read when registering artifact
25
25
  - [issue-gaps-analyze.md](~/.maestro/workflows/issue-gaps-analyze.md) — read when --gaps is triggered
26
+ - [boundary-grill.md](~/.maestro/workflows/boundary-grill.md) — read when boundary conflicts detected (between Phase 4 and Phase 5)
26
27
  </deferred_reading>
27
28
 
28
29
  <context>
@@ -94,6 +95,12 @@ Every decision MUST trace to independently gathered evidence. Manual Read/Grep i
94
95
 
95
96
  Decisions without CLI/agent-sourced evidence MUST be flagged as LOW CONFIDENCE.
96
97
 
98
+ ### Boundary Grill (Step 5 → Step 6)
99
+
100
+ After discussion rounds, BEFORE synthesis: run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
101
+ Input: discussion.md decisions + exploration-codebase.json. Scope guard: "only analyze decisions; do not prejudge plan/execute concerns".
102
+ IF conflicts → results to `analysis.md` § Boundary Grill Results + update `context.md` Locked/Free/Deferred.
103
+
97
104
  ### Standard Mode Gates
98
105
 
99
106
  Gates 1-4 are defined in `analyze.md`. NEVER skip gates. NEVER substitute manual Read/Grep for agent/CLI exploration.
@@ -193,6 +200,8 @@ Full mode:
193
200
  - [ ] Confidence tracking initialized (Step 4.6) and re-scored each round (Step 5.8)
194
201
  - [ ] Readiness gate checked before synthesis (Step 5.10)
195
202
  - [ ] Pressure pass completed ≥ 1 time before Step 6
203
+ - [ ] Boundary grill executed between Phase 4 and Phase 5 (skip if no conflicts detected)
204
+ - [ ] Boundary grill results written to analysis.md § Boundary Grill Results (if conflicts found)
196
205
  - [ ] Confidence summary with factor decomposition written to analysis.md
197
206
 
198
207
  Gaps mode:
@@ -25,6 +25,7 @@ Pipeline: grill (optional) → **brainstorm** → roadmap / analyze / blueprint.
25
25
  - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
26
26
  - [index.json](~/.maestro/templates/index.json) — read when operating in phase mode
27
27
  - [brainstorm-visualize.md](~/.maestro/workflows/brainstorm-visualize.md) — read when html-prototypes/ produced and user wants to browse them
28
+ - [boundary-grill.md](~/.maestro/workflows/boundary-grill.md) — read when boundary conflicts detected (in cross-role review)
28
29
  </deferred_reading>
29
30
 
30
31
  <context>
@@ -88,8 +89,14 @@ These gates apply to Auto mode (full pipeline). Do NOT advance past a gate until
88
89
  - REQUIRED: Per-feature files `{role}/analysis-F-*.md` written for each feature in §10.
89
90
  - BLOCKED if missing: complete all role analyses before spawning cross-role-reviewer.
90
91
 
91
- **GATE 3: Cross-Role Review → Completion** (Step 4.5 → Report)
92
+ **GATE 2.5: Cross-Role Review → Boundary Grill** (Step 4.5 → Step 4.6)
93
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md` after cross-role-reviewer output.
94
+ Input: reviewer findings + role Decision Digests. Scope guard: "only brainstorm decisions; do not pre-resolve roadmap/plan choices".
95
+ IF conflicts → results to `guidance-specification.md` §12.5 + feed into GATE 3. NON-BLOCKING.
96
+
97
+ **GATE 3: Cross-Role Review → Completion** (Step 4.5/4.6 → Report)
92
98
  - REQUIRED: Cross-role-reviewer output received with `patch_targets[]`.
99
+ - REQUIRED: Boundary grill completed (if conflicts detected, results logged).
93
100
  - REQUIRED: If findings > 0, resolutions applied via Edit AND logged in `guidance-specification.md` §12.
94
101
  - REQUIRED: If findings == 0, final report explicitly states "No cross-role issues detected".
95
102
  - BLOCKED if missing: complete review synthesis before reporting.
@@ -191,6 +198,8 @@ Status verdicts:
191
198
  - [ ] `ui-designer/analysis.md` references DESIGN.md visual constraints when ui-designer is selected
192
199
  - [ ] Each `{role}/analysis.md` §2 Decisions table has ≥ 1 row per feature
193
200
  - [ ] Cross-role review (Step 4.5) executed; reviewer compares §2 Decision Digests; output includes `patch_targets[]` for every finding
201
+ - [ ] Boundary grill executed after cross-role review (skip if no conflicts detected)
202
+ - [ ] Boundary grill results written to guidance-specification.md §12.5 (if conflicts found)
194
203
  - [ ] If findings exist: each accepted resolution applied via Edit (annotate / strikeout / append) AND logged in `guidance-specification.md` §12 "Cross-Role Resolutions"
195
204
  - [ ] If zero findings: final report explicitly states "No cross-role issues detected"; guidance §12 unchanged
196
205
  - [ ] Heading-drift patch failures surfaced in final report (if any)
@@ -73,7 +73,12 @@ S_COLLECT:
73
73
  GUARD: 1+ succeeded → continue with partial results (W001)
74
74
 
75
75
  S_CROSS_VERIFY:
76
- S_SYNTHESIZE DO: A_CLASSIFY_FINDINGS
76
+ S_BOUNDARY_GRILL DO: A_CLASSIFY_FINDINGS
77
+
78
+ S_BOUNDARY_GRILL:
79
+ → S_SYNTHESIZE WHEN: no boundary conflicts detected DO: —
80
+ → S_SYNTHESIZE WHEN: conflicts detected + resolved DO: A_BOUNDARY_GRILL
81
+ GUARD: max 3 conflicts × 3 questions; non-blocking
77
82
 
78
83
  S_SYNTHESIZE:
79
84
  → S_REGISTER DO: A_GENERATE_OUTPUTS
@@ -134,6 +139,12 @@ Read all per-tool outputs. For each finding:
134
139
  consensus_level = consensus_count / total_findings * 100.
135
140
  If consensus_level < 40%: W003.
136
141
 
142
+ ### A_BOUNDARY_GRILL
143
+
144
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
145
+ Input: classified CONFLICT findings + per-tool outputs. Check upstream scope if `--from` used.
146
+ IF conflicts → tag with resolution, feed into A_GENERATE_OUTPUTS. No conflicts → pass through.
147
+
137
148
  ### A_GENERATE_OUTPUTS
138
149
 
139
150
  Resolve conflicts via evidence-weighted voting:
@@ -160,6 +171,8 @@ Write 3 files:
160
171
  <success_criteria>
161
172
  - [ ] All delegates launched in parallel via Bash(run_in_background: true), STOP after launch
162
173
  - [ ] Cross-verification: consensus/conflict/unique classification with consensus_level
174
+ - [ ] Boundary grill executed on CONFLICT items (skip if no boundary conflicts detected)
175
+ - [ ] Boundary grill results written to collab-report.md § Boundary Grill Results (if conflicts found)
163
176
  - [ ] 3 output files produced (collab-report.md, context.md, conclusions.json)
164
177
  - [ ] CLB artifact registered in state.json
165
178
  - [ ] Partial degradation: continued if 1+ tools succeeded
@@ -92,9 +92,9 @@ S_FALLBACK:
92
92
  读 project state 推断 `lifecycle_position`(核心信号):
93
93
 
94
94
  ```bash
95
- cat .workflow/state.json 2>$null # phase / milestone / artifacts
96
- ls -la .workflow/scratch/ 2>$null | head -10 # 最近 artifact (mtime DESC)
97
- ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
95
+ cat .workflow/state.json 2>/dev/null # phase / milestone / artifacts
96
+ ls -la .workflow/scratch/ 2>/dev/null | head -10 # 最近 artifact (mtime DESC)
97
+ ls -la .workflow/.maestro/ 2>/dev/null | head -5 # 进行中的 session
98
98
  ```
99
99
 
100
100
  **项目状态 → lifecycle_position → 自然下一步:**
@@ -110,7 +110,8 @@ ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
110
110
  | 最新 artifact = plan | execute | `maestro-execute {phase}` |
111
111
  | 最新 artifact = execute | review | `quality-review {phase}` |
112
112
  | review verdict=PASS | test-gen | `quality-auto-test {phase}` |
113
- | 测试全绿 | milestone-audit | `maestro-milestone-audit` |
113
+ | 测试全绿 + current_milestone 存在 | milestone-audit | `maestro-milestone-audit` |
114
+ | 测试全绿 + current_milestone=null (standalone) | review-done | 回退到 `quality-review` 或 `manage-status`(无 milestone 上下文时不推荐 milestone 命令) |
114
115
  | 当前 milestone 全 phase 完成 | milestone-complete | `maestro-milestone-complete` |
115
116
  | 任一 stage 产物含 gaps/failed | debug | `quality-debug {gap}` |
116
117
 
@@ -133,6 +134,16 @@ brainstorm → blueprint → init → analyze-macro → roadmap
133
134
  | `name` 关键词命中 intent | 中 | intent 含 "test" → quality-test/quality-auto-test 加分 |
134
135
  | Workflow 簇匹配 | 中 | intent 涉及学习/知识/issue 等场景触发对应簇 |
135
136
  | Recent activity 反向避免 | 低 | 刚完成的 stage 短期内降权 |
137
+ | **前置条件不满足** | **禁止** | 候选命令的前置条件未满足时,直接从候选池移除(如 `maestro-milestone-*` 在 `current_milestone=null` 时移除) |
138
+
139
+ **前置条件检查(评分前执行,不满足则移除候选):**
140
+
141
+ | 命令 | 前置条件 |
142
+ |------|---------|
143
+ | `maestro-milestone-audit` | `current_milestone` 存在且非 null |
144
+ | `maestro-milestone-complete` | `current_milestone` 存在且非 null |
145
+ | `maestro-milestone-release` | `current_milestone` 存在且非 null |
146
+ | `maestro-merge` | 存在活跃的 fork 分支 |
136
147
 
137
148
  **特殊意图处理:**
138
149