maestro-flow 0.3.2 → 0.3.4

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 (187) hide show
  1. package/.claude/CLAUDE.md +2 -2
  2. package/.claude/agents/cli-explore-agent.md +1 -1
  3. package/.claude/agents/team-worker.md +237 -237
  4. package/.claude/commands/maestro-coordinate.md +65 -65
  5. package/.claude/commands/maestro-link-coordinate.md +71 -71
  6. package/.claude/commands/manage-issue-execute.md +73 -73
  7. package/.claude/commands/quality-business-test.md +110 -0
  8. package/.claude/skills/team-coordinate/SKILL.md +266 -266
  9. package/.claude/skills/team-lifecycle-v4/SKILL.md +209 -209
  10. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +94 -94
  11. package/.claude/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -62
  12. package/.claude/skills/team-lifecycle-v4/roles/planner/role.md +85 -85
  13. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +95 -95
  14. package/.claude/skills/team-quality-assurance/SKILL.md +147 -147
  15. package/.claude/skills/team-quality-assurance/roles/scout/role.md +75 -75
  16. package/.claude/skills/team-review/SKILL.md +147 -147
  17. package/.claude/skills/team-review/roles/reviewer/role.md +68 -68
  18. package/.claude/skills/team-review/roles/scanner/role.md +79 -79
  19. package/.claude/skills/team-tech-debt/SKILL.md +128 -128
  20. package/.claude/skills/team-tech-debt/roles/executor/role.md +76 -76
  21. package/.claude/skills/team-tech-debt/roles/scanner/role.md +90 -90
  22. package/.claude/skills/team-tech-debt/roles/validator/role.md +78 -78
  23. package/.claude/skills/team-testing/SKILL.md +143 -143
  24. package/.claude/skills/team-testing/roles/executor/role.md +99 -99
  25. package/.claude/skills/team-testing/roles/generator/role.md +98 -98
  26. package/.codex/skills/maestro-coordinate/SKILL.md +1 -1
  27. package/.codex/skills/manage-issue-analyze/SKILL.md +3 -3
  28. package/.codex/skills/manage-issue-execute/SKILL.md +4 -4
  29. package/.codex/skills/manage-issue-plan/SKILL.md +2 -2
  30. package/.codex/skills/quality-business-test/SKILL.md +223 -0
  31. package/.codex/skills/team-coordinate/SKILL.md +7 -7
  32. package/.codex/skills/team-coordinate/roles/coordinator/role.md +1 -1
  33. package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -2
  34. package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +2 -2
  35. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  36. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +2 -2
  37. package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +1 -1
  38. package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +2 -2
  39. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  40. package/.codex/skills/team-quality-assurance/SKILL.md +2 -2
  41. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +2 -2
  42. package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -2
  43. package/.codex/skills/team-review/SKILL.md +2 -2
  44. package/.codex/skills/team-review/roles/coordinator/role.md +2 -2
  45. package/.codex/skills/team-review/roles/reviewer/role.md +1 -1
  46. package/.codex/skills/team-review/roles/scanner/role.md +1 -1
  47. package/.codex/skills/team-tech-debt/SKILL.md +2 -2
  48. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +1 -1
  49. package/.codex/skills/team-tech-debt/roles/executor/role.md +1 -1
  50. package/.codex/skills/team-tech-debt/roles/scanner/role.md +1 -1
  51. package/.codex/skills/team-tech-debt/roles/validator/role.md +1 -1
  52. package/.codex/skills/team-testing/SKILL.md +2 -2
  53. package/.codex/skills/team-testing/roles/coordinator/role.md +2 -2
  54. package/.codex/skills/team-testing/roles/executor/role.md +1 -1
  55. package/.codex/skills/team-testing/roles/generator/role.md +1 -1
  56. package/README.md +31 -2
  57. package/README.zh-CN.md +23 -1
  58. package/chains/_intent-map.json +6 -0
  59. package/chains/_router.json +14 -0
  60. package/chains/full-lifecycle.json +15 -0
  61. package/chains/quality-loop.json +16 -1
  62. package/chains/singles/business-test.json +26 -0
  63. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +16 -2
  64. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.d.ts +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js +25 -9
  67. package/dashboard/dist-server/dashboard/src/server/agents/stream-json-adapter.js.map +1 -1
  68. package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +3 -0
  69. package/dashboard/dist-server/src/agents/cli-agent-runner.js +78 -61
  70. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  71. package/dashboard/dist-server/src/agents/cli-history-store.d.ts +14 -1
  72. package/dashboard/dist-server/src/agents/cli-history-store.js +24 -2
  73. package/dashboard/dist-server/src/agents/cli-history-store.js.map +1 -1
  74. package/dashboard/dist-server/src/commands/delegate.js +142 -6
  75. package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
  76. package/dist/src/agents/cli-agent-runner.d.ts +3 -0
  77. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  78. package/dist/src/agents/cli-agent-runner.js +78 -61
  79. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  80. package/dist/src/agents/cli-history-store.d.ts +14 -1
  81. package/dist/src/agents/cli-history-store.d.ts.map +1 -1
  82. package/dist/src/agents/cli-history-store.js +24 -2
  83. package/dist/src/agents/cli-history-store.js.map +1 -1
  84. package/dist/src/commands/delegate.d.ts.map +1 -1
  85. package/dist/src/commands/delegate.js +142 -6
  86. package/dist/src/commands/delegate.js.map +1 -1
  87. package/dist/src/commands/hooks.d.ts +15 -0
  88. package/dist/src/commands/hooks.d.ts.map +1 -1
  89. package/dist/src/commands/hooks.js +29 -2
  90. package/dist/src/commands/hooks.js.map +1 -1
  91. package/dist/src/commands/install-backend.d.ts +15 -0
  92. package/dist/src/commands/install-backend.d.ts.map +1 -1
  93. package/dist/src/commands/install-backend.js +67 -0
  94. package/dist/src/commands/install-backend.js.map +1 -1
  95. package/dist/src/commands/install-ui/BackupConfig.d.ts +6 -4
  96. package/dist/src/commands/install-ui/BackupConfig.d.ts.map +1 -1
  97. package/dist/src/commands/install-ui/BackupConfig.js +39 -12
  98. package/dist/src/commands/install-ui/BackupConfig.js.map +1 -1
  99. package/dist/src/commands/install-ui/ConfigPanel.d.ts.map +1 -1
  100. package/dist/src/commands/install-ui/ConfigPanel.js +1 -1
  101. package/dist/src/commands/install-ui/ConfigPanel.js.map +1 -1
  102. package/dist/src/commands/install-ui/InstallConfirm.d.ts +3 -0
  103. package/dist/src/commands/install-ui/InstallConfirm.d.ts.map +1 -1
  104. package/dist/src/commands/install-ui/InstallConfirm.js +5 -1
  105. package/dist/src/commands/install-ui/InstallConfirm.js.map +1 -1
  106. package/dist/src/commands/install-ui/InstallExecution.d.ts +2 -0
  107. package/dist/src/commands/install-ui/InstallExecution.d.ts.map +1 -1
  108. package/dist/src/commands/install-ui/InstallExecution.js +30 -5
  109. package/dist/src/commands/install-ui/InstallExecution.js.map +1 -1
  110. package/dist/src/commands/install-ui/InstallFlow.d.ts +1 -1
  111. package/dist/src/commands/install-ui/InstallFlow.d.ts.map +1 -1
  112. package/dist/src/commands/install-ui/InstallFlow.js +31 -6
  113. package/dist/src/commands/install-ui/InstallFlow.js.map +1 -1
  114. package/dist/src/commands/install-ui/InstallHub.d.ts +5 -0
  115. package/dist/src/commands/install-ui/InstallHub.d.ts.map +1 -1
  116. package/dist/src/commands/install-ui/InstallHub.js +24 -0
  117. package/dist/src/commands/install-ui/InstallHub.js.map +1 -1
  118. package/dist/src/commands/install-ui/InstallResult.d.ts.map +1 -1
  119. package/dist/src/commands/install-ui/InstallResult.js +1 -1
  120. package/dist/src/commands/install-ui/InstallResult.js.map +1 -1
  121. package/dist/src/commands/install-ui/StatuslineConfig.d.ts +9 -0
  122. package/dist/src/commands/install-ui/StatuslineConfig.d.ts.map +1 -0
  123. package/dist/src/commands/install-ui/StatuslineConfig.js +13 -0
  124. package/dist/src/commands/install-ui/StatuslineConfig.js.map +1 -0
  125. package/dist/src/commands/install-ui/index.d.ts +1 -1
  126. package/dist/src/commands/install-ui/index.d.ts.map +1 -1
  127. package/dist/src/commands/install-ui/types.d.ts +6 -0
  128. package/dist/src/commands/install-ui/types.d.ts.map +1 -1
  129. package/dist/src/commands/install-ui/types.js +3 -0
  130. package/dist/src/commands/install-ui/types.js.map +1 -1
  131. package/dist/src/commands/install.d.ts.map +1 -1
  132. package/dist/src/commands/install.js +6 -1
  133. package/dist/src/commands/install.js.map +1 -1
  134. package/dist/src/commands/overlay.d.ts.map +1 -1
  135. package/dist/src/commands/overlay.js +45 -1
  136. package/dist/src/commands/overlay.js.map +1 -1
  137. package/dist/src/commands/team.d.ts +10 -0
  138. package/dist/src/commands/team.d.ts.map +1 -1
  139. package/dist/src/commands/team.js +436 -42
  140. package/dist/src/commands/team.js.map +1 -1
  141. package/dist/src/core/manifest.d.ts.map +1 -1
  142. package/dist/src/core/manifest.js +58 -0
  143. package/dist/src/core/manifest.js.map +1 -1
  144. package/dist/src/core/overlay/applier.d.ts +4 -0
  145. package/dist/src/core/overlay/applier.d.ts.map +1 -1
  146. package/dist/src/core/overlay/applier.js.map +1 -1
  147. package/dist/src/hooks/delegate-monitor.js +1 -1
  148. package/dist/src/hooks/delegate-monitor.js.map +1 -1
  149. package/dist/src/hooks/plugins/spec-injection-plugin.d.ts.map +1 -1
  150. package/dist/src/hooks/plugins/spec-injection-plugin.js +17 -1
  151. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  152. package/dist/src/hooks/spec-injector.d.ts +2 -1
  153. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  154. package/dist/src/hooks/spec-injector.js +19 -2
  155. package/dist/src/hooks/spec-injector.js.map +1 -1
  156. package/dist/src/hooks/team-monitor.d.ts.map +1 -1
  157. package/dist/src/hooks/team-monitor.js +17 -0
  158. package/dist/src/hooks/team-monitor.js.map +1 -1
  159. package/dist/src/i18n/locales/en.d.ts.map +1 -1
  160. package/dist/src/i18n/locales/en.js +25 -1
  161. package/dist/src/i18n/locales/en.js.map +1 -1
  162. package/dist/src/i18n/locales/zh.d.ts.map +1 -1
  163. package/dist/src/i18n/locales/zh.js +25 -1
  164. package/dist/src/i18n/locales/zh.js.map +1 -1
  165. package/dist/src/i18n/types.d.ts +22 -0
  166. package/dist/src/i18n/types.d.ts.map +1 -1
  167. package/dist/src/mcp/delegate-channel-relay.d.ts.map +1 -1
  168. package/dist/src/mcp/delegate-channel-relay.js +9 -9
  169. package/dist/src/mcp/delegate-channel-relay.js.map +1 -1
  170. package/dist/src/tools/index.d.ts.map +1 -1
  171. package/dist/src/tools/index.js +11 -2
  172. package/dist/src/tools/index.js.map +1 -1
  173. package/dist/src/tools/namespace-guard.d.ts +37 -0
  174. package/dist/src/tools/namespace-guard.d.ts.map +1 -0
  175. package/dist/src/tools/namespace-guard.js +126 -0
  176. package/dist/src/tools/namespace-guard.js.map +1 -0
  177. package/dist/src/tools/spec-loader.d.ts +17 -1
  178. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  179. package/dist/src/tools/spec-loader.js +71 -13
  180. package/dist/src/tools/spec-loader.js.map +1 -1
  181. package/dist/src/tools/team-members.d.ts +16 -0
  182. package/dist/src/tools/team-members.d.ts.map +1 -1
  183. package/dist/src/tools/team-members.js +31 -0
  184. package/dist/src/tools/team-members.js.map +1 -1
  185. package/package.json +2 -2
  186. package/templates/business-test-report.json +68 -0
  187. package/workflows/delegate-usage.md +330 -0
@@ -1,62 +1,62 @@
1
- # Implement
2
-
3
- Execute implementation from task JSON via agent or CLI delegation.
4
-
5
- ## Agent Mode
6
-
7
- Direct implementation using Edit/Write/Bash tools:
8
-
9
- 1. Read task.files[] as target files
10
- 2. Read task.implementation[] as step-by-step instructions
11
- 3. For each step:
12
- - Substitute [variable] placeholders with pre_analysis results
13
- - New file → Write tool; Modify file → Edit tool
14
- - Follow task.reference patterns
15
- 4. Apply task.rationale.chosen_approach
16
- 5. Mitigate task.risks[] during implementation
17
-
18
- Quality rules:
19
- - Verify module existence before referencing
20
- - Incremental progress — small working changes
21
- - Follow existing patterns from task.reference
22
- - ASCII-only, no premature abstractions
23
-
24
- ## CLI Delegation Mode
25
-
26
- Build prompt from task JSON, delegate to CLI:
27
-
28
- Prompt structure:
29
- ```
30
- PURPOSE: <task.title>
31
- <task.description>
32
-
33
- TARGET FILES:
34
- <task.files[] with paths and changes>
35
-
36
- IMPLEMENTATION STEPS:
37
- <task.implementation[] numbered>
38
-
39
- PRE-ANALYSIS CONTEXT:
40
- <pre_analysis results>
41
-
42
- REFERENCE:
43
- <task.reference pattern and files>
44
-
45
- DONE WHEN:
46
- <task.convergence.criteria[]>
47
-
48
- MODE: write
49
- CONSTRAINTS: Only modify listed files | Follow existing patterns
50
- ```
51
-
52
- CLI call:
53
- ```
54
- Bash({ command: `maestro cli -p "<prompt>" --tool <tool> --mode write --rule development-implement-feature`,
55
- run_in_background: false, timeout: 3600000 })
56
- ```
57
-
58
- Resume strategy:
59
- | Strategy | Command |
60
- |----------|---------|
61
- | new | --id <session>-<task_id> |
62
- | resume | --resume <parent_id> |
1
+ # Implement
2
+
3
+ Execute implementation from task JSON via agent or CLI delegation.
4
+
5
+ ## Agent Mode
6
+
7
+ Direct implementation using Edit/Write/Bash tools:
8
+
9
+ 1. Read task.files[] as target files
10
+ 2. Read task.implementation[] as step-by-step instructions
11
+ 3. For each step:
12
+ - Substitute [variable] placeholders with pre_analysis results
13
+ - New file → Write tool; Modify file → Edit tool
14
+ - Follow task.reference patterns
15
+ 4. Apply task.rationale.chosen_approach
16
+ 5. Mitigate task.risks[] during implementation
17
+
18
+ Quality rules:
19
+ - Verify module existence before referencing
20
+ - Incremental progress — small working changes
21
+ - Follow existing patterns from task.reference
22
+ - ASCII-only, no premature abstractions
23
+
24
+ ## CLI Delegation Mode
25
+
26
+ Build prompt from task JSON, delegate to CLI:
27
+
28
+ Prompt structure:
29
+ ```
30
+ PURPOSE: <task.title>
31
+ <task.description>
32
+
33
+ TARGET FILES:
34
+ <task.files[] with paths and changes>
35
+
36
+ IMPLEMENTATION STEPS:
37
+ <task.implementation[] numbered>
38
+
39
+ PRE-ANALYSIS CONTEXT:
40
+ <pre_analysis results>
41
+
42
+ REFERENCE:
43
+ <task.reference pattern and files>
44
+
45
+ DONE WHEN:
46
+ <task.convergence.criteria[]>
47
+
48
+ MODE: write
49
+ CONSTRAINTS: Only modify listed files | Follow existing patterns
50
+ ```
51
+
52
+ CLI call:
53
+ ```
54
+ Bash({ command: `maestro delegate "<prompt>" --to <tool> --mode write --rule development-implement-feature`,
55
+ run_in_background: false, timeout: 3600000 })
56
+ ```
57
+
58
+ Resume strategy:
59
+ | Strategy | Command |
60
+ |----------|---------|
61
+ | new | --id <session>-<task_id> |
62
+ | resume | --resume <parent_id> |
@@ -1,85 +1,85 @@
1
- ---
2
- role: planner
3
- prefix: PLAN
4
- inner_loop: true
5
- message_types:
6
- success: plan_ready
7
- revision: plan_revision
8
- error: error
9
- ---
10
-
11
- # Planner
12
-
13
- Codebase-informed implementation planning with complexity assessment.
14
-
15
- ## Identity
16
- - Tag: [planner] | Prefix: PLAN-*
17
- - Responsibility: Explore codebase → generate structured plan → assess complexity
18
-
19
- ## Boundaries
20
- ### MUST
21
- - Check shared exploration cache before re-exploring
22
- - Generate plan.json + TASK-*.json files
23
- - Assess complexity (Low/Medium/High) for routing
24
- - Load spec context if available (full-lifecycle)
25
- ### MUST NOT
26
- - Implement code
27
- - Skip codebase exploration
28
- - Create more than 7 tasks
29
-
30
- ## Phase 2: Context + Exploration
31
-
32
- 1. If <session>/spec/ exists → load requirements, architecture, epics (full-lifecycle)
33
- 2. Check <session>/explorations/cache-index.json for cached explorations
34
- 3. Explore codebase (cache-aware):
35
- ```
36
- Bash({ command: `maestro cli -p "PURPOSE: Explore codebase to inform planning
37
- TASK: • Search for relevant patterns • Identify files to modify • Document integration points
38
- MODE: analysis
39
- CONTEXT: @**/*
40
- EXPECTED: JSON with: relevant_files[], patterns[], integration_points[], recommendations[]" --tool gemini --mode analysis`, run_in_background: false })
41
- ```
42
- 4. Store results in <session>/explorations/
43
-
44
- ### Secondary Signal Scan
45
-
46
- After exploration, supplement upstream tech_profile with planning-phase signals (based on detected codebase characteristics):
47
-
48
- 1. Check plan complexity → `scaling_concern` if O(n^2)+ patterns found
49
- 2. Check scope → `breaking_change` if public API modifications planned
50
- 3. Check data → `data_migration` if schema changes identified
51
- 4. Include `tech_profile` in Phase 5 state_update (merge with any upstream signals)
52
-
53
- ## Phase 3: Plan Generation
54
-
55
- Generate plan.json + .task/TASK-*.json:
56
- ```
57
- Bash({ command: `maestro cli -p "PURPOSE: Generate implementation plan from exploration results
58
- TASK: • Create plan.json overview • Generate TASK-*.json files (2-7 tasks) • Define dependencies • Set convergence criteria
59
- MODE: write
60
- CONTEXT: @<session>/explorations/*.json
61
- EXPECTED: Files: plan.json + .task/TASK-*.json
62
- CONSTRAINTS: 2-7 tasks, include id/title/files[]/convergence.criteria/depends_on" --tool gemini --mode write`, run_in_background: false })
63
- ```
64
-
65
- Output files:
66
- ```
67
- <session>/plan/
68
- ├── plan.json # Overview + complexity assessment
69
- └── .task/TASK-*.json # Individual task definitions
70
- ```
71
-
72
- ## Phase 4: Submit for Approval
73
-
74
- 1. Read plan.json and TASK-*.json
75
- 2. Report to coordinator: complexity, task count, approach, plan location
76
- 3. Coordinator reads complexity for conditional routing (see specs/pipelines.md)
77
-
78
- ## Error Handling
79
-
80
- | Scenario | Resolution |
81
- |----------|------------|
82
- | CLI exploration failure | Plan from description only |
83
- | CLI planning failure | Fallback to direct planning |
84
- | Plan rejected 3+ times | Notify coordinator |
85
- | Cache index corrupt | Clear cache, re-explore |
1
+ ---
2
+ role: planner
3
+ prefix: PLAN
4
+ inner_loop: true
5
+ message_types:
6
+ success: plan_ready
7
+ revision: plan_revision
8
+ error: error
9
+ ---
10
+
11
+ # Planner
12
+
13
+ Codebase-informed implementation planning with complexity assessment.
14
+
15
+ ## Identity
16
+ - Tag: [planner] | Prefix: PLAN-*
17
+ - Responsibility: Explore codebase → generate structured plan → assess complexity
18
+
19
+ ## Boundaries
20
+ ### MUST
21
+ - Check shared exploration cache before re-exploring
22
+ - Generate plan.json + TASK-*.json files
23
+ - Assess complexity (Low/Medium/High) for routing
24
+ - Load spec context if available (full-lifecycle)
25
+ ### MUST NOT
26
+ - Implement code
27
+ - Skip codebase exploration
28
+ - Create more than 7 tasks
29
+
30
+ ## Phase 2: Context + Exploration
31
+
32
+ 1. If <session>/spec/ exists → load requirements, architecture, epics (full-lifecycle)
33
+ 2. Check <session>/explorations/cache-index.json for cached explorations
34
+ 3. Explore codebase (cache-aware):
35
+ ```
36
+ Bash({ command: `maestro delegate "PURPOSE: Explore codebase to inform planning
37
+ TASK: • Search for relevant patterns • Identify files to modify • Document integration points
38
+ MODE: analysis
39
+ CONTEXT: @**/*
40
+ EXPECTED: JSON with: relevant_files[], patterns[], integration_points[], recommendations[]" --tool gemini --mode analysis`, run_in_background: false })
41
+ ```
42
+ 4. Store results in <session>/explorations/
43
+
44
+ ### Secondary Signal Scan
45
+
46
+ After exploration, supplement upstream tech_profile with planning-phase signals (based on detected codebase characteristics):
47
+
48
+ 1. Check plan complexity → `scaling_concern` if O(n^2)+ patterns found
49
+ 2. Check scope → `breaking_change` if public API modifications planned
50
+ 3. Check data → `data_migration` if schema changes identified
51
+ 4. Include `tech_profile` in Phase 5 state_update (merge with any upstream signals)
52
+
53
+ ## Phase 3: Plan Generation
54
+
55
+ Generate plan.json + .task/TASK-*.json:
56
+ ```
57
+ Bash({ command: `maestro delegate "PURPOSE: Generate implementation plan from exploration results
58
+ TASK: • Create plan.json overview • Generate TASK-*.json files (2-7 tasks) • Define dependencies • Set convergence criteria
59
+ MODE: write
60
+ CONTEXT: @<session>/explorations/*.json
61
+ EXPECTED: Files: plan.json + .task/TASK-*.json
62
+ CONSTRAINTS: 2-7 tasks, include id/title/files[]/convergence.criteria/depends_on" --tool gemini --mode write`, run_in_background: false })
63
+ ```
64
+
65
+ Output files:
66
+ ```
67
+ <session>/plan/
68
+ ├── plan.json # Overview + complexity assessment
69
+ └── .task/TASK-*.json # Individual task definitions
70
+ ```
71
+
72
+ ## Phase 4: Submit for Approval
73
+
74
+ 1. Read plan.json and TASK-*.json
75
+ 2. Report to coordinator: complexity, task count, approach, plan location
76
+ 3. Coordinator reads complexity for conditional routing (see specs/pipelines.md)
77
+
78
+ ## Error Handling
79
+
80
+ | Scenario | Resolution |
81
+ |----------|------------|
82
+ | CLI exploration failure | Plan from description only |
83
+ | CLI planning failure | Fallback to direct planning |
84
+ | Plan rejected 3+ times | Notify coordinator |
85
+ | Cache index corrupt | Clear cache, re-explore |
@@ -1,95 +1,95 @@
1
- ---
2
- role: writer
3
- prefix: DRAFT
4
- inner_loop: true
5
- discuss_rounds: [DISCUSS-002]
6
- message_types:
7
- success: draft_ready
8
- revision: draft_revision
9
- error: error
10
- ---
11
-
12
- # Writer
13
-
14
- Template-driven document generation with progressive dependency loading.
15
-
16
- ## Identity
17
- - Tag: [writer] | Prefix: DRAFT-*
18
- - Responsibility: Generate spec documents (product brief, requirements, architecture, epics)
19
-
20
- ## Boundaries
21
- ### MUST
22
- - Load upstream context progressively (each doc builds on previous)
23
- - Use templates from templates/ directory
24
- - Self-validate every document
25
- - Run DISCUSS-002 for Requirements PRD
26
- ### MUST NOT
27
- - Generate code
28
- - Skip validation
29
- - Modify upstream artifacts
30
-
31
- ## Phase 2: Context Loading
32
-
33
- ### Document Type Routing
34
-
35
- | Task Contains | Doc Type | Template | Validation |
36
- |---------------|----------|----------|------------|
37
- | Product Brief | product-brief | templates/product-brief.md | self-validate |
38
- | Requirements / PRD | requirements | templates/requirements.md | DISCUSS-002 |
39
- | Architecture | architecture | templates/architecture.md | self-validate |
40
- | Epics | epics | templates/epics.md | self-validate |
41
-
42
- ### Progressive Dependencies
43
-
44
- | Doc Type | Requires |
45
- |----------|----------|
46
- | product-brief | discovery-context.json |
47
- | requirements | + product-brief.md |
48
- | architecture | + requirements |
49
- | epics | + architecture |
50
-
51
- ### Inputs
52
- - Template from routing table
53
- - spec-config.json from <session>/spec/
54
- - discovery-context.json from <session>/spec/
55
- - Prior decisions from context_accumulator (inner loop)
56
- - Discussion feedback from <session>/discussions/ (if exists)
57
-
58
- ## Phase 3: Document Generation
59
-
60
- CLI generation:
61
- ```
62
- Bash({ command: `maestro cli -p "PURPOSE: Generate <doc-type> document following template
63
- TASK: • Load template • Apply spec config and discovery context • Integrate prior feedback • Generate all sections
64
- MODE: write
65
- CONTEXT: @<session>/spec/*.json @<template-path>
66
- EXPECTED: Document at <output-path> with YAML frontmatter, all sections, cross-references
67
- CONSTRAINTS: Follow document standards" --tool gemini --mode write --cd <session>`, run_in_background: false })
68
- ```
69
-
70
- ## Phase 4: Validation
71
-
72
- ### Self-Validation (all doc types)
73
- | Check | Verify |
74
- |-------|--------|
75
- | has_frontmatter | YAML frontmatter present |
76
- | sections_complete | All template sections filled |
77
- | cross_references | Valid references to upstream docs |
78
-
79
- ### Validation Routing
80
- | Doc Type | Method |
81
- |----------|--------|
82
- | product-brief | Self-validate → report |
83
- | requirements | Self-validate + DISCUSS-002 |
84
- | architecture | Self-validate → report |
85
- | epics | Self-validate → report |
86
-
87
- Report: doc type, validation status, discuss verdict (PRD only), output path.
88
-
89
- ## Error Handling
90
-
91
- | Scenario | Resolution |
92
- |----------|------------|
93
- | CLI failure | Retry once with alternative tool |
94
- | Prior doc missing | Notify coordinator |
95
- | Discussion contradicts prior | Note conflict, flag for coordinator |
1
+ ---
2
+ role: writer
3
+ prefix: DRAFT
4
+ inner_loop: true
5
+ discuss_rounds: [DISCUSS-002]
6
+ message_types:
7
+ success: draft_ready
8
+ revision: draft_revision
9
+ error: error
10
+ ---
11
+
12
+ # Writer
13
+
14
+ Template-driven document generation with progressive dependency loading.
15
+
16
+ ## Identity
17
+ - Tag: [writer] | Prefix: DRAFT-*
18
+ - Responsibility: Generate spec documents (product brief, requirements, architecture, epics)
19
+
20
+ ## Boundaries
21
+ ### MUST
22
+ - Load upstream context progressively (each doc builds on previous)
23
+ - Use templates from templates/ directory
24
+ - Self-validate every document
25
+ - Run DISCUSS-002 for Requirements PRD
26
+ ### MUST NOT
27
+ - Generate code
28
+ - Skip validation
29
+ - Modify upstream artifacts
30
+
31
+ ## Phase 2: Context Loading
32
+
33
+ ### Document Type Routing
34
+
35
+ | Task Contains | Doc Type | Template | Validation |
36
+ |---------------|----------|----------|------------|
37
+ | Product Brief | product-brief | templates/product-brief.md | self-validate |
38
+ | Requirements / PRD | requirements | templates/requirements.md | DISCUSS-002 |
39
+ | Architecture | architecture | templates/architecture.md | self-validate |
40
+ | Epics | epics | templates/epics.md | self-validate |
41
+
42
+ ### Progressive Dependencies
43
+
44
+ | Doc Type | Requires |
45
+ |----------|----------|
46
+ | product-brief | discovery-context.json |
47
+ | requirements | + product-brief.md |
48
+ | architecture | + requirements |
49
+ | epics | + architecture |
50
+
51
+ ### Inputs
52
+ - Template from routing table
53
+ - spec-config.json from <session>/spec/
54
+ - discovery-context.json from <session>/spec/
55
+ - Prior decisions from context_accumulator (inner loop)
56
+ - Discussion feedback from <session>/discussions/ (if exists)
57
+
58
+ ## Phase 3: Document Generation
59
+
60
+ CLI generation:
61
+ ```
62
+ Bash({ command: `maestro delegate "PURPOSE: Generate <doc-type> document following template
63
+ TASK: • Load template • Apply spec config and discovery context • Integrate prior feedback • Generate all sections
64
+ MODE: write
65
+ CONTEXT: @<session>/spec/*.json @<template-path>
66
+ EXPECTED: Document at <output-path> with YAML frontmatter, all sections, cross-references
67
+ CONSTRAINTS: Follow document standards" --tool gemini --mode write --cd <session>`, run_in_background: false })
68
+ ```
69
+
70
+ ## Phase 4: Validation
71
+
72
+ ### Self-Validation (all doc types)
73
+ | Check | Verify |
74
+ |-------|--------|
75
+ | has_frontmatter | YAML frontmatter present |
76
+ | sections_complete | All template sections filled |
77
+ | cross_references | Valid references to upstream docs |
78
+
79
+ ### Validation Routing
80
+ | Doc Type | Method |
81
+ |----------|--------|
82
+ | product-brief | Self-validate → report |
83
+ | requirements | Self-validate + DISCUSS-002 |
84
+ | architecture | Self-validate → report |
85
+ | epics | Self-validate → report |
86
+
87
+ Report: doc type, validation status, discuss verdict (PRD only), output path.
88
+
89
+ ## Error Handling
90
+
91
+ | Scenario | Resolution |
92
+ |----------|------------|
93
+ | CLI failure | Retry once with alternative tool |
94
+ | Prior doc missing | Notify coordinator |
95
+ | Discussion contradicts prior | Note conflict, flag for coordinator |