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,104 @@
1
+ # Spec Remove Workflow
2
+
3
+ Remove a `<spec-entry>` block from a specs container file. Symmetric with `specs-add.md`.
4
+
5
+ Uses `maestro wiki remove-entry` for atomic removal — the entry is deleted from the markdown file and the unified wiki index is auto-updated by WikiIndexer.
6
+
7
+ ---
8
+
9
+ ## Prerequisites
10
+
11
+ - `.workflow/specs/` initialized (at least one specs file exists)
12
+ - `maestro wiki` CLI available
13
+ - Entry ID known (use `maestro wiki list --type spec` to discover)
14
+
15
+ ---
16
+
17
+ ## Argument Shape
18
+
19
+ ```
20
+ /spec-remove spec-learnings-003 → remove entry 003 from learnings.md
21
+ /spec-remove spec-coding-conventions-001 → remove entry 001 from coding-conventions.md
22
+ /spec-remove spec-quality-rules-005 -y → remove without confirmation
23
+ ```
24
+
25
+ | Flag | Effect |
26
+ |------|--------|
27
+ | `<entry-id>` | Required. The spec sub-node ID to remove |
28
+ | `-y` / `--yes` | Skip confirmation prompt |
29
+
30
+ ---
31
+
32
+ ## Stage 1: Parse Input
33
+
34
+ 1. Extract entry ID from arguments
35
+ 2. Validate non-empty (E001 if missing)
36
+ 3. Check `.workflow/specs/` exists (E002 if not)
37
+
38
+ ---
39
+
40
+ ## Stage 2: Lookup Entry
41
+
42
+ 1. Run `maestro wiki get <entry-id> --json` to fetch entry metadata
43
+ 2. Validate entry exists (E003 if not found)
44
+ 3. Validate entry is a spec sub-node — must have:
45
+ - `type` = "spec"
46
+ - `parent` field set (sub-nodes have parent pointing to container)
47
+ - If not a sub-node, error E004
48
+ 4. Extract: title, category, keywords, container file path, body preview
49
+
50
+ ---
51
+
52
+ ## Stage 3: Confirm Removal
53
+
54
+ Display entry details for user confirmation:
55
+
56
+ ```
57
+ == Spec Entry to Remove ==
58
+ ID: {entry-id}
59
+ Title: {title}
60
+ Category: {category}
61
+ Keywords: {keywords}
62
+ Container: .workflow/specs/{filename}
63
+ Preview: {first 80 chars of body}
64
+
65
+ Remove this entry? [y/N]
66
+ ```
67
+
68
+ If `-y` flag: skip confirmation.
69
+ If user declines: abort with "Cancelled."
70
+
71
+ ---
72
+
73
+ ## Stage 4: Remove Entry
74
+
75
+ Execute removal via wiki CLI:
76
+
77
+ ```bash
78
+ maestro wiki remove-entry <entry-id>
79
+ ```
80
+
81
+ This command:
82
+ 1. Reads the container file
83
+ 2. Locates the `<spec-entry>` block by index position
84
+ 3. Removes the block (including opening tag, body, closing tag)
85
+ 4. Writes the updated file
86
+ 5. WikiIndexer auto-updates `.workflow/wiki-index.json`
87
+
88
+ ---
89
+
90
+ ## Stage 5: Verify & Report
91
+
92
+ 1. Verify entry no longer appears: `maestro wiki get <entry-id>` should return not-found
93
+ 2. Display confirmation:
94
+
95
+ ```
96
+ == Entry Removed ==
97
+ ID: {entry-id}
98
+ From: .workflow/specs/{filename}
99
+ Remaining: {remaining entry count} entries in {filename}
100
+
101
+ To verify: maestro wiki list --type spec --category {category}
102
+ To re-add: /spec-add {category} {content}
103
+ ```
104
+
@@ -0,0 +1,316 @@
1
+ ---
2
+ name: spec-setup
3
+ alias: spec-setup
4
+ ---
5
+
6
+ # Workflow: spec-setup
7
+
8
+ System specs initialization -- scan project structure, detect tech stack, generate convention files.
9
+
10
+ ## Trigger
11
+
12
+ - First `/maestro-init` (automatic)
13
+ - Manual `/spec-setup`
14
+
15
+ ## Prerequisites
16
+
17
+ - Project root must exist
18
+ - `.workflow/` directory should exist (create if missing)
19
+
20
+ ## Execution Steps
21
+
22
+ ### Step 1: Ensure Directory Structure
23
+
24
+ Ensure `.workflow/` and `.workflow/specs/` exist (create if missing).
25
+
26
+ ### Step 2: Scan Project Structure
27
+
28
+ Scan project root for tech stack indicators:
29
+
30
+ ```
31
+ Manifest files → runtime: package.json (Node), tsconfig.json (TS), pyproject.toml/requirements.txt (Python),
32
+ go.mod (Go), Cargo.toml (Rust), pom.xml (Maven), build.gradle (Gradle), composer.json (PHP),
33
+ Gemfile (Ruby), .csproj/.sln (.NET), Dockerfile/docker-compose.yml (containers)
34
+
35
+ Dependency analysis → frameworks: react/next, vue, angular, express/fastify, django/flask, gin/echo, spring
36
+ ```
37
+
38
+ ### Step 3: Detect Code Patterns
39
+
40
+ Scan source files for coding conventions:
41
+
42
+ ```
43
+ Detect from first 20 source files: indentation style, naming conventions (camelCase/PascalCase/snake_case),
44
+ import style (named/default, aliases, barrels), formatter configs (.prettierrc, .editorconfig, eslint),
45
+ file naming pattern (kebab/camel/Pascal)
46
+ ```
47
+
48
+ ### Step 4: Generate Core Files (always created)
49
+
50
+ #### 4a: coding-conventions.md
51
+
52
+ Output: `.workflow/specs/coding-conventions.md`
53
+
54
+ ```markdown
55
+ ---
56
+ title: "Coding Conventions"
57
+ category: coding
58
+ ---
59
+ # Coding Conventions
60
+
61
+ Auto-generated from project analysis. Update manually as patterns evolve.
62
+
63
+ ## Formatting
64
+ - Indentation: {detected}
65
+ - Line length: {detected or "not configured"}
66
+ - Trailing commas: {detected}
67
+ - Semicolons: {detected}
68
+
69
+ ## Naming
70
+ - Variables/functions: {camelCase | snake_case}
71
+ - Classes/types: {PascalCase}
72
+ - Constants: {UPPER_SNAKE_CASE | camelCase}
73
+ - Files: {kebab-case | camelCase | PascalCase}
74
+
75
+ ## Imports
76
+ - Style: {named imports | default imports | mixed}
77
+ - Path aliases: {@ | ~ | none}
78
+ - Order: {built-in, external, internal, relative}
79
+
80
+ ## Patterns
81
+ {list detected patterns from codebase analysis}
82
+
83
+ ## Entries
84
+ {empty section for spec-add entries}
85
+ ```
86
+
87
+ #### 4b: architecture-constraints.md
88
+
89
+ Output: `.workflow/specs/architecture-constraints.md`
90
+
91
+ ```markdown
92
+ ---
93
+ title: "Architecture Constraints"
94
+ category: arch
95
+ ---
96
+ # Architecture Constraints
97
+
98
+ Auto-generated from project structure. Update manually as architecture evolves.
99
+
100
+ ## Module Structure
101
+ - Type: {monorepo | single-package | multi-package}
102
+ - Key modules: {list detected top-level directories with purposes}
103
+
104
+ ## Layer Boundaries
105
+ {detected layers: e.g., commands/ -> core/ -> tools/ -> types/}
106
+
107
+ ## Dependency Rules
108
+ {detected from imports: which modules import from which}
109
+
110
+ ## Technology Constraints
111
+ - Runtime: {Node.js >= X | Python >= X | ...}
112
+ - Module system: {ESM | CommonJS | ...}
113
+ - Strict mode: {yes | no}
114
+
115
+ ## Entries
116
+ {empty section for spec-add entries}
117
+ ```
118
+
119
+ #### 4c: learnings.md
120
+
121
+ Output: `.workflow/specs/learnings.md`
122
+
123
+ ```markdown
124
+ ---
125
+ title: "Learnings"
126
+ category: learning
127
+ ---
128
+ # Learnings
129
+
130
+ Bugs, gotchas, and lessons learned during development.
131
+ Add entries with: `/spec-add learning <description>`
132
+
133
+ ## Entries
134
+
135
+ {empty -- entries added via spec-add}
136
+ ```
137
+
138
+ ### Step 5: Generate Optional Files (when signals detected)
139
+
140
+ #### 5a: quality-rules.md (when linter config or CI detected)
141
+
142
+ Output: `.workflow/specs/quality-rules.md`
143
+
144
+ ```markdown
145
+ ---
146
+ title: "Quality Rules"
147
+ category: quality
148
+ ---
149
+ # Quality Rules
150
+
151
+ ## Entries
152
+
153
+ {empty -- entries added via spec-add}
154
+ ```
155
+
156
+ #### 5b: test-conventions.md (when test framework or test files detected)
157
+
158
+ Scan existing test files for conventions (framework, naming, directory structure, patterns).
159
+
160
+ Output: `.workflow/specs/test-conventions.md`
161
+
162
+ ```markdown
163
+ ---
164
+ title: "Test Conventions"
165
+ category: test
166
+ ---
167
+ # Test Conventions
168
+
169
+ Auto-generated from project analysis. Update manually as patterns evolve.
170
+
171
+ ## Framework
172
+ - Framework: {detected: Jest | Vitest | pytest | Mocha | none}
173
+ - Run command: {detected: npm test | pytest | etc.}
174
+
175
+ ## Directory Structure
176
+ - Pattern: {detected: __tests__/ | tests/ | co-located | etc.}
177
+
178
+ ## Naming Conventions
179
+ - Test files: {detected: *.test.ts | *.spec.ts | test_*.py | etc.}
180
+
181
+ ## Patterns
182
+ {detected patterns from existing test files}
183
+
184
+ ## Entries
185
+ {empty section for spec-add entries}
186
+ ```
187
+
188
+ #### 5c: ui-conventions.md (when frontend framework detected)
189
+
190
+ Scan for frontend frameworks (React, Vue, Angular, Svelte, etc.) and UI libraries.
191
+
192
+ Output: `.workflow/specs/ui-conventions.md`
193
+
194
+ ```markdown
195
+ ---
196
+ title: "UI Conventions"
197
+ category: ui
198
+ ---
199
+ # UI Conventions
200
+
201
+ Auto-generated from project analysis. Update manually as patterns evolve.
202
+
203
+ ## Entries
204
+
205
+ {empty section for spec-add entries}
206
+ ```
207
+
208
+ #### 5d: debug-notes.md and review-standards.md
209
+
210
+ These are NOT created during setup. They are created on demand when `spec-add debug` or `spec-add review` is first used.
211
+
212
+ ### Step 6: Generate Workflow Knowhow Recipes (when signals detected)
213
+
214
+ Spec files in Step 4-5 capture *conventions*. This step captures *operational workflows* — "how to do X in this project" — as **recipe-type knowhow** so future agents can discover them via `maestro wiki search` and `maestro knowhow list --type recipe`.
215
+
216
+ Output directory: `.workflow/knowhow/` (knowhow store, NOT `.workflow/specs/`).
217
+ Schema: matches `recipe` type defined in `~/.maestro/workflows/knowhow.md` Part B.
218
+
219
+ **Detection → recipe matrix:**
220
+
221
+ | Recipe slug | Trigger signals | Step extraction source |
222
+ |-------------|----------------|------------------------|
223
+ | `test-workflow` | Test framework detected in Step 5b (jest/vitest/pytest/mocha/go test/cargo test) | `package.json` `scripts.test*`, `pytest.ini`/`pyproject.toml [tool.pytest]`, `go test ./...`, test layout from Step 5b |
224
+ | `debug-workflow` | `.vscode/launch.json` OR logging lib import (pino/winston/loguru/zap/log) OR error tracker SDK (sentry/bugsnag/rollbar) OR `DEBUG=` env usage in code | launch.json entries, `--inspect` flags in scripts, logger config files, observed `log.debug(...)` / `logger.info(...)` patterns |
225
+ | `build-workflow` | `scripts.build` in package.json OR Makefile `build:` target OR `cargo build` OR `gradle build` OR `go build` | Verbatim script chain; multi-step pipelines noted explicitly |
226
+ | `dev-workflow` | `scripts.dev`/`scripts.start` OR `manage.py runserver` OR `air`/`reflex` config OR docker-compose dev override | Dev command + detected port from config + hot-reload flag |
227
+ | `lint-workflow` | Linter+formatter pair detected: eslint+prettier / ruff+black / golangci-lint+gofmt / rustfmt+clippy | Configured commands, pre-commit hooks from `.pre-commit-config.yaml` or `husky/`, CI lint job |
228
+
229
+ **Skip rule:** If signals are missing, skip the recipe — do NOT generate placeholders.
230
+
231
+ **Idempotency rule:** Before writing, glob `.workflow/knowhow/RCP-*-{slug}.md`. If a file matching the slug exists, do NOT overwrite — write `.workflow/knowhow/RCP-{YYYYMMDD}-{slug}.proposed.md` instead and mention it in Step 7 summary so the user can diff and merge manually.
232
+
233
+ **Filename:** `.workflow/knowhow/RCP-{YYYYMMDD}-{slug}.md` (date + semantic slug for readability).
234
+
235
+ **Tags rule:** Match content language (English codebase → English tags). Always include `workflow`, the slug, and the detected framework (e.g. `vitest`, `pytest`). Add `auto-generated` so users can identify spec-setup output for later pruning.
236
+
237
+ **Recipe template** (one file per detected workflow):
238
+
239
+ ```markdown
240
+ ---
241
+ title: "{Project name} — {Workflow name}"
242
+ type: recipe
243
+ tags: [workflow, {slug}, {framework}, auto-generated]
244
+ created: {ISO timestamp}
245
+ source: spec-setup
246
+ ---
247
+
248
+ # {title}
249
+
250
+ ## Goal
251
+ {One sentence stating the operational outcome — "Run the test suite locally and in CI", "Reproduce and inspect a runtime bug with full stack context", etc.}
252
+
253
+ ## Prerequisites
254
+ - {Required runtime/version from manifest, e.g. "Node.js >= 18"}
255
+ - {Required env vars detected in .env.example or code}
256
+ - {Required services if docker-compose detected}
257
+
258
+ ## Steps
259
+ 1. {Copy-paste-ready command 1 — derived from detected scripts}
260
+ 2. {Command 2}
261
+ 3. ...
262
+
263
+ ## Expected Outcome
264
+ {Concrete success signal — "All tests green, coverage report at coverage/index.html" / "Dev server reachable at http://localhost:PORT with HMR active"}
265
+
266
+ ## Common Pitfalls
267
+ - {Inferred from detected patterns — e.g. "Vitest watch mode locks DB if integration suite is selected"}
268
+ - {Generic gotchas: port conflicts, missing env, stale dist/}
269
+
270
+ ## Related
271
+ - [[test-conventions]] / [[architecture-constraints]] — convention specs (link when they exist)
272
+ ```
273
+
274
+ **Per-recipe extraction guides:**
275
+
276
+ - **`test-workflow`** — Steps must list: (a) install command if first run, (b) full-suite command, (c) watch/filter command, (d) coverage command. For pytest, include marker selection if `pytest.ini` declares markers. For Go, document `-race` and `-tags` flags if used in CI.
277
+ - **`debug-workflow`** — Steps must cover: (a) attach/launch via debugger (cite the exact `launch.json` configuration name), (b) increase log verbosity (cite the env var or config flag actually used in code), (c) reproduce-and-capture pattern (point at the project's logging entry pattern with one file:line example). Mention error-tracker DSN env if Sentry/Bugsnag SDK is wired.
278
+ - **`build-workflow`** — Reproduce the `scripts.build` chain verbatim; if it spans multiple commands, number them. Note the output directory (`dist/`, `build/`, `target/`) and any required `prepublishOnly`/`postbuild` side effects.
279
+ - **`dev-workflow`** — Dev server command, detected default port, hot-reload flag, and any companion process (e.g. `npm run dev` + `npm run mcp` if both are typically run together — detect this when both appear under `scripts` and one is `dev`).
280
+ - **`lint-workflow`** — Linter command, formatter command, fix command (`--fix` / `--write`), pre-commit hook trigger if `husky/_/pre-commit` or `.pre-commit-config.yaml` exists.
281
+
282
+ **Quality bar:** Every generated recipe must contain at least one runnable command. If signals are present but no concrete command can be extracted with confidence, do NOT write the file — emit `W002: <slug> signals detected but commands ambiguous, skipped` and continue.
283
+
284
+ **Wiki indexing:** Files in `.workflow/knowhow/` are auto-indexed by WikiIndexer (`type=knowhow`). No separate index step required — they appear in `maestro wiki list --type knowhow` after the next index pass.
285
+
286
+ ### Step 7: Summary
287
+
288
+ Glob created spec/recipe files MUST exist before Step 7 summary; BLOCKED if missing.
289
+
290
+ Display list of all created files grouped by destination:
291
+
292
+ ```
293
+ ## Specs (.workflow/specs/)
294
+ - coding-conventions.md
295
+ - architecture-constraints.md
296
+ - learnings.md
297
+ - {optional spec files created}
298
+
299
+ ## Workflow Recipes (.workflow/knowhow/)
300
+ - RCP-{ts}-test-workflow.md (vitest detected)
301
+ - RCP-{ts}-debug-workflow.md (pino + .vscode/launch.json detected)
302
+ - {other recipes}
303
+
304
+ ## Skipped (signals missing)
305
+ - build-workflow — no build script detected
306
+ - {other skips}
307
+
308
+ ## Deferred (created on demand)
309
+ - debug-notes.md, review-standards.md — use /spec-add when needed
310
+ ```
311
+
312
+ Note that `debug-notes.md` and `review-standards.md` are created on demand via `/spec-add`, and any `.proposed.md` files indicate an existing recipe was not overwritten — review and merge manually.
313
+
314
+ ## Output
315
+
316
+ All files listed above under `.workflow/specs/` and `.workflow/knowhow/`.
@@ -0,0 +1,149 @@
1
+ # Workflow: status
2
+
3
+ Status dashboard with intelligent routing.
4
+
5
+ ---
6
+
7
+ ## Step 1: Load State
8
+
9
+ 1. Check `.workflow/state.json` exists:
10
+ - If missing → display "No project initialized. Run `/workflow:init` to start." → exit
11
+
12
+ 2. Read `.workflow/state.json`:
13
+ - Extract: project_name, current_milestone, status, milestones, artifacts
14
+ - Derive current_phase and phases_summary from artifacts[] (see src/utils/state-schema.ts)
15
+ - Extract: accumulated_context (key_decisions, blockers, deferred)
16
+
17
+ 3. Read `.workflow/roadmap.md`:
18
+ - Extract phase list with titles
19
+
20
+ 4. Load Issue State from `.workflow/issues/issues.jsonl` (if exists):
21
+ ```
22
+ Compute: by_status (registered/diagnosed/planning/planned/executing counts),
23
+ by_severity (critical/high/medium/low counts),
24
+ total_open (exclude completed/failed/deferred),
25
+ critical_open + critical_issues list {id, title, status}
26
+ ```
27
+ If file missing → issue_state = null
28
+
29
+ ---
30
+
31
+ ## Step 2: Build Virtual Phase View from Artifact Registry
32
+
33
+ Derive phase progress from `state.json.artifacts[]`:
34
+
35
+ ```
36
+ milestone_artifacts = artifacts filtered by current_milestone
37
+ phases_from_roadmap = parse roadmap.md → { number, slug, title }
38
+
39
+ Per phase: check completed artifact types (analyze/plan/execute/verify)
40
+ → derive status: verified > executed > planned > analyzed > pending
41
+ → get task counts from plan artifact's plan.json if available
42
+
43
+ Output: phases[] = { number, slug, title, status, tasks_total, tasks_completed, has_verify }
44
+ Also collect: adhoc_artifacts (scope == "adhoc")
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Step 2.5: Artifact Registry Consistency Check
50
+
51
+ ```
52
+ If roadmap exists → warn if any artifacts reference phases not in roadmap (orphan check)
53
+ If roadmap missing but artifacts exist → warn: may indicate completed milestone, suggest /maestro continue
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Step 3: Compute Progress
59
+
60
+ ```
61
+ Count phases by status: completed, executing, planning, exploring, pending, blocked
62
+ progress_pct = (completed / total) * 100
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Step 4: Display Dashboard
68
+
69
+ ```
70
+ PROJECT / MILESTONE / STATUS / PROGRESS bar ({completed}/{total} phases)
71
+ Per phase: [{status_icon}] Phase {N}: {title} — status, task counts, verification
72
+ CONTEXT: key_decisions, blockers, deferred
73
+ ```
74
+
75
+ ### Step 4.1: Render Issue Summary
76
+
77
+ If issue_state exists: display ISSUES panel (open count, critical count, by-status breakdown, critical issues list).
78
+ - Omit critical sub-section if none. Note blockers→issues migration if applicable. Note deferred items.
79
+
80
+ If issue_state is null: "No issues tracked. Use /manage-issue create to discover issues."
81
+
82
+ Status icons:
83
+ - `[x]` completed
84
+ - `[>]` executing / in_progress
85
+ - `[~]` planning / exploring
86
+ - `[ ]` pending
87
+ - `[!]` blocked
88
+
89
+ ### Step 4.2: Render Worktree Status
90
+
91
+ ```
92
+ If .workflow/worktree-scope.json exists → WORKTREE MODE panel: milestone, branch, owned_phases, main_worktree
93
+ Else if .workflow/worktrees.json has active entries → ACTIVE WORKTREES panel: milestone/branch/path per worktree,
94
+ with sync (/maestro-fork --sync) and merge (/maestro-merge) hints
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Step 5: Route Next Step
100
+
101
+ ### Step 5.0: Issue-Aware Routing
102
+
103
+ If issue_state exists, evaluate BEFORE status routing:
104
+ - critical_open > 0 → suggest manage-issue list --severity critical, quality-debug --from-uat
105
+ - diagnosed > 0 → suggest maestro-plan --gaps
106
+ - registered > 0 → suggest quality-debug
107
+
108
+ ### Step 5.1: Status-Based Routing
109
+
110
+ Based on current project state, suggest the next command:
111
+
112
+ | Current State | Suggested Command |
113
+ |---|---|
114
+ | No phases planned | /maestro-brainstorm 1 or /maestro-plan 1 |
115
+ | Phase pending, needs analysis | /maestro-analyze \<N\> |
116
+ | Phase pending, needs decisions | /maestro-analyze \<N\> -q |
117
+ | Phase planned, not executed | /maestro-execute \<N\> |
118
+ | Phase executing, tasks blocked | /quality-debug \<N\> |
119
+ | Phase executed, not verified | /quality-review \<N\> |
120
+ | Phase verified with gaps | /maestro-plan \<N\> --gaps |
121
+ | Phase verified, not reviewed | /quality-review \<N\> |
122
+ | Phase reviewed, BLOCK verdict | /maestro-plan \<N\> --gaps |
123
+ | Phase reviewed, PASS/WARN | /quality-test \<N\> |
124
+ | Low test coverage | /quality-auto-test \<N\> |
125
+ | UAT passed, all phases done | /maestro-milestone-audit |
126
+ | UAT has failures | /quality-debug --from-uat \<N\> |
127
+ | Need integration tests | /quality-auto-test \<N\> |
128
+ | All milestone phases complete | /maestro-milestone-audit |
129
+ | Milestone audit passed | /maestro-milestone-complete |
130
+ | Ad-hoc small task | /maestro-quick \<task\> |
131
+
132
+ Display:
133
+ ```
134
+ NEXT STEP: {suggested_command}
135
+ {reason}
136
+ ```
137
+
138
+ If there are blockers, display them prominently before the routing suggestion.
139
+
140
+ ---
141
+
142
+ ## Step 6: Scratch Tasks (if any)
143
+
144
+ Check `.workflow/scratch/` for active tasks:
145
+
146
+ 1. For each `scratch/*/index.json` where status != "completed":
147
+ - Display: type, title, status, progress
148
+ 2. If active scratch tasks exist:
149
+ - Note: "Active scratch tasks found. These are independent of phase pipeline."
@@ -0,0 +1,116 @@
1
+ # Workflow: sync
2
+
3
+ Change detection, impact chain traversal, and codebase doc synchronization. Auto-triggered after execute, or manual via `/workflow:sync`.
4
+
5
+ ## Arguments
6
+
7
+ | Arg | Description | Default |
8
+ |-----|-------------|---------|
9
+ | `--full` | Complete resync of all tracked files (ignores git diff, rebuilds all docs) | `false` |
10
+ | `--since <ref>` | Git ref for diff baseline (commit hash, `HEAD~N`, branch) | `HEAD~1` |
11
+ | `--dry-run` | Show impact analysis without writing changes | `false` |
12
+
13
+ ---
14
+
15
+ ## Workflow Steps
16
+
17
+ ### Step 1: Parse Input and Validate
18
+
19
+ ```
20
+ Parse flags: --full (resync all), --since <ref> (diff baseline), --dry-run (preview)
21
+ Default: incremental sync since last tracked sync point
22
+ Require .workflow/ exists → else abort E001
23
+ ```
24
+
25
+ ### Step 2: Detect Changed Files
26
+
27
+ ```
28
+ --full → collect all files from doc-index.json code_locations
29
+ else → git diff --name-only <since-ref|HEAD~1|--cached>
30
+ No files changed → emit W001, exit
31
+ ```
32
+
33
+ ### Step 3: Load Doc Index
34
+
35
+ ```
36
+ Read .workflow/codebase/doc-index.json
37
+ Extract: components[], features[], requirements[], architecture_decisions[]
38
+
39
+ If missing: prompt → (a) MUST run /manage-codebase-rebuild then re-run
40
+ or → (b) DEGRADED_MODE: git-diff-only, skip Steps 3-5; flag sync as [LOW CONFIDENCE] (git-diff-only, Steps 3-5 skipped)
41
+ ```
42
+
43
+ ### Step 4: Impact Chain Traversal
44
+
45
+ For each `changed_file` in `changed_files[]`:
46
+
47
+ ```
48
+ Traverse impact chain: file → components (via code_locations match)
49
+ → features (via component.feature_ids) → requirements (via feature.requirement_ids)
50
+ Aggregate deduplicated: { files, components, features, requirements }
51
+ ```
52
+
53
+ GATE Step 4→5: impact_chain non-empty BEFORE update index; BLOCKED if impact_chain empty (no affected components/features/requirements identified)
54
+
55
+ ### Step 5: Update Doc Index (skip if --dry-run)
56
+
57
+ ```
58
+ Affected components → refresh last_updated, re-scan code_locations for symbols[]
59
+ Affected features → refresh last_updated, update status
60
+ Write updated doc-index.json
61
+ ```
62
+
63
+ ### Step 6: Regenerate Affected Docs (skip if --dry-run)
64
+
65
+ ```
66
+ Components → regenerate .workflow/codebase/tech-registry/{component-slug}.md
67
+ Features → regenerate .workflow/codebase/feature-maps/{feature-slug}.md
68
+ ```
69
+
70
+ ### Step 7: Update State and Specs (skip if --dry-run)
71
+
72
+ ```
73
+ state.json → last_sync timestamp, change summary
74
+ index.json → update affected phase indexes
75
+ Dependency manifests changed + project.md exists → refresh Tech Stack section
76
+ ```
77
+
78
+ ### Step 8: Create Action Log
79
+
80
+ ```
81
+ Write .workflow/codebase/action-logs/{hash}.md:
82
+ date, baseline, files changed, affected components/features/requirements, impact counts
83
+ ```
84
+
85
+ ### Step 9: Report
86
+
87
+ ```
88
+ Display: changed files, affected components/features/requirements, specs updated, action log path
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Error Handling
94
+
95
+ | Code | Meaning |
96
+ |------|---------|
97
+ | E001 | .workflow/ not initialized — suggest running Skill({ skill: "maestro-init" }) first |
98
+ | W001 | No changes detected since last sync — report clean state, skip updates |
99
+
100
+ | Error | Action |
101
+ |-------|--------|
102
+ | .workflow/ missing | Fail with E001 |
103
+ | doc-index.json missing | Suggest `/workflow:codebase rebuild` |
104
+ | No git repo | Fail with message: "Git repository required for sync" |
105
+ | Changed file not in any component | Log as "untracked file" in action log (no impact chain) |
106
+ | doc-index.json parse error | Fail with error details |
107
+
108
+ ## Output Files
109
+
110
+ | File | Action |
111
+ |------|--------|
112
+ | `.workflow/codebase/doc-index.json` | Updated (timestamps, symbols) |
113
+ | `.workflow/codebase/tech-registry/{slug}.md` | Regenerated for affected components |
114
+ | `.workflow/codebase/feature-maps/{slug}.md` | Regenerated for affected features |
115
+ | `.workflow/codebase/action-logs/{hash}.md` | Created |
116
+ | `.workflow/project.md` | Tech Stack section updated if dependency manifests changed |