pi-maestro-flow 0.2.0 → 0.3.0

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 (235) hide show
  1. package/README.md +44 -72
  2. package/agents/cross-role-reviewer.md +1 -1
  3. package/agents/impeccable-agent.md +1 -1
  4. package/agents/ralph-executor.md +1 -1
  5. package/agents/team-worker.md +1 -1
  6. package/agents/workflow-analyzer.md +1 -1
  7. package/agents/workflow-codebase-mapper.md +1 -1
  8. package/agents/workflow-collab-planner.md +1 -1
  9. package/agents/workflow-debugger.md +1 -1
  10. package/agents/workflow-executor.md +1 -1
  11. package/agents/workflow-integration-checker.md +1 -1
  12. package/agents/workflow-nyquist-auditor.md +1 -1
  13. package/agents/workflow-phase-researcher.md +1 -1
  14. package/agents/workflow-planner.md +1 -1
  15. package/agents/workflow-project-researcher.md +1 -1
  16. package/agents/workflow-reviewer.md +1 -1
  17. package/agents/workflow-verifier.md +1 -1
  18. package/package.json +13 -4
  19. package/skills/codify-to-knowhow/SKILL.md +1 -1
  20. package/skills/delegation-check/SKILL.md +1 -1
  21. package/skills/domain-add/SKILL.md +5 -7
  22. package/skills/insight-challenge/SKILL.md +1 -1
  23. package/skills/learn-decompose/SKILL.md +4 -4
  24. package/skills/learn-follow/SKILL.md +5 -5
  25. package/skills/learn-investigate/SKILL.md +5 -5
  26. package/skills/learn-second-opinion/SKILL.md +5 -5
  27. package/skills/maestro/SKILL.md +9 -10
  28. package/skills/maestro-amend/SKILL.md +3 -3
  29. package/skills/maestro-analyze/SKILL.md +10 -13
  30. package/skills/maestro-blueprint/SKILL.md +8 -11
  31. package/skills/maestro-brainstorm/SKILL.md +11 -14
  32. package/skills/maestro-collab/SKILL.md +4 -4
  33. package/skills/maestro-companion/SKILL.md +3 -3
  34. package/skills/maestro-composer/SKILL.md +11 -12
  35. package/skills/maestro-execute/SKILL.md +9 -12
  36. package/skills/maestro-fork/SKILL.md +8 -11
  37. package/skills/maestro-grill/SKILL.md +13 -16
  38. package/skills/maestro-guard/SKILL.md +5 -5
  39. package/skills/maestro-help/SKILL.md +3 -3
  40. package/skills/maestro-impeccable/SKILL.md +7 -7
  41. package/skills/maestro-init/SKILL.md +9 -12
  42. package/skills/maestro-merge/SKILL.md +6 -8
  43. package/skills/maestro-milestone-audit/SKILL.md +3 -5
  44. package/skills/maestro-milestone-complete/SKILL.md +9 -12
  45. package/skills/maestro-milestone-release/SKILL.md +9 -11
  46. package/skills/maestro-next/SKILL.md +5 -5
  47. package/skills/maestro-overlay/SKILL.md +16 -16
  48. package/skills/maestro-plan/SKILL.md +9 -12
  49. package/skills/maestro-player/SKILL.md +5 -5
  50. package/skills/maestro-quick/SKILL.md +5 -7
  51. package/skills/maestro-ralph/SKILL.md +16 -17
  52. package/skills/maestro-ralph-cli/SKILL.md +6 -6
  53. package/skills/maestro-ralph-cli-execute/SKILL.md +2 -2
  54. package/skills/maestro-ralph-execute/SKILL.md +4 -4
  55. package/skills/maestro-ralph-v2/SKILL.md +18 -19
  56. package/skills/maestro-roadmap/SKILL.md +8 -9
  57. package/skills/maestro-swarm-workflow/SKILL.md +9 -9
  58. package/skills/maestro-tools-execute/SKILL.md +5 -7
  59. package/skills/maestro-tools-register/SKILL.md +7 -9
  60. package/skills/maestro-ui-codify/SKILL.md +9 -10
  61. package/skills/maestro-universal-workflow/SKILL.md +15 -15
  62. package/skills/maestro-update/SKILL.md +10 -10
  63. package/skills/manage-codebase-rebuild/SKILL.md +4 -6
  64. package/skills/manage-drift-realign/SKILL.md +8 -11
  65. package/skills/manage-harvest/SKILL.md +6 -9
  66. package/skills/manage-issue/SKILL.md +5 -8
  67. package/skills/manage-issue-discover/SKILL.md +8 -11
  68. package/skills/manage-kg-extractors/SKILL.md +3 -3
  69. package/skills/manage-knowhow/SKILL.md +3 -5
  70. package/skills/manage-knowhow-capture/SKILL.md +4 -6
  71. package/skills/manage-knowledge-audit/SKILL.md +6 -9
  72. package/skills/manage-status/SKILL.md +3 -5
  73. package/skills/manage-wiki/SKILL.md +5 -7
  74. package/skills/odyssey-debug/SKILL.md +13 -13
  75. package/skills/odyssey-improve/SKILL.md +15 -15
  76. package/skills/odyssey-planex/SKILL.md +16 -16
  77. package/skills/odyssey-review-test-fix/SKILL.md +11 -11
  78. package/skills/odyssey-ui/SKILL.md +10 -10
  79. package/skills/prompt-generator/SKILL.md +5 -5
  80. package/skills/quality-auto-test/SKILL.md +3 -5
  81. package/skills/quality-debug/SKILL.md +3 -5
  82. package/skills/quality-refactor/SKILL.md +3 -5
  83. package/skills/quality-retrospective/SKILL.md +10 -13
  84. package/skills/quality-review/SKILL.md +5 -8
  85. package/skills/quality-sync/SKILL.md +3 -5
  86. package/skills/quality-test/SKILL.md +4 -6
  87. package/skills/scholar-anti-ai-writing/SKILL.md +1 -1
  88. package/skills/scholar-citation-verify/SKILL.md +1 -1
  89. package/skills/scholar-experiment/SKILL.md +2 -2
  90. package/skills/scholar-ideation/SKILL.md +7 -7
  91. package/skills/scholar-latex-organizer/SKILL.md +1 -1
  92. package/skills/scholar-publish/SKILL.md +3 -3
  93. package/skills/scholar-rebuttal-pro/SKILL.md +3 -3
  94. package/skills/scholar-review/SKILL.md +1 -1
  95. package/skills/scholar-writing/SKILL.md +1 -1
  96. package/skills/security-audit/SKILL.md +2 -4
  97. package/skills/skill-generator/SKILL.md +3 -3
  98. package/skills/skill-iter-tune/SKILL.md +3 -3
  99. package/skills/skill-simplify/SKILL.md +1 -1
  100. package/skills/skill-tuning/SKILL.md +1 -1
  101. package/skills/spec-add/SKILL.md +5 -7
  102. package/skills/spec-load/SKILL.md +3 -5
  103. package/skills/spec-remove/SKILL.md +4 -6
  104. package/skills/spec-setup/SKILL.md +6 -8
  105. package/skills/team-adversarial-swarm/SKILL.md +5 -5
  106. package/skills/team-arch-opt/SKILL.md +2 -2
  107. package/skills/team-brainstorm/SKILL.md +3 -3
  108. package/skills/team-coordinate/SKILL.md +4 -4
  109. package/skills/team-designer/SKILL.md +1 -1
  110. package/skills/team-executor/SKILL.md +3 -3
  111. package/skills/team-frontend/SKILL.md +2 -2
  112. package/skills/team-frontend-debug/SKILL.md +3 -3
  113. package/skills/team-interactive-craft/SKILL.md +2 -2
  114. package/skills/team-issue/SKILL.md +3 -3
  115. package/skills/team-lifecycle-v4/SKILL.md +4 -4
  116. package/skills/team-motion-design/SKILL.md +2 -2
  117. package/skills/team-perf-opt/SKILL.md +3 -3
  118. package/skills/team-planex/SKILL.md +2 -2
  119. package/skills/team-quality-assurance/SKILL.md +3 -3
  120. package/skills/team-review/SKILL.md +3 -3
  121. package/skills/team-roadmap-dev/SKILL.md +3 -3
  122. package/skills/team-swarm/SKILL.md +4 -4
  123. package/skills/team-tech-debt/SKILL.md +2 -2
  124. package/skills/team-testing/SKILL.md +3 -3
  125. package/skills/team-ui-polish/SKILL.md +2 -2
  126. package/skills/team-uidesign/SKILL.md +2 -2
  127. package/skills/team-ultra-analyze/SKILL.md +4 -4
  128. package/skills/team-ux-improve/SKILL.md +3 -3
  129. package/skills/team-visual-a11y/SKILL.md +2 -2
  130. package/skills/workflow-skill-designer/SKILL.md +8 -8
  131. package/templates/business-test-report.json +68 -0
  132. package/templates/config.json +48 -0
  133. package/templates/context.md +16 -0
  134. package/templates/doc-index.json +11 -0
  135. package/templates/index.json +68 -0
  136. package/templates/issue.json +36 -0
  137. package/templates/plan.json +38 -0
  138. package/templates/project.md +60 -0
  139. package/templates/reflection-log.md +20 -0
  140. package/templates/roadmap.md +45 -0
  141. package/templates/scratch-index.json +19 -0
  142. package/templates/search-tool.json +1 -0
  143. package/templates/search-tools.md +47 -0
  144. package/templates/state.json +18 -0
  145. package/templates/task-summary.md +21 -0
  146. package/templates/task.json +89 -0
  147. package/templates/terminology-template.json +22 -0
  148. package/templates/uat.md +21 -0
  149. package/templates/validation.json +31 -0
  150. package/templates/verification.json +37 -0
  151. package/templates/workflow.md +14 -0
  152. package/templates/worktree-scope.json +9 -0
  153. package/templates/worktrees.json +26 -0
  154. package/workflows/agy-instructions.md +156 -0
  155. package/workflows/analyze.md +768 -0
  156. package/workflows/auto-test.md +705 -0
  157. package/workflows/blueprint.md +406 -0
  158. package/workflows/boundary-grill.md +50 -0
  159. package/workflows/brainstorm.md +508 -0
  160. package/workflows/business-test.md +574 -0
  161. package/workflows/chinese-response.md +25 -0
  162. package/workflows/claude-instructions.md +167 -0
  163. package/workflows/codebase-rebuild.md +267 -0
  164. package/workflows/codebase-refresh.md +168 -0
  165. package/workflows/codex-instructions.md +156 -0
  166. package/workflows/coding-philosophy.md +70 -0
  167. package/workflows/command-authoring.md +823 -0
  168. package/workflows/debug.md +409 -0
  169. package/workflows/delegate-usage.md +99 -0
  170. package/workflows/domain-add.md +121 -0
  171. package/workflows/drift-realign.md +396 -0
  172. package/workflows/execute.md +631 -0
  173. package/workflows/explore-usage.md +93 -0
  174. package/workflows/finish-work.md +124 -0
  175. package/workflows/fork.md +162 -0
  176. package/workflows/grill.md +494 -0
  177. package/workflows/harvest.md +478 -0
  178. package/workflows/impeccable.md +168 -0
  179. package/workflows/init.md +157 -0
  180. package/workflows/instruction-authoring-guide.md +97 -0
  181. package/workflows/integration-test.md +186 -0
  182. package/workflows/interview-mechanics.md +8 -0
  183. package/workflows/issue-analyze.md +20 -0
  184. package/workflows/issue-discover.md +238 -0
  185. package/workflows/issue-execute.md +110 -0
  186. package/workflows/issue-gaps-analyze.codex.md +256 -0
  187. package/workflows/issue-gaps-analyze.md +215 -0
  188. package/workflows/issue-plan.md +110 -0
  189. package/workflows/issue.md +338 -0
  190. package/workflows/knowhow.md +429 -0
  191. package/workflows/knowledge-audit.md +355 -0
  192. package/workflows/learn.md +271 -0
  193. package/workflows/maestro-chain-execute.md +20 -0
  194. package/workflows/maestro-link-coordinate.md +114 -0
  195. package/workflows/maestro-super.md +120 -0
  196. package/workflows/maestro.md +501 -0
  197. package/workflows/map.md +74 -0
  198. package/workflows/merge.md +122 -0
  199. package/workflows/milestone-audit.md +155 -0
  200. package/workflows/milestone-complete.md +167 -0
  201. package/workflows/milestone-release.md +82 -0
  202. package/workflows/odyssey-base-codex.md +305 -0
  203. package/workflows/odyssey-base.md +256 -0
  204. package/workflows/overlays.md +109 -0
  205. package/workflows/plan.md +520 -0
  206. package/workflows/quick.md +350 -0
  207. package/workflows/ralph-amend-goal.md +177 -0
  208. package/workflows/refactor.md +87 -0
  209. package/workflows/retrospective.md +471 -0
  210. package/workflows/review.md +448 -0
  211. package/workflows/roadmap-common.md +193 -0
  212. package/workflows/roadmap.md +106 -0
  213. package/workflows/shell-exec-protocol.md +30 -0
  214. package/workflows/skill-authoring.md +265 -0
  215. package/workflows/spec-generate.md +475 -0
  216. package/workflows/specs-add.md +123 -0
  217. package/workflows/specs-load.md +76 -0
  218. package/workflows/specs-remove.md +104 -0
  219. package/workflows/specs-setup.md +316 -0
  220. package/workflows/status.md +149 -0
  221. package/workflows/sync.md +116 -0
  222. package/workflows/tdd.md +255 -0
  223. package/workflows/test-gen.md +226 -0
  224. package/workflows/test.md +385 -0
  225. package/workflows/tools-spec.md +70 -0
  226. package/workflows/ui-codify-extract.md +372 -0
  227. package/workflows/ui-codify-knowhow.md +258 -0
  228. package/workflows/ui-codify-package.md +159 -0
  229. package/workflows/ui-codify.md +227 -0
  230. package/workflows/ui-design.md +393 -0
  231. package/workflows/ui-style.md +201 -0
  232. package/workflows/verify.md +557 -0
  233. package/workflows/wiki-connect.md +153 -0
  234. package/workflows/wiki-digest.md +180 -0
  235. package/workflows/wiki-manage.md +113 -0
@@ -0,0 +1,122 @@
1
+ # Workflow: merge
2
+
3
+ ---
4
+
5
+ ## Step 1: Parse Arguments and Flags
6
+
7
+ ```
8
+ Timestamps use UTC+8 ISO format throughout.
9
+
10
+ Parse from $ARGUMENTS:
11
+ --force → force (skip incomplete-phase confirmation)
12
+ --dry-run → dryRun (preview only)
13
+ --no-cleanup → noCleanup (keep worktree after merge)
14
+ --continue → continueMode (resume after conflict resolution)
15
+ -m <N> or bare <N> → milestoneNum (1-based)
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Step 2: Validate Context
21
+
22
+ ```
23
+ Reject: .workflow/worktree-scope.json present (E001 — must run from main worktree).
24
+ Require: .workflow/worktrees.json (E002 — nothing to merge without registry).
25
+ Read registry from worktrees.json.
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Step 3: Registry Health Check
31
+
32
+ ```
33
+ Detect worktree entries whose directories no longer exist.
34
+ If stale entries found → warn (W001), remove from registry, rewrite worktrees.json.
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Step 4: Resolve Merge Target
40
+
41
+ ```
42
+ --continue → load target from .workflow/.merge-state.json (E003 if missing), skip to Step 7.
43
+ Otherwise → find active worktree for milestoneNum in registry (E004 if no milestone specified).
44
+ If no matching target → display active worktrees and exit.
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Step 5: Validate Readiness
50
+
51
+ ```
52
+ Check phase completeness via worktree artifact registry (execute artifacts → completed or incomplete).
53
+ If incomplete phases and not --force → warn (W002), confirm with user.
54
+ If --dry-run → display merge preview (branch, milestone, completed/incomplete phases) and exit.
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Step 6: Phase 1 — Git Merge
60
+
61
+ ```
62
+ 6a: Pull main into worktree branch (cd {target.path} && git merge main --no-edit).
63
+ On conflict → warn (W003), instruct to resolve in worktree, exit.
64
+
65
+ 6b: Merge worktree branch into main (git merge {target.branch} --no-ff).
66
+ On conflict → save .workflow/.merge-state.json {target, phase:"git_merge_conflict"},
67
+ instruct: resolve, git merge --continue, then /maestro-merge --continue. Exit.
68
+
69
+ Display "Git merge successful."
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Step 7: Phase 2 — Artifact Sync
75
+
76
+ ```
77
+ Step_7:
78
+
79
+ 7a: Copy milestone artifact directories from worktree → main .workflow/.
80
+ Filter: artifacts matching target.milestone or target.owned_phases.
81
+
82
+ 7b: Merge artifact registries — update existing by ID, append new entries.
83
+
84
+ 7c: Record in mainState.transition_history:
85
+ { milestone_num, milestone, action:"worktree_merge", completed_at, branch, phases }
86
+
87
+ 7d: Merge accumulated_context — deduplicate key_decisions, append deferred items.
88
+
89
+ Update mainState.last_updated, write .workflow/state.json.
90
+
91
+ 7e: Mark completed phases in .workflow/roadmap.md with completion indicator.
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Step 8: Cleanup
97
+
98
+ ```
99
+ Unless --no-cleanup: remove git worktree and delete branch.
100
+ Remove target entry from worktrees.json registry.
101
+ Clean up .workflow/.merge-state.json if present.
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Step 9: Summary
107
+
108
+ ```
109
+ Display:
110
+ === MERGE COMPLETE ===
111
+ Milestone: M{target.milestone_num} — {target.milestone}
112
+ Branch: {target.branch}
113
+ Phases: {target.owned_phases.join(', ')}
114
+ Completed: {completedPhases.length}/{target.owned_phases.length}
115
+
116
+ State: .workflow/state.json updated
117
+ Roadmap: .workflow/roadmap.md updated
118
+
119
+ Next steps:
120
+ Skill({ skill: "manage-status" }) -- View dashboard
121
+ Skill({ skill: "maestro-milestone-audit" }) -- Audit merged milestone
122
+ ```
@@ -0,0 +1,155 @@
1
+ # Workflow: milestone-audit
2
+
3
+ Cross-phase integration audit for milestone completion. Based on artifact registry.
4
+
5
+ ---
6
+
7
+ ## Step 1: Load Milestone Context
8
+
9
+ 1. Read `.workflow/state.json`:
10
+ - Determine target milestone (from $ARGUMENTS or current_milestone)
11
+ - If no milestone: ERROR E001
12
+ - Get `artifacts[]` array
13
+ - Resolve milestone object from `milestones[]` by id
14
+ - Determine milestone type: `milestone_obj.type` (default `"standard"` if field missing)
15
+
16
+ 2. **Standard milestone** (`type != "adhoc"`):
17
+ - Parse `.workflow/roadmap.md` to identify all phases belonging to this milestone
18
+
19
+ 3. **Adhoc milestone** (`type == "adhoc"`):
20
+ - Skip roadmap.md parsing (roadmap may not exist)
21
+ - Phases are defined by `milestone_obj.phases[]` (typically `[1]` with slug `"standalone"`)
22
+
23
+ 4. Group milestone artifacts by type → `analyze_artifacts`, `plan_artifacts`, `execute_artifacts`, `verify_artifacts`
24
+
25
+ ---
26
+
27
+ ## Step 2: Phase Coverage Check
28
+
29
+ **Standard milestone**: Parse roadmap.md phases for this milestone. For each phase, verify completed artifacts exist for analyze, plan, and execute types. WARN if any phase is missing its execute artifact: "Phase {number} ({title}) missing execute artifact"
30
+
31
+ **Adhoc milestone**: Skip phase-level coverage check (no roadmap phases to validate). Instead, verify that at least one complete artifact chain exists: plan artifact (PLN) + execute artifact (EXC) with matching milestone ID. WARN if no execute artifact found.
32
+
33
+ ---
34
+
35
+ ## Step 3: Ad-hoc Completeness Check
36
+
37
+ Check all ad-hoc artifacts (`scope == "adhoc"`) for this milestone are completed. WARN if any incomplete (list ids).
38
+
39
+ ---
40
+
41
+ ## Step 4: Execution Completeness Check
42
+
43
+ For each execute artifact, read `{path}/.task/TASK-*.json` and verify all tasks are completed or skipped. WARN if any tasks remain incomplete: "Plan {plan_dir}: {N} tasks not completed"
44
+
45
+ ---
46
+
47
+ ## Step 5: Integration Check
48
+
49
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `workflow-integration-checker` agent:
50
+
51
+ ```
52
+ Agent({
53
+ subagent_type: "workflow-integration-checker",
54
+ prompt: "
55
+ Audit cross-phase integration for milestone {milestone}.
56
+
57
+ Artifacts to audit:
58
+ {for each execute artifact: path, phase, scope}
59
+
60
+ Check:
61
+ 1. SHARED INTERFACES -- Do artifacts that share interfaces have compatible types/contracts?
62
+ 2. DEPENDENCY CHAINS -- Are all cross-phase dependencies satisfied?
63
+ 3. DATA CONTRACTS -- Do data models used across phases match?
64
+ 4. API CONSISTENCY -- Are API endpoints/interfaces consistent?
65
+ 5. CONFIGURATION -- Are shared configs compatible?
66
+ 6. ERROR HANDLING -- Do error flows work across boundaries?
67
+
68
+ For each check, report:
69
+ - Status: passed | gap_found
70
+ - If gap: description, affected phases, severity, fix suggestion
71
+
72
+ Ensure directory exists: mkdir -p .workflow/milestones/{milestone}/
73
+ Write audit report to .workflow/milestones/{milestone}/audit-report.md
74
+ Return: summary with gap count and severity breakdown.
75
+ ",
76
+ run_in_background: false
77
+ })
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Step 5.5: CLI Supplementary Integration Scan (optional)
83
+
84
+ **Purpose:** Use external CLI tool for broad cross-phase dependency and API consistency checks that complement the agent-based integration checker.
85
+
86
+ **Skip if** no enabled CLI tools or milestone has only 1 phase.
87
+
88
+ ```
89
+ IF no CLI tools enabled OR phases.length <= 1: skip to Step 6
90
+
91
+ # Collect all modified files across execute artifacts
92
+ all_execute_paths = execute_artifacts.map(a => a.path)
93
+
94
+ Bash({
95
+ command: 'maestro delegate "PURPOSE: Cross-phase integration scan for milestone completion
96
+ TASK: Check for import/export consistency across phase boundaries | Detect shared type/interface mismatches | Identify configuration key conflicts between phases
97
+ MODE: analysis
98
+ CONTEXT: @${all_execute_paths as glob patterns}
99
+ EXPECTED: JSON { import_issues: [{ file, import_path, issue }], type_mismatches: [{ type_name, definitions: [{ file, shape }] }], config_conflicts: [{ key, values: [{ file, value }] }] }
100
+ CONSTRAINTS: Only check cross-phase boundaries | Ignore intra-phase issues
101
+ " --role analyze --mode analysis',
102
+ run_in_background: true
103
+ })
104
+ ```
105
+
106
+ **On callback:** Parse result, append to integration checker findings. Critical items surface in Step 6 verdict.
107
+
108
+ ---
109
+
110
+ ## Step 5.9: Artifact & Evidence Verification
111
+
112
+ Before proceeding to verdict:
113
+ - Verify `audit-report.md` exists at `.workflow/milestones/{milestone}/audit-report.md`. If missing: re-run Step 5.
114
+ - Every audit check result MUST cite what was examined and what was found (e.g., "Phase 1 chain complete: ANL-001 → PLN-001 → EXC-001" or "Phase 2 missing EXC artifact"). Do NOT mark checks as PASS without verifying the actual artifact exists.
115
+
116
+ ---
117
+
118
+ ## Step 6: Audit Report & Verdict
119
+
120
+ 1. Read the audit report generated by the integration checker
121
+
122
+ 2. Determine verdict:
123
+ - PASS: all phases have complete artifact chains + no critical integration gaps
124
+ - FAIL: missing execute artifacts OR critical integration gaps
125
+
126
+ 3. Display structured report:
127
+
128
+ ```
129
+ ====================================================
130
+ MILESTONE AUDIT: {milestone} ({milestone_name})
131
+ ARTIFACTS: {total_count}
132
+ ====================================================
133
+
134
+ PHASE COVERAGE:
135
+ Phase 1 ({slug}): ANL-001 → PLN-001 → EXC-001 ✓
136
+ Phase 2 ({slug}): ANL-002 → PLN-002 → EXC-002 ✓
137
+
138
+ AD-HOC TASKS:
139
+ {topic}: ANL-003 → PLN-003 → EXC-003 ✓
140
+
141
+ VERIFICATION:
142
+ VRF-001: milestone-level verify ✓ (or "not yet run")
143
+
144
+ INTEGRATION:
145
+ Shared Interfaces: {passed|N gaps}
146
+ Dependency Chains: {passed|N gaps}
147
+ Data Contracts: {passed|N gaps}
148
+
149
+ VERDICT: PASS | FAIL
150
+ ====================================================
151
+ ```
152
+
153
+ 4. Route next step:
154
+ - PASS → suggest `/maestro-milestone-complete`
155
+ - FAIL → suggest specific fix actions
@@ -0,0 +1,167 @@
1
+ # Workflow: milestone-complete
2
+
3
+ ---
4
+
5
+ ## Step 1: Validation
6
+
7
+ 1. Read `.workflow/state.json`:
8
+ - Determine target milestone (from $ARGUMENTS or current_milestone)
9
+ - If no milestone: ERROR E001
10
+ - Resolve milestone object from `milestones[]` by id
11
+ - Determine milestone type: `milestone_obj.type` (default `"standard"` if field missing)
12
+
13
+ 2. Check milestone audit status:
14
+ - Read `.workflow/milestones/{milestone}/audit-report.md` if exists
15
+ - If no audit report:
16
+ - ERROR E004: "No audit report found. Audit is a required hard contract — cannot complete without it."
17
+ - Guidance: "Run `/maestro-milestone-audit` first, then re-run this command."
18
+ - Exit (skipping audit is not permitted)
19
+ - If verdict is FAIL: ERROR E002
20
+
21
+ 3. Verify all milestone artifacts have status "completed" → ERROR E003 if any incomplete (list ids and statuses)
22
+
23
+ ---
24
+
25
+ ## Step 2: Create Milestone Archive
26
+
27
+ 1. Create archive directory:
28
+ ```
29
+ mkdir -p .workflow/milestones/{milestone}/artifacts/
30
+ ```
31
+
32
+ 2. Snapshot roadmap:
33
+ - **Standard milestone**: `cp .workflow/roadmap.md .workflow/milestones/{milestone}/roadmap-snapshot.md`
34
+ - **Adhoc milestone**: Skip roadmap snapshot (roadmap may not exist)
35
+
36
+ 3. Archive scratch directories: copy each milestone artifact's `.workflow/{artifact.path}` to `.workflow/milestones/{milestone}/artifacts/{basename}/`. After each copy:
37
+
38
+ a. If the destination contains `archive.json` with `lifecycle.status == "sealed"`:
39
+ - Set `lifecycle.status = "archived"`
40
+ - Set `lifecycle.archived_at = now`
41
+ - Set `lifecycle.linked_milestone = {milestone}` if currently null
42
+
43
+ b. If the destination contains `context-package.json`, prune it (scheme C — non-destructive):
44
+ - Read full content as `orig`
45
+ - Compute `pruned` = {
46
+ `open_questions`: items without `answer` and without `resolved_in`,
47
+ `constraints`: items where `status == "open"`,
48
+ `insights`: items beyond index 20 (keep top 20 by source order),
49
+ `references`: items whose `path` does not exist on disk (relative to session dir)
50
+ }
51
+ - If any `pruned.*` is non-empty:
52
+ - Write `{session_dir}/context-package.pruned.json` containing the dropped items
53
+ - Rewrite `context-package.json` keeping only:
54
+ `open_questions` answered/resolved, `constraints` status=locked, `insights[0..20]`, `references` whose paths exist; all other top-level fields unchanged
55
+ - Update `archive.json.pruned = { "at": now, "counts": { open_questions, constraints, insights, references }, "ref": "context-package.pruned.json" }`
56
+ - Otherwise leave both files untouched and set `archive.json.pruned = { "at": now, "counts": {...zeros}, "ref": null }`
57
+
58
+ c. If the session dir lacks `archive.json` (legacy session prior to lifecycle convention), skip (a) and (b); log W0xx "legacy session not indexed"; flag archive as [LOW CONFIDENCE] (lifecycle.indexed=false, legacy session).
59
+
60
+ ---
61
+
62
+ ## Step 2.5: Load Existing Learnings
63
+
64
+ ```
65
+ existing_learnings = maestro spec load --category coding
66
+ ```
67
+
68
+ Check existing entries to avoid duplicates when appending in Step 3.
69
+
70
+ ---
71
+
72
+ ## Step 3: Extract Learnings
73
+
74
+ 1. For each execute artifact, read `.summaries/` and `reflection-log.md` if exists:
75
+ - Extract strategy adjustments
76
+ - Extract patterns discovered
77
+ - Extract pitfalls encountered
78
+
79
+ 2. Aggregate learnings and append to `.workflow/specs/learnings.md` using `<spec-entry>` closed-tag format. Each entry (strategy adjustment, pattern, or pitfall) follows this template:
80
+ ```
81
+ <spec-entry category="learning" keywords="{auto-extracted}" date="{YYYY-MM-DD}" source="milestone-complete">
82
+
83
+ ### {summary}
84
+
85
+ {content}
86
+ Milestone: {milestone}
87
+
88
+ </spec-entry>
89
+ ```
90
+
91
+ **Keyword extraction**: Extract 3-5 domain-specific terms from the content (same rules as `spec-add`).
92
+
93
+ ---
94
+
95
+ ## Step 4: Update State
96
+
97
+ 1. Archive artifact entries to milestone_history:
98
+ ```json
99
+ {
100
+ "milestone_history": [
101
+ {
102
+ "id": "{milestone}",
103
+ "name": "{milestone_name}",
104
+ "status": "completed",
105
+ "completed_at": "{now}",
106
+ "archive_path": "milestones/{milestone}/",
107
+ "archived_artifacts": [ ...all milestone artifacts entries... ]
108
+ }
109
+ ]
110
+ }
111
+ ```
112
+
113
+ 2. Clear artifacts array: remove all entries where `milestone == target_milestone`
114
+
115
+ 3. Advance to next milestone:
116
+ - **Standard milestone**: activate first pending milestone → set as `current_milestone`. If none pending → set `current_milestone = null`, `status = "completed"`
117
+ - **Adhoc milestone**: Do NOT search for next milestone. Set `current_milestone = null`, `status = "idle"` (adhoc milestones are self-contained, no successor)
118
+
119
+ 4. Write state.json (atomic)
120
+
121
+ ---
122
+
123
+ ## Step 5: Clean Scratch
124
+
125
+ Remove archived scratch directories: delete `.workflow/{artifact.path}` for each archived artifact.
126
+
127
+ ---
128
+
129
+ ## Step 6: Generate Summary
130
+
131
+ Write `.workflow/milestones/{milestone}/summary.md`:
132
+ ```markdown
133
+ # Milestone: {milestone} — {name}
134
+
135
+ **Completed**: {date}
136
+ **Artifacts**: {count} (analyze: {n}, plan: {n}, execute: {n}, verify: {n})
137
+
138
+ ## Key Outcomes
139
+ {extracted from audit report + learnings}
140
+
141
+ ## Learnings
142
+ {top patterns and pitfalls}
143
+
144
+ ## Next Milestone
145
+ {next milestone name and first phase, or "Project complete"}
146
+ ```
147
+
148
+ Update `.workflow/project.md` Context section with milestone summary.
149
+
150
+ ---
151
+
152
+ ## Step 7: Report
153
+
154
+ ```
155
+ === MILESTONE COMPLETE ===
156
+ Milestone: {milestone} ({name})
157
+ Artifacts: {count} archived
158
+ Learnings: {learnings_count} extracted
159
+
160
+ Archive: .workflow/milestones/{milestone}/
161
+ Next: {next_milestone or "Project complete" or "Ad-hoc task complete"}
162
+
163
+ Next steps:
164
+ /maestro-milestone-release -- Cut a release
165
+ /maestro-analyze -- Start next milestone (standard only)
166
+ /manage-status -- View project state
167
+ ```
@@ -0,0 +1,82 @@
1
+ # Workflow: milestone-release
2
+
3
+ Bump version, generate changelog, and tag the current milestone for release.
4
+
5
+ > **STATUS: PLACEHOLDER** — minimal skeleton referenced by `maestro-milestone-release.md`.
6
+ > Full release pipeline is TODO. Do not invoke until contents below are fleshed out.
7
+
8
+ ---
9
+
10
+ ## Arguments
11
+
12
+ | Flag | Description | Default |
13
+ |------|-------------|---------|
14
+ | `<milestone>` | Milestone id from `.workflow/state.json` `milestones[]` | current_milestone |
15
+ | `--bump <level>` | Semver bump: `major` \| `minor` \| `patch` | `minor` |
16
+ | `--dry-run` | Preview changes without writing | `false` |
17
+
18
+ ---
19
+
20
+ ## Step 1: Validation
21
+
22
+ 1. Read `.workflow/state.json`:
23
+ - Determine target milestone (from `$ARGUMENTS` or `current_milestone`).
24
+ - If no milestone: ERROR E001.
25
+ 2. Verify milestone is **completed**:
26
+ - Read `.workflow/milestones/{milestone}/audit-report.md` — verdict must be `PASS`.
27
+ - If missing or non-PASS: ERROR E002 with guidance to run `/maestro-milestone-complete` first.
28
+ 3. Read package manifest (`package.json` / `pyproject.toml` / etc.) — locate current version. TODO: multi-manifest detection.
29
+
30
+ ---
31
+
32
+ ## Step 2: Version Bump
33
+
34
+ 1. Compute next version from `--bump` level (semver). TODO: prerelease/build metadata handling.
35
+ 2. Update manifest file in place. If `--dry-run`: print diff and exit.
36
+
37
+ ---
38
+
39
+ ## Step 3: Changelog Generation
40
+
41
+ 1. Read milestone audit report + retrospective insights (`.workflow/milestones/{milestone}/`).
42
+ 2. Render `CHANGELOG.md` entry — header `## [vX.Y.Z] - YYYY-MM-DD`, body grouped by `Added / Changed / Fixed / Removed`.
43
+ 3. TODO: integrate with `quality-retrospective` output for richer narrative.
44
+
45
+ ---
46
+
47
+ ## Step 4: Tag and Commit
48
+
49
+ 1. Stage updated manifest + `CHANGELOG.md`.
50
+ 2. Commit: `chore(release): vX.Y.Z — {milestone}`.
51
+ 3. Create annotated git tag `vX.Y.Z`.
52
+ 4. TODO: optionally push tag (`--push` flag).
53
+
54
+ ---
55
+
56
+ ## Outputs
57
+
58
+ | Artifact | Status |
59
+ |----------|--------|
60
+ | Updated manifest version | written |
61
+ | `CHANGELOG.md` entry | appended |
62
+ | Git tag `vX.Y.Z` | created locally (not pushed) |
63
+
64
+ ---
65
+
66
+ ## Error Codes
67
+
68
+ | Code | Meaning |
69
+ |------|---------|
70
+ | E001 | No milestone resolvable |
71
+ | E002 | Milestone not completed / audit not PASS |
72
+ | E003 | Manifest file not found |
73
+ | E004 | Git working tree dirty (uncommitted changes block tagging) |
74
+
75
+ ---
76
+
77
+ ## TODO (placeholder gaps)
78
+
79
+ - Multi-package monorepo support.
80
+ - Push tag + GitHub release integration.
81
+ - Roll-back path on failed tag.
82
+ - Wire to `manage-knowhow-capture` for release-note capture.