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,429 @@
1
+ # KnowHow Workflow
2
+
3
+ ## Dual Store Architecture
4
+
5
+ | Store | Path | Format | Index |
6
+ |-------|------|--------|-------|
7
+ | `workflow` | `.workflow/knowhow/` | `{PREFIX}-*.md` (6 prefixes) | `.workflow/wiki-index.json` (unified, WikiIndexer) |
8
+ | `system` | `~/.claude/projects/{project}/memory/` | `MEMORY.md` + topic `.md` files | None (flat files) |
9
+
10
+ **System memory path detection:**
11
+ ```bash
12
+ # Derive from project root — replace path separators with '--', prefix drive letter
13
+ # e.g., D:\maestro2 → ~/.claude/projects/D--maestro2/memory/
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Content Type Matrix
19
+
20
+ Six types of knowhow, each with dedicated structure:
21
+
22
+ | Type | Prefix | Purpose | Trigger |
23
+ |------|--------|---------|---------|
24
+ | `session` | KNW- | Session state recovery | End of complex task, before context switch |
25
+ | `template` | TPL- | Reusable code/config templates | Extracting a pattern, saving boilerplate |
26
+ | `recipe` | RCP- | Step-by-step operational guide | Documenting a workflow, onboarding |
27
+ | `reference` | REF- | External doc / API quick-reference | Importing docs, saving URL summaries |
28
+ | `decision` | DCS- | Architecture Decision Record | Making non-trivial design choices |
29
+ | `tip` | TIP- | Quick note, snippet, reminder | Fleeting insight, debugging trick |
30
+
31
+ All types share `WikiNodeType = 'knowhow'`. The `type` field distinguishes subtypes in wiki queries.
32
+
33
+ ---
34
+
35
+ ## Part A: KnowHow Management (manage-knowhow)
36
+
37
+ Operations: list, search, view, edit, delete, prune across both stores.
38
+
39
+ ### Step 1: Resolve Paths
40
+
41
+ - **Workflow**: `.workflow/knowhow/` (index: `.workflow/wiki-index.json`)
42
+ - **System**: `~/.claude/projects/{project-path}/memory/`
43
+
44
+ Verify stores exist. Neither → E001.
45
+
46
+ ### Step 2: Parse Input
47
+
48
+ | Input | Route |
49
+ |-------|-------|
50
+ | No arguments, `list`, `列表`, `ls` | List mode |
51
+ | `search <query>`, `搜索`, `find` | Search mode |
52
+ | `view <id\|file>`, `查看`, `show` | View mode |
53
+ | `edit <file>`, `编辑` | Edit mode (system store only) |
54
+ | `delete <id\|file>`, `删除`, `rm` | Delete mode |
55
+ | `prune`, `清理`, `cleanup` | Prune mode |
56
+
57
+ **Store auto-detection:** Arguments matching `KNW-*`, `TIP-*`, `TPL-*`, `RCP-*`, `REF-*`, `DCS-*` → workflow store. Other filenames → system store.
58
+
59
+ ### Step 3: List
60
+
61
+ Workflow: `maestro wiki list --type knowhow --json`, filter by `--keywords`, `--type`, `--role`.
62
+ System: Glob `*.md` files, extract titles.
63
+
64
+ Display: ID/File, Type, Category, Date, Tags, Summary with navigation hints.
65
+
66
+ ### Step 4: Search
67
+
68
+ Full-text search across both stores. Rank: exact match > heading > content.
69
+
70
+ ### Step 5-9: View, Edit, Delete, Prune, Integrity Check
71
+
72
+ MANDATORY: execute View/Edit/Delete/Prune/Integrity-Check logic per spec; REQUIRED produce: per-step result + final store-consistency report; BLOCKED if any step's produce missing.
73
+
74
+ - **View**: Workflow `maestro wiki get <slug>`, System Read file; BLOCKED if entry not found.
75
+ - **Edit**: System store only, direct file edit preserving frontmatter; BLOCKED if frontmatter schema invalid after edit.
76
+ - **Delete**: Workflow `maestro wiki delete <slug>`, System mv to `.workflow/.trash/`; REQUIRED produce backup; BLOCKED if backup missing.
77
+ - **Prune**: Scan `status=deprecated|superseded` entries, list candidates, delete after confirm; REQUIRED produce prune report; BLOCKED if delete without backup.
78
+ - **Integrity Check**: Workflow verify `wiki-index.json` matches disk, System verify MEMORY.md links; REQUIRED produce report {missing[], stale[]}; BLOCKED if missing>0.
79
+
80
+ ---
81
+
82
+ ## Part B: KnowHow Capture (manage-knowhow-capture)
83
+
84
+ Capture reusable knowledge into `.workflow/knowhow/`.
85
+
86
+ ### Step 1: Detect Type
87
+
88
+ | Token | Type |
89
+ |-------|------|
90
+ | `compact`, `session`, `压缩` | session |
91
+ | `template`, `tpl`, `模板` | template |
92
+ | `recipe`, `rcp`, `配方`, `步骤` | recipe |
93
+ | `reference`, `ref`, `参考` | reference |
94
+ | `decision`, `dcs`, `决策`, `adr` | decision |
95
+ | `tip`, `note`, `记录` | tip |
96
+ | No arguments | AskUserQuestion (6 options) |
97
+
98
+ ### Step 2: Generate Content by Type
99
+
100
+ #### session (KNW-{YYYYMMDD}-{slug}.md)
101
+
102
+ Extract from current conversation. Sections:
103
+
104
+ 1. **Session ID** — WFS-* or `manual-{date}`
105
+ 2. **Project Root** — Absolute path
106
+ 3. **Objective** — High-level goal
107
+ 4. **Execution Plan** — Source type + complete verbatim content
108
+ 5. **Working Files** — 3-8 modified files with roles, absolute paths
109
+ 6. **Reference Files** — Key context files (CLAUDE.md, types, configs)
110
+ 7. **Last Action** — Final action + result
111
+ 8. **Decisions** — `| Decision | Reasoning |` table
112
+ 9. **Constraints** — User-specified limitations
113
+ 10. **Dependencies** — Added/changed packages
114
+ 11. **Known Issues** — Deferred bugs
115
+ 12. **Changes Made** — Completed modifications
116
+ 13. **Pending** — Next steps
117
+ 14. **Notes** — Unstructured
118
+
119
+ Plan detection priority: IMPL_PLAN.md > TodoWrite > user-stated > inferred.
120
+ Rules: VERBATIM plan, ABSOLUTE paths, decisions include reasoning.
121
+
122
+ #### template (TPL-{YYYYMMDD}-{slug}.md)
123
+
124
+ Reusable code or configuration pattern. Sections:
125
+
126
+ ```markdown
127
+ ---
128
+ title: {descriptive name}
129
+ description: {one-line summary for search results}
130
+ type: template
131
+ lang: {typescript|python|bash|yaml|...}
132
+ tags: [{comma-separated}]
133
+ created: {ISO timestamp}
134
+ ---
135
+
136
+ # {title}
137
+
138
+ ## Usage
139
+ When and how to use this template.
140
+
141
+ ## Parameters
142
+ | Placeholder | Description | Default |
143
+ |-------------|-------------|---------|
144
+ | `{{name}}` | ... | ... |
145
+
146
+ ## Dependencies
147
+ - package-list
148
+
149
+ ## Code
150
+ ```{lang}
151
+ {copy-paste ready code}
152
+ ```
153
+
154
+ ## Notes
155
+ Additional context.
156
+ ```
157
+
158
+ #### recipe (RCP-{YYYYMMDD}-{slug}.md)
159
+
160
+ Step-by-step operational guide. Sections:
161
+
162
+ ```markdown
163
+ ---
164
+ title: {goal summary}
165
+ description: {one-line summary for search results}
166
+ type: recipe
167
+ tags: [{comma-separated}]
168
+ created: {ISO timestamp}
169
+ ---
170
+
171
+ # {title}
172
+
173
+ ## Goal
174
+ What this recipe accomplishes.
175
+
176
+ ## Prerequisites
177
+ - Tool/access/config requirements
178
+
179
+ ## Steps
180
+ 1. First step
181
+ 2. Second step
182
+ ...
183
+
184
+ ## Expected Outcome
185
+ What success looks like.
186
+
187
+ ## Common Pitfalls
188
+ - Gotcha 1
189
+ - Gotcha 2
190
+
191
+ ## Related
192
+ - [[recipe-xxx]] — Related recipes
193
+ - [[template-xxx]] — Templates used
194
+ ```
195
+
196
+ #### reference (REF-{YYYYMMDD}-{slug}.md)
197
+
198
+ External documentation digest. Sections:
199
+
200
+ ```markdown
201
+ ---
202
+ title: {reference title}
203
+ description: {one-line summary for search results}
204
+ type: reference
205
+ source: {original URL}
206
+ tags: [{comma-separated}]
207
+ created: {ISO timestamp}
208
+ last_verified: {ISO date}
209
+ ---
210
+
211
+ # {title}
212
+
213
+ ## Source
214
+ {URL or document reference}
215
+
216
+ ## Key Points
217
+ - Essential info point 1
218
+ - Essential info point 2
219
+
220
+ ## Applicable Scenarios
221
+ - When to consult this reference
222
+
223
+ ## Quick Examples
224
+ ```lang
225
+ {copy-paste examples}
226
+ ```
227
+
228
+ ## Notes
229
+ Additional context.
230
+ ```
231
+
232
+ #### decision (DCS-{YYYYMMDD}-{slug}.md)
233
+
234
+ Architecture Decision Record. Sections:
235
+
236
+ ```markdown
237
+ ---
238
+ title: {decision summary}
239
+ description: {one-line summary for search results}
240
+ type: decision
241
+ status: {proposed|accepted|superseded}
242
+ tags: [{comma-separated}]
243
+ created: {ISO timestamp}
244
+ ---
245
+
246
+ # {title}
247
+
248
+ ## Context
249
+ Background and problem statement.
250
+
251
+ ## Decision
252
+ What was decided.
253
+
254
+ ## Alternatives Considered
255
+ | Alternative | Pros | Cons | Rejected Because |
256
+ |-------------|------|------|------------------|
257
+ | Option A | ... | ... | ... |
258
+ | Option B | ... | ... | ... |
259
+
260
+ ## Rationale
261
+ Why this choice over alternatives.
262
+
263
+ ## Consequences
264
+ ### Positive
265
+ - Benefit 1
266
+
267
+ ### Negative
268
+ - Trade-off 1
269
+
270
+ ## Related
271
+ - [[spec-xxx]] — Affected spec
272
+ - [[recipe-xxx]] — Implementation recipe
273
+ ```
274
+
275
+ #### tip (TIP-{YYYYMMDD}-{slug}.md)
276
+
277
+ Quick note. Minimal structure:
278
+
279
+ ```markdown
280
+ ---
281
+ title: {tip summary}
282
+ description: {one-line summary for search results}
283
+ type: tip
284
+ tags: [{comma-separated}]
285
+ created: {ISO timestamp}
286
+ ---
287
+
288
+ # {title}
289
+
290
+ {content}
291
+
292
+ ## Context
293
+ {Auto-detected files/modules}
294
+ ```
295
+
296
+ ### Step 3: Generate Tags (Language-Aware)
297
+
298
+ Auto-generate 3-5 tags matching the **content language**:
299
+
300
+ - **Chinese content** → Chinese tags (2-4 字词语,如 `认证`, `路由`, `状态管理`)
301
+ - **English content** → English tags (lowercase, hyphenated, e.g. `auth`, `routing`, `state-mgmt`)
302
+ - **Mixed content** → Bilingual tags (中英各半,如 `认证,auth,令牌,token`)
303
+
304
+ Tag quality rules:
305
+ - Domain-specific terms users would naturally search for
306
+ - Avoid generic words (代码/code, 文件/file, 函数/function)
307
+ - Chinese tags: 2-4 characters, no punctuation
308
+ - English tags: lowercase, hyphens for multi-word
309
+
310
+ ### Step 4: Write File
311
+
312
+ Write to `.workflow/knowhow/{PREFIX}-{YYYYMMDD}-{slug}.md`.
313
+
314
+ Frontmatter keys by type:
315
+
316
+ | Field | session | template | recipe | reference | decision | tip |
317
+ |-------|:-------:|:--------:|:------:|:---------:|:--------:|:---:|
318
+ | title | Y | Y | Y | Y | Y | Y |
319
+ | description | Y | Y | Y | Y | Y | Y |
320
+ | type | Y | Y | Y | Y | Y | Y |
321
+ | tags | Y | Y | Y | Y | Y | Y |
322
+ | created | Y | Y | Y | Y | Y | Y |
323
+ | lang | | Y | | | | |
324
+ | source | | | | Y | | |
325
+ | status | | | | | Y | |
326
+ | last_verified | | | | Y | | |
327
+
328
+ ### Step 4: Report
329
+
330
+ Display confirmation with ID, type, file path, and type-specific summary line.
331
+
332
+ ---
333
+
334
+ ## Part C: Retrieval
335
+
336
+ ### CLI
337
+
338
+ ```bash
339
+ maestro knowhow list # all entries
340
+ maestro knowhow list --type template # by type
341
+ maestro knowhow search "deploy auth" # full-text
342
+ maestro knowhow get knowhow-{slug} # view one
343
+
344
+ maestro wiki list --type knowhow --json # programmatic
345
+ maestro wiki list --type knowhow --role plan # decisions only
346
+ ```
347
+
348
+ ### MCP
349
+
350
+ ```
351
+ store_knowhow { operation: "search", query: "deploy" }
352
+ store_knowhow { operation: "add", type: "template", title: "...", description: "...", body: "..." }
353
+ ```
354
+
355
+ ### Type Label Reference
356
+
357
+ | Wiki type | Type | Prefix | Label |
358
+ |-----------|------|--------|-------|
359
+ | knowhow | session | KNW- | Session |
360
+ | knowhow | tip | TIP- | Tip |
361
+ | knowhow | template | TPL- | Template |
362
+ | knowhow | recipe | RCP- | Recipe |
363
+ | knowhow | reference | REF- | Reference |
364
+ | knowhow | decision | DCS- | Decision |
365
+ | spec | learning | — | Learning Insight (in `specs/learnings.md`) |
366
+
367
+ ---
368
+
369
+ ## Part D: Learning Insights Container (specs/learnings.md)
370
+
371
+ ### Container Format
372
+
373
+ ```markdown
374
+ ---
375
+ title: "Learning Insights"
376
+ type: spec
377
+ roles: [implement]
378
+ tags: [insights, learning]
379
+ created: {ISO timestamp}
380
+ ---
381
+ # Learning Insights
382
+
383
+ Atomic insights captured during active work.
384
+
385
+ ## Entries
386
+
387
+ <spec-entry category="coding" keywords="pattern,auth,jwt" date="2026-05-10" id="INS-abc123" source="manual">
388
+
389
+ ### JWT refresh tokens must rotate on every use
390
+
391
+ Refresh-on-use prevents replay attacks.
392
+
393
+ - **Phase**: 1 (01-auth)
394
+ - **Confidence**: high
395
+ - **Tags**: auth, jwt, security
396
+
397
+ </spec-entry>
398
+
399
+ <spec-entry category="debug" keywords="gotcha,redis,cache" date="2026-05-11" id="INS-def456" source="retrospective">
400
+
401
+ ### Redis MULTI is not truly transactional
402
+
403
+ MULTI/EXEC guarantees atomicity but not isolation...
404
+
405
+ - **Phase**: 2 (02-cache)
406
+ - **Lens**: technical
407
+ - **Confidence**: medium
408
+
409
+ </spec-entry>
410
+ ```
411
+
412
+ ### Producers
413
+
414
+ Multiple workflows append `<spec-entry>` blocks to this container:
415
+
416
+ | Workflow | Source value | When |
417
+ |----------|-------------|------|
418
+ | `manage-learn` | `manual` or `tip` | Manual capture during active work |
419
+ | `quality-retrospective` | `retrospective` | Phase retrospective insight distillation |
420
+ | `learn-retro` | `retro-git` or `retro-decision` | Retrospective from git activity or decisions |
421
+ | `wiki-connect` | `wiki-connect` | Graph connectivity insights |
422
+ | `wiki-digest` | `wiki-digest` | Knowledge synthesis meta-insights |
423
+
424
+ ### Retrieval
425
+
426
+ ```bash
427
+ maestro wiki list --type knowhow --role implement # list all insights
428
+ maestro wiki search "<query>" # full-text search
429
+ ```