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,385 @@
1
+ # Test Workflow (UAT)
2
+
3
+ Conversational UAT testing with persistent state, auto-diagnosis, and gap-fix closure loop.
4
+
5
+ **Core**: Show expected behavior, ask if reality matches. One test at a time.
6
+ - "yes" / "y" / "next" / empty / "pass" → pass
7
+ - "skip" / "can't test" / "n/a" → skipped
8
+ - Anything else → logged as issue, severity auto-inferred
9
+
10
+ NEVER ask "how severe is this?"
11
+
12
+ ---
13
+
14
+ ### Step 1: Resolve Target
15
+
16
+ | Input | Action |
17
+ |-------|--------|
18
+ | Phase number (e.g., "3") | `TARGET_TYPE=phase`, resolve from `state.json` artifacts |
19
+ | Scratch task ID | `TARGET_TYPE=scratch`, `SCRATCH_DIR=.workflow/scratch/{id}/` |
20
+ | Nothing | Check active UAT sessions (Step 2), else prompt user |
21
+
22
+ **Flags:** `--smoke` (cold-start smoke tests before UAT), `--auto-fix` (auto gap-fix loop on failures)
23
+
24
+ Validate target exists and has verification.json (E002).
25
+
26
+ ---
27
+
28
+ ### Step 2: Check Active Sessions
29
+
30
+ ```bash
31
+ # Check scratch dirs (resolved via artifact registry) for active UAT sessions
32
+ find .workflow/scratch -name "uat.md" -type f 2>/dev/null | head -5
33
+ ```
34
+
35
+ Read each file's frontmatter (status, target) and Current Test section.
36
+
37
+ **If active sessions exist AND no $ARGUMENTS:**
38
+
39
+ Display inline:
40
+ ```
41
+ ## Active UAT Sessions
42
+
43
+ | # | Target | Status | Current Test | Progress |
44
+ |---|--------|--------|--------------|----------|
45
+ | 1 | 04-comments | testing | 3. Reply to Comment | 2/6 |
46
+ | 2 | quick-fix-nav | testing | 1. Nav Links | 0/4 |
47
+
48
+ Reply with a number to resume, or provide a phase/task to start new.
49
+ ```
50
+
51
+ Wait for user response.
52
+ - Number -> resume that session (go to Step 9: Resume From File)
53
+ - Phase/task ID -> new session (go to Step 4: Find Testables)
54
+
55
+ **If active sessions exist AND $ARGUMENTS provided:**
56
+ Check if session exists for that target. If yes, offer resume or restart.
57
+
58
+ **If no active sessions AND no $ARGUMENTS:**
59
+ Prompt: "No active UAT sessions. Provide a phase number or scratch task ID to start testing."
60
+
61
+ **If no active sessions AND $ARGUMENTS:**
62
+ Continue to Step 3 or Step 4.
63
+
64
+ ---
65
+
66
+ ### Step 3: Run Smoke Tests (if --smoke)
67
+
68
+ Skip if --smoke not set.
69
+
70
+ Inject basic sanity tests BEFORE UAT scenarios:
71
+
72
+ | Smoke Test | Check | Method |
73
+ |------------|-------|--------|
74
+ | App starts | Process runs without crash | `bash: start command, check exit code` |
75
+ | Routes respond | Key endpoints return non-error | `bash: curl/fetch main routes` |
76
+ | Build clean | No build errors | `bash: build command succeeds` |
77
+ | Dependencies | No missing deps | `bash: install check` |
78
+
79
+ Record smoke results in uat.md under `## Smoke Tests` section.
80
+ If any smoke test fails: abort UAT, report as blocker, suggest Skill({ skill: "quality-debug" }). (E003)
81
+
82
+ ---
83
+
84
+ ### Step 4: Load Verification Context
85
+
86
+ Read from target directory: `verification.json`, `validation.json`, `index.json`, `plan.json`, `.summaries/TASK-*.md`.
87
+
88
+ Build testable list from success_criteria + must_haves + task accomplishments (user-observable outcomes only).
89
+
90
+ ---
91
+
92
+ ### Step 5: Design Test Scenarios
93
+
94
+ For each testable item, create a scenario:
95
+ - **id**: T-001, T-002, ...
96
+ - **name**: Brief test name
97
+ - **category**: "e2e" | "integration" | "unit"
98
+ - **expected**: Specific observable behavior (what user should see)
99
+ - **requirement_ref**: Which success criterion this covers
100
+
101
+ Write test-plan.json to `.tests/`:
102
+ ```json
103
+ {
104
+ "target": "{phase or scratch ID}",
105
+ "generated_at": "{ISO timestamp}",
106
+ "tests": [...],
107
+ "coverage": {
108
+ "requirements_mapped": ["SC-001"],
109
+ "requirements_unmapped": ["SC-003"]
110
+ }
111
+ }
112
+ ```
113
+
114
+ ```bash
115
+ mkdir -p "$OUTPUT_DIR/.tests"
116
+ ```
117
+
118
+ Skip internal/non-observable items (refactors, type changes).
119
+
120
+ ---
121
+
122
+ ### Step 6: Create UAT File
123
+
124
+ Archive existing `uat.md` → `$OUTPUT_DIR/.history/uat-{YYYY-MM-DDTHH-mm-ss}.md`.
125
+
126
+ Create `$OUTPUT_DIR/uat.md`:
127
+
128
+ ```markdown
129
+ ---
130
+ status: testing
131
+ target: {phase slug or scratch ID}
132
+ source: [list of summary files]
133
+ started: {ISO timestamp}
134
+ updated: {ISO timestamp}
135
+ ---
136
+
137
+ ## Current Test
138
+ <!-- OVERWRITE each test - shows where we are -->
139
+
140
+ number: 1
141
+ name: {first test name}
142
+ expected: |
143
+ {what user should observe}
144
+ awaiting: user response
145
+
146
+ ## Smoke Tests
147
+ {results if ran, otherwise omitted}
148
+
149
+ ## Tests
150
+
151
+ ### 1. {Test Name}
152
+ expected: {observable behavior}
153
+ result: [pending]
154
+
155
+ ### 2. {Test Name}
156
+ expected: {observable behavior}
157
+ result: [pending]
158
+
159
+ ...
160
+
161
+ ## Summary
162
+
163
+ total: {N}
164
+ passed: 0
165
+ issues: 0
166
+ pending: {N}
167
+ skipped: 0
168
+
169
+ ## Gaps
170
+
171
+ [none yet]
172
+ ```
173
+
174
+ → Step 7.
175
+
176
+ ---
177
+
178
+ ### Step 7: Present Test
179
+
180
+ Display:
181
+
182
+ ```
183
+ ------------------------------------------------------------
184
+ TEST {number}/{total}: {name}
185
+ ------------------------------------------------------------
186
+
187
+ Expected behavior:
188
+ {expected}
189
+
190
+ ------------------------------------------------------------
191
+ > Type "pass" or describe what's wrong
192
+ ------------------------------------------------------------
193
+ ```
194
+
195
+ Wait for user response (plain text).
196
+
197
+ ---
198
+
199
+ ### Step 8: Process Response
200
+
201
+ | Response | Action |
202
+ |----------|--------|
203
+ | empty / "yes" / "y" / "ok" / "pass" / "next" | Pass |
204
+ | "skip" / "can't test" / "n/a" | Skipped |
205
+ | Anything else | Issue (severity auto-inferred) |
206
+
207
+ For issues, update Tests section:
208
+ ```yaml
209
+ ### {N}. {name}
210
+ expected: {expected}
211
+ result: issue
212
+ reported: "{verbatim user response}"
213
+ severity: {inferred}
214
+ ```
215
+
216
+ Append to Gaps section:
217
+ ```yaml
218
+ - test: {N}
219
+ truth: "{expected behavior}"
220
+ status: failed
221
+ reason: "User reported: {verbatim}"
222
+ severity: {inferred}
223
+ requirement_ref: {if mapped}
224
+ ```
225
+
226
+ **Auto-create Issue from UAT Gap:**
227
+
228
+ Append to `.workflow/issues/issues.jsonl`: `ISS-{YYYYMMDD}-{NNN}`, title "UAT: {test.name} - {response}" (max 100 chars), `source: "uat"`, severity/priority from inference. Back-reference: set `gap.issue_id` in gap YAML.
229
+
230
+ **Write triggers:** 1) Issue found 2) Session complete 3) Every 5 passed tests (checkpoint).
231
+
232
+ More tests → Step 7. No more → Step 10.
233
+
234
+ ---
235
+
236
+ ### Step 9: Resume From File
237
+
238
+ Read uat.md → find first `result: [pending]` → update Current Test → Step 7.
239
+
240
+ ---
241
+
242
+ ### Step 10: Complete Session
243
+
244
+ Update uat.md: `status: complete`. Archive existing test artifacts → `.history/`.
245
+
246
+ Write `.tests/test-results.json`:
247
+ ```json
248
+ {
249
+ "target": "{phase or scratch ID}",
250
+ "completed_at": "{ISO timestamp}",
251
+ "results": [
252
+ { "id": "T-001", "name": "...", "status": "pass|issue|skipped", "details": "..." }
253
+ ],
254
+ "summary": { "total": N, "passed": N, "issues": N, "skipped": N }
255
+ }
256
+ ```
257
+
258
+ Write `.tests/coverage-report.json`:
259
+ ```json
260
+ {
261
+ "target": "{phase or scratch ID}",
262
+ "generated_at": "{ISO timestamp}",
263
+ "requirements_covered": ["SC-001"],
264
+ "requirements_uncovered": ["SC-003"],
265
+ "coverage_percentage": 66.7
266
+ }
267
+ ```
268
+
269
+ Update index.json with uat results (`status`, `test_count`, `passed`, `gaps`).
270
+
271
+ issues == 0 → Step 13. issues > 0 → Step 11.
272
+
273
+ ---
274
+
275
+ ### Step 11: Auto-Diagnose
276
+
277
+ 1. **Cluster gaps** by component/area (same file/module → one cluster, same flow → one cluster)
278
+ 2. MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: **Spawn one debug agent per cluster** (parallel, `run_in_background: false`): pre-filled symptoms, `goal: find_root_cause`. Include `issue_id` refs.
279
+ 3. **Collect results**, update uat.md gaps:
280
+ ```yaml
281
+ - test: {N}
282
+ truth: "..."
283
+ status: failed
284
+ reason: "..."
285
+ severity: {inferred}
286
+ root_cause: "{diagnosed cause}"
287
+ fix_direction: "{suggested approach}"
288
+ affected_files: ["{file1}", "{file2}"]
289
+ ```
290
+
291
+ ---
292
+
293
+ ### Step 12: Gap Closure Decision
294
+
295
+ `AUTO_FIX` set → skip prompt, go to gap-fix loop. Otherwise present:
296
+
297
+ ```
298
+ ### Diagnosis Complete
299
+
300
+ | Gap | Severity | Root Cause | Fix Direction |
301
+ |-----|----------|------------|---------------|
302
+ | T-3 | major | Missing null check | Add guard clause |
303
+ | T-5 | blocker | Event not cleaned | Add cleanup logic |
304
+
305
+ Options:
306
+ 1. Auto-fix -- Plan and execute fixes, then re-verify
307
+ 2. Debug deep -- Skill({ skill: "quality-debug" }) per issue
308
+ 3. Plan fixes -- Skill({ skill: "maestro-plan", args: "{phase} --gaps" })
309
+ 4. Manual fix -- Address issues yourself
310
+ ```
311
+
312
+ | Choice | Action |
313
+ |--------|--------|
314
+ | 1 / "auto-fix" | Go to gap-fix loop |
315
+ | 2 / "debug" | Suggest Skill({ skill: "quality-debug" }) |
316
+ | 3 / "plan" | Suggest Skill({ skill: "maestro-plan", args: "{phase} --gaps" }) |
317
+ | 4 / "manual" | Done, report results |
318
+
319
+ **Gap-fix closure loop** (max 2 iterations):
320
+
321
+ 1. `maestro-plan {phase} --gaps` → fix tasks
322
+ 2. `maestro-execute {phase}` → execute fixes
323
+ 3. `maestro-execute {phase}` → re-verify
324
+
325
+ Issue lifecycle: `registered` → `planning` → `executing` → `completed` | `failed`.
326
+
327
+ Pass → update uat.md gaps as resolved. Still gaps → report remaining, suggest manual intervention.
328
+
329
+ ---
330
+
331
+ ### Step 12.5: UAT Confidence Scoring
332
+
333
+ Dimensions (4): scenario_coverage, diagnostic_depth, observation_quality, closure_completeness. Factors (weights): requirements_mapped(.30), observation_specificity(.25), user_validation(.20), diagnostic_depth(.15), consistency(.10). Score at: init (Step 5), per user response (Step 8), after gap-fix loop (Step 12).
334
+
335
+ Quality mechanisms: Pressure Pass — >80% pass → ask user to try edge case. Devil's Advocate — >70% first-try pass → challenge scenario difficulty. Stall Detection — 2 gap-fix iterations without improvement → stop.
336
+
337
+ Readiness Gate (blocks Step 13): scenario_coverage < 40% | blocker gap without diagnosis | no pressure pass (if >80%) | unresolved gaps without acknowledgment. Append confidence summary to uat.md.
338
+
339
+ ---
340
+
341
+ ### Step 13: Report
342
+
343
+ ```
344
+ === UAT RESULTS ===
345
+ Target: {target}
346
+
347
+ Smoke Tests: {smoke_count} run, {smoke_pass} passed (if ran)
348
+ UAT Tests: {total} total
349
+ Passed: {passed}
350
+ Issues: {issues} ({blocker_count} blockers, {major_count} major)
351
+ Skipped: {skipped}
352
+
353
+ Diagnosis: {diagnosed_count}/{issues} gaps diagnosed
354
+ Auto-fix: {fixed_count} gaps resolved (if ran)
355
+
356
+ Files:
357
+ {target_dir}/uat.md
358
+ {target_dir}/.tests/test-results.json
359
+ {target_dir}/.tests/coverage-report.json
360
+
361
+ Next steps:
362
+ {suggested_next_command}
363
+ ```
364
+
365
+ **Next step routing:**
366
+
367
+ | Result | Suggestion |
368
+ |--------|------------|
369
+ | All passed, no gaps | Skill({ skill: "maestro-milestone-audit" }) |
370
+ | Gaps auto-fixed | Skill({ skill: "maestro-milestone-audit" }) |
371
+ | Gaps remain, diagnosed | Skill({ skill: "quality-debug" }) or Skill({ skill: "maestro-plan", args: "--gaps" }) |
372
+ | Low coverage | Skill({ skill: "quality-auto-test", args: "{phase}" }) to generate missing tests |
373
+
374
+ ---
375
+
376
+ ## Severity Inference
377
+
378
+ | User says | Infer |
379
+ |-----------|-------|
380
+ | "crashes", "error", "exception", "fails completely", "can't use" | blocker |
381
+ | "doesn't work", "nothing happens", "wrong behavior", "broken" | major |
382
+ | "works but...", "slow", "weird", "minor issue", "inconsistent" | minor |
383
+ | "color", "spacing", "alignment", "looks off", "typo" | cosmetic |
384
+
385
+ Default: **major**. NEVER ask severity — infer and move on.
@@ -0,0 +1,70 @@
1
+ # Tool Spec Reference
2
+
3
+ ## Storage
4
+
5
+ Path: `.workflow/knowhow/` with `tool: true` in YAML frontmatter.
6
+
7
+ ## Entry Format
8
+
9
+ Knowhow document (`knowhow/RCP-<slug>.md`):
10
+ ```yaml
11
+ ---
12
+ title: Tool Name
13
+ type: recipe
14
+ tool: true
15
+ summary: "Use when {timing}. {scope description}"
16
+ tags: [keyword1, keyword2]
17
+ category: coding
18
+ ---
19
+
20
+ ## Prerequisites
21
+ ...
22
+
23
+ ## Steps
24
+ 1. ...
25
+ ```
26
+
27
+ ## Description Rules
28
+
29
+ - First line after `### Title` must state **when to use** this tool
30
+ - For ref entries: `spec load` shows only the first 200 chars after heading — timing must be in that window
31
+ - For ref knowhow docs: YAML `summary` field is shown by `wiki list` and wiki-role-loader hook
32
+
33
+ ## Discovery Path
34
+
35
+ ```
36
+ Register (knowhow/ + tool: true) → spec load --category / spec-injector auto-inject → agent discovers tool
37
+ ```
38
+
39
+ Agents discover tool specs via:
40
+ - `spec load --category <category>` — scans knowhow/ for `category + tool: true` matches
41
+ - `spec-injector` hook — auto-injects at Agent launch based on agent type → category mapping
42
+ - `spec load --keyword <word>` — keyword search across all entries (cross-category)
43
+
44
+ ## Category Reference
45
+
46
+ `category` = **who consumes** (agent type), not what the content is about.
47
+
48
+ | Category | Consumer Agent | Decision Question | Signal Words |
49
+ |---|---|---|---|
50
+ | coding | code-developer, workflow-executor | 开发者实现时需要? | build, deploy, integrate, configure, api-contract |
51
+ | test | tdd-developer, test-fix-agent | 测试者验证时需要? | verify, validate, e2e, regression, idempotency |
52
+ | review | workflow-reviewer | 审查者检查时需要? | audit, checklist, compliance, quality-gate |
53
+ | arch | workflow-planner | 规划者设计时需要? | design, architecture, decompose, blueprint |
54
+ | debug | debug-explore-agent | 调试者排查时需要? | diagnose, trace, root-cause, reproduce |
55
+
56
+ **Multi-consumer**: If tool serves multiple agents, split into separate docs with different categories.
57
+
58
+ ## CLI Commands
59
+
60
+ ```bash
61
+ # Register new tool as knowhow document
62
+ maestro knowhow add "knowhow/RCP-<slug>.md" --type recipe --tool
63
+
64
+ # Promote existing knowhow to tool (in place)
65
+ maestro wiki update <id> --frontmatter '{"tool": true, "category": "<cat>", "summary": "..."}'
66
+
67
+ # Load specs by category
68
+ maestro spec load --category <category>
69
+ maestro spec load --category <category> --keyword <word>
70
+ ```