maestro-flow 0.3.46 → 0.3.48

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 (241) hide show
  1. package/.claude/agents/ui-design-agent.md +1 -0
  2. package/.claude/agents/workflow-executor.md +3 -0
  3. package/.claude/commands/learn-decompose.md +91 -146
  4. package/.claude/commands/learn-follow.md +102 -137
  5. package/.claude/commands/learn-investigate.md +102 -167
  6. package/.claude/commands/learn-retro.md +100 -243
  7. package/.claude/commands/learn-second-opinion.md +95 -135
  8. package/.claude/commands/maestro-amend.md +95 -232
  9. package/.claude/commands/maestro-analyze.md +1 -6
  10. package/.claude/commands/maestro-collab.md +104 -265
  11. package/.claude/commands/maestro-composer.md +113 -293
  12. package/.claude/commands/maestro-execute.md +10 -17
  13. package/.claude/commands/maestro-impeccable.md +89 -0
  14. package/.claude/commands/maestro-plan.md +1 -6
  15. package/.claude/commands/maestro-player.md +111 -340
  16. package/.claude/commands/maestro-quick.md +9 -0
  17. package/.claude/commands/maestro-ralph-execute.md +167 -210
  18. package/.claude/commands/maestro-ralph.md +245 -426
  19. package/.claude/commands/maestro-ui-codify.md +13 -0
  20. package/.claude/commands/maestro-ui-craft.md +364 -0
  21. package/.claude/commands/maestro-ui-design.md +12 -1
  22. package/.claude/commands/maestro-verify.md +12 -13
  23. package/.claude/commands/maestro.md +142 -72
  24. package/.claude/commands/manage-knowhow-capture.md +45 -170
  25. package/.claude/commands/quality-auto-test.md +9 -0
  26. package/.claude/commands/quality-debug.md +11 -25
  27. package/.claude/commands/quality-refactor.md +9 -0
  28. package/.claude/commands/quality-review.md +5 -14
  29. package/.claude/commands/spec-add.md +1 -1
  30. package/.claude/commands/spec-load.md +3 -2
  31. package/.claude/skills/maestro-impeccable/SKILL.md +169 -0
  32. package/.codex/skills/learn-decompose/SKILL.md +1 -1
  33. package/.codex/skills/learn-investigate/SKILL.md +2 -1
  34. package/.codex/skills/maestro/SKILL.md +420 -313
  35. package/.codex/skills/maestro-analyze/SKILL.md +126 -417
  36. package/.codex/skills/maestro-brainstorm/SKILL.md +129 -451
  37. package/.codex/skills/maestro-collab/SKILL.md +134 -547
  38. package/.codex/skills/maestro-execute/SKILL.md +3 -1
  39. package/.codex/skills/maestro-impeccable/SKILL.md +112 -0
  40. package/.codex/skills/maestro-plan/SKILL.md +88 -437
  41. package/.codex/skills/maestro-player/SKILL.md +191 -333
  42. package/.codex/skills/maestro-quick/SKILL.md +2 -0
  43. package/.codex/skills/maestro-ralph/SKILL.md +327 -710
  44. package/.codex/skills/maestro-roadmap/SKILL.md +201 -518
  45. package/.codex/skills/maestro-ui-codify/SKILL.md +1 -0
  46. package/.codex/skills/maestro-ui-craft/SKILL.md +341 -0
  47. package/.codex/skills/maestro-ui-design/SKILL.md +10 -0
  48. package/.codex/skills/maestro-verify/SKILL.md +116 -409
  49. package/.codex/skills/quality-auto-test/SKILL.md +145 -443
  50. package/.codex/skills/quality-refactor/SKILL.md +1 -1
  51. package/.codex/skills/quality-test/SKILL.md +229 -517
  52. package/.codex/skills/spec-add/SKILL.md +1 -1
  53. package/README.md +4 -1
  54. package/README.zh-CN.md +3 -1
  55. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +3 -0
  56. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  57. package/dashboard/dist-server/dashboard/src/server/routes/install.js +110 -1
  58. package/dashboard/dist-server/dashboard/src/server/routes/install.js.map +1 -1
  59. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +56 -0
  60. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  61. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +2 -0
  62. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  63. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +2 -2
  64. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +2 -0
  66. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  67. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +3 -1
  68. package/dashboard/dist-server/dashboard/src/shared/constants.d.ts +2 -0
  69. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  70. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  71. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  72. package/dist/src/agents/cli-agent-runner.js +1 -3
  73. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  74. package/dist/src/agents/cli-history-store.d.ts +5 -0
  75. package/dist/src/agents/cli-history-store.d.ts.map +1 -1
  76. package/dist/src/agents/cli-history-store.js +65 -13
  77. package/dist/src/agents/cli-history-store.js.map +1 -1
  78. package/dist/src/cli.js +13 -0
  79. package/dist/src/cli.js.map +1 -1
  80. package/dist/src/commands/command-help.d.ts +3 -0
  81. package/dist/src/commands/command-help.d.ts.map +1 -0
  82. package/dist/src/commands/command-help.js +60 -0
  83. package/dist/src/commands/command-help.js.map +1 -0
  84. package/dist/src/commands/config.d.ts.map +1 -1
  85. package/dist/src/commands/config.js +17 -0
  86. package/dist/src/commands/config.js.map +1 -1
  87. package/dist/src/commands/delegate.d.ts.map +1 -1
  88. package/dist/src/commands/delegate.js +12 -2
  89. package/dist/src/commands/delegate.js.map +1 -1
  90. package/dist/src/commands/impeccable.d.ts +10 -0
  91. package/dist/src/commands/impeccable.d.ts.map +1 -0
  92. package/dist/src/commands/impeccable.js +181 -0
  93. package/dist/src/commands/impeccable.js.map +1 -0
  94. package/dist/src/commands/spec.js +1 -1
  95. package/dist/src/commands/spec.js.map +1 -1
  96. package/dist/src/commands/wiki.d.ts.map +1 -1
  97. package/dist/src/commands/wiki.js +5 -1
  98. package/dist/src/commands/wiki.js.map +1 -1
  99. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  100. package/dist/src/config/cli-tools-config.js +10 -7
  101. package/dist/src/config/cli-tools-config.js.map +1 -1
  102. package/dist/src/core/addon-registry.d.ts +31 -0
  103. package/dist/src/core/addon-registry.d.ts.map +1 -0
  104. package/dist/src/core/addon-registry.js +28 -0
  105. package/dist/src/core/addon-registry.js.map +1 -0
  106. package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -0
  107. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  108. package/dist/src/hooks/spec-injector.js +2 -2
  109. package/dist/src/hooks/spec-injector.js.map +1 -1
  110. package/dist/src/index.d.ts +2 -0
  111. package/dist/src/index.d.ts.map +1 -1
  112. package/dist/src/index.js +1 -0
  113. package/dist/src/index.js.map +1 -1
  114. package/dist/src/tools/impeccable/critique-storage.d.ts +28 -0
  115. package/dist/src/tools/impeccable/critique-storage.d.ts.map +1 -0
  116. package/dist/src/tools/impeccable/critique-storage.js +120 -0
  117. package/dist/src/tools/impeccable/critique-storage.js.map +1 -0
  118. package/dist/src/tools/impeccable/design-parser.d.ts +90 -0
  119. package/dist/src/tools/impeccable/design-parser.d.ts.map +1 -0
  120. package/dist/src/tools/impeccable/design-parser.js +696 -0
  121. package/dist/src/tools/impeccable/design-parser.js.map +1 -0
  122. package/dist/src/tools/impeccable/detect-csp.d.ts +6 -0
  123. package/dist/src/tools/impeccable/detect-csp.d.ts.map +1 -0
  124. package/dist/src/tools/impeccable/detect-csp.js +130 -0
  125. package/dist/src/tools/impeccable/detect-csp.js.map +1 -0
  126. package/dist/src/tools/impeccable/is-generated.d.ts +4 -0
  127. package/dist/src/tools/impeccable/is-generated.d.ts.map +1 -0
  128. package/dist/src/tools/impeccable/is-generated.js +56 -0
  129. package/dist/src/tools/impeccable/is-generated.js.map +1 -0
  130. package/dist/src/tools/impeccable/live/accept.d.ts +50 -0
  131. package/dist/src/tools/impeccable/live/accept.d.ts.map +1 -0
  132. package/dist/src/tools/impeccable/live/accept.js +556 -0
  133. package/dist/src/tools/impeccable/live/accept.js.map +1 -0
  134. package/dist/src/tools/impeccable/live/bootstrap.d.ts +2 -0
  135. package/dist/src/tools/impeccable/live/bootstrap.d.ts.map +1 -0
  136. package/dist/src/tools/impeccable/live/bootstrap.js +244 -0
  137. package/dist/src/tools/impeccable/live/bootstrap.js.map +1 -0
  138. package/dist/src/tools/impeccable/live/complete.d.ts +7 -0
  139. package/dist/src/tools/impeccable/live/complete.d.ts.map +1 -0
  140. package/dist/src/tools/impeccable/live/complete.js +67 -0
  141. package/dist/src/tools/impeccable/live/complete.js.map +1 -0
  142. package/dist/src/tools/impeccable/live/completion.d.ts +24 -0
  143. package/dist/src/tools/impeccable/live/completion.d.ts.map +1 -0
  144. package/dist/src/tools/impeccable/live/completion.js +26 -0
  145. package/dist/src/tools/impeccable/live/completion.js.map +1 -0
  146. package/dist/src/tools/impeccable/live/inject.d.ts +41 -0
  147. package/dist/src/tools/impeccable/live/inject.d.ts.map +1 -0
  148. package/dist/src/tools/impeccable/live/inject.js +394 -0
  149. package/dist/src/tools/impeccable/live/inject.js.map +1 -0
  150. package/dist/src/tools/impeccable/live/poll.d.ts +24 -0
  151. package/dist/src/tools/impeccable/live/poll.d.ts.map +1 -0
  152. package/dist/src/tools/impeccable/live/poll.js +180 -0
  153. package/dist/src/tools/impeccable/live/poll.js.map +1 -0
  154. package/dist/src/tools/impeccable/live/resume.d.ts +5 -0
  155. package/dist/src/tools/impeccable/live/resume.d.ts.map +1 -0
  156. package/dist/src/tools/impeccable/live/resume.js +30 -0
  157. package/dist/src/tools/impeccable/live/resume.js.map +1 -0
  158. package/dist/src/tools/impeccable/live/server.d.ts +6 -0
  159. package/dist/src/tools/impeccable/live/server.d.ts.map +1 -0
  160. package/dist/src/tools/impeccable/live/server.js +867 -0
  161. package/dist/src/tools/impeccable/live/server.js.map +1 -0
  162. package/dist/src/tools/impeccable/live/session-store.d.ts +72 -0
  163. package/dist/src/tools/impeccable/live/session-store.d.ts.map +1 -0
  164. package/dist/src/tools/impeccable/live/session-store.js +281 -0
  165. package/dist/src/tools/impeccable/live/session-store.js.map +1 -0
  166. package/dist/src/tools/impeccable/live/static/live-browser-session.js +123 -0
  167. package/dist/src/tools/impeccable/live/static/live-browser.js +4860 -0
  168. package/dist/src/tools/impeccable/live/static/modern-screenshot.umd.js +14 -0
  169. package/dist/src/tools/impeccable/live/status.d.ts +2 -0
  170. package/dist/src/tools/impeccable/live/status.d.ts.map +1 -0
  171. package/dist/src/tools/impeccable/live/status.js +52 -0
  172. package/dist/src/tools/impeccable/live/status.js.map +1 -0
  173. package/dist/src/tools/impeccable/live/wrap.d.ts +33 -0
  174. package/dist/src/tools/impeccable/live/wrap.d.ts.map +1 -0
  175. package/dist/src/tools/impeccable/live/wrap.js +572 -0
  176. package/dist/src/tools/impeccable/live/wrap.js.map +1 -0
  177. package/dist/src/tools/impeccable/load-context.d.ts +13 -0
  178. package/dist/src/tools/impeccable/load-context.d.ts.map +1 -0
  179. package/dist/src/tools/impeccable/load-context.js +79 -0
  180. package/dist/src/tools/impeccable/load-context.js.map +1 -0
  181. package/dist/src/tools/impeccable/paths.d.ts +34 -0
  182. package/dist/src/tools/impeccable/paths.d.ts.map +1 -0
  183. package/dist/src/tools/impeccable/paths.js +102 -0
  184. package/dist/src/tools/impeccable/paths.js.map +1 -0
  185. package/dist/src/tools/spec-entry-parser.d.ts +1 -1
  186. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  187. package/dist/src/tools/spec-entry-parser.js +1 -1
  188. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  189. package/dist/src/tools/spec-init.d.ts.map +1 -1
  190. package/dist/src/tools/spec-init.js +26 -1
  191. package/dist/src/tools/spec-init.js.map +1 -1
  192. package/dist/src/tools/spec-loader.d.ts +1 -1
  193. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  194. package/dist/src/tools/spec-loader.js +2 -0
  195. package/dist/src/tools/spec-loader.js.map +1 -1
  196. package/package.json +2 -2
  197. package/workflows/claude-instructions.md +17 -5
  198. package/workflows/cli-tools-usage.md +10 -3
  199. package/workflows/delegate-usage.md +3 -2
  200. package/workflows/impeccable/adapt.md +190 -0
  201. package/workflows/impeccable/animate.md +175 -0
  202. package/workflows/impeccable/audit.md +133 -0
  203. package/workflows/impeccable/bolder.md +113 -0
  204. package/workflows/impeccable/brand.md +118 -0
  205. package/workflows/impeccable/clarify.md +174 -0
  206. package/workflows/impeccable/codex.md +105 -0
  207. package/workflows/impeccable/cognitive-load.md +106 -0
  208. package/workflows/impeccable/color-and-contrast.md +105 -0
  209. package/workflows/impeccable/colorize.md +154 -0
  210. package/workflows/impeccable/craft.md +123 -0
  211. package/workflows/impeccable/critique.md +261 -0
  212. package/workflows/impeccable/delight.md +302 -0
  213. package/workflows/impeccable/distill.md +111 -0
  214. package/workflows/impeccable/document.md +439 -0
  215. package/workflows/impeccable/extract.md +69 -0
  216. package/workflows/impeccable/harden.md +347 -0
  217. package/workflows/impeccable/heuristics-scoring.md +234 -0
  218. package/workflows/impeccable/interaction-design.md +195 -0
  219. package/workflows/impeccable/layout.md +141 -0
  220. package/workflows/impeccable/live.md +622 -0
  221. package/workflows/impeccable/motion-design.md +109 -0
  222. package/workflows/impeccable/onboard.md +234 -0
  223. package/workflows/impeccable/optimize.md +258 -0
  224. package/workflows/impeccable/overdrive.md +130 -0
  225. package/workflows/impeccable/personas.md +179 -0
  226. package/workflows/impeccable/polish.md +242 -0
  227. package/workflows/impeccable/product.md +62 -0
  228. package/workflows/impeccable/quieter.md +99 -0
  229. package/workflows/impeccable/responsive-design.md +114 -0
  230. package/workflows/impeccable/shape.md +165 -0
  231. package/workflows/impeccable/spatial-design.md +100 -0
  232. package/workflows/impeccable/teach.md +168 -0
  233. package/workflows/impeccable/typeset.md +124 -0
  234. package/workflows/impeccable/typography.md +159 -0
  235. package/workflows/impeccable/ux-writing.md +107 -0
  236. package/workflows/impeccable.md +164 -0
  237. package/workflows/maestro.md +7 -3
  238. package/workflows/skill-authoring.md +265 -0
  239. package/workflows/specs-add.md +3 -2
  240. package/workflows/specs-load.md +2 -1
  241. package/workflows/specs-setup.md +21 -1
@@ -6,486 +6,195 @@ allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, AskUser
6
6
  ---
7
7
 
8
8
  <purpose>
9
- Wave-based multi-dimensional analysis using `spawn_agents_on_csv`. Diamond topology: CLI exploration agents gather codebase context (Wave 1), 6-dimension scoring agents evaluate in parallel (Wave 2), then decision synthesis agent compiles final decisions and context.md (Wave 3).
10
-
11
- **Core workflow**: Parse Subject -> CLI Exploration -> 6-Dimension Scoring -> Decision Synthesis
12
-
13
- **Tri-depth**: Full mode (all 3 waves), Quick mode (`-q`, Wave 3 only), or Gaps mode (`--gaps`, issue root cause analysis pipeline).
14
-
15
- ```
16
- +---------------------------------------------------------------------------+
17
- | ANALYZE CSV WAVE WORKFLOW |
18
- +---------------------------------------------------------------------------+
19
- | |
20
- | Phase 1: Subject Resolution -> CSV |
21
- | +-- Parse phase number or topic text from arguments |
22
- | +-- Detect mode (phase / scratch) and depth (full / quick) |
23
- | +-- Resolve output directory |
24
- | +-- Load prior context (project.md, roadmap, brainstorm artifacts) |
25
- | +-- Select dimensions and perspectives (interactive or auto) |
26
- | +-- Generate tasks.csv with exploration + scoring + synthesis rows |
27
- | +-- User validates dimension breakdown (skip if -y) |
28
- | |
29
- | Phase 2: Wave Execution Engine |
30
- | +-- Wave 1: CLI Exploration (parallel) [SKIP in -q mode] |
31
- | | +-- Each agent explores codebase for a specific dimension |
32
- | | +-- 3-layer exploration: module discovery, structure tracing, |
33
- | | | code anchor extraction |
34
- | | +-- Discoveries shared via board (code patterns, tech stack) |
35
- | | +-- Results: findings + relevant file paths per dimension |
36
- | +-- Wave 2: 6-Dimension Scoring (parallel) [SKIP in -q mode] |
37
- | | +-- Each agent scores one dimension (1-5) with evidence |
38
- | | +-- Receives exploration findings via prev_context |
39
- | | +-- Discoveries shared via board (risks, alternatives) |
40
- | | +-- Results: score + recommendations per dimension |
41
- | +-- Wave 3: Decision Synthesis (single agent) |
42
- | | +-- Compile all scores into analysis.md |
43
- | | +-- Identify gray areas, generate Locked/Free/Deferred decisions |
44
- | | +-- Build context.md for downstream plan |
45
- | | +-- Go/No-Go recommendation with confidence level |
46
- | +-- discoveries.ndjson shared across all waves (append-only) |
47
- | |
48
- | Phase 3: Results Aggregation |
49
- | +-- Export results.csv + analysis.md + context.md |
50
- | +-- Generate conclusions.json with decision trail |
51
- | +-- Auto-create issues for deferred items |
52
- | +-- Update phase index.json with analysis status |
53
- | +-- Display summary with verdict + next steps |
54
- | |
55
- +---------------------------------------------------------------------------+
56
- ```
9
+ Wave-based multi-dimensional analysis using `spawn_agents_on_csv`. Diamond topology:
10
+ Wave 1 (CLI exploration, parallel) -> Wave 2 (6-dimension scoring, parallel) -> Wave 3 (decision synthesis).
57
11
 
12
+ **Tri-depth**: Full mode (all 3 waves), Quick mode (`-q`, Wave 3 only), Gaps mode (`--gaps`, issue root cause pipeline).
58
13
  </purpose>
59
14
 
60
15
  <context>
61
- ```bash
62
- $maestro-analyze "3"
63
- $maestro-analyze -y "microservices vs monolith"
64
- $maestro-analyze -c 6 "3 -q"
65
- $maestro-analyze --continue "20260318-analyze-microservices"
66
- ```
16
+ $ARGUMENTS -- phase number, topic text, and optional flags.
67
17
 
68
18
  **Flags**:
69
19
  - `-y, --yes`: Skip all confirmations (auto mode)
70
- - `-c, --concurrency N`: Max concurrent agents within each wave (default: 6)
20
+ - `-c, --concurrency N`: Max concurrent agents per wave (default: 6)
71
21
  - `--continue`: Resume existing session
72
- - `-q, --quick`: Quick mode -- skip exploration + scoring, go straight to decision extraction (Wave 3 only)
73
- - `--gaps [ISS-ID]`: Issue root cause analysis mode. If ISS-ID provided, analyze single issue. If omitted, analyze all open/registered issues from issues.jsonl. Replaces manage-issue-analyze.
74
-
75
- When `--yes` or `-y`: Auto-confirm dimension selection, skip interactive scoping, use defaults for perspectives and depth, auto-deepen for up to 3 rounds.
22
+ - `-q, --quick`: Skip exploration + scoring, Wave 3 only
23
+ - `--gaps [ISS-ID]`: Issue root cause analysis. If ISS-ID: single issue. If omitted: all open/registered from issues.jsonl.
76
24
 
77
- **Output Directory**: `.workflow/.csv-wave/{session-id}/`
78
- **Core Output**: `tasks.csv` (master state) + `results.csv` (final) + `discoveries.ndjson` (shared exploration) + `context.md` (decision extraction report) + `analysis.md` (6-dimension scoring summary)
25
+ **Session**: `.workflow/.csv-wave/{YYYYMMDD}-analyze-{slug}/`
26
+ **Output**: tasks.csv, results.csv, discoveries.ndjson, context.md (all modes), analysis.md + conclusions.json (full mode only)
79
27
  </context>
80
28
 
81
29
  <csv_schema>
82
30
 
83
- ### tasks.csv (Master State)
31
+ ### tasks.csv
84
32
 
85
33
  ```csv
86
34
  id,title,description,dimension,analysis_type,deps,context_from,wave,status,findings,score,recommendations,error
87
- "1","Explore: Architecture","Explore codebase for architecture-relevant patterns: module boundaries, dependency graph, layer violations, design patterns in use. 3-layer exploration: module discovery, structure tracing, code anchor extraction.","architecture","explore","","","1","","","","",""
88
- "2","Explore: Implementation","Explore codebase for implementation patterns: code structure, error handling, algorithm choices, type safety. Extract code anchors with file:line references.","implementation","explore","","","1","","","","",""
89
- "3","Explore: Performance","Explore codebase for performance characteristics: hot paths, resource utilization, concurrency patterns, potential bottlenecks.","performance","explore","","","1","","","","",""
90
- "4","Score: Feasibility","Score feasibility (0-100) with evidence: technical difficulty, team capability gaps, time estimate, tooling requirements. Reference exploration findings.","feasibility","score","1;2;3","1;2;3","2","","","","",""
91
- "5","Score: Impact","Score impact (0-100) with evidence: user value, business value, tech debt reduction, developer experience improvement.","impact","score","1;2;3","1;2;3","2","","","","",""
92
- "6","Score: Risk","Score risk (0-100) with evidence: failure modes, security concerns, scalability limits, regression potential. Build probability-impact matrix.","risk","score","1;2;3","1;2;3","2","","","","",""
93
- "7","Score: Complexity","Score complexity (0-100) with evidence: integration points, dependency count, learning curve, testing difficulty.","complexity","score","1;2;3","1;2;3","2","","","","",""
94
- "8","Score: Alignment","Score alignment (0-100) with evidence: project vision fit, roadmap consistency, architecture principle adherence.","alignment","score","1;2;3","1;2;3","2","","","","",""
95
- "9","Score: Maintainability","Score maintainability (0-100) with evidence: code clarity, documentation coverage, test coverage, refactoring safety.","maintainability","score","1;2;3","1;2;3","2","","","","",""
96
- "10","Decision Synthesis","Compile all dimension scores into analysis.md. Identify gray areas. Generate Locked/Free/Deferred decisions for context.md. Formulate Go/No-Go recommendation with confidence. Build conclusions.json.","synthesis","decide","4;5;6;7;8;9","4;5;6;7;8;9","3","","","","",""
35
+ "1","Explore: Architecture","Explore codebase for architecture patterns: module boundaries, dependency graph, design patterns. 3-layer: module discovery, structure tracing, code anchor extraction.","architecture","explore","","","1","","","","",""
36
+ "2","Explore: Implementation","Explore codebase for implementation patterns: code structure, error handling, type safety. Extract code anchors with file:line.","implementation","explore","","","1","","","","",""
37
+ "3","Explore: Performance","Explore codebase for performance: hot paths, resource utilization, concurrency, bottlenecks.","performance","explore","","","1","","","","",""
38
+ "4","Score: Feasibility","Score feasibility (0-100): technical difficulty, team capability, time estimate, tooling.","feasibility","score","1;2;3","1;2;3","2","","","","",""
39
+ "5","Score: Impact","Score impact (0-100): user value, business value, tech debt reduction, DX.","impact","score","1;2;3","1;2;3","2","","","","",""
40
+ "6","Score: Risk","Score risk (0-100): failure modes, security, scalability, regression.","risk","score","1;2;3","1;2;3","2","","","","",""
41
+ "7","Score: Complexity","Score complexity (0-100): integration points, dependencies, learning curve, testing.","complexity","score","1;2;3","1;2;3","2","","","","",""
42
+ "8","Score: Alignment","Score alignment (0-100): project vision, roadmap consistency, architecture principles.","alignment","score","1;2;3","1;2;3","2","","","","",""
43
+ "9","Score: Maintainability","Score maintainability (0-100): code clarity, docs, test coverage, refactoring safety.","maintainability","score","1;2;3","1;2;3","2","","","","",""
44
+ "10","Decision Synthesis","Compile scores into analysis.md. Gray areas. Locked/Free/Deferred decisions for context.md. Go/No-Go + conclusions.json.","synthesis","decide","4;5;6;7;8;9","4;5;6;7;8;9","3","","","","",""
97
45
  ```
98
46
 
99
- **Columns**:
100
-
101
- | Column | Phase | Description |
102
- |--------|-------|-------------|
103
- | `id` | Input | Unique task identifier (string) |
104
- | `title` | Input | Short task title |
105
- | `description` | Input | Detailed analysis instructions for this task |
106
- | `dimension` | Input | Analysis dimension: architecture/implementation/performance/feasibility/impact/risk/complexity/alignment/maintainability/synthesis |
107
- | `analysis_type` | Input | Task type: explore/score/decide |
108
- | `deps` | Input | Semicolon-separated dependency task IDs |
109
- | `context_from` | Input | Semicolon-separated task IDs whose findings this task needs |
110
- | `wave` | Computed | Wave number (1 = explore, 2 = score, 3 = decide) |
111
- | `status` | Output | `pending` -> `completed` / `failed` / `skipped` |
112
- | `findings` | Output | Key findings summary (max 500 chars) |
113
- | `score` | Output | Dimension score (0-100 for scoring tasks, empty for explore/decide) |
114
- | `recommendations` | Output | Dimension-specific recommendations |
115
- | `confidence_score` | Output | Per-dimension confidence score (0-100) from factor-based assessment |
116
- | `error` | Output | Error message if failed |
117
-
118
- ### Per-Wave CSV (Temporary)
119
-
120
- Each wave generates `wave-{N}.csv` with extra `prev_context` column.
121
-
122
- ### Output Artifacts
123
-
124
- | File | Purpose | Lifecycle |
125
- |------|---------|-----------|
126
- | `tasks.csv` | Master state -- all tasks with status/findings | Updated after each wave |
127
- | `wave-{N}.csv` | Per-wave input (temporary) | Created before wave, deleted after |
128
- | `results.csv` | Final export of all task results | Created in Phase 3 |
129
- | `discoveries.ndjson` | Shared exploration board | Append-only, carries across waves |
130
- | `context.md` | Locked/Free/Deferred decisions for downstream plan | Created in Phase 3 |
131
- | `analysis.md` | 6-dimension scoring summary + risk matrix + Go/No-Go | Created in Phase 3 (full mode only) |
132
- | `conclusions.json` | Structured conclusions with decision trail | Created in Phase 3 (full mode only) |
133
-
134
- ### Session Structure
47
+ **Column semantics**:
48
+ - Input: id (unique string), title, description (detailed agent instructions), dimension (architecture/implementation/performance/feasibility/impact/risk/complexity/alignment/maintainability/synthesis), analysis_type (explore/score/decide), deps (semicolon-sep task IDs), context_from (IDs whose findings this task needs), wave (1=explore, 2=score, 3=decide)
49
+ - Output: status (pending->completed/failed/skipped), findings (key summary, max 500 chars), score (0-100 for scoring tasks, empty for explore/decide), recommendations, confidence_score (0-100 per dimension), error
135
50
 
136
- ```
137
- .workflow/.csv-wave/{YYYYMMDD}-analyze-{slug}/
138
- +-- tasks.csv
139
- +-- results.csv
140
- +-- discoveries.ndjson
141
- +-- context.md
142
- +-- analysis.md
143
- +-- conclusions.json
144
- +-- wave-{N}.csv (temporary)
145
- ```
51
+ Wave 1: N exploration rows (parallel). Wave 2: 6 scoring rows (parallel). Wave 3: 1 synthesis row.
52
+ Quick mode: 1 synthesis row only. Gaps mode: 1 row per issue (W1) + 1 per group (W2).
53
+
54
+ Available exploration dimensions: architecture, implementation, performance, security, concept, comparison, decision, external_research.
146
55
  </csv_schema>
147
56
 
148
57
  <invariants>
149
- 1. **Start Immediately**: First action is session initialization, then Phase 1
150
- 2. **Wave Order is Sacred**: Never execute wave 2 before wave 1 completes and results are merged
151
- 3. **CSV is Source of Truth**: Master tasks.csv holds all state
152
- 4. **Context Propagation**: prev_context built from master CSV, not from memory
153
- 5. **Discovery Board is Append-Only**: Never clear, modify, or recreate discoveries.ndjson
154
- 6. **Quick Mode Shortcut**: With -q flag, generate only wave 3 task, skip exploration and scoring
155
- 6b. **Gaps Mode Pipeline**: With --gaps flag, load issues, explore per issue, write analysis records back to issues.jsonl, output context.md for plan --gaps
156
- 7. **Skip on Failure**: Degrade gracefully -- missing exploration reduces scoring quality, missing scoring reduces synthesis quality
157
- 8. **Cleanup Temp Files**: Remove wave-{N}.csv after results are merged
158
- 9. **DO NOT STOP**: Continuous execution until all waves complete
159
- 10. **Tri-Output**: context.md is ALWAYS produced (all modes). analysis.md + conclusions.json are full-mode only. Gaps mode writes analysis records to issues.jsonl + context.md for plan --gaps.
58
+ 1. **Wave order sacred**: Never execute wave N+1 before wave N completes
59
+ 2. **CSV is source of truth**: Master tasks.csv holds all state
60
+ 3. **Context propagation**: prev_context from master CSV, not memory
61
+ 4. **Discovery board append-only**: Never modify/delete discoveries.ndjson
62
+ 5. **Quick mode shortcut**: -q generates only wave 3 task
63
+ 6. **Gaps mode pipeline**: --gaps follows: Load issues from issues.jsonl -> Classify & group by location/component -> CSV gen (W1: 1 explore row per issue, W2: 1 synthesis per group) -> Execute waves -> Write issue.analysis record per issue -> Append history `{ action: "analyzed", at: <ISO>, by: "maestro-analyze --gaps" }` -> Output context.md for plan --gaps
64
+ 7. **Graceful degradation**: Missing exploration reduces scoring quality; missing scoring reduces synthesis quality
65
+ 8. **Tri-output**: context.md always. analysis.md + conclusions.json full-mode only. Gaps mode writes to issues.jsonl + context.md
160
66
  </invariants>
161
67
 
162
- <execution>
163
-
164
- ### Session Initialization
68
+ <state_machine>
165
69
 
166
- **Parse from `$ARGUMENTS`**:
70
+ <states>
71
+ S_PARSE -- 解析参数、确定 scope/depth/mode PERSIST: --
72
+ S_CONTEXT -- 加载先验上下文(project/roadmap/specs) PERSIST: --
73
+ S_CSV_GEN -- 生成 tasks.csv PERSIST: tasks.csv
74
+ S_WAVE_1 -- CLI Exploration (parallel spawn) PERSIST: per-dimension findings + tasks.csv
75
+ S_WAVE_2 -- 6-Dimension Scoring (parallel spawn) PERSIST: scores + tasks.csv
76
+ S_WAVE_3 -- Decision Synthesis (single agent spawn) PERSIST: context.md + analysis.md + conclusions.json
77
+ S_AGGREGATE -- 注册 artifact、输出摘要 PERSIST: state.json + results.csv
78
+ </states>
167
79
 
168
- | Variable | Source | Default |
169
- |----------|--------|---------|
170
- | `AUTO_YES` | `--yes` or `-y` | false |
171
- | `continueMode` | `--continue` | false |
172
- | `maxConcurrency` | `--concurrency N` or `-c N` | 6 |
173
- | `QUICK_MODE` | `-q` or `--quick` | false |
174
- | `GAPS_MODE` | `--gaps` | false |
175
- | `gapsIssueId` | `--gaps ISS-{id}` | null |
176
- | `subjectArg` | remaining text after flag removal | "" |
80
+ <transitions>
177
81
 
178
- **Auto-bootstrap**: If `.workflow/state.json` missing, create minimal `{ project: null, status: "active", current_milestone: null, artifacts: [] }`.
82
+ S_PARSE:
83
+ -> S_CONTEXT WHEN: scope resolved (milestone/phase/adhoc/standalone/gaps)
84
+ -> ERROR(E001) WHEN: no args and no roadmap
179
85
 
180
- **Scope determination** (from `state.json` + `subjectArg`):
86
+ **Scope routing**:
87
+ | Condition | Scope | Slug |
88
+ |-----------|-------|------|
89
+ | --gaps flag | gaps | ISS-ID slugified or "issue-gaps" |
90
+ | Empty subject + milestone + roadmap | milestone | milestone name slugified |
91
+ | Empty subject, no roadmap | ERROR E001 | -- |
92
+ | Numeric + milestone + roadmap | phase | phase slug from roadmap |
93
+ | Text subject + milestone | adhoc | subject slugified (max 40) |
94
+ | Text subject, no milestone | standalone | subject slugified (max 40) |
181
95
 
182
- | Condition | Scope | Slug |
183
- |-----------|-------|------|
184
- | `GAPS_MODE` | `gaps` | `gapsIssueId` slugified or `"issue-gaps"` |
185
- | Empty subject + milestone + roadmap | `milestone` | milestone name slugified |
186
- | Empty subject, no roadmap | ERROR: `"E001: No args and no roadmap"` | — |
187
- | Numeric subject + milestone + roadmap | `phase` | phase slug from roadmap |
188
- | Numeric subject, no roadmap | ERROR: `"Phase number requires init + roadmap"` | — |
189
- | Text subject + milestone | `adhoc` | subject slugified (max 40 chars) |
190
- | Text subject, no milestone | `standalone` | subject slugified (max 40 chars) |
96
+ S_CONTEXT:
97
+ -> S_CSV_GEN DO: load project.md, roadmap.md, state.json, prior artifacts, specs
191
98
 
192
- **Session paths** (UTC+8 date prefix):
193
- - `sessionFolder`: `.workflow/.csv-wave/{YYYYMMDD}-analyze-{slug}/`
194
- - `scratchDir`: `.workflow/scratch/{YYYYMMDD}-analyze-{slug}/`
99
+ S_CSV_GEN:
100
+ -> S_WAVE_1 WHEN: full mode DO: generate N explore + 6 score + 1 synthesis rows
101
+ -> S_WAVE_3 WHEN: quick mode DO: generate 1 synthesis row only
102
+ -> S_WAVE_1 WHEN: gaps mode DO: generate per-issue explore + per-group synthesis rows
195
103
 
196
- Create both directories.
104
+ S_WAVE_1:
105
+ -> S_WAVE_2 WHEN: full mode, 1+ completed DO: A_SPAWN_WAVE_1
106
+ -> S_WAVE_3 WHEN: gaps mode, 1+ completed DO: merge results
107
+ -> ERROR WHEN: all failed
197
108
 
198
- ### Phase 1: Subject Resolution -> CSV
109
+ S_WAVE_2:
110
+ -> S_WAVE_3 DO: A_SPAWN_WAVE_2
199
111
 
200
- **Objective**: Parse subject, load context, select dimensions, generate tasks.csv.
112
+ S_WAVE_3:
113
+ -> S_AGGREGATE DO: A_SPAWN_WAVE_3
201
114
 
202
- **Decomposition Rules**:
115
+ S_AGGREGATE:
116
+ -> END DO: A_AGGREGATE_RESULTS
203
117
 
204
- 1. **Scope detection**: Already determined in Session Initialization (milestone/phase/adhoc/standalone)
205
- 2. **Context loading** (milestone/phase scope):
206
- - Read `.workflow/project.md` -- project vision and constraints
207
- - Read `.workflow/roadmap.md` -- phase structure and dependencies
208
- - Read `.workflow/state.json` → `current_milestone`, `artifacts[]`, `accumulated_context`
209
- - Find prior analyze artifacts from `state.json.artifacts[]` (type=analyze, same milestone) → load their `context.md`
210
- - Find brainstorm artifacts from `state.json.artifacts[]` (type=brainstorm, same milestone) → load `guidance-specification.md`
211
- - Load project specs: `maestro spec load --category arch`
118
+ </transitions>
212
119
 
213
- 3. **Quick mode routing**: If QUICK_MODE, generate only wave 3 (synthesis/decide) task in CSV. Skip exploration and scoring.
120
+ <actions>
214
121
 
215
- 3b. **Gaps mode routing** (if GAPS_MODE) — follow `~/.maestro/workflows/issue-gaps-analyze.codex.md` for full CSV wave pipeline:
216
- - Load issues from `.workflow/issues/issues.jsonl`
217
- - If `gapsIssueId`: load single issue, validate existence
218
- - If no ISS-ID: filter `status == "open" || status == "registered"`
219
- - Classify & group issues by location/component overlap
220
- - Generate tasks.csv: wave 1 = one exploration row per issue, wave 2 = one synthesis row per group
221
- - Execute via spawn_agents_on_csv (wave 1 parallel per issue, wave 2 parallel per group)
222
- - Pipeline: Load Issues → Classify & Group → CSV Generation → Wave 1: Explore → Wave 2: Synthesize → Write issue.analysis → Output context.md
223
- - On completion: append history entry `{ action: "analyzed", at: <ISO>, by: "maestro-analyze --gaps" }` per issue
122
+ ### A_SPAWN_WAVE_1
224
123
 
225
- 4. **Dimension and perspective selection** (full mode):
124
+ Filter wave==1 -> write wave-1.csv -> `spawn_agents_on_csv({ csv_path, max_concurrency })`.
226
125
 
227
- | Depth | Exploration Dimensions | Scoring Dimensions |
228
- |-------|----------------------|-------------------|
229
- | Standard (default) | architecture, implementation, performance | feasibility, impact, risk, complexity, alignment, maintainability |
230
- | Custom (interactive) | User-selected from 8 available | All 6 scoring dimensions |
126
+ **Exploration agent** (3-layer per dimension):
127
+ 1. Module Discovery (breadth): keyword search, relevant files, module boundaries
128
+ 2. Structure Tracing (depth): top 3-5 files, call chains 2-3 levels, data flow
129
+ 3. Code Anchor Extraction (detail): code snippet 20-50 lines with file:line per finding
231
130
 
232
- Available exploration dimensions:
233
- - architecture, implementation, performance, security, concept, comparison, decision, external_research
131
+ Share via discovery board. Merge results -> master tasks.csv.
234
132
 
235
- 5. **CSV generation**:
236
- - Full mode: N exploration rows (wave 1) + 6 scoring rows (wave 2) + 1 synthesis row (wave 3)
237
- - Quick mode: 1 synthesis row only (wave 1, no deps)
133
+ ### A_SPAWN_WAVE_2
238
134
 
239
- **Wave computation**: 3-wave diamond -- explore = wave 1, score = wave 2, decide = wave 3. Quick mode: single wave.
135
+ Filter wave==2 -> build prev_context from wave 1 findings -> write wave-2.csv -> spawn.
240
136
 
241
- **User validation**: Display task breakdown (skip if AUTO_YES).
137
+ **Scoring agent** (6 dimensions: feasibility, impact, risk, complexity, alignment, maintainability):
138
+ Score 0-100 with specific evidence (code refs from exploration). Each score MUST reference exploration findings.
242
139
 
243
- ### Phase 2: Wave Execution Engine
140
+ Merge results -> master tasks.csv.
244
141
 
245
- **Objective**: Execute analysis pipeline wave-by-wave via spawn_agents_on_csv.
142
+ ### A_SPAWN_WAVE_3
246
143
 
247
- #### Wave 1: CLI Exploration (Parallel) [SKIP in -q mode]
144
+ Filter wave==3 -> build prev_context from wave 2 scores (or project context for quick mode) -> spawn.
248
145
 
249
- Filter `wave == 1 && status == pending` from master CSV. No prev_context (no predecessors). Write `wave-1.csv`.
146
+ **Synthesis agent**:
147
+ - Full mode: analysis.md (executive summary, per-dimension scores, risk matrix, Go/No-Go), context.md (Locked/Free/Deferred decisions), conclusions.json
148
+ - Quick mode: context.md only from available project context
149
+ - Gaps mode: per-issue analysis records -> issues.jsonl + context.md for plan --gaps
250
150
 
251
- ```javascript
252
- spawn_agents_on_csv({
253
- csv_path: `${sessionFolder}/wave-1.csv`,
254
- id_column: "id",
255
- instruction: buildExplorationInstruction(sessionFolder), // agent: ~/.codex/agents/cli-explore-agent.toml
256
- max_concurrency: maxConcurrency,
257
- max_runtime_seconds: 3600,
258
- output_csv_path: `${sessionFolder}/wave-1-results.csv`,
259
- output_schema: { id, status: ["completed"|"failed"], findings, score, recommendations, error }
260
- // required: id, status, findings
261
- })
262
- ```
263
-
264
- Merge results into master `tasks.csv`, delete `wave-1.csv`.
265
-
266
- **Exploration agent responsibilities** (3-layer per dimension):
267
- 1. **Module Discovery** (breadth) -- keyword search, relevant files, module boundaries
268
- 2. **Structure Tracing** (depth) -- top 3-5 files: call chains 2-3 levels, data flow
269
- 3. **Code Anchor Extraction** (detail) -- code snippet (20-50 lines) with file:line per finding
270
- - Share findings via discovery board
271
-
272
- #### Wave 2: 6-Dimension Scoring (Parallel) [SKIP in -q mode]
273
-
274
- Filter `wave == 2 && status == pending` from master CSV. Build `prev_context` from wave 1 findings (format: `[Task N: Title] summary...` per exploration task). Write `wave-2.csv` with `prev_context` column.
275
-
276
- ```javascript
277
- spawn_agents_on_csv({
278
- csv_path: `${sessionFolder}/wave-2.csv`,
279
- id_column: "id",
280
- instruction: buildScoringInstruction(sessionFolder), // agent: ~/.codex/agents/workflow-analyzer.toml
281
- max_concurrency: maxConcurrency,
282
- max_runtime_seconds: 3600,
283
- output_csv_path: `${sessionFolder}/wave-2-results.csv`,
284
- output_schema: { id, status: ["completed"|"failed"], findings, score, recommendations, error }
285
- // required: id, status, findings, score
286
- })
287
- ```
151
+ Gray area detection: domain-aware (things users SEE/CALL/RUN/READ), phase-specific (skip prior decided areas).
288
152
 
289
- Merge results into master `tasks.csv`, delete `wave-2.csv`.
153
+ ### A_AGGREGATE_RESULTS
290
154
 
291
- **Scoring agent responsibilities** (6 dimensions):
155
+ 1. Export results.csv
156
+ 2. **Confidence scoring** (full mode): factors -- findings_depth(.30), evidence_strength(.25), coverage_breadth(.20), user_validation(.15), consistency(.10). Thresholds: <60% deeper, 60-80% optional, 80-95% converging, >95% converge.
157
+ 3. Auto-create issues from Deferred items -> issues.jsonl
158
+ 4. Spec enrichment: Locked decisions -> `maestro spec add arch`; code patterns -> `maestro spec add coding`
159
+ 5. Register artifact in state.json (type: analyze)
160
+ 6. Copy outputs to scratchDir, display summary
292
161
 
293
- | Dimension | Focus Areas | Score Range |
294
- |-----------|------------|-------------|
295
- | Feasibility | Technical difficulty, team capability, time, tooling | 0-100 |
296
- | Impact | User value, business value, tech debt reduction, DX | 0-100 |
297
- | Risk | Failure modes, security, scalability, regression | 0-100 |
298
- | Complexity | Integration points, dependencies, learning curve, testing | 0-100 |
299
- | Alignment | Project vision fit, roadmap consistency, architecture principles | 0-100 |
300
- | Maintainability | Code clarity, documentation, test coverage, refactoring safety | 0-100 |
162
+ </actions>
301
163
 
302
- Each score MUST include specific evidence (code refs, data points from exploration findings).
164
+ </state_machine>
303
165
 
304
- #### Wave 3: Decision Synthesis (Single Agent)
305
-
306
- Filter `wave == 3` (or wave 1 in quick mode) `&& status == pending`. If full mode and all wave 2 failed, fall back to available exploration context.
307
-
308
- **prev_context source**:
309
- - Full mode: wave 2 scoring findings (format: `[Task N: Score Dim] Score: X. summary...`)
310
- - Quick mode: loaded project context (project.md, roadmap, brainstorm artifacts)
311
-
312
- Write wave CSV with `prev_context`, execute `spawn_agents_on_csv` for synthesis agent, merge results, delete temp CSV.
313
-
314
- **Synthesis agent responsibilities**:
315
- - Compile dimension scores into analysis.md (full mode):
316
- - Executive summary with overall assessment
317
- - Per-dimension scores with key evidence
318
- - Risk matrix visualization
319
- - Go/No-Go recommendation with confidence
320
- - Identify gray areas (both modes):
321
- - Domain-aware: something users SEE/CALL/RUN/READ/are ORGANIZED
322
- - Phase-specific: skip areas decided in prior context.md
323
- - If guidance-specification.md loaded: skip MUST/MUST NOT, focus on SHOULD/MAY gaps
324
- - Generate Locked/Free/Deferred decisions for context.md
325
- - Build conclusions.json (full mode) with decision trail and recommendations
326
-
327
- ### Phase 3: Results Aggregation
328
-
329
- **Objective**: Generate final results and output artifacts.
330
-
331
- 1. Read final master `tasks.csv`
332
- 2. Export as `results.csv`
333
- 3. Build `analysis.md` (full mode only):
334
-
335
- ```markdown
336
- # Analysis Report -- {subject}
337
-
338
- ## Executive Summary
339
- - Overall assessment: {Go/No-Go/Conditional}
340
- - Confidence: {high/medium/low}
341
- - Key risk: {top risk}
342
-
343
- ## Dimension Scores
344
- | Dimension | Score | Key Evidence |
345
- |-----------|-------|-------------|
346
- | Feasibility | {N}/100 | {evidence} |
347
- | Impact | {N}/100 | {evidence} |
348
- | Risk | {N}/100 | {evidence} |
349
- | Complexity | {N}/100 | {evidence} |
350
- | Alignment | {N}/100 | {evidence} |
351
- | Maintainability | {N}/100 | {evidence} |
352
-
353
- ## Risk Matrix
354
- {probability-impact matrix}
355
-
356
- ## Recommendations
357
- {prioritized recommendations with rationale}
358
- ```
166
+ <discovery_board>
359
167
 
360
- 3b. **Confidence scoring** (full mode only):
168
+ | Type | Dedup Key | Data |
169
+ |------|-----------|------|
170
+ | exploration_finding | data.file+data.line | {file, line, snippet, dimension, significance} |
171
+ | dimension_score | data.dimension | {dimension, score, evidence, confidence} |
172
+ | risk_item | data.description | {description, probability, impact, mitigation} |
173
+ | decision_candidate | data.area | {area, options[], recommendation, classification} |
174
+ | alternative | data.name | {name, description, pros[], cons[], fit_score} |
361
175
 
362
- Factors (weights): findings_depth(.30), evidence_strength(.25), coverage_breadth(.20), user_validation(.15, 0 in CSV mode), consistency(.10). Overall = average of dimension scores. Thresholds: <60% deeper | 60-80% optional | 80-95% converging | >95% converge. Append confidence summary to `analysis.md` and `conclusions.json`.
363
-
364
- 4. Build `context.md` (both modes):
365
-
366
- ```markdown
367
- # Context: {subject}
368
-
369
- **Date**: {date}
370
- **Mode**: {full|quick}
371
- **Areas discussed**: {list}
372
-
373
- ## Decisions
374
-
375
- ### Decision N: {TITLE}
376
- - **Context**: {what and why}
377
- - **Options**: 1. {opt1} 2. {opt2}
378
- - **Chosen**: {selected}
379
- - **Reason**: {rationale}
380
-
381
- ## Constraints
382
-
383
- ### Locked
384
- {decisions that are final and must be followed}
385
-
386
- ### Free
387
- {decisions left to implementer discretion}
388
-
389
- ### Deferred
390
- {ideas captured but postponed to later phases}
391
-
392
- ## Code Context
393
- {relevant code references from exploration}
394
- ```
395
-
396
- 5. Build `conclusions.json` (full mode only):
397
-
398
- ```json
399
- {
400
- "session_id": "<session>",
401
- "subject": "<subject>",
402
- "mode": "full",
403
- "recommendation": "Go|No-Go|Conditional",
404
- "confidence": "high|medium|low",
405
- "dimensions": [
406
- { "name": "feasibility", "score": 75, "findings": "...", "recommendations": "..." }
407
- ],
408
- "decisions": [
409
- { "title": "...", "classification": "locked|free|deferred", "rationale": "..." }
410
- ],
411
- "risk_matrix": [...],
412
- "timestamp": "<ISO>"
413
- }
414
- ```
415
-
416
- 6. **Auto-create issues from Deferred items**: Filter decisions with `classification == "Deferred"`, append each as issue to `.workflow/issues/issues.jsonl`.
417
-
418
- 7b. **Spec Enrichment**: For each Locked decision in context.md, persist via CLI:
419
- - `maestro spec add arch "<decision.title>" "<decision.rationale>" --keywords ... --source analyze:{sessionId}`
420
- - For non-trivial code patterns discovered during exploration → `maestro spec add coding ...`
421
-
422
- 7. **Register artifact in state.json**: Append `{ id: "ANL-{next_id}", type: "analyze", milestone, phase, scope, path: scratchDir, status: "completed", depends_on: null, harvested: false, created_at, completed_at }`.
423
- 8. Copy final outputs (context.md, analysis.md, conclusions.json) from CSV session folder to `scratchDir`
424
- 9. Display summary
425
-
426
- ### Shared Discovery Board Protocol
427
-
428
- #### Standard Discovery Types
429
-
430
- | Type | Dedup Key | Data Schema | Description |
431
- |------|-----------|-------------|-------------|
432
- | `code_pattern` | `data.name` | `{name, file, description}` | Reusable code pattern found |
433
- | `integration_point` | `data.file` | `{file, description, exports[]}` | Module connection point |
434
- | `convention` | singleton | `{naming, imports, formatting}` | Project code conventions |
435
- | `blocker` | `data.issue` | `{issue, severity, impact}` | Blocking issue found |
436
- | `tech_stack` | singleton | `{framework, language, tools[]}` | Technology stack info |
437
-
438
- #### Domain Discovery Types
439
-
440
- | Type | Dedup Key | Data Schema | Description |
441
- |------|-----------|-------------|-------------|
442
- | `exploration_finding` | `data.file+data.line` | `{file, line, snippet, dimension, significance}` | Code anchor from exploration |
443
- | `dimension_score` | `data.dimension` | `{dimension, score, evidence, confidence}` | Scoring result |
444
- | `risk_item` | `data.description` | `{description, probability, impact, mitigation}` | Identified risk |
445
- | `decision_candidate` | `data.area` | `{area, options[], recommendation, classification}` | Gray area for decision |
446
- | `alternative` | `data.name` | `{name, description, pros[], cons[], fit_score}` | Alternative approach |
447
-
448
- #### Protocol
449
-
450
- 1. **Read** `{session_folder}/discoveries.ndjson` before own analysis
451
- 2. **Skip covered**: If discovery of same type + dedup key exists, skip
452
- 3. **Write immediately**: Append findings as found
453
- 4. **Append-only**: Never modify or delete
454
- 5. **Deduplicate**: Check before writing
455
-
456
- ```bash
457
- echo '{"ts":"<ISO>","worker":"{id}","type":"exploration_finding","data":{"file":"src/auth/login.ts","line":42,"snippet":"export async function verifyToken(...)","dimension":"architecture","significance":"Core auth entry point"}}' >> {session_folder}/discoveries.ndjson
458
- ```
459
- </execution>
176
+ Protocol: read before analysis, append-only, dedup by type+key.
177
+ </discovery_board>
460
178
 
461
179
  <error_codes>
462
-
463
- | Error | Resolution |
464
- |-------|------------|
465
- | Subject argument missing (non-gaps) | Abort with error: "Analysis subject required (phase number or topic text)" |
466
- | --gaps but no issues found | Abort with error: "No open/registered issues in issues.jsonl" |
467
- | --gaps ISS-ID not found | Abort with error: "Issue {ISS-ID} not found — run manage-issue list" |
468
- | Phase directory not found | List available phases, abort with error |
469
- | No prior context for quick mode | Warn: limited context, proceed with available information |
470
- | Exploration agent timeout | Mark as failed, continue with remaining exploration agents |
471
- | All exploration agents failed | Proceed to scoring with limited context, note limitation |
472
- | Scoring agent timeout | Mark as failed, use available scores for synthesis |
473
- | All scoring agents failed | Skip analysis.md, proceed to decision extraction only |
474
- | Synthesis agent failed | Use raw scores/exploration as fallback, generate minimal context.md |
475
- | CSV parse error | Validate format, show line number |
476
- | discoveries.ndjson corrupt | Ignore malformed lines |
180
+ | Condition | Recovery |
181
+ |-----------|----------|
182
+ | Subject argument missing (non-gaps) | Abort: "Analysis subject required" |
183
+ | --gaps but no issues found | Abort: "No open/registered issues" |
184
+ | --gaps ISS-ID not found | Abort: "Issue not found" |
185
+ | Phase directory not found | List available phases, abort |
186
+ | All exploration agents failed | Proceed to scoring with limited context |
187
+ | All scoring agents failed | Skip analysis.md, decision extraction only |
188
+ | Synthesis agent failed | Minimal context.md from raw scores/exploration |
477
189
  | Continue mode: no session found | List available sessions |
478
190
  </error_codes>
479
191
 
480
192
  <success_criteria>
481
- - [ ] Session folder created with valid tasks.csv
482
193
  - [ ] All waves executed in order (or skipped per mode)
483
- - [ ] context.md produced (all modes)
484
- - [ ] analysis.md + conclusions.json produced (full mode only)
194
+ - [ ] context.md produced (all modes); analysis.md + conclusions.json (full mode)
195
+ - [ ] Confidence scored per dimension with factor-based model (full mode)
485
196
  - [ ] Deferred items auto-created as issues
486
197
  - [ ] Artifact registered in state.json
487
- - [ ] Confidence scored per dimension with factor-based model (full mode only)
488
- - [ ] Confidence summary appended to analysis.md and conclusions.json
489
- - [ ] Final outputs copied to scratchDir
490
198
  - [ ] discoveries.ndjson append-only throughout
491
199
  </success_criteria>
200
+ </output>