maestro-flow 0.3.19 → 0.3.20

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 (42) hide show
  1. package/.claude/commands/learn-investigate.md +195 -195
  2. package/.claude/commands/learn-retro.md +303 -303
  3. package/.claude/commands/learn-second-opinion.md +167 -167
  4. package/.claude/commands/maestro-amend.md +300 -300
  5. package/.claude/commands/maestro-analyze.md +126 -126
  6. package/.claude/commands/maestro-composer.md +354 -354
  7. package/.claude/commands/maestro-execute.md +114 -114
  8. package/.claude/commands/maestro-learn.md +140 -140
  9. package/.claude/commands/maestro-milestone-audit.md +68 -68
  10. package/.claude/commands/maestro-milestone-complete.md +75 -75
  11. package/.claude/commands/maestro-milestone-release.md +96 -96
  12. package/.claude/commands/maestro-plan.md +138 -138
  13. package/.claude/commands/maestro-player.md +404 -404
  14. package/.claude/commands/maestro-update.md +176 -176
  15. package/.claude/commands/maestro-verify.md +90 -90
  16. package/.claude/commands/manage-codebase-rebuild.md +75 -75
  17. package/.claude/commands/manage-knowhow-capture.md +193 -193
  18. package/.claude/commands/manage-knowhow.md +77 -77
  19. package/.claude/commands/manage-learn.md +67 -67
  20. package/.claude/commands/manage-wiki.md +62 -62
  21. package/.claude/commands/quality-business-test.md +110 -110
  22. package/.claude/commands/quality-retrospective.md +78 -78
  23. package/.claude/commands/spec-add.md +49 -49
  24. package/.claude/commands/spec-load.md +51 -51
  25. package/.claude/commands/spec-remove.md +51 -51
  26. package/.claude/commands/wiki-connect.md +62 -62
  27. package/.claude/commands/wiki-digest.md +69 -69
  28. package/.codex/skills/maestro-link-coordinate/SKILL.md +5 -5
  29. package/.codex/skills/maestro-player/SKILL.md +5 -5
  30. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js +3 -3
  31. package/dashboard/dist-server/dashboard/src/server/coordinator/workflow-coordinator.js.map +1 -1
  32. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js +1 -1
  33. package/dashboard/dist-server/dashboard/src/server/execution/execution-scheduler.js.map +1 -1
  34. package/dist/src/commands/coordinate.js +2 -2
  35. package/dist/src/commands/coordinate.js.map +1 -1
  36. package/dist/src/hooks/coordinator-tracker.d.ts +1 -1
  37. package/dist/src/hooks/coordinator-tracker.js +3 -3
  38. package/dist/src/hooks/coordinator-tracker.js.map +1 -1
  39. package/package.json +1 -1
  40. package/workflows/maestro-link-coordinate.md +3 -3
  41. package/workflows/maestro.codex.md +2 -2
  42. package/workflows/maestro-coordinate.codex.md +0 -281
@@ -1,75 +1,75 @@
1
- ---
2
- name: manage-codebase-rebuild
3
- description: Full rebuild of codebase documentation - scans project, builds doc-index.json, generates all tech-registry and feature-maps
4
- argument-hint: "[--focus <area>] [--force] [--skip-commit]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - Agent
13
- - AskUserQuestion
14
- ---
15
-
16
- <purpose>
17
- Perform a full rebuild of the .workflow/codebase/ documentation system from scratch. Scans the entire project source to identify components, features, requirements, and ADRs, then spawns parallel workflow-codebase-mapper agents to generate all documentation artifacts. This is a destructive operation that overwrites existing codebase docs.
18
-
19
- Can run before or after `/maestro-init` -- works on any codebase with source files. Also serves the previous `spec-map` use case via `--focus <area>` for scoped dimension analysis.
20
- </purpose>
21
-
22
- <required_reading>
23
- @~/.maestro/workflows/codebase-rebuild.md
24
- </required_reading>
25
-
26
- <context>
27
- $ARGUMENTS -- optional flags.
28
-
29
- **Flags:**
30
- - `--focus <area>` -- Scope mapper agents to a single domain (e.g., `auth`, `api`, `database`). When omitted, all 4 mappers run on the full codebase.
31
- - `--force` -- Skip confirmation prompt and proceed directly
32
- - `--skip-commit` -- Do not auto-commit after rebuild
33
-
34
- **Mapper agent assignments (when `--focus` omitted):**
35
- | Agent | Focus | Output file |
36
- |-------|-------|-------------|
37
- | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
38
- | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
39
- | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
40
- | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
41
-
42
- **State files:**
43
- - `.workflow/` -- must be initialized (project.md, state.json exist)
44
- - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
45
- - `.workflow/codebase/doc-index.json` -- generated documentation index
46
- </context>
47
-
48
- <execution>
49
- Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
50
-
51
- **When `--focus <area>` is set:** pass the area string to each mapper agent as scoping context; only regenerate the docs relevant to that scope (leave others untouched unless missing).
52
-
53
- **Next-step routing on completion:**
54
- - View updated project state → `/manage-status`
55
- - Incremental updates later → `/manage-codebase-refresh`
56
- </execution>
57
-
58
- <error_codes>
59
- | Code | Severity | Condition | Recovery |
60
- |------|----------|-----------|----------|
61
- | E001 | error | .workflow/ not initialized | Run maestro-init first to create .workflow/ |
62
- | W001 | warning | A mapper agent failed (partial results) | Retry failed mapper or accept partial results |
63
- | W002 | warning | `.workflow/codebase/` already exists -- user prompted for rebuild/skip | check_existing |
64
- </error_codes>
65
-
66
- <success_criteria>
67
- - [ ] User confirmed rebuild (or --force used)
68
- - [ ] .workflow/codebase/ cleared and rebuilt from scratch (or scoped subset when --focus set)
69
- - [ ] All 4 mapper agents spawned (failures logged as W001)
70
- - [ ] doc-index.json generated and valid
71
- - [ ] All documentation files regenerated
72
- - [ ] state.json updated with rebuild timestamp
73
- - [ ] project.md Tech Stack section updated if changes detected
74
- - [ ] Next step routing: `/manage-status` or `/manage-codebase-refresh` for incremental updates later
75
- </success_criteria>
1
+ ---
2
+ name: manage-codebase-rebuild
3
+ description: Full rebuild of codebase documentation - scans project, builds doc-index.json, generates all tech-registry and feature-maps
4
+ argument-hint: "[--focus <area>] [--force] [--skip-commit]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Agent
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <purpose>
17
+ Perform a full rebuild of the .workflow/codebase/ documentation system from scratch. Scans the entire project source to identify components, features, requirements, and ADRs, then spawns parallel workflow-codebase-mapper agents to generate all documentation artifacts. This is a destructive operation that overwrites existing codebase docs.
18
+
19
+ Can run before or after `/maestro-init` -- works on any codebase with source files. Also serves the previous `spec-map` use case via `--focus <area>` for scoped dimension analysis.
20
+ </purpose>
21
+
22
+ <required_reading>
23
+ @~/.maestro/workflows/codebase-rebuild.md
24
+ </required_reading>
25
+
26
+ <context>
27
+ $ARGUMENTS -- optional flags.
28
+
29
+ **Flags:**
30
+ - `--focus <area>` -- Scope mapper agents to a single domain (e.g., `auth`, `api`, `database`). When omitted, all 4 mappers run on the full codebase.
31
+ - `--force` -- Skip confirmation prompt and proceed directly
32
+ - `--skip-commit` -- Do not auto-commit after rebuild
33
+
34
+ **Mapper agent assignments (when `--focus` omitted):**
35
+ | Agent | Focus | Output file |
36
+ |-------|-------|-------------|
37
+ | Mapper 1 | **Tech stack** -- languages, frameworks, dependencies, build system | `tech-stack.md` |
38
+ | Mapper 2 | **Architecture** -- layers, module boundaries, data flow, entry points | `architecture.md` |
39
+ | Mapper 3 | **Features** -- capabilities, API surface, user-facing functionality | `features.md` |
40
+ | Mapper 4 | **Cross-cutting concerns** -- error handling, logging, auth, config, testing | `concerns.md` |
41
+
42
+ **State files:**
43
+ - `.workflow/` -- must be initialized (project.md, state.json exist)
44
+ - `.workflow/codebase/` -- target directory (will be cleared and rebuilt)
45
+ - `.workflow/codebase/doc-index.json` -- generated documentation index
46
+ </context>
47
+
48
+ <execution>
49
+ Follow '~/.maestro/workflows/codebase-rebuild.md' completely.
50
+
51
+ **When `--focus <area>` is set:** pass the area string to each mapper agent as scoping context; only regenerate the docs relevant to that scope (leave others untouched unless missing).
52
+
53
+ **Next-step routing on completion:**
54
+ - View updated project state → `/manage-status`
55
+ - Incremental updates later → `/manage-codebase-refresh`
56
+ </execution>
57
+
58
+ <error_codes>
59
+ | Code | Severity | Condition | Recovery |
60
+ |------|----------|-----------|----------|
61
+ | E001 | error | .workflow/ not initialized | Run maestro-init first to create .workflow/ |
62
+ | W001 | warning | A mapper agent failed (partial results) | Retry failed mapper or accept partial results |
63
+ | W002 | warning | `.workflow/codebase/` already exists -- user prompted for rebuild/skip | check_existing |
64
+ </error_codes>
65
+
66
+ <success_criteria>
67
+ - [ ] User confirmed rebuild (or --force used)
68
+ - [ ] .workflow/codebase/ cleared and rebuilt from scratch (or scoped subset when --focus set)
69
+ - [ ] All 4 mapper agents spawned (failures logged as W001)
70
+ - [ ] doc-index.json generated and valid
71
+ - [ ] All documentation files regenerated
72
+ - [ ] state.json updated with rebuild timestamp
73
+ - [ ] project.md Tech Stack section updated if changes detected
74
+ - [ ] Next step routing: `/manage-status` or `/manage-codebase-refresh` for incremental updates later
75
+ </success_criteria>
@@ -1,193 +1,193 @@
1
- ---
2
- name: manage-knowhow-capture
3
- description: Capture reusable knowledge into .workflow/knowhow/ — session compact, template, recipe, reference, decision, or tip
4
- argument-hint: "[type] [description] [--lang <lang>] [--source <url>] [--tag tag1,tag2]"
5
- allowed-tools:
6
- - Read
7
- - Write
8
- - Edit
9
- - Bash
10
- - Glob
11
- - Grep
12
- - AskUserQuestion
13
- ---
14
- <purpose>
15
- Capture reusable knowledge into `.workflow/knowhow/` with type-specific structured fields.
16
- Six content types, each optimized for a different reuse pattern. All entries are automatically
17
- indexed by WikiIndexer (type=knowhow) and searchable via `maestro knowhow search`.
18
- </purpose>
19
-
20
- <required_reading>
21
- @~/.maestro/workflows/knowhow.md
22
- </required_reading>
23
-
24
- <context>
25
- Arguments: $ARGUMENTS
26
-
27
- **Types:**
28
-
29
- | Type | Prefix | Use Case | Key Fields |
30
- |------|--------|----------|------------|
31
- | `compact` | KNW- | Session state recovery | objective, files, decisions, plan, pending |
32
- | `template` | TPL- | Code/config templates | language, code block, usage context |
33
- | `recipe` | RCP- | Step-by-step how-to | prerequisites, steps, expected outcome |
34
- | `reference` | REF- | External doc / API quick-ref | source URL, key points, scenarios |
35
- | `decision` | DCS- | Design decision record | context, alternatives, rationale, consequences |
36
- | `tip` | TIP- | Quick note / reminder | content, tags |
37
-
38
- No arguments: auto-detect type or ask user via AskUserQuestion.
39
-
40
- **Flags:**
41
- - `--lang <lang>` — Language for templates (typescript, python, bash, yaml, etc.)
42
- - `--source <url>` — Source URL for references
43
- - `--tag tag1,tag2` — Categorization tags
44
- - `--title <title>` — Explicit title (auto-generated if omitted)
45
- </context>
46
-
47
- <execution>
48
-
49
- ### Step 1: Detect Type
50
-
51
- Parse first token as type. If ambiguous, AskUserQuestion with options:
52
-
53
- | Token Match | Type |
54
- |-------------|------|
55
- | `compact`, `session`, `压缩`, `保存` | compact |
56
- | `template`, `tpl`, `模板` | template |
57
- | `recipe`, `rcp`, `配方`, `步骤` | recipe |
58
- | `reference`, `ref`, `参考`, `引用` | reference |
59
- | `decision`, `dcs`, `决策`, `adr` | decision |
60
- | `tip`, `note`, `记录`, `快速` | tip |
61
- | No match, short text, `--tag` present | tip |
62
- | No arguments | AskUserQuestion (6 options) |
63
-
64
- ### Step 2: Generate Content by Type
65
-
66
- #### compact (KNW-{YYYYMMDD}-{HHMM}.md)
67
-
68
- Extract from conversation history:
69
- - **Session ID** — WFS-* if workflow session active, else `manual-{date}`
70
- - **Project Root** — Absolute path
71
- - **Objective** — High-level goal
72
- - **Execution Plan** — Source + complete verbatim content (never summarize)
73
- - **Working Files** — Modified files with roles (absolute paths, 3-8 files)
74
- - **Reference Files** — Read-only context files
75
- - **Last Action** — Final action + result
76
- - **Decisions** — Table: decision | reasoning
77
- - **Constraints** — User-specified limitations
78
- - **Dependencies** — Added/changed packages
79
- - **Known Issues** — Deferred bugs
80
- - **Changes Made** — Completed modifications
81
- - **Pending** — Next steps
82
- - **Notes** — Unstructured thoughts
83
-
84
- Plan detection priority: workflow session IMPL_PLAN.md > TodoWrite items > user-stated > inferred.
85
-
86
- #### template (TPL-{YYYYMMDD}-{HHMM}.md)
87
-
88
- Ask for or extract:
89
- - **Language / Tech** — `--lang` flag or inferred from context
90
- - **Usage** — When/how to use this template
91
- - **Code** — The template content (ask user to provide or select from conversation)
92
- - **Parameters** — Placeholders to replace (e.g. `{{name}}`, `{{port}}`)
93
- - **Dependencies** — Required packages/config
94
- - **Tags** — From `--tag` flag
95
-
96
- If code not provided explicitly, prompt user: "Paste the template code:"
97
-
98
- #### recipe (RCP-{YYYYMMDD}-{HHMM}.md)
99
-
100
- Ask for or extract:
101
- - **Goal** — What this recipe accomplishes
102
- - **Prerequisites** — Tools, access, config needed
103
- - **Steps** — Numbered step-by-step instructions
104
- - **Expected Outcome** — What success looks like
105
- - **Common Pitfalls** — Known issues / gotchas
106
- - **Related** — Links to templates, references, decisions used
107
- - **Tags** — From `--tag` flag
108
-
109
- If steps not clear, prompt user: "Describe the steps (numbered list):"
110
-
111
- #### reference (REF-{YYYYMMDD}-{HHMM}.md)
112
-
113
- Ask for or extract:
114
- - **Source** — `--source` flag (URL, doc title, API endpoint)
115
- - **Key Points** — Bullet list of essential info
116
- - **Applicable Scenarios** — When to consult this reference
117
- - **Quick Examples** — Copy-paste ready code snippets
118
- - **Last Verified** — Date (today)
119
- - **Tags** — From `--tag` flag
120
-
121
- If `--source` provided, offer to fetch and summarize via WebFetch.
122
-
123
- #### decision (DCS-{YYYYMMDD}-{HHMM}.md)
124
-
125
- Ask for or extract:
126
- - **Context** — Background and problem statement
127
- - **Decision** — What was decided
128
- - **Alternatives Considered** — Table: alternative | pros | cons | rejected because
129
- - **Rationale** — Why this choice over alternatives
130
- - **Consequences** — Positive and negative impact
131
- - **Related** — Links to affected specs, recipes, templates
132
- - **Date** — Decision date
133
- - **Status** — proposed | accepted | superseded
134
-
135
- #### tip (TIP-{YYYYMMDD}-{HHMM}.md)
136
-
137
- Simple note:
138
- - **Content** — Everything after type token (or full $ARGUMENTS)
139
- - **Context** — Auto-detected from recent conversation files
140
- - **Tags** — From `--tag` flag
141
- - **Timestamp** — ISO format
142
-
143
- ### Step 3: Write File
144
-
145
- Write to `.workflow/knowhow/{PREFIX}-{YYYYMMDD}-{HHMM}.md` with YAML frontmatter:
146
-
147
- ```yaml
148
- ---
149
- title: {auto or --title}
150
- type: {type}
151
- category: {type}
152
- created: {ISO timestamp}
153
- tags: [{tags}]
154
- source: {url if reference}
155
- lang: {language if template}
156
- status: {status if decision}
157
- ---
158
- {markdown body}
159
- ```
160
-
161
- ### Step 4: Confirm
162
-
163
- ```
164
- === KNOWHOW CAPTURED ===
165
- Type: {type}
166
- ID: knowhow-{slug}
167
- File: .workflow/knowhow/{filename}
168
-
169
- {type-specific summary line}
170
- ```
171
- </execution>
172
-
173
- <error_codes>
174
- | Code | Severity | Description | Stage |
175
- |------|----------|-------------|-------|
176
- | E001 | error | `.workflow/` not initialized — run `/maestro-init` first | validate |
177
- | E002 | error | Template: no code provided after prompt | template |
178
- | E003 | error | Recipe: no steps provided after prompt | recipe |
179
- | W001 | warning | No active workflow session — compact captures conversation only | compact |
180
- | W002 | warning | Plan detection found no explicit plan — using inferred plan | compact |
181
- | W003 | warning | `--source` URL could not be fetched — proceeding with manual entry | reference |
182
- </error_codes>
183
-
184
- <success_criteria>
185
- - [ ] Type correctly detected or selected
186
- - [ ] All type-specific fields populated (not empty)
187
- - [ ] YAML frontmatter written with correct fields
188
- - [ ] Markdown body follows type structure
189
- - [ ] File written to `.workflow/knowhow/` with correct prefix
190
- - [ ] Auto-indexed by WikiIndexer (type=knowhow)
191
- - [ ] Confirmation displayed with ID, type, file path
192
- - [ ] Next step hint appropriate to type shown
193
- </success_criteria>
1
+ ---
2
+ name: manage-knowhow-capture
3
+ description: Capture reusable knowledge into .workflow/knowhow/ — session compact, template, recipe, reference, decision, or tip
4
+ argument-hint: "[type] [description] [--lang <lang>] [--source <url>] [--tag tag1,tag2]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - AskUserQuestion
13
+ ---
14
+ <purpose>
15
+ Capture reusable knowledge into `.workflow/knowhow/` with type-specific structured fields.
16
+ Six content types, each optimized for a different reuse pattern. All entries are automatically
17
+ indexed by WikiIndexer (type=knowhow) and searchable via `maestro knowhow search`.
18
+ </purpose>
19
+
20
+ <required_reading>
21
+ @~/.maestro/workflows/knowhow.md
22
+ </required_reading>
23
+
24
+ <context>
25
+ Arguments: $ARGUMENTS
26
+
27
+ **Types:**
28
+
29
+ | Type | Prefix | Use Case | Key Fields |
30
+ |------|--------|----------|------------|
31
+ | `compact` | KNW- | Session state recovery | objective, files, decisions, plan, pending |
32
+ | `template` | TPL- | Code/config templates | language, code block, usage context |
33
+ | `recipe` | RCP- | Step-by-step how-to | prerequisites, steps, expected outcome |
34
+ | `reference` | REF- | External doc / API quick-ref | source URL, key points, scenarios |
35
+ | `decision` | DCS- | Design decision record | context, alternatives, rationale, consequences |
36
+ | `tip` | TIP- | Quick note / reminder | content, tags |
37
+
38
+ No arguments: auto-detect type or ask user via AskUserQuestion.
39
+
40
+ **Flags:**
41
+ - `--lang <lang>` — Language for templates (typescript, python, bash, yaml, etc.)
42
+ - `--source <url>` — Source URL for references
43
+ - `--tag tag1,tag2` — Categorization tags
44
+ - `--title <title>` — Explicit title (auto-generated if omitted)
45
+ </context>
46
+
47
+ <execution>
48
+
49
+ ### Step 1: Detect Type
50
+
51
+ Parse first token as type. If ambiguous, AskUserQuestion with options:
52
+
53
+ | Token Match | Type |
54
+ |-------------|------|
55
+ | `compact`, `session`, `压缩`, `保存` | compact |
56
+ | `template`, `tpl`, `模板` | template |
57
+ | `recipe`, `rcp`, `配方`, `步骤` | recipe |
58
+ | `reference`, `ref`, `参考`, `引用` | reference |
59
+ | `decision`, `dcs`, `决策`, `adr` | decision |
60
+ | `tip`, `note`, `记录`, `快速` | tip |
61
+ | No match, short text, `--tag` present | tip |
62
+ | No arguments | AskUserQuestion (6 options) |
63
+
64
+ ### Step 2: Generate Content by Type
65
+
66
+ #### compact (KNW-{YYYYMMDD}-{HHMM}.md)
67
+
68
+ Extract from conversation history:
69
+ - **Session ID** — WFS-* if workflow session active, else `manual-{date}`
70
+ - **Project Root** — Absolute path
71
+ - **Objective** — High-level goal
72
+ - **Execution Plan** — Source + complete verbatim content (never summarize)
73
+ - **Working Files** — Modified files with roles (absolute paths, 3-8 files)
74
+ - **Reference Files** — Read-only context files
75
+ - **Last Action** — Final action + result
76
+ - **Decisions** — Table: decision | reasoning
77
+ - **Constraints** — User-specified limitations
78
+ - **Dependencies** — Added/changed packages
79
+ - **Known Issues** — Deferred bugs
80
+ - **Changes Made** — Completed modifications
81
+ - **Pending** — Next steps
82
+ - **Notes** — Unstructured thoughts
83
+
84
+ Plan detection priority: workflow session IMPL_PLAN.md > TodoWrite items > user-stated > inferred.
85
+
86
+ #### template (TPL-{YYYYMMDD}-{HHMM}.md)
87
+
88
+ Ask for or extract:
89
+ - **Language / Tech** — `--lang` flag or inferred from context
90
+ - **Usage** — When/how to use this template
91
+ - **Code** — The template content (ask user to provide or select from conversation)
92
+ - **Parameters** — Placeholders to replace (e.g. `{{name}}`, `{{port}}`)
93
+ - **Dependencies** — Required packages/config
94
+ - **Tags** — From `--tag` flag
95
+
96
+ If code not provided explicitly, prompt user: "Paste the template code:"
97
+
98
+ #### recipe (RCP-{YYYYMMDD}-{HHMM}.md)
99
+
100
+ Ask for or extract:
101
+ - **Goal** — What this recipe accomplishes
102
+ - **Prerequisites** — Tools, access, config needed
103
+ - **Steps** — Numbered step-by-step instructions
104
+ - **Expected Outcome** — What success looks like
105
+ - **Common Pitfalls** — Known issues / gotchas
106
+ - **Related** — Links to templates, references, decisions used
107
+ - **Tags** — From `--tag` flag
108
+
109
+ If steps not clear, prompt user: "Describe the steps (numbered list):"
110
+
111
+ #### reference (REF-{YYYYMMDD}-{HHMM}.md)
112
+
113
+ Ask for or extract:
114
+ - **Source** — `--source` flag (URL, doc title, API endpoint)
115
+ - **Key Points** — Bullet list of essential info
116
+ - **Applicable Scenarios** — When to consult this reference
117
+ - **Quick Examples** — Copy-paste ready code snippets
118
+ - **Last Verified** — Date (today)
119
+ - **Tags** — From `--tag` flag
120
+
121
+ If `--source` provided, offer to fetch and summarize via WebFetch.
122
+
123
+ #### decision (DCS-{YYYYMMDD}-{HHMM}.md)
124
+
125
+ Ask for or extract:
126
+ - **Context** — Background and problem statement
127
+ - **Decision** — What was decided
128
+ - **Alternatives Considered** — Table: alternative | pros | cons | rejected because
129
+ - **Rationale** — Why this choice over alternatives
130
+ - **Consequences** — Positive and negative impact
131
+ - **Related** — Links to affected specs, recipes, templates
132
+ - **Date** — Decision date
133
+ - **Status** — proposed | accepted | superseded
134
+
135
+ #### tip (TIP-{YYYYMMDD}-{HHMM}.md)
136
+
137
+ Simple note:
138
+ - **Content** — Everything after type token (or full $ARGUMENTS)
139
+ - **Context** — Auto-detected from recent conversation files
140
+ - **Tags** — From `--tag` flag
141
+ - **Timestamp** — ISO format
142
+
143
+ ### Step 3: Write File
144
+
145
+ Write to `.workflow/knowhow/{PREFIX}-{YYYYMMDD}-{HHMM}.md` with YAML frontmatter:
146
+
147
+ ```yaml
148
+ ---
149
+ title: {auto or --title}
150
+ type: {type}
151
+ category: {type}
152
+ created: {ISO timestamp}
153
+ tags: [{tags}]
154
+ source: {url if reference}
155
+ lang: {language if template}
156
+ status: {status if decision}
157
+ ---
158
+ {markdown body}
159
+ ```
160
+
161
+ ### Step 4: Confirm
162
+
163
+ ```
164
+ === KNOWHOW CAPTURED ===
165
+ Type: {type}
166
+ ID: knowhow-{slug}
167
+ File: .workflow/knowhow/{filename}
168
+
169
+ {type-specific summary line}
170
+ ```
171
+ </execution>
172
+
173
+ <error_codes>
174
+ | Code | Severity | Description | Stage |
175
+ |------|----------|-------------|-------|
176
+ | E001 | error | `.workflow/` not initialized — run `/maestro-init` first | validate |
177
+ | E002 | error | Template: no code provided after prompt | template |
178
+ | E003 | error | Recipe: no steps provided after prompt | recipe |
179
+ | W001 | warning | No active workflow session — compact captures conversation only | compact |
180
+ | W002 | warning | Plan detection found no explicit plan — using inferred plan | compact |
181
+ | W003 | warning | `--source` URL could not be fetched — proceeding with manual entry | reference |
182
+ </error_codes>
183
+
184
+ <success_criteria>
185
+ - [ ] Type correctly detected or selected
186
+ - [ ] All type-specific fields populated (not empty)
187
+ - [ ] YAML frontmatter written with correct fields
188
+ - [ ] Markdown body follows type structure
189
+ - [ ] File written to `.workflow/knowhow/` with correct prefix
190
+ - [ ] Auto-indexed by WikiIndexer (type=knowhow)
191
+ - [ ] Confirmation displayed with ID, type, file path
192
+ - [ ] Next step hint appropriate to type shown
193
+ </success_criteria>