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,215 @@
1
+ # Workflow: Issue Gaps Analysis
2
+
3
+ > **CLI variants**: see `issue-gaps-analyze.codex.md` for codex-specific notes (CSV-wave variant using `spawn_agents_on_csv`).
4
+
5
+ Root cause analysis for issues using CLI exploration and codebase context gathering.
6
+ Supports single issue (ISS-ID) or batch (all open/registered) with classification and parallel analysis.
7
+ Produces analysis records in issues.jsonl and context.md for downstream `plan --gaps`.
8
+
9
+ **Invoked by**: `maestro-analyze --gaps [ISS-ID]`
10
+
11
+ ## Input
12
+
13
+ - `ISS-ID` (optional): Specific issue to analyze. If omitted, analyze all open/registered issues.
14
+ - `TOOL`: CLI tool for exploration (default: gemini)
15
+ - `DEPTH`: `standard` or `deep` (default: standard)
16
+
17
+ ## Pipeline
18
+
19
+ ```
20
+ Load Issues → Classify & Group → Parallel Analysis (per group) → Write issue.analysis → Output context.md
21
+ ```
22
+
23
+ ---
24
+
25
+ ### Step 1: Load Issues
26
+
27
+ ```
28
+ If ISS-ID provided:
29
+ Load single issue from .workflow/issues/issues.jsonl
30
+ → fatal if file missing or ID not found (E_ISSUE_NOT_FOUND)
31
+ → skip Step 2 (classification), go directly to Step 3
32
+
33
+ If no ISS-ID:
34
+ Load all issues where status == "open" || status == "registered"
35
+ → fatal if none found (E_NO_ISSUES)
36
+
37
+ Validate: at least 1 issue loaded.
38
+ ```
39
+
40
+ ---
41
+
42
+ ### Step 2: Classify & Group (batch mode only)
43
+
44
+ ```
45
+ Group loaded issues by overlap in affected area:
46
+
47
+ Classification dimensions:
48
+ - location: file path prefix (e.g. src/auth/, src/api/)
49
+ - component: affected_components field overlap
50
+ - category: issue.category or severity level
51
+
52
+ Grouping rules:
53
+ 1. Same location prefix (first 2 path segments) → same group
54
+ 2. Shared affected_components → same group
55
+ 3. Remaining ungrouped → individual groups (1 issue each)
56
+
57
+ Output: GROUPS[] where each group = { group_id, label, issues[], shared_context_keywords[] }
58
+
59
+ Display group breakdown to user (skip if AUTO_YES).
60
+ ```
61
+
62
+ ---
63
+
64
+ ### Step 3: Gather Codebase Context (per group)
65
+
66
+ ```
67
+ For each group:
68
+ Merge keywords from all issues in group: title, description, location, affected_components.
69
+ Deduplicate keywords.
70
+
71
+ Standard depth: maestro explore per group (keywords as prompt), fallback grep; flag analysis as [LOW CONFIDENCE] (grep fallback, semantic depth lost).
72
+ Deep depth: maestro explore multi-prompt + semantic Agent search (error handling,
73
+ data flow, deps), merge results.
74
+
75
+ Build GROUP_CONTEXT: related files, key snippets (max 50 lines), dependency chain.
76
+ Shared context benefits co-located issues — avoids redundant exploration.
77
+ ```
78
+
79
+ ---
80
+
81
+ ### Step 4: Run Analysis (per group, parallel across groups)
82
+
83
+ ```
84
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Launch analysis for each group in parallel using Agent tool:
85
+
86
+ Agent({
87
+ subagent_type: "general-purpose",
88
+ prompt: "Root cause analysis for issues in group [{group.label}]:
89
+ {for each issue in group}
90
+ ISS-{id}: {title} — {description}, severity: {severity}, location: {location}
91
+ {end}
92
+ CODEBASE CONTEXT: {GROUP_CONTEXT}
93
+ TASK: For EACH issue — identify root cause (file:line) → assess impact → list related files → rate confidence → suggest fix direction. Note cross-issue relationships within this group.
94
+ EXPECTED: JSON array [{ iss_id, root_cause, impact, related_files[], confidence, suggested_approach, cross_refs[] }]
95
+ CONSTRAINTS: Evidence-only, no speculation. Use Read/Grep to verify before concluding."
96
+ })
97
+
98
+ Alternatively, attempt CLI delegate first per group:
99
+
100
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: maestro delegate "<same prompt>" --role analyze --mode analysis
101
+
102
+ If delegate fails (timeout, unavailable, parse error):
103
+ Fall back to Agent tool with same prompt; set analysis confidence=low and flag as [LOW CONFIDENCE] (delegate failed).
104
+ Record fallback in analysis metadata: { tool: "agent-fallback", reason: "<error>" }
105
+
106
+ Validate response per issue: all required fields present.
107
+ Parse failure → save raw output to issue feedback for review.
108
+ ```
109
+
110
+ ---
111
+
112
+ ### Step 5: Build Analysis Record (per issue)
113
+
114
+ ```
115
+ For each issue from Step 4 results:
116
+
117
+ Construct IssueAnalysis:
118
+ {
119
+ root_cause,
120
+ affected_files: related_files,
121
+ impact_scope: impact,
122
+ fix_direction: suggested_approach,
123
+ confidence,
124
+ cross_refs: [ISS-IDs of related issues in same group],
125
+ analyzed_at: NOW_ISO,
126
+ tool: TOOL or "agent-fallback",
127
+ depth: DEPTH
128
+ }
129
+ ```
130
+
131
+ ---
132
+
133
+ ### Step 6: Update Issues in JSONL
134
+
135
+ ```
136
+ Read-modify-write issues.jsonl (single pass for all analyzed issues):
137
+ For each issue:
138
+ Set issue.analysis = ANALYSIS, updated_at = NOW_ISO
139
+ Append issue.history: { action: "analyzed", at: NOW_ISO, by: "maestro-analyze --gaps" }
140
+ Status unchanged (analysis is metadata enrichment).
141
+ Verify: re-read file, confirm analysis field present for all updated issues.
142
+ ```
143
+
144
+ ---
145
+
146
+ ### Step 7: Output context.md
147
+
148
+ ```
149
+ Aggregate all analyzed issues into context.md, organized by group:
150
+
151
+ # Context: Issue Gaps Analysis
152
+
153
+ **Date**: {date}
154
+ **Issues analyzed**: {count}
155
+ **Groups**: {group_count}
156
+
157
+ ## Group: {group.label}
158
+
159
+ ### ISS-{id}: {title}
160
+ - **Root cause**: {root_cause}
161
+ - **Affected files**: {affected_files}
162
+ - **Impact scope**: {impact_scope}
163
+ - **Fix direction**: {fix_direction}
164
+ - **Confidence**: {confidence}
165
+ - **Cross-refs**: {related ISS-IDs}
166
+
167
+ (repeat per issue, per group)
168
+
169
+ ## Cross-Group Dependencies
170
+ {issues that span multiple groups or share root causes}
171
+
172
+ ## Constraints
173
+
174
+ ### Locked
175
+ {constraints derived from root cause evidence}
176
+
177
+ ### Free
178
+ {implementation choices left to planner}
179
+
180
+ Write context.md to session output directory.
181
+ ```
182
+
183
+ ---
184
+
185
+ ### Step 8: Display Summary and Next Steps
186
+
187
+ ```
188
+ Display: group breakdown, per-issue root cause, confidence, cross-refs.
189
+
190
+ Next steps:
191
+ - maestro-plan --gaps (plan fix tasks linked to analyzed issues)
192
+ - maestro-analyze --gaps {ISS-ID} (re-analyze specific issue with deeper context)
193
+ - manage-issue list (review all issues)
194
+ ```
195
+
196
+ ---
197
+
198
+ ## Output
199
+
200
+ - **Updated**: `.workflow/issues/issues.jsonl` -- issue records enriched with `analysis` field
201
+ - **Created**: `context.md` -- aggregated root causes grouped for downstream `plan --gaps`
202
+ - **Analysis fields**: root_cause, affected_files, impact_scope, fix_direction, confidence, cross_refs, analyzed_at, tool, depth
203
+
204
+ ## Quality Criteria
205
+
206
+ - Issues classified by location/component overlap before analysis
207
+ - Groups analyzed in parallel (Agent or delegate per group)
208
+ - CLI delegate attempted first; Agent fallback on failure
209
+ - Analysis grounded in actual codebase evidence (file:line references)
210
+ - Cross-issue relationships captured within groups (cross_refs)
211
+ - JSON result validated before writing to JSONL
212
+ - Issue status unchanged (analysis is non-destructive enrichment)
213
+ - Single-pass read-modify-write preserves JSONL integrity
214
+ - context.md organized by group with cross-group dependencies
215
+ - Next-step routing guides to plan --gaps
@@ -0,0 +1,110 @@
1
+ # Workflow: Issue Planning
2
+
3
+ > **DEPRECATED**: This workflow was used by the deleted `manage-issue-plan` command.
4
+ > Use `maestro-plan --gaps` instead, which generates TASK files linked to issues via `task_refs`.
5
+
6
+ Solution planning for a specific issue with codebase-aware step generation and prompt template construction.
7
+
8
+ ## Input
9
+
10
+ - `$ARGUMENTS`: `<ISS-ID> [--tool gemini|qwen] [--from-analysis]`
11
+ - Operates on `.workflow/issues/`
12
+
13
+ ---
14
+
15
+ ### Step 1: Parse Arguments
16
+
17
+ ```
18
+ Extract ISS-ID (required, pattern ISS-\d{8}-\d{3}).
19
+ Flags: --tool gemini|qwen (default: gemini), --from-analysis (default: auto-detect)
20
+ ```
21
+
22
+ ---
23
+
24
+ ### Step 2: Load Issue and Validate
25
+
26
+ ```
27
+ Load ISS-ID from .workflow/issues/issues.jsonl → fatal if file missing or ID not found.
28
+ Status check: open/registered → proceed; other → warn but continue (non-destructive).
29
+ If solution already exists → confirm overwrite with user (abort if declined).
30
+ ```
31
+
32
+ ---
33
+
34
+ ### Step 3: Load Analysis Context
35
+
36
+ ```
37
+ If ISSUE.analysis exists → build ANALYSIS_CONTEXT from root_cause, impact,
38
+ related_files, confidence, suggested_approach.
39
+ If null and --from-analysis explicit → warn (suggest running analyze first).
40
+ Otherwise ANALYSIS_CONTEXT = "" (proceed without).
41
+ ```
42
+
43
+ ---
44
+
45
+ ### Step 4: Generate Solution via CLI
46
+
47
+ ```
48
+ Delegate planning prompt with issue details + ANALYSIS_CONTEXT:
49
+
50
+ MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: maestro delegate "Generate step-by-step solution for {ISS-ID}: {ISSUE.title}
51
+ ISSUE: title, description, severity, location, fix_direction
52
+ {ANALYSIS_CONTEXT}
53
+ TASK: Break into atomic steps with action types (create|modify|delete|test)
54
+ EXPECTED: JSON { steps: [{ title, description, files[], action }], context, promptTemplate }
55
+ CONSTRAINTS: Concrete, file-specific steps
56
+ " --to {TOOL} --mode analysis
57
+
58
+ Validate response: steps[] non-empty, each with title/description/files/action.
59
+ Parse failure → save raw output to issue feedback for review.
60
+ ```
61
+
62
+ ---
63
+
64
+ ### Step 5: Build Solution Record
65
+
66
+ ```
67
+ Construct IssueSolution:
68
+ { steps, context, promptTemplate, planned_at: NOW_ISO, planned_by: TOOL }
69
+ ```
70
+
71
+ ---
72
+
73
+ ### Step 6: Update Issue in JSONL
74
+
75
+ ```
76
+ Read-modify-write issues.jsonl:
77
+ Set issue.solution = SOLUTION, updated_at = NOW_ISO
78
+ Append issue_history: actor "planning-agent", note "{N} steps generated"
79
+ Status unchanged (planning is metadata enrichment).
80
+ Verify: re-read file, confirm solution field present.
81
+ ```
82
+
83
+ ---
84
+
85
+ ### Step 7: Display Solution Steps Table and Next Steps
86
+
87
+ ```
88
+ Display: approach summary, steps table (# | action | title | files), prompt template.
89
+
90
+ Next steps:
91
+ - manage-issue-execute {ISS-ID} (execute | --dry-run | --executor codex)
92
+ - manage-issue status {ISS-ID}
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Output
98
+
99
+ - **Updated**: `.workflow/issues/issues.jsonl` -- issue record enriched with `solution` field
100
+ - **Solution fields**: steps[], context, promptTemplate, planned_at, planned_by
101
+
102
+ ## Quality Criteria
103
+
104
+ - Solution steps are concrete with specific file targets and action types
105
+ - Analysis context included when available for better accuracy
106
+ - Prompt template is self-contained and executable by an agent
107
+ - JSON result validated before writing to JSONL
108
+ - Issue status unchanged (planning is non-destructive enrichment)
109
+ - Read-modify-write pattern preserves other issues in JSONL
110
+ - Next-step routing guides user to execution
@@ -0,0 +1,338 @@
1
+ # Workflow: Issue Management
2
+
3
+ CRUD operations and lifecycle management for project issues.
4
+
5
+ ## Input
6
+
7
+ - `$ARGUMENTS`: subcommand + options
8
+ - Operates on `.workflow/issues/`
9
+
10
+ ---
11
+
12
+ ### Step 1: Parse Subcommand
13
+
14
+ ```
15
+ Extract SUBCOMMAND (first token) and ARGS (remaining) from $ARGUMENTS.
16
+ Valid: create | list | status | update | close | link
17
+ Missing/invalid → error with usage: /manage-issue <create|list|status|update|close|link> [options]
18
+ ```
19
+
20
+ ---
21
+
22
+ ### Step 2: Validate Issues Directory
23
+
24
+ ```
25
+ Require .workflow/ exists → fatal if missing: "No project initialized. Run /maestro-init first."
26
+ Auto-create if missing: .workflow/issues/, issues.jsonl, issue-history.jsonl
27
+ ```
28
+
29
+ ---
30
+
31
+ ### Step 3: Route to Subcommand Handler
32
+
33
+ ```
34
+ Route: create→Step 4, list→Step 5, status→Step 6, update→Step 7, close→Step 8, link→Step 9
35
+ ```
36
+
37
+ ---
38
+
39
+ ### Step 4: Create Issue
40
+
41
+ Parse options from ARGS:
42
+
43
+ ```
44
+ Options:
45
+ --title TEXT Issue title (required)
46
+ --severity VALUE critical|high|medium|low (default: medium)
47
+ --source VALUE planned|supplement|bug|review|verification|discovery|manual (default: manual)
48
+ --phase VALUE Phase reference, e.g. "01-auth" (optional)
49
+ --milestone VALUE Milestone reference, e.g. "MVP" (optional, auto-derived from state.json if omitted)
50
+ --description TEXT Detailed description (optional, prompted if missing)
51
+ --priority NUMBER 1-5, lower is higher priority (default: 3)
52
+ --tags TAG1,TAG2 Comma-separated tags (optional)
53
+
54
+ If --title is missing:
55
+ AskUserQuestion({ question: "What is the issue title?" })
56
+
57
+ Derive milestone_ref if not provided:
58
+ IF --milestone not provided AND file_exists(".workflow/state.json"):
59
+ milestone_ref = state.json.current_milestone
60
+ ELSE:
61
+ milestone_ref = --milestone value or null
62
+ ```
63
+
64
+ Generate issue ID:
65
+
66
+ ```
67
+ ID = ISS-{YYYYMMDD}-{NNN} where NNN = next available 3-digit sequence for today
68
+ Scan both issues.jsonl and issue-history.jsonl to avoid collisions.
69
+ ```
70
+
71
+ Build issue record from template:
72
+
73
+ ```json
74
+ {
75
+ "id": "{ID}",
76
+ "title": "{TITLE}",
77
+ "status": "open",
78
+ "priority": {PRIORITY},
79
+ "severity": "{SEVERITY}",
80
+ "source": "{SOURCE}",
81
+ "milestone_ref": "{MILESTONE_REF or null}",
82
+ "phase_ref": "{PHASE_REF or null}",
83
+ "gap_ref": null,
84
+ "description": "{DESCRIPTION}",
85
+ "fix_direction": "",
86
+ "context": {
87
+ "location": "",
88
+ "suggested_fix": "",
89
+ "notes": ""
90
+ },
91
+ "tags": ["{TAGS}"],
92
+ "affected_components": [],
93
+ "feedback": [],
94
+ "issue_history": [
95
+ {
96
+ "timestamp": "{NOW_ISO}",
97
+ "from_status": null,
98
+ "to_status": "open",
99
+ "actor": "user",
100
+ "note": "Issue created"
101
+ }
102
+ ],
103
+ "created_at": "{NOW_ISO}",
104
+ "updated_at": "{NOW_ISO}",
105
+ "resolved_at": null,
106
+ "resolution": null
107
+ }
108
+ ```
109
+
110
+ Write to storage:
111
+
112
+ ```
113
+ Append record as single JSONL line to .workflow/issues/issues.jsonl.
114
+ Display confirmation: ID, title, status, severity.
115
+ ```
116
+
117
+ Ask for supplementary information:
118
+
119
+ ```
120
+ Prompt user for supplementary context (background, repro steps, related issues, notes).
121
+ If provided → append supplement entry {content, stage:"post_creation", author:"user", created_at} to issue record.
122
+ If empty → skip.
123
+ ```
124
+
125
+ Cross-milestone conflict check (for supplement issues):
126
+
127
+ ```
128
+ IF source == "supplement" AND milestone_ref set:
129
+ Scan other milestones' plan.json for files_to_create[] that overlap with affected_components.
130
+ If overlap found → warn about cross-milestone conflict, suggest minimal fix vs deferral.
131
+ ```
132
+
133
+ Suggest next steps:
134
+
135
+ ```
136
+ Suggest: status {ID}, link {ID} --task TASK-NNN, list
137
+ ```
138
+
139
+ ---
140
+
141
+ ### Step 5: List Issues
142
+
143
+ Parse filter options from ARGS:
144
+
145
+ ```
146
+ Options:
147
+ --status VALUE Filter by status (open|in_progress|completed|failed|deferred)
148
+ --phase VALUE Filter by phase_ref
149
+ --milestone VALUE Filter by milestone_ref
150
+ --severity VALUE Filter by severity (critical|high|medium|low)
151
+ --source VALUE Filter by source
152
+ --all Include closed issues from issue-history.jsonl
153
+ ```
154
+
155
+ Read and filter:
156
+
157
+ ```
158
+ Read issues.jsonl (+ issue-history.jsonl if --all).
159
+ Apply matching filters: status, phase_ref (contains), severity, milestone_ref, source.
160
+ Sort by priority (ascending), then severity (critical > high > medium > low).
161
+ ```
162
+
163
+ Display tabular output:
164
+
165
+ ```
166
+ ISSUES ({count} found):
167
+ ---------------------------------------------------------------
168
+ ID | Status | Sev | Pri | Title
169
+ ---------------------------------------------------------------
170
+ ISS-20260315-001 | open | high | 2 | Refresh token rotation
171
+ ISS-20260315-002 | in_progress | medium | 3 | Missing input validation
172
+ ---------------------------------------------------------------
173
+
174
+ Filters applied: {list of active filters or "none"}
175
+ ```
176
+
177
+ If no issues found:
178
+
179
+ ```
180
+ No issues found{with applied filters}.
181
+
182
+ Create one: Skill({ skill: "manage-issue", args: "create --title \"...\"" })
183
+ Discover issues: Skill({ skill: "manage-issue-discover" })
184
+ ```
185
+
186
+ ---
187
+
188
+ ### Step 6: Show Issue Status
189
+
190
+ Parse issue ID from ARGS:
191
+
192
+ ```
193
+ Extract ISS-XXXXXXXX-NNN from ARGS (prompt if missing).
194
+ Lookup in issues.jsonl, fallback to issue-history.jsonl → error if not found.
195
+ ```
196
+
197
+ Display full detail view:
198
+
199
+ ```
200
+ ====================================================
201
+ ISSUE: {id}
202
+ TITLE: {title}
203
+ STATUS: {status} SEVERITY: {severity} PRIORITY: {priority}
204
+ ====================================================
205
+
206
+ SOURCE: {source}
207
+ PHASE: {phase_ref or "none"}
208
+ GAP REF: {gap_ref or "none"}
209
+ CREATED: {created_at}
210
+ UPDATED: {updated_at}
211
+ RESOLVED: {resolved_at or "pending"}
212
+
213
+ DESCRIPTION:
214
+ {description}
215
+
216
+ FIX DIRECTION:
217
+ {fix_direction or "not specified"}
218
+
219
+ CONTEXT:
220
+ Location: {context.location or "not specified"}
221
+ Suggested Fix: {context.suggested_fix or "none"}
222
+ Notes: {context.notes or "none"}
223
+
224
+ TAGS: {tags joined by ", " or "none"}
225
+ AFFECTED: {affected_components joined by ", " or "none"}
226
+
227
+ HISTORY:
228
+ {for each entry in issue_history}
229
+ [{timestamp}] {from_status} -> {to_status} ({actor}): {note}
230
+ {/for}
231
+
232
+ FEEDBACK:
233
+ {for each entry in feedback}
234
+ [{timestamp}] ({type}): {content}
235
+ {/for}
236
+ {or "none"}
237
+
238
+ RESOLUTION:
239
+ {resolution or "not resolved"}
240
+ ====================================================
241
+ ```
242
+
243
+ Suggest next steps based on status:
244
+
245
+ ```
246
+ open → suggest: update --status in_progress, link --task
247
+ in_progress → suggest: close --resolution, update --status deferred
248
+ completed/failed/deferred → "This issue is archived."
249
+ ```
250
+
251
+ ---
252
+
253
+ ### Step 7: Update Issue
254
+
255
+ Parse issue ID and field updates from ARGS:
256
+
257
+ ```
258
+ Options:
259
+ ISS-XXXXXXXX-NNN Issue ID (required, first positional arg)
260
+ --status VALUE New status (open|in_progress)
261
+ --priority NUMBER New priority (1-5)
262
+ --severity VALUE New severity (critical|high|medium|low)
263
+ --tags TAG1,TAG2 Replace tags
264
+ --add-tag TAG Add a tag
265
+ --phase VALUE Set phase_ref
266
+ --milestone VALUE Set milestone_ref
267
+ --fix-direction TEXT Set fix_direction
268
+ --description TEXT Update description
269
+ --note TEXT Add feedback entry (type=clarification)
270
+ ```
271
+
272
+ Process update:
273
+
274
+ ```
275
+ Find record by ID in issues.jsonl → error if not found.
276
+ Apply each provided option to the corresponding field.
277
+ If --status changed → append issue_history entry {timestamp, from_status, to_status, actor:"user"}.
278
+ If --note provided → append feedback entry {timestamp, type:"clarification", content}.
279
+ Set updated_at, rewrite issues.jsonl, display changed fields.
280
+ ```
281
+
282
+ ---
283
+
284
+ ### Step 8: Close Issue
285
+
286
+ Parse issue ID and resolution from ARGS:
287
+
288
+ ```
289
+ Options:
290
+ ISS-XXXXXXXX-NNN Issue ID (required)
291
+ --resolution TEXT Resolution description (required)
292
+ --status VALUE Final status: completed|failed|deferred (default: completed)
293
+ ```
294
+
295
+ Process close:
296
+
297
+ ```
298
+ Find record by ID in issues.jsonl → error if not found.
299
+ Prompt for --resolution if missing.
300
+ Set status (default "completed"), resolved_at, resolution; append issue_history entry.
301
+ Move record from issues.jsonl → issue-history.jsonl.
302
+ Display: ID, final status, resolution.
303
+ ```
304
+
305
+ ---
306
+
307
+ ### Step 9: Link Issue to Task
308
+
309
+ Parse issue ID and task reference from ARGS:
310
+
311
+ ```
312
+ Options:
313
+ ISS-XXXXXXXX-NNN Issue ID (required)
314
+ --task TASK-NNN Task ID to link (required)
315
+ ```
316
+
317
+ Process bidirectional link:
318
+
319
+ ```
320
+ Find issue by ID in issues.jsonl → error if not found.
321
+ Locate task file via artifact registry (.workflow/{path}/.task/{TASK_ID}.json)
322
+ or scratch fallback (.workflow/scratch/*/.task/{TASK_ID}.json) → error if not found.
323
+
324
+ Update issue: set gap_ref (if null), add TASK_ID to affected_components, append issue_history entry.
325
+ Update task: append issue ID to "issue_refs" field.
326
+
327
+ Display: linked pair, issue title, task path.
328
+ Suggest: status {ISSUE_ID}, update --status in_progress.
329
+ ```
330
+
331
+ ---
332
+
333
+ ## Output
334
+
335
+ - **Storage**: `.workflow/issues/issues.jsonl` (active), `.workflow/issues/issue-history.jsonl` (closed)
336
+ - **Format**: One JSON object per line (JSONL), append-friendly
337
+ - **ID scheme**: `ISS-YYYYMMDD-NNN` (NNN auto-incremented per day)
338
+