maestro-flow 0.3.43 → 0.3.45

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 (149) 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 +136 -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 +18 -2
  24. package/.claude/commands/spec-load.md +25 -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 +149 -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 +104 -101
  56. package/.codex/skills/spec-load/SKILL.md +73 -77
  57. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  58. package/.codex/skills/wiki-connect/SKILL.md +5 -5
  59. package/.codex/skills/wiki-digest/SKILL.md +8 -8
  60. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +0 -1
  61. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  62. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js +2 -2
  63. package/dashboard/dist-server/dashboard/src/server/state/fs-watcher.js.map +1 -1
  64. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.d.ts +1 -1
  65. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js +1 -1
  66. package/dashboard/dist-server/dashboard/src/server/supervisor/self-learning-service.js.map +1 -1
  67. package/dashboard/dist-server/dashboard/src/server/wiki/search.js +2 -2
  68. package/dashboard/dist-server/dashboard/src/server/wiki/search.js.map +1 -1
  69. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +6 -3
  70. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +29 -14
  71. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  72. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +0 -1
  73. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  74. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.d.ts +1 -2
  75. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +2 -52
  76. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  77. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +68 -33
  78. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  79. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +1 -1
  80. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js +1 -11
  81. package/dashboard/dist-server/dashboard/src/server/wiki/writer-stress.test.js.map +1 -1
  82. package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +5 -4
  83. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +26 -12
  84. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  85. package/dashboard/dist-server/src/agents/cli-agent-runner.js +5 -5
  86. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  87. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +4 -2
  88. package/dashboard/dist-server/src/tools/spec-entry-parser.js +19 -7
  89. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  90. package/dashboard/dist-server/src/tools/spec-loader.d.ts +4 -4
  91. package/dashboard/dist-server/src/tools/spec-loader.js +166 -23
  92. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  93. package/dist/src/agents/cli-agent-runner.js +5 -5
  94. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  95. package/dist/src/commands/knowhow.d.ts.map +1 -1
  96. package/dist/src/commands/knowhow.js +25 -6
  97. package/dist/src/commands/knowhow.js.map +1 -1
  98. package/dist/src/commands/spec.d.ts +1 -1
  99. package/dist/src/commands/spec.d.ts.map +1 -1
  100. package/dist/src/commands/spec.js +70 -3
  101. package/dist/src/commands/spec.js.map +1 -1
  102. package/dist/src/commands/wiki.d.ts.map +1 -1
  103. package/dist/src/commands/wiki.js +45 -6
  104. package/dist/src/commands/wiki.js.map +1 -1
  105. package/dist/src/hooks/keyword-spec-injector.js +1 -1
  106. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  107. package/dist/src/hooks/plugins/spec-injection-plugin.js +2 -2
  108. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  109. package/dist/src/hooks/spec-injector.d.ts +0 -6
  110. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  111. package/dist/src/hooks/spec-injector.js +36 -43
  112. package/dist/src/hooks/spec-injector.js.map +1 -1
  113. package/dist/src/hooks/wiki-role-loader.d.ts +18 -0
  114. package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -0
  115. package/dist/src/hooks/wiki-role-loader.js +43 -0
  116. package/dist/src/hooks/wiki-role-loader.js.map +1 -0
  117. package/dist/src/tools/spec-entry-parser.d.ts +4 -2
  118. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  119. package/dist/src/tools/spec-entry-parser.js +19 -7
  120. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  121. package/dist/src/tools/spec-init.js +54 -54
  122. package/dist/src/tools/spec-loader.d.ts +4 -4
  123. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  124. package/dist/src/tools/spec-loader.js +166 -23
  125. package/dist/src/tools/spec-loader.js.map +1 -1
  126. package/dist/src/tools/spec-writer.d.ts +5 -0
  127. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  128. package/dist/src/tools/spec-writer.js +27 -0
  129. package/dist/src/tools/spec-writer.js.map +1 -1
  130. package/dist/src/tools/store-knowhow.d.ts.map +1 -1
  131. package/dist/src/tools/store-knowhow.js +56 -27
  132. package/dist/src/tools/store-knowhow.js.map +1 -1
  133. package/package.json +1 -1
  134. package/workflows/execute.md +1 -1
  135. package/workflows/harvest.md +13 -13
  136. package/workflows/knowhow.md +72 -11
  137. package/workflows/learn.md +70 -58
  138. package/workflows/milestone-complete.md +1 -1
  139. package/workflows/retrospective.md +50 -56
  140. package/workflows/specs-load.md +15 -14
  141. package/workflows/tools-spec.md +65 -0
  142. package/workflows/ui-codify-extract.md +373 -0
  143. package/workflows/ui-codify-knowhow.md +258 -0
  144. package/workflows/ui-codify-package.md +161 -0
  145. package/workflows/ui-codify.md +225 -0
  146. package/workflows/verify.md +1 -1
  147. package/workflows/wiki-connect.md +7 -7
  148. package/workflows/wiki-digest.md +13 -13
  149. package/workflows/wiki-manage.md +1 -1
@@ -3,8 +3,8 @@
3
3
  Atomic insight capture, search, and retrieval. Lightweight gstack-style "eureka moment" log that complements the retrospective workflow: where retrospective extracts insights from completed phases in bulk, `manage-learn` captures one insight at a time during active work.
4
4
 
5
5
  Storage:
6
- - `.workflow/learning/lessons.jsonl` — append-only JSONL row per insight (shared with retrospective output)
7
- - `.workflow/learning/learning-index.json` searchable index
6
+ - `.workflow/specs/learnings.md` — append-only container of `<spec-entry>` sub-entries (shared with retrospective output)
7
+ - Auto-indexed by WikiIndexer (no manual index required)
8
8
 
9
9
  **Shared store rationale:** Manual captures (`source: "manual"`), tips (`source: "tip"`), retrospective-distilled insights (`source: "retrospective"`, `lens: <name>` from `quality-retrospective`), and learn-retro insights (`source: "retro-git"` or `source: "retro-decision"` from `learn-retro`) all live in the same store so search and list see the entire knowledge corpus. The `source` field disambiguates origin.
10
10
 
@@ -15,7 +15,7 @@ This workflow does NOT spawn agents or call CLI tools. It is a thin file operati
15
15
  ## Prerequisites
16
16
 
17
17
  - `.workflow/` initialized (`.workflow/state.json` exists). If missing, error E001.
18
- - The `learning/` directory and its files are created on first use; do not require them to exist upfront.
18
+ - The `specs/` directory and `learnings.md` are created on first use; do not require them to exist upfront.
19
19
 
20
20
  ---
21
21
 
@@ -23,17 +23,17 @@ This workflow does NOT spawn agents or call CLI tools. It is a thin file operati
23
23
 
24
24
  ```
25
25
  /manage-learn "<insight text>" → capture, infer category, auto-link phase
26
- /manage-learn "<insight>" --category pattern --tag auth,jwt → capture with explicit category and tags
26
+ /manage-learn "<insight>" --category pattern --keywords auth,jwt → capture with explicit category and keywords
27
27
  /manage-learn list → show recent 20 insights
28
- /manage-learn list --tag auth → filtered list
29
- /manage-learn search <query> → text search across lessons.jsonl
28
+ /manage-learn list --keywords auth → filtered list
29
+ /manage-learn search <query> → search via maestro wiki search
30
30
  /manage-learn show <INS-id> → full insight + linked phase context
31
31
  ```
32
32
 
33
33
  | Flag | Effect |
34
34
  |------|--------|
35
35
  | `--category <name>` | One of: pattern, antipattern, decision, tool, gotcha, technique, tip. Default: inferred (tip mode defaults to `tip`). |
36
- | `--tag t1,t2` | Comma-separated tags. Insight mode implicitly adds `manual`, tip mode implicitly adds `tip`. |
36
+ | `--keywords t1,t2` | Comma-separated keywords. Insight mode implicitly adds `manual`, tip mode implicitly adds `tip`. |
37
37
  | `--phase <N>` | Override auto-detected phase link. Use `--phase 0` to force "no phase". |
38
38
  | `--confidence <level>` | high / medium / low. Default: medium (insight), low (tip). |
39
39
  | `--lens <name>` | Filter by retrospective lens: technical, process, quality, decision, git (list/search only). |
@@ -46,7 +46,7 @@ This workflow does NOT spawn agents or call CLI tools. It is a thin file operati
46
46
  ```
47
47
  Verify .workflow/ exists (else E001). Route by first token:
48
48
  "list" → list | "search" → search (next token = query) | "show" → show (next token = INS-id)
49
- "tip" → tip capture (source="tip", category="tip", confidence="low", implicit tag "tip")
49
+ "tip" → tip capture (source="tip", category="tip", confidence="low", implicit keyword "tip")
50
50
  else → capture mode (full quoted text = insight body)
51
51
  Empty args → AskUserQuestion. Invalid --category → E002.
52
52
  ```
@@ -58,15 +58,27 @@ Empty args → AskUserQuestion. Invalid --category → E002.
58
58
  ### Step 2.1: Bootstrap storage
59
59
 
60
60
  ```bash
61
- LEARN_DIR=".workflow/learning"
62
- LESSONS_FILE="$LEARN_DIR/lessons.jsonl"
63
- INDEX_FILE="$LEARN_DIR/learning-index.json"
61
+ SPECS_DIR=".workflow/specs"
62
+ INSIGHTS_FILE="$SPECS_DIR/learnings.md"
64
63
 
65
- mkdir -p "$LEARN_DIR"
66
- touch "$LESSONS_FILE"
64
+ mkdir -p "$SPECS_DIR"
67
65
 
68
- if [ ! -f "$INDEX_FILE" ]; then
69
- echo '{"entries":[],"_metadata":{"created":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","version":"1.0"}}' > "$INDEX_FILE"
66
+ if [ ! -f "$INSIGHTS_FILE" ]; then
67
+ cat > "$INSIGHTS_FILE" << 'EOF'
68
+ ---
69
+ title: "Learning Insights"
70
+ type: spec
71
+ roles: [implement]
72
+ tags: [insights, learning]
73
+ created: $(date -u +%Y-%m-%dT%H:%M:%SZ)
74
+ ---
75
+ # Learning Insights
76
+
77
+ Atomic insights captured during active work.
78
+
79
+ ## Entries
80
+
81
+ EOF
70
82
  fi
71
83
  ```
72
84
 
@@ -102,32 +114,33 @@ Simple keyword heuristics — no LLM call. Match the insight text (lowercased) a
102
114
 
103
115
  First match wins. If nothing matches, category = `technique`.
104
116
 
105
- ### Step 2.5: Build row
117
+ ### Step 2.5: Build spec-entry
106
118
 
107
119
  ```
108
- row = {
109
- id: "INS-{hex}",
110
- phase: phase,
111
- phase_slug: phase_slug,
112
- lens: null, // null for manual capture (only retrospective sets this)
113
- category: category,
114
- title: first 80 chars of insight text (truncated on word boundary),
115
- summary: full insight text,
116
- confidence: --confidence value or "medium",
117
- tags: parsed --tag values + ["manual"],
118
- evidence_refs: [], // empty for manual capture
119
- routed_to: "none",
120
- routed_id: null,
121
- source: "manual",
122
- captured_at: now ISO 8601 UTC
123
- }
120
+ entry = <spec-entry
121
+ category="{category}"
122
+ keywords="{category},{parsed --keywords values joined by comma}"
123
+ date="{YYYY-MM-DD}"
124
+ id="INS-{hex}"
125
+ source="manual"
126
+ >
127
+
128
+ ### {title: first 80 chars of insight text, truncated on word boundary}
129
+
130
+ {full insight text}
131
+
132
+ - **Phase**: {phase or "none"} ({phase_slug or "—"})
133
+ - **Confidence**: {--confidence value or "medium"}
134
+ - **Tags**: {parsed --keywords values + ["manual"]}
135
+
136
+ </spec-entry>
124
137
  ```
125
138
 
126
139
  ### Step 2.6: Persist
127
140
 
128
- Append row as single JSON line to `.workflow/learning/lessons.jsonl`.
141
+ Append the `<spec-entry>` block to `.workflow/specs/learnings.md`.
129
142
 
130
- Update `.workflow/learning/learning-index.json` append an index entry mirroring key row fields: `id`, `type:"insight"`, `timestamp`, `file:"lessons.jsonl"`, `summary` (=title), `tags`, `lens`, `category`, `phase`, `phase_slug`, `confidence`, `routed_to:"none"`, `routed_id:null`.
143
+ WikiIndexer auto-indexes the entry no manual index update required.
131
144
 
132
145
  ### Step 2.7: Confirmation banner
133
146
 
@@ -139,12 +152,12 @@ Display: ID, category, confidence, tags, phase (+slug if present), title, file p
139
152
 
140
153
  ### Step 3.1: Read entries
141
154
 
142
- Read `.workflow/learning/learning-index.json`. Filter by `--tag`, `--category`, `--phase`, `--lens` flags. Sort by timestamp descending. Limit to 20 (or `--limit N`).
155
+ Query via `maestro wiki list --type knowhow --role implement --json`. Filter by `--keywords`, `--category`, `--phase`, `--lens` flags. Sort by timestamp descending. Limit to 20 (or `--limit N`).
143
156
 
144
157
  ### Step 3.2: Display table
145
158
 
146
159
  ```
147
- === LEARNING INSIGHTS ({shown}/{total}) ===
160
+ === KNOWHOW INSIGHTS ({shown}/{total}) ===
148
161
 
149
162
  ID Category Phase Conf Tags Title
150
163
  ────────────── ────────── ────── ───── ─────────────────── ────────────────────────────
@@ -174,9 +187,9 @@ Capture your first: Skill({ skill: "manage-learn", args: "\"...\"" })
174
187
 
175
188
  Next token after "search". Empty → AskUserQuestion.
176
189
 
177
- ### Step 4.2: Scan lessons.jsonl
190
+ ### Step 4.2: Search via wiki
178
191
 
179
- Case-insensitive search across each row's `title`, `summary`, `tags`, `category`, `lens`. Rank matches: title match +3, tags +2, summary +1. Sort by rank desc, then captured_at desc.
192
+ Execute `maestro wiki search "<query>" --type knowhow --json`. Results are ranked by BM25 relevance. Sort by rank desc, then date desc.
180
193
 
181
194
  ### Step 4.3: Display results
182
195
 
@@ -204,45 +217,44 @@ List all: Skill({ skill: "manage-learn", args: "list" })
204
217
 
205
218
  ## Stage 5: show mode
206
219
 
207
- ### Step 5.1: Locate row
220
+ ### Step 5.1: Locate entry
208
221
 
209
- Find row matching target INS-id in `lessons.jsonl`. Missing arg → E003. Not found → E004.
222
+ Find `<spec-entry>` matching target INS-id in `learnings.md`. Missing arg → E003. Not found → E004.
210
223
 
211
224
  ### Step 5.2: Resolve linked phase context (if any)
212
225
 
213
- If `row.phase_slug` set: look up phase directory from `state.json` artifacts, read its `index.json` for title/status, check for `retrospective.md`.
226
+ If `entry.phase_slug` set (parsed from entry content): look up phase directory from `state.json` artifacts, read its `index.json` for title/status, check for `retrospective.md`.
214
227
 
215
228
  ### Step 5.3: Resolve routed artifact (if any)
216
229
 
217
- Map `routed_to` → path: `spec` → `.workflow/specs/{id}`, `issue` → `.workflow/issues/issues.jsonl#{id}`, `note` → `.workflow/knowhow/{id}.md`.
230
+ Map `routed_to` → path: `spec` → `.workflow/specs/{id}`, `issue` → `.workflow/issues/issues.jsonl#{id}`, `knowhow` → `.workflow/knowhow/{id}.md`.
218
231
 
219
232
  ### Step 5.4: Display
220
233
 
221
234
  ```
222
235
  =========================================
223
- INSIGHT: {row.id}
224
- CATEGORY: {row.category}
225
- CONFIDENCE: {row.confidence}
226
- SOURCE: {row.source}{IF row.lens: " (" + row.lens + " lens)"}
236
+ INSIGHT: {entry.id}
237
+ CATEGORY: {entry.category}
238
+ CONFIDENCE: {entry.confidence}
239
+ SOURCE: {entry.source}{IF entry.lens: " (" + entry.lens + " lens)"}
227
240
  =========================================
228
241
 
229
- CAPTURED: {row.captured_at}
230
- PHASE: {row.phase or "none"}{IF phase_slug: " (" + phase_slug + ")"}
231
- TAGS: {row.tags joined by ", "}
242
+ CAPTURED: {entry.date}
243
+ PHASE: {entry.phase or "none"}{IF phase_slug: " (" + phase_slug + ")"}
244
+ TAGS: {entry.keywords}
232
245
 
233
246
  TITLE:
234
- {row.title}
247
+ {entry.title}
235
248
 
236
249
  SUMMARY:
237
- {row.summary}
250
+ {entry.content}
238
251
 
239
252
  EVIDENCE:
240
- {FOR ref in row.evidence_refs:} - {ref}{END FOR}
241
- {OR "(none — manual capture)"}
253
+ {parsed from entry content, or "(none — manual capture)"}
242
254
 
243
255
  ROUTED:
244
- Target: {row.routed_to}
245
- ID: {row.routed_id or "—"}
256
+ Target: {entry.routed_to or "none"}
257
+ ID: {entry.routed_id or "—"}
246
258
  Path: {routed_path or "—"}
247
259
 
248
260
  {IF phase_context:}
@@ -259,7 +271,7 @@ PHASE CONTEXT:
259
271
 
260
272
  | Workflow | Relationship |
261
273
  |----------|--------------|
262
- | `quality-retrospective` | Producer. Writes insights into the same `lessons.jsonl` with `source: "retrospective"` and a populated `lens` field. |
263
- | `manage-knowhow-capture` | Sibling. Captures session state for recovery; `learn` captures timeless insights. They share the JSONL+index pattern but live in different directories so retrieval semantics stay clean. |
274
+ | `quality-retrospective` | Producer. Appends `<spec-entry>` to the same `specs/learnings.md` with `source: "retrospective"` and a populated `lens` field. |
275
+ | `manage-knowhow-capture` | Sibling. Captures session state for recovery; `learn` captures timeless insights. Both write to `.workflow/knowhow/` with different prefixes. |
264
276
  | `phase-transition` | Reader (informally). Phase-transition's free-form `.workflow/specs/learnings.md` is a distinct file with a different audience; do not merge them. |
265
- | `maestro-plan` | Future consumer. Should query `lessons.jsonl` filtered by tag/lens/category to inform planning decisions. (Out of scope for this command.) |
277
+ | `maestro-plan` | Future consumer. Should query via `maestro wiki search` or `maestro wiki list --type knowhow --role implement` to inform planning decisions. (Out of scope for this command.) |
@@ -41,7 +41,7 @@ Archive completed milestone, move artifacts to history, and prepare for next.
41
41
  ## Step 2.5: Load Existing Learnings
42
42
 
43
43
  ```
44
- existing_learnings = maestro spec load --category learning
44
+ existing_learnings = maestro spec load --category coding
45
45
  ```
46
46
 
47
47
  Check existing entries to avoid duplicates when appending in Step 3.
@@ -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 category="{insight.category}" keywords="{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
 
@@ -399,7 +411,7 @@ Append each insight to .workflow/specs/learnings.md as <spec-entry> with:
399
411
  category="learning", 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 category="coding" 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
 
@@ -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>] [--category <category>] [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
+ --category -- filter by category: coding | arch | test | review | debug | quality | learning
13
+ Loads category's primary doc in full + cross-file entries with matching category attr
14
14
  keyword -- optional, grep within loaded specs for matching sections
15
15
  ```
16
16
 
@@ -18,16 +18,17 @@ 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 Category Mapping
22
+
23
+ | File | Category |
24
+ |------|----------|
25
+ | `coding-conventions.md` | coding |
26
+ | `architecture-constraints.md` | arch |
27
+ | `test-conventions.md` | test |
28
+ | `review-standards.md` | review |
29
+ | `debug-notes.md` | debug |
30
+ | `quality-rules.md` | quality |
31
+ | `learnings.md` | learning |
31
32
 
32
33
  ## Layer Order by Scope
33
34
 
@@ -44,7 +45,7 @@ Each layer is prefixed with a section header when multi-layer.
44
45
 
45
46
  ### Step 1: Parse Arguments
46
47
 
47
- Extract `--scope`, `--uid`, `--category <type>` and remaining text (keyword for grep).
48
+ Extract `--scope`, `--uid`, `--category <category>` and remaining text (keyword for grep).
48
49
 
49
50
  ### Step 2: Load Specs via CLI
50
51
 
@@ -0,0 +1,65 @@
1
+ # Tool Spec Reference
2
+
3
+ Shared reference for tool spec registration and execution commands.
4
+
5
+ ## Storage
6
+
7
+ Tool specs are stored as knowhow documents in `.workflow/knowhow/` with `tool: true` in YAML frontmatter. Tool registration creates knowhow files, not spec entries. The `category` field determines which `spec load --category` queries match this tool.
8
+
9
+ ## Entry Format
10
+
11
+ Knowhow document (`knowhow/RCP-<slug>.md`):
12
+ ```yaml
13
+ ---
14
+ title: Tool Name
15
+ type: recipe
16
+ tool: true
17
+ summary: "Use when {timing}. {scope description}"
18
+ tags: [keyword1, keyword2]
19
+ category: coding
20
+ ---
21
+
22
+ ## Prerequisites
23
+ ...
24
+
25
+ ## Steps
26
+ 1. ...
27
+ ```
28
+
29
+ ## Description Rules
30
+
31
+ - First line after `### Title` must state **when to use** this tool
32
+ - For ref entries: `spec load` shows only the first 200 chars after heading — timing must be in that window
33
+ - For ref knowhow docs: YAML `summary` field is shown by `wiki list` and wiki-role-loader hook
34
+
35
+ ## Discovery Path
36
+
37
+ ```
38
+ Register → tools.md → spec load --category <category> / spec-injector auto-inject → agent discovers tool
39
+ ```
40
+
41
+ Agents discover tool specs via:
42
+ - `spec load --category <category>` — returns entries matching the category
43
+ - `spec-injector` hook — auto-injects at Agent launch based on agent type
44
+ - `spec load --keyword <word>` — keyword search across all entries
45
+
46
+ ## Category Reference
47
+
48
+ | Category | Agent types | Tool examples |
49
+ |----------|-------------|---------------|
50
+ | coding | code-developer, workflow-executor | Build, deploy, integrate |
51
+ | test | tdd-developer, test-fix-agent | Test flows, verification steps |
52
+ | review | workflow-reviewer | Checklists, audit standards |
53
+ | arch | workflow-planner | Design flows, analysis steps |
54
+ | debug | debug-explore-agent | Diagnostic flows, investigation |
55
+
56
+ ## CLI Commands
57
+
58
+ ```bash
59
+ # Register tool as knowhow document
60
+ maestro knowhow add "knowhow/RCP-<slug>.md" --type recipe --tool
61
+
62
+ # Load specs by category
63
+ maestro spec load --category <category>
64
+ maestro spec load --category <category> --keyword <word>
65
+ ```