maestro-flow 0.3.43 → 0.3.44

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 (169) hide show
  1. package/.claude/commands/learn-decompose.md +10 -15
  2. package/.claude/commands/learn-follow.md +11 -16
  3. package/.claude/commands/learn-investigate.md +18 -22
  4. package/.claude/commands/learn-retro.md +23 -26
  5. package/.claude/commands/learn-second-opinion.md +11 -16
  6. package/.claude/commands/maestro-analyze.md +8 -0
  7. package/.claude/commands/maestro-brainstorm.md +8 -0
  8. package/.claude/commands/maestro-execute.md +11 -3
  9. package/.claude/commands/maestro-learn.md +4 -4
  10. package/.claude/commands/maestro-milestone-complete.md +6 -6
  11. package/.claude/commands/maestro-plan.md +8 -0
  12. package/.claude/commands/maestro-ralph-execute.md +1 -2
  13. package/.claude/commands/maestro-tools-execute.md +117 -0
  14. package/.claude/commands/maestro-tools-register.md +137 -0
  15. package/.claude/commands/maestro-ui-codify.md +67 -0
  16. package/.claude/commands/manage-harvest.md +1 -1
  17. package/.claude/commands/manage-learn.md +5 -7
  18. package/.claude/commands/manage-wiki.md +1 -1
  19. package/.claude/commands/quality-auto-test.md +1 -1
  20. package/.claude/commands/quality-debug.md +8 -0
  21. package/.claude/commands/quality-retrospective.md +4 -5
  22. package/.claude/commands/quality-review.md +8 -0
  23. package/.claude/commands/spec-add.md +25 -4
  24. package/.claude/commands/spec-load.md +26 -6
  25. package/.claude/commands/spec-setup.md +2 -2
  26. package/.claude/commands/wiki-connect.md +1 -1
  27. package/.claude/commands/wiki-digest.md +5 -6
  28. package/.claude/skills/codify-to-knowhow/SKILL.md +167 -0
  29. package/.claude/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  30. package/.claude/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  31. package/.claude/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  32. package/.claude/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  33. package/.codex/skills/codify-to-knowhow/SKILL.md +427 -0
  34. package/.codex/skills/learn-decompose/SKILL.md +8 -8
  35. package/.codex/skills/learn-follow/SKILL.md +6 -6
  36. package/.codex/skills/learn-investigate/SKILL.md +4 -4
  37. package/.codex/skills/learn-retro/SKILL.md +7 -7
  38. package/.codex/skills/learn-second-opinion/SKILL.md +6 -6
  39. package/.codex/skills/maestro-analyze/SKILL.md +491 -491
  40. package/.codex/skills/maestro-collab/SKILL.md +1 -1
  41. package/.codex/skills/maestro-learn/SKILL.md +1 -1
  42. package/.codex/skills/maestro-milestone-complete/SKILL.md +122 -122
  43. package/.codex/skills/maestro-plan/SKILL.md +485 -485
  44. package/.codex/skills/maestro-tools-execute/SKILL.md +105 -0
  45. package/.codex/skills/maestro-tools-register/SKILL.md +144 -0
  46. package/.codex/skills/maestro-ui-codify/SKILL.md +398 -0
  47. package/.codex/skills/maestro-verify/SKILL.md +486 -486
  48. package/.codex/skills/manage-harvest/SKILL.md +3 -3
  49. package/.codex/skills/manage-issue-discover/SKILL.md +431 -431
  50. package/.codex/skills/manage-learn/SKILL.md +13 -13
  51. package/.codex/skills/manage-wiki/SKILL.md +1 -1
  52. package/.codex/skills/quality-auto-test/SKILL.md +553 -553
  53. package/.codex/skills/quality-refactor/SKILL.md +151 -151
  54. package/.codex/skills/quality-retrospective/SKILL.md +6 -6
  55. package/.codex/skills/spec-add/SKILL.md +17 -4
  56. package/.codex/skills/spec-load/SKILL.md +24 -28
  57. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  58. package/.codex/skills/team-review/roles/reviewer/role.md +1 -1
  59. package/.codex/skills/team-tech-debt/roles/scanner/role.md +1 -1
  60. package/.codex/skills/team-testing/roles/executor/role.md +1 -1
  61. package/.codex/skills/team-testing/roles/generator/role.md +1 -1
  62. package/.codex/skills/wiki-connect/SKILL.md +5 -5
  63. package/.codex/skills/wiki-digest/SKILL.md +8 -8
  64. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +2 -1
  67. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  68. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js +2 -2
  69. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js.map +1 -1
  70. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.d.ts +1 -1
  71. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js +1 -1
  72. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js.map +1 -1
  73. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +2 -2
  74. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  75. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +7 -3
  76. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +47 -15
  77. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  78. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +1 -1
  79. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  80. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +1 -2
  81. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +3 -52
  82. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  83. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +67 -21
  84. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  85. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +6 -1
  86. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +1 -11
  87. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
  88. package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +7 -4
  89. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +27 -12
  90. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  91. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +10 -2
  92. package/dashboard/dist-server/src/tools/spec-entry-parser.js +46 -12
  93. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  94. package/dashboard/dist-server/src/tools/spec-loader.d.ts +6 -2
  95. package/dashboard/dist-server/src/tools/spec-loader.js +119 -23
  96. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  97. package/dist/src/commands/knowhow.d.ts.map +1 -1
  98. package/dist/src/commands/knowhow.js +21 -2
  99. package/dist/src/commands/knowhow.js.map +1 -1
  100. package/dist/src/commands/spec.d.ts +1 -1
  101. package/dist/src/commands/spec.d.ts.map +1 -1
  102. package/dist/src/commands/spec.js +78 -4
  103. package/dist/src/commands/spec.js.map +1 -1
  104. package/dist/src/commands/wiki.d.ts.map +1 -1
  105. package/dist/src/commands/wiki.js +51 -3
  106. package/dist/src/commands/wiki.js.map +1 -1
  107. package/dist/src/hooks/keyword-spec-injector.js +1 -1
  108. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  109. package/dist/src/hooks/plugins/spec-injection-plugin.js +11 -11
  110. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  111. package/dist/src/hooks/spec-injector.d.ts +1 -0
  112. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  113. package/dist/src/hooks/spec-injector.js +55 -22
  114. package/dist/src/hooks/spec-injector.js.map +1 -1
  115. package/dist/src/hooks/wiki-role-loader.d.ts +18 -0
  116. package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -0
  117. package/dist/src/hooks/wiki-role-loader.js +43 -0
  118. package/dist/src/hooks/wiki-role-loader.js.map +1 -0
  119. package/dist/src/tools/spec-entry-parser.d.ts +10 -2
  120. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  121. package/dist/src/tools/spec-entry-parser.js +46 -12
  122. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  123. package/dist/src/tools/spec-init.d.ts.map +1 -1
  124. package/dist/src/tools/spec-init.js +19 -0
  125. package/dist/src/tools/spec-init.js.map +1 -1
  126. package/dist/src/tools/spec-loader.d.ts +6 -2
  127. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  128. package/dist/src/tools/spec-loader.js +119 -23
  129. package/dist/src/tools/spec-loader.js.map +1 -1
  130. package/dist/src/tools/spec-writer.d.ts +6 -1
  131. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  132. package/dist/src/tools/spec-writer.js +29 -2
  133. package/dist/src/tools/spec-writer.js.map +1 -1
  134. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  135. package/dist/src/tools/store-knowhow.js +56 -27
  136. package/dist/src/tools/store-knowhow.js.map +1 -1
  137. package/package.json +1 -1
  138. package/workflows/analyze.md +2 -2
  139. package/workflows/auto-test.md +2 -2
  140. package/workflows/brainstorm.md +1 -1
  141. package/workflows/codebase-rebuild.md +1 -1
  142. package/workflows/codebase-refresh.md +1 -1
  143. package/workflows/debug.md +1 -1
  144. package/workflows/execute.md +3 -3
  145. package/workflows/harvest.md +13 -13
  146. package/workflows/integration-test.md +2 -2
  147. package/workflows/issue-discover.md +1 -1
  148. package/workflows/knowhow.md +72 -11
  149. package/workflows/learn.md +70 -58
  150. package/workflows/map.md +1 -1
  151. package/workflows/milestone-complete.md +2 -2
  152. package/workflows/plan.md +1 -1
  153. package/workflows/quick.md +1 -1
  154. package/workflows/refactor.md +1 -1
  155. package/workflows/retrospective.md +51 -57
  156. package/workflows/review.md +1 -1
  157. package/workflows/roadmap-common.md +1 -1
  158. package/workflows/specs-add.md +11 -2
  159. package/workflows/specs-load.md +17 -15
  160. package/workflows/test-gen.md +1 -1
  161. package/workflows/tools-spec.md +98 -0
  162. package/workflows/ui-codify-extract.md +373 -0
  163. package/workflows/ui-codify-knowhow.md +258 -0
  164. package/workflows/ui-codify-package.md +161 -0
  165. package/workflows/ui-codify.md +225 -0
  166. package/workflows/verify.md +1 -1
  167. package/workflows/wiki-connect.md +7 -7
  168. package/workflows/wiki-digest.md +13 -13
  169. package/workflows/wiki-manage.md +1 -1
@@ -1,8 +1,8 @@
1
1
  # Retrospective Workflow
2
2
 
3
- Multi-lens 复盘 of completed phase artifacts. Consumes existing execution outputs (verification.json, review.json, issues.jsonl, .summaries/, state.json, uat.md, plan.json) and routes distilled insights into the spec / note / issue / lessons stores.
3
+ Multi-lens 复盘 of completed phase artifacts. Consumes existing execution outputs (verification.json, review.json, issues.jsonl, .summaries/, state.json, uat.md, plan.json) and routes distilled insights into the spec / note / issue / knowhow stores.
4
4
 
5
- This is a **post-execution analysis** workflow. It reads only — until the routing stage, where it writes new spec stubs, issue rows, memory entries, and lesson rows. It never modifies existing phase artifacts.
5
+ This is a **post-execution analysis** workflow. It reads only — until the routing stage, where it writes new spec stubs, issue rows, memory entries, and knowhow entries. It never modifies existing phase artifacts.
6
6
 
7
7
  ---
8
8
 
@@ -304,24 +304,24 @@ Accept all? [Y/n/i for individual]
304
304
 
305
305
  #### Target: spec
306
306
 
307
- Route spec-routed insights as `<spec-entry>` entries into the appropriate category file. Map insight type to category:
308
- - `pattern` / `convention` → `coding`
309
- - `adr-candidate` / architecture → `arch`
310
- - quality-related → `quality`
307
+ Route spec-routed insights as `<spec-entry>` entries into the appropriate target file. Map insight type to roles:
308
+ - `pattern` / `convention` → `implement`
309
+ - `adr-candidate` / architecture → `plan`
310
+ - quality-related → `review`
311
311
 
312
312
  ```
313
- Map insight type → category → target file:
314
- pattern/convention → coding → coding-conventions.md
315
- adr-candidate/architecture → arch → arch-decisions.md
316
- quality-related → quality → quality-conventions.md
313
+ Map insight type → roles → target file:
314
+ pattern/convention → implement → coding-conventions.md
315
+ adr-candidate/architecture → plan → arch-decisions.md
316
+ quality-related → review → quality-conventions.md
317
317
 
318
318
  Append <spec-entry> to .workflow/specs/{target_file} with:
319
- category, keywords (3-5 extracted from title+summary), date, source="retrospective"
319
+ roles, keywords (3-5 extracted from title+summary), date, source="retrospective"
320
320
  Body: insight title, summary, evidence refs, phase/lens/INS_id/confidence metadata
321
321
 
322
- Create target file with category frontmatter if it does not exist.
322
+ Create target file with roles frontmatter if it does not exist.
323
323
 
324
- insight.routed_id = "{category_file}#INS-{INS_id}"
324
+ insight.routed_id = "{target_file}#INS-{INS_id}"
325
325
  ```
326
326
 
327
327
  #### Target: note
@@ -369,26 +369,38 @@ After all routings complete, re-write `retrospective.json` with the `routed_id`
369
369
 
370
370
  ---
371
371
 
372
- ## Stage 7: persist_lessons
372
+ ## Stage 7: persist_insights
373
373
 
374
- Append every distilled insight (regardless of routing target, including `routed_to: "none"`) to the lessons store.
374
+ Append every distilled insight (regardless of routing target, including `routed_to: "none"`) to the knowhow store.
375
375
 
376
376
  ### Bootstrap
377
377
 
378
378
  ```
379
- Ensure .workflow/learning/lessons.jsonl and learning-index.json exist.
380
- Initialize learning-index.json with {"entries":[],"_metadata":{"created":"...","version":"1.0"}} if new.
379
+ Ensure .workflow/specs/ exists and learnings.md exists.
380
+ Create learnings.md with frontmatter (title, type: spec, roles: [implement]) if new.
381
381
  ```
382
382
 
383
- ### Append rows
383
+ ### Append entries
384
384
 
385
- For each insight in `distilled_insights`, append a JSON line to `.workflow/learning/lessons.jsonl` with fields:
386
- `{ id, phase, phase_slug, lens, category, title, summary, confidence, tags, evidence_refs, routed_to, routed_id, source: "retrospective", captured_at }`
385
+ For each insight in `distilled_insights`, append a `<spec-entry>` to `.workflow/specs/learnings.md`:
387
386
 
388
- ### Update index
387
+ ```html
388
+ <spec-entry roles="{insight.role}" keywords="{insight.category},{insight.tags joined by comma}" date="{YYYY-MM-DD}" id="{insight.id}" source="retrospective">
389
389
 
390
- Append an entry to `.workflow/learning/learning-index.json` entries[] for each new insight:
391
- `{ id, type: "insight", timestamp, file: "lessons.jsonl", summary (80 chars), tags, lens, category, phase, phase_slug, confidence, routed_to, routed_id }`
390
+ ### {insight.title}
391
+
392
+ {insight.summary}
393
+
394
+ - **Phase**: {phase} ({phase_slug})
395
+ - **Lens**: {insight.lens}
396
+ - **Confidence**: {insight.confidence}
397
+ - **Evidence**: {insight.evidence_refs}
398
+ - **Routed to**: {insight.routed_to} ({insight.routed_id or "—"})
399
+
400
+ </spec-entry>
401
+ ```
402
+
403
+ WikiIndexer auto-indexes each entry — no manual index update required.
392
404
 
393
405
  ### Backward-compat append to specs/learnings.md
394
406
 
@@ -396,10 +408,10 @@ Append learnings to `.workflow/specs/learnings.md` (shared with milestone-comple
396
408
 
397
409
  ```
398
410
  Append each insight to .workflow/specs/learnings.md as <spec-entry> with:
399
- category="learning", keywords (3-5 extracted), date, source="retrospective"
411
+ roles="implement", keywords (3-5 extracted), date, source="retrospective"
400
412
  Body: title, summary, phase/lens/INS_id metadata
401
413
 
402
- Create file with category frontmatter + "## Entries" header if it does not exist.
414
+ Create file with roles frontmatter + "## Entries" header if it does not exist.
403
415
  ```
404
416
 
405
417
  ---
@@ -409,12 +421,12 @@ Create file with category frontmatter + "## Entries" header if it does not exist
409
421
  Print confirmation banner and route the user.
410
422
 
411
423
  ```
412
- Print banner: phase, lenses run, insight count, routing summary (spec/note/issue/lesson counts with target paths), output file paths.
424
+ Print banner: phase, lenses run, insight count, routing summary (spec/note/issue/knowhow counts with target paths), output file paths.
413
425
 
414
426
  Suggested next steps:
415
427
  manage-status — Review project state
416
428
  manage-issue list --source retrospective — Triage created issues
417
- manage-learn list — Browse the lessons library
429
+ manage-learn list — Browse the insights library
418
430
  maestro-milestone-audit — Audit milestone if all phases done
419
431
  ```
420
432
 
@@ -484,39 +496,21 @@ If `mode == "range"` or `--all`, loop Stages 3-8 per phase, then print aggregate
484
496
  }
485
497
  ```
486
498
 
487
- ### lessons.jsonl row
499
+ ### spec-entry (in specs/learnings.md)
488
500
 
489
- One JSON object per line:
501
+ ```html
502
+ <spec-entry roles="implement" keywords="pattern,auth,jwt,security" date="2026-04-11" id="INS-a1b2c3d4" source="retrospective">
490
503
 
491
- ```json
492
- {"id":"INS-a1b2c3d4","phase":1,"phase_slug":"01-auth","lens":"technical","category":"pattern","title":"JWT refresh tokens must rotate on every use","summary":"...","confidence":"high","tags":["auth","jwt","security"],"evidence_refs":["..."],"routed_to":"spec","routed_id":"coding-conventions.md#INS-a1b2c3d4","source":"retrospective","captured_at":"2026-04-11T10:00:00Z"}
493
- ```
504
+ ### JWT refresh tokens must rotate on every use
494
505
 
495
- ### learning-index.json
506
+ Refresh-on-use prevents replay attacks. Implemented in src/auth/refresh.ts; should become a project-wide convention.
496
507
 
497
- ```json
498
- {
499
- "entries": [
500
- {
501
- "id": "INS-a1b2c3d4",
502
- "type": "insight",
503
- "timestamp": "2026-04-11T10:00:00Z",
504
- "file": "lessons.jsonl",
505
- "summary": "JWT refresh tokens must rotate on every use",
506
- "tags": ["auth", "jwt", "security"],
507
- "lens": "technical",
508
- "category": "pattern",
509
- "phase": 1,
510
- "phase_slug": "01-auth",
511
- "confidence": "high",
512
- "routed_to": "spec",
513
- "routed_id": "coding-conventions.md#INS-a1b2c3d4"
514
- }
515
- ],
516
- "_metadata": {
517
- "created": "2026-04-11T10:00:00Z",
518
- "version": "1.0"
519
- }
520
- }
508
+ - **Phase**: 1 (01-auth)
509
+ - **Lens**: technical
510
+ - **Confidence**: high
511
+ - **Evidence**: .workflow/scratch/plan-auth-2026-04-15/verification.json#gaps[2]
512
+ - **Routed to**: spec (coding-conventions.md#INS-a1b2c3d4)
513
+
514
+ </spec-entry>
521
515
  ```
522
516
 
@@ -104,7 +104,7 @@ dimensions = --dimensions flag (comma-separated), or level defaults:
104
104
  **Skip if `--skip-specs` flag is set.**
105
105
 
106
106
  ```
107
- specs_content = maestro spec load --category review
107
+ specs_content = maestro spec load --role review
108
108
  ```
109
109
 
110
110
  Pass specs_content to reviewer agents as quality standards context.
@@ -15,7 +15,7 @@ Block if `.workflow/worktree-scope.json` exists — must run from main worktree.
15
15
  ### Load Specs
16
16
 
17
17
  ```
18
- specs_content = maestro spec load --category arch
18
+ specs_content = maestro spec load --role plan
19
19
  ```
20
20
 
21
21
  Ensure phases respect architectural constraints.
@@ -5,11 +5,12 @@ Add a `<spec-entry>` closed-tag entry to a single target spec file by category.
5
5
  ## Arguments
6
6
 
7
7
  ```
8
- $ARGUMENTS: "[--scope <scope>] [--uid <uid>] <category> <content>"
8
+ $ARGUMENTS: "[--scope <scope>] [--uid <uid>] [--roles <csv>] <category> <content>"
9
9
 
10
10
  --scope -- target scope: project (default) | global | team | personal
11
11
  --uid -- user id for personal scope (auto-detected from git if omitted)
12
- category -- one of: coding, arch, quality, debug, test, review, learning
12
+ --roles -- comma-separated applicable roles (implement,plan,test,review,analyze,explore)
13
+ category -- one of: coding, arch, quality, debug, test, review, learning, tools
13
14
  content -- free-text description of the entry
14
15
  ```
15
16
 
@@ -33,6 +34,7 @@ content -- free-text description of the entry
33
34
  | `test` | `test-conventions.md` |
34
35
  | `review` | `review-standards.md` |
35
36
  | `learning` | `learnings.md` |
37
+ | `tools` | `tools.md` |
36
38
 
37
39
  ## Prerequisites
38
40
 
@@ -83,6 +85,13 @@ Auto-extract 3-5 relevant keywords from the content:
83
85
  ```
84
86
  Entry format (closed-tag), date = YYYY-MM-DD, title = first meaningful phrase:
85
87
 
88
+ When --roles provided (new format):
89
+ <spec-entry roles="{role1},{role2}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
90
+ ### {title}
91
+ {content}
92
+ </spec-entry>
93
+
94
+ When --roles not provided (legacy format):
86
95
  <spec-entry category="{category}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
87
96
  ### {title}
88
97
  {content}
@@ -5,12 +5,12 @@ Load spec files filtered by category. Supports project, global, team, and person
5
5
  ## Arguments
6
6
 
7
7
  ```
8
- $ARGUMENTS: "[--scope <scope>] [--uid <uid>] [--category <type>] [keyword]"
8
+ $ARGUMENTS: "[--scope <scope>] [--uid <uid>] [--role <role>] [keyword]"
9
9
 
10
10
  --scope -- load scope: project (default) | global | team | personal
11
11
  --uid -- user id for personal scope (auto-detected from git if omitted)
12
- --category -- filter by category (1:1 mapping to file):
13
- coding | arch | quality | debug | test | review | learning | all
12
+ --role -- filter by role: implement | plan | test | review | analyze | explore
13
+ Loads primary role doc in full + cross-file entries with matching roles attr
14
14
  keyword -- optional, grep within loaded specs for matching sections
15
15
  ```
16
16
 
@@ -18,16 +18,18 @@ keyword -- optional, grep within loaded specs for matching sections
18
18
 
19
19
  Each category loads exactly one file per layer. Same mapping as spec-add.
20
20
 
21
- | Category | File loaded |
22
- |----------|------------|
23
- | `coding` | `coding-conventions.md` |
24
- | `arch` | `architecture-constraints.md` |
25
- | `quality` | `quality-rules.md` |
26
- | `debug` | `debug-notes.md` |
27
- | `test` | `test-conventions.md` |
28
- | `review` | `review-standards.md` |
29
- | `learning` | `learnings.md` |
30
- | `all` (default) | All `.md` files in specs/ |
21
+ ## File Primary Role Mapping
22
+
23
+ | File | Role |
24
+ |------|------|
25
+ | `coding-conventions.md` | implement |
26
+ | `architecture-constraints.md` | plan |
27
+ | `test-conventions.md` | test |
28
+ | `review-standards.md` | review |
29
+ | `debug-notes.md` | analyze |
30
+ | `quality-rules.md` | review |
31
+ | `learnings.md` | implement |
32
+ | `tools.md` | _(per-entry roles)_ |
31
33
 
32
34
  ## Layer Order by Scope
33
35
 
@@ -44,12 +46,12 @@ Each layer is prefixed with a section header when multi-layer.
44
46
 
45
47
  ### Step 1: Parse Arguments
46
48
 
47
- Extract `--scope`, `--uid`, `--category <type>` and remaining text (keyword for grep).
49
+ Extract `--scope`, `--uid`, `--role <role>` and remaining text (keyword for grep).
48
50
 
49
51
  ### Step 2: Load Specs via CLI
50
52
 
51
53
  ```bash
52
- maestro spec load --scope <scope> [--uid <uid>] [--category <category>] [--keyword <word>]
54
+ maestro spec load --scope <scope> [--uid <uid>] [--role <role>] [--keyword <word>]
53
55
  ```
54
56
 
55
57
  If `maestro spec load` CLI is unavailable, read files directly from the resolved directory.
@@ -9,7 +9,7 @@ Tests expose bugs -- fixing is for quality-debug or maestro-execute.
9
9
  ### Step 0: Load Project Specs
10
10
 
11
11
  ```
12
- specs_content = maestro spec load --category test
12
+ specs_content = maestro spec load --role test
13
13
  ```
14
14
 
15
15
  Follow project test conventions in Step 4 (Generate Test Plan) and Step 5 (Write Tests).
@@ -0,0 +1,98 @@
1
+ # Tool Spec Reference
2
+
3
+ Shared reference for tool spec registration and execution commands.
4
+
5
+ ## Storage
6
+
7
+ Tool specs are stored in `.workflow/specs/tools.md` as `<spec-entry>` blocks with per-entry `roles` attribute. The `tools.md` file has no primary role — entries are loaded via role matching.
8
+
9
+ ## Entry Format
10
+
11
+ ### Inline mode (short process, <10 steps)
12
+
13
+ ```xml
14
+ <spec-entry roles="implement,test" keywords="payment,gateway,idempotency" date="YYYY-MM-DD">
15
+
16
+ ### Tool Name
17
+
18
+ Use when {trigger condition / timing}.
19
+
20
+ 1. Step one
21
+ 2. Step two
22
+ ...
23
+
24
+ </spec-entry>
25
+ ```
26
+
27
+ ### Ref mode (long process, >=10 steps or with code examples)
28
+
29
+ Spec index entry in `tools.md`:
30
+ ```xml
31
+ <spec-entry roles="implement" keywords="oauth,pkce,token" date="YYYY-MM-DD"
32
+ ref="knowhow/RCP-<slug>.md">
33
+
34
+ ### Tool Name
35
+
36
+ Use when {trigger condition}. {scope summary — must fit within 200 chars for spec load display}.
37
+
38
+ </spec-entry>
39
+ ```
40
+
41
+ Referenced knowhow document (`knowhow/RCP-<slug>.md`):
42
+ ```yaml
43
+ ---
44
+ title: Tool Name
45
+ type: recipe
46
+ summary: "Use when {timing}. {scope description}"
47
+ tags: [keyword1, keyword2]
48
+ roles: [implement]
49
+ ---
50
+
51
+ ## Prerequisites
52
+ ...
53
+
54
+ ## Steps
55
+ 1. ...
56
+ ```
57
+
58
+ ## Description Rules
59
+
60
+ - First line after `### Title` must state **when to use** this tool
61
+ - For ref entries: `spec load` shows only the first 200 chars after heading — timing must be in that window
62
+ - For ref knowhow docs: YAML `summary` field is shown by `wiki list` and wiki-role-loader hook
63
+
64
+ ## Discovery Path
65
+
66
+ ```
67
+ Register → tools.md → spec load --role <role> / spec-injector auto-inject → agent discovers tool
68
+ ```
69
+
70
+ Agents discover tool specs via:
71
+ - `spec load --role <role>` — returns entries matching the role
72
+ - `spec-injector` hook — auto-injects at Agent launch based on agent type
73
+ - `spec load --keyword <word>` — keyword search across all entries
74
+
75
+ ## Role Reference
76
+
77
+ | Role | Agent types | Tool examples |
78
+ |------|-------------|---------------|
79
+ | implement | code-developer, workflow-executor | Build, deploy, integrate |
80
+ | test | tdd-developer, test-fix-agent | Test flows, verification steps |
81
+ | review | workflow-reviewer | Checklists, audit standards |
82
+ | plan | workflow-planner | Design flows, analysis steps |
83
+ | analyze | debug-explore-agent | Diagnostic flows, investigation |
84
+
85
+ ## CLI Commands
86
+
87
+ ```bash
88
+ # Add inline tool spec
89
+ maestro spec add tools "<title>" "<content>" --roles "<csv>" --keywords "<csv>"
90
+
91
+ # Add ref tool spec with knowhow
92
+ maestro spec add tools "<title>" "<summary>" --roles "<csv>" --keywords "<csv>" \
93
+ --ref "knowhow/RCP-<slug>.md" --knowhow-type recipe
94
+
95
+ # Load tool specs
96
+ maestro spec load --role <role>
97
+ maestro spec load --role <role> --keyword <word>
98
+ ```