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
@@ -13,96 +13,103 @@ allowed-tools:
13
13
  # CLI Explore Agent
14
14
 
15
15
  ## Role
16
- 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.
16
+ Specialized CLI exploration agent. Autonomously analyzes codebases and generates structured outputs. Read-only.
17
17
 
18
18
  **CRITICAL: Mandatory Initial Read**
19
19
  When spawned with `<files_to_read>`, read ALL listed files before any analysis.
20
20
 
21
21
  **Core responsibilities:**
22
- 1. **Structural Analysis** - Module discovery, file patterns, symbol inventory via Bash tools
23
- 2. **Semantic Understanding** - Design intent, architectural patterns via CLI analysis
24
- 3. **Dependency Mapping** - Import/export graphs, circular detection, coupling analysis
25
- 4. **Structured Output** - Schema-compliant JSON generation with validation
22
+ 1. **Structural Analysis** Module discovery, file patterns, symbol inventory
23
+ 2. **Semantic Understanding** Design intent, architectural patterns via CLI analysis
24
+ 3. **Dependency Mapping** Import/export graphs, circular detection, coupling analysis
25
+ 4. **Structured Output** Schema-compliant JSON generation with validation
26
26
 
27
27
  **Analysis Modes**:
28
- - `quick-scan` → Bash only (fast)
29
- - `deep-scan` → Bash + CLI dual-source (thorough)
30
- - `dependency-map` → Graph construction (comprehensive)
28
+ - `quick-scan` → `maestro explore` single prompt (fast)
29
+ - `deep-scan` → `maestro explore` multi-prompt parallel (thorough)
30
+ - `dependency-map` → Multi-prompt + Bash graph construction (comprehensive)
31
31
 
32
32
  ## 4-Phase Execution Workflow
33
33
 
34
34
  ```
35
- Phase 1: Task Understanding
36
- Parse prompt for: analysis scope, output requirements, schema path
37
- Phase 2: Analysis Execution
38
- Bash structural scan + CLI semantic analysis (based on mode)
39
- Phase 3: Schema Validation (MANDATORY if schema specified)
40
- ↓ Read schema → Extract EXACT field names → Validate structure
41
- Phase 4: Output Generation
42
- ↓ Agent report + File output (strictly schema-compliant)
35
+ Phase 1: Task Understanding → parse scope, output requirements, schema
36
+ Phase 2: Analysis Execution maestro explore + Bash structural scan
37
+ Phase 3: Schema Validation → read schema, validate structure
38
+ Phase 4: Output Generation agent report + file output
43
39
  ```
44
40
 
45
41
  ## Phase 1: Task Understanding
46
42
 
47
- ### Autonomous Initialization (execute before any analysis)
48
-
49
43
  1. **Project Structure Discovery**:
50
44
  - Glob `src/**` and top-level directories to map module structure
51
45
  - Read `package.json` / `Cargo.toml` / `go.mod` / `pyproject.toml` for tech stack
52
46
 
53
47
  2. **Output Schema Loading** (if output file path specified in prompt):
54
- - Read schema file and memorize requirements BEFORE any analysis begins
48
+ - Read schema file and memorize requirements BEFORE any analysis
55
49
 
56
50
  3. **Project Context Loading** (from spec system):
57
51
  - Load exploration specs: `maestro spec load --category arch`
58
- - Extract: tech_stack, architecture, key_components, overview
59
- - If no specs returned, proceed with fresh analysis
60
52
 
61
- 4. **Task Keyword Search** (initial file discovery):
62
- - Extract keywords from prompt, detect primary language, run targeted Grep
63
- - Store results as `keyword_files` for Phase 2 scoping
53
+ 4. **Determine analysis depth from prompt keywords**:
54
+ - Quick lookup, structure overview quick-scan
55
+ - Deep analysis, design intent, architecture deep-scan
56
+ - Dependencies, impact analysis, coupling → dependency-map
64
57
 
65
- **Extract from prompt**:
66
- - Analysis target and scope
67
- - Analysis mode (quick-scan / deep-scan / dependency-map)
68
- - Output file path and schema file path (if specified)
58
+ ## Phase 2: Analysis Execution
69
59
 
70
- **Determine analysis depth from prompt keywords**:
71
- - Quick lookup, structure overview → quick-scan
72
- - Deep analysis, design intent, architecture → deep-scan
73
- - Dependencies, impact analysis, coupling → dependency-map
60
+ ### Primary: `maestro explore` (preferred)
74
61
 
75
- ## Phase 2: Analysis Execution
62
+ **Quick-scan** single targeted prompt:
76
63
 
77
- ### Bash Structural Scan
64
+ ```bash
65
+ maestro explore "FIND: <target from prompt>
66
+ SCOPE: src/
67
+ EXCLUDE: test files, node_modules, generated code
68
+ EXPECTED: file:line evidence list" --max-turns 3
69
+ ```
70
+
71
+ **Deep-scan** — multi-prompt parallel for multi-angle coverage:
78
72
 
79
73
  ```bash
80
- # Pattern discovery (adapt based on language)
81
- rg "^export (class|interface|function) " --type ts -n
82
- rg "^(class|def) \w+" --type py -n
83
- rg "^import .* from " -n | head -30
74
+ maestro explore \
75
+ "FIND: <structural patterns>
76
+ SCOPE: src/
77
+ EXPECTED: file:line list" \
78
+ "FIND: <design intent / architecture>
79
+ SCOPE: src/
80
+ EXPECTED: pattern descriptions with file evidence" \
81
+ --max-turns 3 --json
82
+ ```
83
+
84
+ **Dependency-map** — combine explore + Bash:
85
+
86
+ ```bash
87
+ maestro explore "FIND: import/export relationships
88
+ SCOPE: src/
89
+ ATTENTION: circular dependencies, tight coupling
90
+ EXPECTED: dependency pairs with file:line" --max-turns 4 --json
84
91
  ```
85
92
 
86
- ### CLI Semantic Analysis (deep-scan, dependency-map)
93
+ ### Secondary: Bash structural scan (supplement only)
87
94
 
88
95
  ```bash
89
- maestro delegate "
90
- PURPOSE: {from prompt}
91
- TASK: {from prompt}
92
- MODE: analysis
93
- CONTEXT: @**/*
94
- EXPECTED: {from prompt}
95
- " --role explore --mode analysis --cd {dir}
96
+ rg "^export (class|interface|function) " --type ts -n | head -30
97
+ rg "^import .* from " -n | head -30
96
98
  ```
97
99
 
98
- **Fallback Chain**: config-driven via `cli-tools.json` role mappings Bash-only
100
+ Use Bash only when `maestro explore` results need structural verification.
101
+
102
+ ### Fallback: `maestro delegate` (only when explore unavailable)
103
+
104
+ ```bash
105
+ maestro delegate "PURPOSE: {from prompt} TASK: {from prompt} MODE: analysis" --role explore --mode analysis
106
+ ```
99
107
 
100
108
  ### Dual-Source Synthesis
101
109
 
102
- 1. Bash results: Precise file:line locations → `discovery_source: "bash-scan"`
103
- 2. CLI results: Semantic understanding, design intent → `discovery_source: "cli-analysis"`
104
- 3. Dependency tracing: Import/export graph `discovery_source: "dependency-trace"`
105
- 4. Merge with source attribution and generate for each file:
110
+ 1. Explore results: Semantic findings → `discovery_source: "explore"`
111
+ 2. Bash results: Precise file:line locations → `discovery_source: "bash-scan"`
112
+ 3. Merge with source attribution and generate for each file:
106
113
  - `rationale`: WHY the file was selected (specific, >10 chars)
107
114
  - `topic_relation`: HOW the file connects to the exploration angle/topic
108
115
  - `key_code`: Detailed descriptions of key symbols with locations (for relevance >= 0.7)
@@ -114,39 +121,35 @@ EXPECTED: {from prompt}
114
121
  **Step 1: Read Schema FIRST** before generating any output
115
122
 
116
123
  **Step 2: Extract Schema Requirements**
117
- 1. Root structure - Is it array `[...]` or object `{...}`?
118
- 2. Required fields - List all `"required": [...]` arrays
119
- 3. Field names EXACTLY - Copy character-by-character (case-sensitive)
120
- 4. Enum values - Copy exact strings (case-sensitive)
121
- 5. Nested structures - Note flat vs nested requirements
124
+ 1. Root structure array `[...]` or object `{...}`?
125
+ 2. Required fields list all `"required": [...]` arrays
126
+ 3. Field names EXACTLY copy character-by-character (case-sensitive)
127
+ 4. Enum values copy exact strings (case-sensitive)
128
+ 5. Nested structures note flat vs nested requirements
122
129
 
123
130
  **Step 3: File Rationale Validation** (MANDATORY for relevant_files / affected_files)
124
131
 
125
132
  Every file entry MUST have:
126
133
  - `rationale` (required, minLength 10): Specific reason tied to the exploration topic
127
- - GOOD: "Contains AuthService.login() which is the entry point for JWT token generation"
128
- - BAD: "Related to auth"
129
134
  - `role` (required, enum): modify_target / dependency / pattern_reference / test_target / type_definition / integration_point / config / context_only
130
- - `discovery_source` (recommended): bash-scan / cli-analysis / dependency-trace / manual
135
+ - `discovery_source` (recommended): explore / bash-scan / dependency-trace / manual
131
136
  - `key_code` (required for relevance >= 0.7): Array of {symbol, location?, description}
132
137
  - `topic_relation` (required for relevance >= 0.7): Connection from exploration angle perspective
133
138
 
134
139
  **Step 4: Pre-Output Validation Checklist**
135
- - [ ] Root structure matches schema (array vs object)
140
+ - [ ] Root structure matches schema
136
141
  - [ ] ALL required fields present at each level
137
- - [ ] Field names EXACTLY match schema (character-by-character)
138
- - [ ] Enum values EXACTLY match schema (case-sensitive)
142
+ - [ ] Field names EXACTLY match schema
143
+ - [ ] Enum values EXACTLY match schema
139
144
  - [ ] Every file has: path + relevance + rationale + role
140
145
  - [ ] Files with relevance >= 0.7 have key_code and topic_relation
141
146
 
142
147
  ## Phase 4: Output Generation
143
148
 
144
149
  ### Agent Output (return to caller)
145
-
146
150
  Brief summary: task completion status, key findings, generated file paths
147
151
 
148
152
  ### File Output (as specified in prompt)
149
-
150
153
  1. Read schema file BEFORE generating output
151
154
  2. Extract ALL field names from schema
152
155
  3. Build JSON using ONLY schema field names
@@ -172,16 +175,16 @@ Brief summary: task completion status, key findings, generated file paths
172
175
  ## Rules
173
176
 
174
177
  ### ALWAYS
175
- - Read schema file FIRST before generating any output (if schema specified)
178
+ - Prefer `maestro explore` over raw Grep/rg for code search
179
+ - Use structured prompt format (FIND/SCOPE/EXCLUDE/ATTENTION/EXPECTED)
180
+ - Read schema file FIRST before generating output (if schema specified)
176
181
  - Copy field names EXACTLY from schema (case-sensitive)
177
182
  - Include file:line references in findings
178
- - Every file MUST have rationale (specific, not generic) and role
179
183
  - Track discovery source for all findings
180
- - Populate key_code and topic_relation for high-relevance files (>= 0.7)
181
184
  - Use `run_in_background: false` for all Bash/CLI calls
182
185
 
183
186
  ### NEVER
184
187
  - Modify any files (read-only agent)
185
188
  - Skip schema reading step when schema is specified
186
- - Guess field names - ALWAYS copy from schema
189
+ - Guess field names ALWAYS copy from schema
187
190
  - Omit required fields
@@ -42,6 +42,7 @@ You perform structured multi-dimensional analysis of technical topics, proposals
42
42
  - Comparison alternatives (if applicable)
43
43
  - **Codebase docs** (if `.workflow/codebase/` exists) — `ARCHITECTURE.md` and `CONCERNS.md` as evidence sources for feasibility/risk/dependency dimensions
44
44
  - **Wiki prior knowledge** (if `maestro wiki` available) — `maestro wiki search "<subject keywords>"` for prior decisions and analyses on related topics
45
+ - **Codebase search** — prefer `maestro explore "FIND: <analysis target> SCOPE: src/ EXPECTED: file:line evidence"` over raw Grep for gathering multi-file evidence across dimensions
45
46
 
46
47
  ## Output
47
48
  `analysis.md`:
@@ -52,6 +52,7 @@ Each line in evidence.ndjson:
52
52
  - **Project specs** — `maestro spec load --category debug`: known issues, root causes, workarounds. Check before forming hypotheses to avoid re-investigating known problems.
53
53
  - **Codebase docs** (if `.workflow/codebase/` exists) — Read `ARCHITECTURE.md` for module boundaries to scope impact analysis and form better hypotheses
54
54
  - **Wiki prior knowledge** (if `maestro wiki` available) — `maestro wiki search "<symptom keywords>"` for prior investigations on similar issues; skip already-documented root causes
55
+ - **Codebase search** — prefer `maestro explore "FIND: <symptom> SCOPE: src/ ATTENTION: <error context>"` over raw Grep for multi-file evidence gathering
55
56
 
56
57
  ## Output
57
58
  - Debug session directory with:
@@ -69,6 +69,7 @@ You implement a single task from the execution plan. Each task is executed atomi
69
69
  - Codebase access for implementation
70
70
  - **Codebase docs** (if `.workflow/codebase/` exists) — Read `ARCHITECTURE.md` for module boundaries and component relationships before implementing cross-module changes
71
71
  - **Wiki prior knowledge** (if `maestro wiki` available) — `maestro wiki search "<task keywords>"` for related decisions/constraints that may affect implementation approach
72
+ - **Codebase search** — prefer `maestro explore "FIND: <pattern> SCOPE: src/ EXCLUDE: tests"` over raw Grep when searching for implementation patterns or integration points
72
73
 
73
74
  ## Output
74
75
  - Code changes (the actual implementation)
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: domain-add
3
+ description: Register a domain term into project glossary
4
+ argument-hint: "<canonical> \"<definition>\""
5
+ allowed-tools:
6
+ - read_file
7
+ - write_file
8
+ - shell
9
+ - find_files
10
+ - search
11
+ ---
12
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
13
+
14
+ <purpose>
15
+ 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).
16
+ </purpose>
17
+
18
+ <required_reading>
19
+ @~/.maestro/workflows/domain-add.md
20
+ </required_reading>
21
+
22
+ <context>
23
+ $ARGUMENTS -- expects `<canonical> "<definition>"`
24
+
25
+ **Examples:**
26
+ ```bash
27
+ /domain-add auth-token "Short-lived credential for API authentication"
28
+ /domain-add event-bus "Central pub-sub message broker for cross-module communication"
29
+ /domain-add 会话上下文 "Runtime state container for active workflow session"
30
+ ```
31
+
32
+ Domain term lifecycle: discover/manual → register → active → (optional) deprecated → removed.
33
+
34
+ **Related commands:**
35
+ - `maestro domain list` — list all registered terms
36
+ - `maestro domain discover` — scan codebase for term candidates
37
+ - `maestro domain show <canonical>` — show term details
38
+ - `maestro domain deprecate <canonical> --successor <new>` — deprecate a term
39
+ </context>
40
+
41
+ <execution>
42
+ Follow '~/.maestro/workflows/domain-add.md' completely.
43
+ </execution>
44
+
45
+ <error_codes>
46
+ | Code | Severity | Description | Stage |
47
+ |------|----------|-------------|-------|
48
+ | E001 | fatal | Canonical name and definition are both required | parse_input |
49
+ | E002 | fatal | `.workflow/domain/` not initialized — run `maestro domain init` first | validate |
50
+ | E003 | fatal | Term already registered with same canonical name | duplicate_check |
51
+ | E004 | warning | Near-match found — confirm merge or create new | duplicate_check |
52
+ </error_codes>
53
+
54
+ <success_criteria>
55
+ - [ ] Canonical name and definition parsed and validated
56
+ - [ ] No duplicate term in glossary (or user confirmed near-match)
57
+ - [ ] Aliases and keywords auto-extracted from definition
58
+ - [ ] Term written to glossary.yaml with tier and relationships
59
+ - [ ] Confirmation displayed with term details and verify command
60
+ </success_criteria>
61
+
62
+ <completion>
63
+ ### Next-step routing
64
+
65
+ | Condition | Suggestion |
66
+ |-----------|-----------|
67
+ | Verify term added | `maestro domain show <canonical>` |
68
+ | Add more terms | `/domain-add <canonical> "<definition>"` |
69
+ | Discover candidates | `maestro domain discover` |
70
+ | List all terms | `maestro domain list` |
71
+ </completion>
@@ -41,17 +41,18 @@ $ARGUMENTS — user intent text, or special keywords.
41
41
  1. **All chains dispatch via maestro-ralph-execute** — maestro never executes steps directly
42
42
  2. **Session before execution** — status.json created before any step runs
43
43
  3. **Auto flag pass-through** — 仅当用户传入 `-y` 时透传 `-y` 到 skill args
44
- 4. **Decomposition contract shared with maestro-ralph** — broad/lifecycle intents run S_DECOMPOSE producing the SAME additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`)Reference maestro-ralph `A_DECOMPOSE_TASKS`
44
+ 4. **Decomposition contract maestro owns** — `source=="maestro"` session maestro 拥有分解契约(`decomposition_owner="maestro"`):S_DECOMPOSE 产出 additive block (`boundary_contract`, `execution_criteria`, `task_decomposition`),下游 ralph 只消费不覆盖(ralph A_DECOMPOSE_TASKS step 0 ownership guard 跳过二次提问)。Reference maestro-ralph `A_DECOMPOSE_TASKS`
45
45
  5. **status.json 唯一真源** — 不生成 `goal-checklist.md` 或外部清单
46
46
  6. **执行步骤统一通过 `maestro ralph next` 加载** — `command_scope`/`command_path` 由 `maestro ralph skills --platform agent --json --quiet` 预校验(project 覆盖 global,限定 `.claude/`);decision 节点不走 CLI,走 `invoke_skill("maestro-ralph")` handoff
47
47
  7. **Topology awareness** — chain catalog 含 grill / brainstorm / blueprint / analyze-macro / analyze / roadmap / plan(三路径) / execute / ...;scope_verdict 由 ralph 在 `post-analyze-scope` 决定
48
- 8. **Grill is interactive-only** — `-y` auto mode MUST skip grill stage and route directly to brainstorm; grill requires Socratic Q&A with the user
48
+ 8. **Grill `-y` 透传** — `-y` auto mode 透传 `-y` grill args(grill 自身 Auto mode 用代码代答),不删除 grill stage;grill 仍产出 grill-report/terminology/context-package 供下游 brainstorm
49
49
  9. **D-007 milestone 反查** — 数字 phase 的 `milestone_id` 由 `state.json.milestones[].phase_slugs` 反查
50
50
  10. **每个 step 必须 `completion_confirmed: true`** — 由 `maestro ralph complete N --status DONE|DONE_WITH_CONCERNS` 写入
51
51
  11. **schema** — `ralph_protocol_version: "1"` 标记 CLI-driven session;新增字段全部可选
52
52
  12. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作,不可绕过。特别是 invariant 1(dispatch via ralph-execute)和 invariant 2(session before execution)和 invariant 10(completion_confirmed 由 CLI 写入)为硬约束。
53
53
  14. **禁止以上下文消耗为由中断执行** — harness 自动处理 context compression,以"上下文不足"或"避免 context overflow"为由中断属于 invariant violation
54
54
  13. **Classification evidence** — S_CLASSIFY 的 chain 选择决策 MUST 记录到 status.json 的 `classification_rationale` 字段:匹配了哪个 pattern、排除了哪些备选、confidence level。无记录的分类不可进入 S_CREATE。
55
+ 15. **控制权优先级(范式治理)** — FSM(maestro/maestro-ralph)独占 session 生命周期 + step 排序 + cross-step decision 节点;Pipeline(plan/execute/analyze)只拥有自身 artifact GATE,由 ralph dispatch 时 GATE 失败 → `complete BLOCKED|NEEDS_RETRY`、自身 GATE 全过 → DONE;Router(maestro-next)只单次推荐,不得出现在 FSM step 内。
55
56
  </invariants>
56
57
 
57
58
  <state_machine>
@@ -130,7 +131,7 @@ S_FALLBACK:
130
131
  1. Read `~/.maestro/workflows/maestro.md` from deferred_reading
131
132
  2. Match intent to task_type via chain catalog (semantic)
132
133
  3. Select chain from chainMap,遵循拓扑约束:
133
- - 压力测试/拷问/验证假设/grill/stress-test → `grill`(**-y 模式跳过 grill,直接走 brainstorm**)
134
+ - 压力测试/拷问/验证假设/grill/stress-test → `grill`(**-y 模式透传 `-y` 到 grill,grill 以 Auto mode 执行,不跳过**)
134
135
  - 头脑风暴/探索 → `brainstorm`
135
136
  - 学习/阅读代码/跟读/follow → `invoke_skill("learn-follow")`;调查/为什么/investigate → `invoke_skill("learn-investigate")`;分解/模式/decompose → `invoke_skill("learn-decompose")`;评审/挑战/second-opinion → `invoke_skill("learn-second-opinion")`;回顾/retro → `invoke_skill("quality-retrospective")`
136
137
  - 正式规格/spec-generate/7-phase → `blueprint`
@@ -148,7 +149,7 @@ S_FALLBACK:
148
149
 
149
150
  ### A_DECOMPOSE_TASKS
150
151
 
151
- maestro-ralph `A_DECOMPOSE_TASKS` 共享分解契约。Condensed:
152
+ `session.decomposition_owner = "maestro"`。下游 ralph 只消费不二次提问(invariant 4)。Condensed:
152
153
 
153
154
  1. 分类意图广度。narrow / 单步 / `{status,init,quick}` 链跳过
154
155
  2. broad/medium → `ask_user` ≤3 轮:Scope / Constraints / Definition of Done
@@ -177,7 +178,7 @@ S_FALLBACK:
177
178
  "ralph_protocol_version": "1", "active_step_index": null,
178
179
  "phase", "phase_is_new": false, "milestone": "",
179
180
  "scope_verdict": null, "analyze_macro_id": null, "blueprint_id": null,
180
- "auto_mode": false, "cli_tool": "claude",
181
+ "auto_mode": false, "decomposition_owner": "maestro", "cli_tool": "claude",
181
182
  "context": { "scratch_dir": null, "plan_dir": null, "analysis_dir": null,
182
183
  "brainstorm_dir": null, "blueprint_dir": null, "issue_id": null },
183
184
  "steps": [{
@@ -222,7 +223,7 @@ S_FALLBACK:
222
223
 
223
224
  - [ ] Intent classified with task_type, complexity, clarity_score
224
225
  - [ ] Chain catalog 覆盖 grill / brainstorm / blueprint / analyze-macro / analyze / roadmap / plan(三路径) / execute / quality pipeline
225
- - [ ] `-y` 模式不触发 grill(交互式压力测试不支持自动模式,跳过直接走 brainstorm)
226
+ - [ ] `-y` 模式透传 `-y` 到 grill(grill 以 Auto mode 代码代答执行,stage 不跳过)
226
227
  - [ ] D-007: 数字 phase 步骤的 `milestone_id` 通过 `state.json.milestones[].phase_slugs` 反查
227
228
  - [ ] macro analyze 后跟 `decision:post-analyze-scope`(由 ralph 评估 scope_verdict 决定下游链路)
228
229
  - [ ] plan 支持 `{phase}` / `--from analyze:{ANL_ID}` / `--from blueprint:{BLP_ID}` 三路径;`source_artifact_ref` 写入 step
@@ -14,8 +14,6 @@ allowed-tools:
14
14
 
15
15
  <purpose>
16
16
  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.
17
-
18
- Differs from `/maestro-overlay` (single explicit intent). This command **discovers** what needs amending by analyzing workflow artifacts.
19
17
  </purpose>
20
18
 
21
19
  <required_reading>
@@ -25,6 +25,7 @@ Multi-dimensional analysis of a proposal, decision, or architecture choice via C
25
25
  <deferred_reading>
26
26
  - [state.json](~/.maestro/templates/state.json) — read when registering artifact
27
27
  - [issue-gaps-analyze.md](~/.maestro/workflows/issue-gaps-analyze.md) — read when --gaps is triggered
28
+ - [boundary-grill.md](~/.maestro/workflows/boundary-grill.md) — read when boundary conflicts detected (between Phase 4 and Phase 5)
28
29
  </deferred_reading>
29
30
 
30
31
  <context>
@@ -96,6 +97,12 @@ Every decision MUST trace to independently gathered evidence. Manual Read/Grep i
96
97
 
97
98
  Decisions without CLI/agent-sourced evidence MUST be flagged as LOW CONFIDENCE.
98
99
 
100
+ ### Boundary Grill (Step 5 → Step 6)
101
+
102
+ After discussion rounds, BEFORE synthesis: run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
103
+ Input: discussion.md decisions + exploration-codebase.json. Scope guard: "only analyze decisions; do not prejudge plan/execute concerns".
104
+ IF conflicts → results to `analysis.md` § Boundary Grill Results + update `context.md` Locked/Free/Deferred.
105
+
99
106
  ### Standard Mode Gates
100
107
 
101
108
  Gates 1-4 are defined in `analyze.md`. NEVER skip gates. NEVER substitute manual Read/Grep for agent/CLI exploration.
@@ -195,6 +202,8 @@ Full mode:
195
202
  - [ ] Confidence tracking initialized (Step 4.6) and re-scored each round (Step 5.8)
196
203
  - [ ] Readiness gate checked before synthesis (Step 5.10)
197
204
  - [ ] Pressure pass completed ≥ 1 time before Step 6
205
+ - [ ] Boundary grill executed between Phase 4 and Phase 5 (skip if no conflicts detected)
206
+ - [ ] Boundary grill results written to analysis.md § Boundary Grill Results (if conflicts found)
198
207
  - [ ] Confidence summary with factor decomposition written to analysis.md
199
208
 
200
209
  Gaps mode:
@@ -27,6 +27,7 @@ Pipeline: grill (optional) → **brainstorm** → roadmap / analyze / blueprint.
27
27
  - [scratch-index.json](~/.maestro/templates/scratch-index.json) — read when operating in scratch mode
28
28
  - [index.json](~/.maestro/templates/index.json) — read when operating in phase mode
29
29
  - [brainstorm-visualize.md](~/.maestro/workflows/brainstorm-visualize.md) — read when html-prototypes/ produced and user wants to browse them
30
+ - [boundary-grill.md](~/.maestro/workflows/boundary-grill.md) — read when boundary conflicts detected (in cross-role review)
30
31
  </deferred_reading>
31
32
 
32
33
  <context>
@@ -90,8 +91,14 @@ These gates apply to Auto mode (full pipeline). Do NOT advance past a gate until
90
91
  - REQUIRED: Per-feature files `{role}/analysis-F-*.md` written for each feature in §10.
91
92
  - BLOCKED if missing: complete all role analyses before spawning cross-role-reviewer.
92
93
 
93
- **GATE 3: Cross-Role Review → Completion** (Step 4.5 → Report)
94
+ **GATE 2.5: Cross-Role Review → Boundary Grill** (Step 4.5 → Step 4.6)
95
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md` after cross-role-reviewer output.
96
+ Input: reviewer findings + role Decision Digests. Scope guard: "only brainstorm decisions; do not pre-resolve roadmap/plan choices".
97
+ IF conflicts → results to `guidance-specification.md` §12.5 + feed into GATE 3. NON-BLOCKING.
98
+
99
+ **GATE 3: Cross-Role Review → Completion** (Step 4.5/4.6 → Report)
94
100
  - REQUIRED: Cross-role-reviewer output received with `patch_targets[]`.
101
+ - REQUIRED: Boundary grill completed (if conflicts detected, results logged).
95
102
  - REQUIRED: If findings > 0, resolutions applied via Edit AND logged in `guidance-specification.md` §12.
96
103
  - REQUIRED: If findings == 0, final report explicitly states "No cross-role issues detected".
97
104
  - BLOCKED if missing: complete review synthesis before reporting.
@@ -193,6 +200,8 @@ Status verdicts:
193
200
  - [ ] `ui-designer/analysis.md` references DESIGN.md visual constraints when ui-designer is selected
194
201
  - [ ] Each `{role}/analysis.md` §2 Decisions table has ≥ 1 row per feature
195
202
  - [ ] Cross-role review (Step 4.5) executed; reviewer compares §2 Decision Digests; output includes `patch_targets[]` for every finding
203
+ - [ ] Boundary grill executed after cross-role review (skip if no conflicts detected)
204
+ - [ ] Boundary grill results written to guidance-specification.md §12.5 (if conflicts found)
196
205
  - [ ] If findings exist: each accepted resolution applied via edit_file(annotate / strikeout / append) AND logged in `guidance-specification.md` §12 "Cross-Role Resolutions"
197
206
  - [ ] If zero findings: final report explicitly states "No cross-role issues detected"; guidance §12 unchanged
198
207
  - [ ] Heading-drift patch failures surfaced in final report (if any)
@@ -75,7 +75,12 @@ S_COLLECT:
75
75
  GUARD: 1+ succeeded → continue with partial results (W001)
76
76
 
77
77
  S_CROSS_VERIFY:
78
- S_SYNTHESIZE DO: A_CLASSIFY_FINDINGS
78
+ S_BOUNDARY_GRILL DO: A_CLASSIFY_FINDINGS
79
+
80
+ S_BOUNDARY_GRILL:
81
+ → S_SYNTHESIZE WHEN: no boundary conflicts detected DO: —
82
+ → S_SYNTHESIZE WHEN: conflicts detected + resolved DO: A_BOUNDARY_GRILL
83
+ GUARD: max 3 conflicts × 3 questions; non-blocking
79
84
 
80
85
  S_SYNTHESIZE:
81
86
  → S_REGISTER DO: A_GENERATE_OUTPUTS
@@ -136,6 +141,12 @@ Read all per-tool outputs. For each finding:
136
141
  consensus_level = consensus_count / total_findings * 100.
137
142
  If consensus_level < 40%: W003.
138
143
 
144
+ ### A_BOUNDARY_GRILL
145
+
146
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
147
+ Input: classified CONFLICT findings + per-tool outputs. Check upstream scope if `--from` used.
148
+ IF conflicts → tag with resolution, feed into A_GENERATE_OUTPUTS. No conflicts → pass through.
149
+
139
150
  ### A_GENERATE_OUTPUTS
140
151
 
141
152
  Resolve conflicts via evidence-weighted voting:
@@ -162,6 +173,8 @@ Write 3 files:
162
173
  <success_criteria>
163
174
  - [ ] All delegates launched in parallel via shell(run_in_background: true), STOP after launch
164
175
  - [ ] Cross-verification: consensus/conflict/unique classification with consensus_level
176
+ - [ ] Boundary grill executed on CONFLICT items (skip if no boundary conflicts detected)
177
+ - [ ] Boundary grill results written to collab-report.md § Boundary Grill Results (if conflicts found)
165
178
  - [ ] 3 output files produced (collab-report.md, context.md, conclusions.json)
166
179
  - [ ] CLB artifact registered in state.json
167
180
  - [ ] Partial degradation: continued if 1+ tools succeeded
@@ -94,9 +94,9 @@ S_FALLBACK:
94
94
  读 project state 推断 `lifecycle_position`(核心信号):
95
95
 
96
96
  ```bash
97
- cat .workflow/state.json 2>$null # phase / milestone / artifacts
98
- ls -la .workflow/scratch/ 2>$null | head -10 # 最近 artifact (mtime DESC)
99
- ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
97
+ cat .workflow/state.json 2>/dev/null # phase / milestone / artifacts
98
+ ls -la .workflow/scratch/ 2>/dev/null | head -10 # 最近 artifact (mtime DESC)
99
+ ls -la .workflow/.maestro/ 2>/dev/null | head -5 # 进行中的 session
100
100
  ```
101
101
 
102
102
  **项目状态 → lifecycle_position → 自然下一步:**
@@ -112,7 +112,8 @@ ls -la .workflow/.maestro/ 2>$null | head -5 # 进行中的 session
112
112
  | 最新 artifact = plan | execute | `maestro-execute {phase}` |
113
113
  | 最新 artifact = execute | review | `quality-review {phase}` |
114
114
  | review verdict=PASS | test-gen | `quality-auto-test {phase}` |
115
- | 测试全绿 | milestone-audit | `maestro-milestone-audit` |
115
+ | 测试全绿 + current_milestone 存在 | milestone-audit | `maestro-milestone-audit` |
116
+ | 测试全绿 + current_milestone=null (standalone) | review-done | 回退到 `quality-review` 或 `manage-status`(无 milestone 上下文时不推荐 milestone 命令) |
116
117
  | 当前 milestone 全 phase 完成 | milestone-complete | `maestro-milestone-complete` |
117
118
  | 任一 stage 产物含 gaps/failed | debug | `quality-debug {gap}` |
118
119
 
@@ -135,6 +136,16 @@ brainstorm → blueprint → init → analyze-macro → roadmap
135
136
  | `name` 关键词命中 intent | 中 | intent 含 "test" → quality-test/quality-auto-test 加分 |
136
137
  | Workflow 簇匹配 | 中 | intent 涉及学习/知识/issue 等场景触发对应簇 |
137
138
  | Recent activity 反向避免 | 低 | 刚完成的 stage 短期内降权 |
139
+ | **前置条件不满足** | **禁止** | 候选命令的前置条件未满足时,直接从候选池移除(如 `maestro-milestone-*` 在 `current_milestone=null` 时移除) |
140
+
141
+ **前置条件检查(评分前执行,不满足则移除候选):**
142
+
143
+ | 命令 | 前置条件 |
144
+ |------|---------|
145
+ | `maestro-milestone-audit` | `current_milestone` 存在且非 null |
146
+ | `maestro-milestone-complete` | `current_milestone` 存在且非 null |
147
+ | `maestro-milestone-release` | `current_milestone` 存在且非 null |
148
+ | `maestro-merge` | 存在活跃的 fork 分支 |
138
149
 
139
150
  **特殊意图处理:**
140
151
 
@@ -23,7 +23,10 @@ Turn natural-language instructions into command overlays — JSON patch files th
23
23
  </required_reading>
24
24
 
25
25
  <context>
26
- **Overlay model** — an overlay is a JSON file with a `name`, one or more `targets` (command names without `.md`), and a list of `patches`. Each patch targets an XML section (`execution`, `required_reading`, `context`, `success_criteria`, etc.), a mode (`append`, `prepend`, `replace`, `new-section`), and `content`. On apply, the patcher wraps the content in hashed HTML-comment markers so re-apply is idempotent and removal is surgical.
26
+ **Overlay model**:
27
+ - JSON file: `name`, `targets[]` (command names), `patches[]`
28
+ - Patch: `section` (XML tag), `mode` (append/prepend/replace/new-section), `content`
29
+ - Apply: hashed HTML-comment markers (idempotent, surgical removal)
27
30
 
28
31
  **Where overlays live**
29
32
  - User overlays: `~/.maestro/overlays/*.json` — created by this skill
@@ -141,8 +144,6 @@ Run:
141
144
  maestro overlay add ~/.maestro/overlays/<slug>.json
142
145
  ```
143
146
 
144
- This validates the overlay, copies it into place (idempotent), and applies it across all known install scopes. On validation failure, fix the JSON and re-run.
145
-
146
147
  ### 5. Report
147
148
 
148
149
  Show the user:
@@ -27,6 +27,7 @@ Produces plan.json + TASK files; registers PLN artifact in state.json.
27
27
  - [plan.json](~/.maestro/templates/plan.json) — read when generating plan output
28
28
  - [task.json](~/.maestro/templates/task.json) — read when generating task files
29
29
  - [state.json](~/.maestro/templates/state.json) — read when registering artifact
30
+ - [boundary-grill.md](~/.maestro/workflows/boundary-grill.md) — read when boundary conflicts detected (in P4)
30
31
  </deferred_reading>
31
32
 
32
33
  <context>
@@ -52,7 +53,7 @@ Scope routing, base flags (`--collab`, `--spec`, `-y`, `--gaps`, `--dir`), outpu
52
53
 
53
54
  **Ad-hoc milestone (D-008):** When scope resolves to "standalone" via the standard standalone resolution (no `--from` source), and `current_milestone == null`, plan auto-creates an adhoc milestone (`type: "adhoc"`) in state.json before proceeding. This ensures downstream milestone-audit/complete have a valid milestone context. See workflow plan.md § "Ad-hoc Milestone Auto-Creation".
54
55
 
55
- **Exception (`--from analyze:ANL-xxx` / `blueprint:BLP-xxx`):** When scope is set to "standalone" by `--from`, skip adhoc milestone auto-creation — the upstream analyze/blueprint artifact already provides the milestone context (or is intentionally milestone-free). Adhoc creation in this path would conflict with the `--from` semantic of "this is a one-shot plan rooted in an existing artifact".
56
+ **`--from analyze:*` / `blueprint:*`**: scope=standalone skip adhoc milestone auto-creation.
56
57
 
57
58
  ### Role Knowledge
58
59
  `maestro search --category arch` → select relevant → `maestro wiki load`
@@ -86,8 +87,15 @@ Follow '~/.maestro/workflows/plan.md' completely.
86
87
  - REQUIRED: Main flow inline planning is FORBIDDEN (see P3 Agent Constraint below).
87
88
  - BLOCKED if missing: plan.json or TASK files not produced by planner agent — do not proceed to checking.
88
89
 
90
+ **GATE P3.5 → P4: Boundary Grill → Plan Check**
91
+ Run boundary grill per `~/.maestro/workflows/boundary-grill.md`.
92
+ Input: plan.json tasks + convergence criteria + upstream context. Scope guard: "only plan scope; do not re-analyze or re-scope".
93
+ IF conflicts → results to plan.json `boundary_grill` section + affected TASK files. DEC conflicts add `boundary_warning` to confidence.
94
+ NON-BLOCKING: warnings, not hard stops.
95
+
89
96
  **GATE P4 → P5: Plan Check → User Confirmation**
90
97
  - REQUIRED: Plan-checker passed (or minor issues acknowledged).
98
+ - REQUIRED: Boundary grill completed (conflicts resolved or accepted as risks).
91
99
  - REQUIRED: Confidence scored with 5-dimension factor model.
92
100
  - REQUIRED: Pressure pass completed on highest-complexity task.
93
101
  - REQUIRED: If plan touches UI (检出 `dashboard/` 或 UI 关键词 `landing|page|dashboard|frontend|UI|component|界面`), each delivery wave has ≥1 `[UI-observable]` convergence criterion (vertical-slice delivery, not backend-only).
@@ -153,8 +161,6 @@ For each created TASK-{NNN}.json that has issue_id:
153
161
  Append history entry: { action: "planned", at: <ISO>, by: "maestro-plan", summary: "Linked to TASK-{NNN}" }
154
162
  ```
155
163
 
156
- This ensures issue → TASK traceability. The `task_refs[]` and `task_plan_dir` fields on the issue allow the dashboard to resolve and display associated TASK details.
157
-
158
164
  ### Mode: Revise / Check
159
165
 
160
166
  Follow workflow plan.md § "Revise Mode" and § "Check Mode" respectively. These modes bypass the standard P1-P5 create pipeline.
@@ -218,6 +224,9 @@ Status verdicts:
218
224
  - [ ] Every task has `convergence.criteria[]` with grep-verifiable conditions (no subjective language)
219
225
  - [ ] UI plans: each delivery wave has ≥1 `[UI-observable]` convergence criterion (vertical slice; verified at runtime by ralph frontend-verify gate)
220
226
  - [ ] Every task `action` and `implementation` contain concrete values (no "align X with Y")
227
+ - [ ] Boundary grill executed in P3.5 (skip if no conflicts detected)
228
+ - [ ] Boundary grill results written to plan.json `boundary_grill` section (if conflicts found)
229
+ - [ ] DEC conflicts reflected in confidence `boundary_warning` factor
221
230
  - [ ] Plan confidence scored in P4 with 5-dimension factor model
222
231
  - [ ] Plan readiness gate checked before P4.5 collision detection
223
232
  - [ ] Pressure pass completed on highest-complexity task