maestro-flow 0.3.44 → 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 (123) hide show
  1. package/.claude/commands/learn-decompose.md +1 -1
  2. package/.claude/commands/learn-follow.md +1 -1
  3. package/.claude/commands/learn-investigate.md +1 -1
  4. package/.claude/commands/learn-retro.md +1 -1
  5. package/.claude/commands/learn-second-opinion.md +1 -1
  6. package/.claude/commands/maestro-analyze.md +1 -1
  7. package/.claude/commands/maestro-brainstorm.md +1 -1
  8. package/.claude/commands/maestro-execute.md +1 -1
  9. package/.claude/commands/maestro-plan.md +1 -1
  10. package/.claude/commands/maestro-tools-execute.md +14 -14
  11. package/.claude/commands/maestro-tools-register.md +25 -26
  12. package/.claude/commands/quality-debug.md +1 -1
  13. package/.claude/commands/quality-review.md +1 -1
  14. package/.claude/commands/spec-add.md +7 -12
  15. package/.claude/commands/spec-load.md +15 -16
  16. package/.claude/skills/codify-to-knowhow/SKILL.md +1 -1
  17. package/.claude/skills/codify-to-knowhow/phases/04-index-verify.md +1 -1
  18. package/.codex/skills/codify-to-knowhow/SKILL.md +2 -2
  19. package/.codex/skills/maestro-analyze/SKILL.md +1 -1
  20. package/.codex/skills/maestro-collab/SKILL.md +1 -1
  21. package/.codex/skills/maestro-milestone-complete/SKILL.md +1 -1
  22. package/.codex/skills/maestro-plan/SKILL.md +1 -1
  23. package/.codex/skills/maestro-tools-execute/SKILL.md +12 -12
  24. package/.codex/skills/maestro-tools-register/SKILL.md +149 -144
  25. package/.codex/skills/maestro-ui-codify/SKILL.md +1 -1
  26. package/.codex/skills/maestro-verify/SKILL.md +1 -1
  27. package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
  28. package/.codex/skills/quality-auto-test/SKILL.md +2 -2
  29. package/.codex/skills/quality-refactor/SKILL.md +1 -1
  30. package/.codex/skills/spec-add/SKILL.md +104 -114
  31. package/.codex/skills/spec-load/SKILL.md +73 -73
  32. package/.codex/skills/team-quality-assurance/roles/executor/role.md +1 -1
  33. package/.codex/skills/team-review/roles/reviewer/role.md +1 -1
  34. package/.codex/skills/team-tech-debt/roles/scanner/role.md +1 -1
  35. package/.codex/skills/team-testing/roles/executor/role.md +1 -1
  36. package/.codex/skills/team-testing/roles/generator/role.md +1 -1
  37. package/dashboard/dist-server/dashboard/src/server/routes/specs.js +1 -1
  38. package/dashboard/dist-server/dashboard/src/server/routes/specs.js.map +1 -1
  39. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js +0 -2
  40. package/dashboard/dist-server/dashboard/src/server/routes/wiki.js.map +1 -1
  41. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.d.ts +0 -1
  42. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js +6 -23
  43. package/dashboard/dist-server/dashboard/src/server/wiki/spec-entry-parser.js.map +1 -1
  44. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js +0 -1
  45. package/dashboard/dist-server/dashboard/src/server/wiki/stress.test.js.map +1 -1
  46. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js +0 -1
  47. package/dashboard/dist-server/dashboard/src/server/wiki/virtual-wiki-adapters.js.map +1 -1
  48. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +25 -36
  49. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  50. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-types.d.ts +0 -5
  51. package/dashboard/dist-server/dashboard/src/server/wiki/writer.d.ts +0 -2
  52. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js +2 -3
  53. package/dashboard/dist-server/dashboard/src/server/wiki/writer.js.map +1 -1
  54. package/dashboard/dist-server/src/agents/cli-agent-runner.js +5 -5
  55. package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
  56. package/dashboard/dist-server/src/tools/spec-entry-parser.d.ts +3 -9
  57. package/dashboard/dist-server/src/tools/spec-entry-parser.js +9 -31
  58. package/dashboard/dist-server/src/tools/spec-entry-parser.js.map +1 -1
  59. package/dashboard/dist-server/src/tools/spec-loader.d.ts +5 -9
  60. package/dashboard/dist-server/src/tools/spec-loader.js +99 -52
  61. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  62. package/dist/src/agents/cli-agent-runner.js +5 -5
  63. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  64. package/dist/src/commands/knowhow.js +4 -4
  65. package/dist/src/commands/knowhow.js.map +1 -1
  66. package/dist/src/commands/spec.d.ts.map +1 -1
  67. package/dist/src/commands/spec.js +7 -14
  68. package/dist/src/commands/spec.js.map +1 -1
  69. package/dist/src/commands/wiki.d.ts.map +1 -1
  70. package/dist/src/commands/wiki.js +11 -20
  71. package/dist/src/commands/wiki.js.map +1 -1
  72. package/dist/src/hooks/plugins/spec-injection-plugin.js +10 -10
  73. package/dist/src/hooks/plugins/spec-injection-plugin.js.map +1 -1
  74. package/dist/src/hooks/spec-injector.d.ts +0 -7
  75. package/dist/src/hooks/spec-injector.d.ts.map +1 -1
  76. package/dist/src/hooks/spec-injector.js +41 -81
  77. package/dist/src/hooks/spec-injector.js.map +1 -1
  78. package/dist/src/hooks/wiki-role-loader.d.ts +5 -5
  79. package/dist/src/hooks/wiki-role-loader.d.ts.map +1 -1
  80. package/dist/src/hooks/wiki-role-loader.js +6 -6
  81. package/dist/src/hooks/wiki-role-loader.js.map +1 -1
  82. package/dist/src/tools/spec-entry-parser.d.ts +3 -9
  83. package/dist/src/tools/spec-entry-parser.d.ts.map +1 -1
  84. package/dist/src/tools/spec-entry-parser.js +9 -31
  85. package/dist/src/tools/spec-entry-parser.js.map +1 -1
  86. package/dist/src/tools/spec-init.d.ts.map +1 -1
  87. package/dist/src/tools/spec-init.js +54 -73
  88. package/dist/src/tools/spec-init.js.map +1 -1
  89. package/dist/src/tools/spec-loader.d.ts +5 -9
  90. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  91. package/dist/src/tools/spec-loader.js +99 -52
  92. package/dist/src/tools/spec-loader.js.map +1 -1
  93. package/dist/src/tools/spec-writer.d.ts +1 -1
  94. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  95. package/dist/src/tools/spec-writer.js +2 -2
  96. package/dist/src/tools/spec-writer.js.map +1 -1
  97. package/package.json +1 -1
  98. package/workflows/analyze.md +2 -2
  99. package/workflows/auto-test.md +2 -2
  100. package/workflows/brainstorm.md +1 -1
  101. package/workflows/codebase-rebuild.md +1 -1
  102. package/workflows/codebase-refresh.md +1 -1
  103. package/workflows/debug.md +1 -1
  104. package/workflows/execute.md +3 -3
  105. package/workflows/integration-test.md +2 -2
  106. package/workflows/issue-discover.md +1 -1
  107. package/workflows/knowhow.md +2 -2
  108. package/workflows/learn.md +1 -1
  109. package/workflows/map.md +1 -1
  110. package/workflows/milestone-complete.md +2 -2
  111. package/workflows/plan.md +1 -1
  112. package/workflows/quick.md +1 -1
  113. package/workflows/refactor.md +1 -1
  114. package/workflows/retrospective.md +3 -3
  115. package/workflows/review.md +1 -1
  116. package/workflows/roadmap-common.md +1 -1
  117. package/workflows/specs-add.md +2 -11
  118. package/workflows/specs-load.md +13 -14
  119. package/workflows/test-gen.md +1 -1
  120. package/workflows/tools-spec.md +17 -50
  121. package/workflows/ui-codify-knowhow.md +1 -1
  122. package/workflows/ui-codify.md +1 -1
  123. package/workflows/verify.md +1 -1
@@ -1,144 +1,149 @@
1
- ---
2
- name: maestro-tools-register
3
- description: Register tool specs - extract, generate, or optimize reusable process definitions
4
- argument-hint: "[description or intent]"
5
- allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
6
- ---
7
-
8
- <purpose>
9
- Codify reusable business processes as tool specs into `.workflow/specs/tools.md`. Once registered, entries are auto-discovered by downstream agents via `spec load --role` and spec-injector — plan agents pick up design/architecture flows, test agents pick up verification methods, implement agents pick up execution steps.
10
-
11
- Three modes:
12
-
13
- 1. **Extract** — Pull reusable processes from conversations/code/docs
14
- 2. **Generate** — Create new tool definitions from user description
15
- 3. **Optimize** — Improve existing tool spec steps, structure, clarity
16
-
17
- Short processes (<10 steps) inline; long processes (>=10 steps or with code examples) use ref mode with knowhow detail doc (RCP-/DOC-).
18
- </purpose>
19
-
20
- <context>
21
- $ARGUMENTS — User intent description, or empty (interactive guidance)
22
-
23
- ```bash
24
- $maestro-tools-register "extract OAuth PKCE token exchange flow from src/auth/"
25
- $maestro-tools-register "generate Stripe webhook idempotency verification --roles implement,test"
26
- $maestro-tools-register "generate E2E checkout flow with payment gateway mock setup --roles test"
27
- $maestro-tools-register "optimize e2e-checkout tool"
28
- ```
29
-
30
- **Tool spec storage**: `.workflow/specs/tools.md`, format:
31
- ```xml
32
- <spec-entry roles="implement,test" keywords="testing,api" date="YYYY-MM-DD">
33
- ### Tool Name
34
- Step content...
35
- </spec-entry>
36
- ```
37
-
38
- **Ref mode** (long processes):
39
- ```xml
40
- <spec-entry roles="implement" keywords="deploy,pipeline" date="YYYY-MM-DD"
41
- ref="knowhow/RCP-deploy-flow.md">
42
- ### Deploy Flow
43
- Standard deployment process. See referenced document.
44
- </spec-entry>
45
- ```
46
- </context>
47
-
48
- <execution>
49
-
50
- ### Step 1: Intent Detection
51
-
52
- Parse $ARGUMENTS to determine mode:
53
- - Contains "extract" extract mode
54
- - Contains "optimize/improve" optimize mode
55
- - Other → generate mode
56
- - Empty ask user with AskUserQuestion
57
-
58
- ### Step 2: Gather Information
59
-
60
- **Extract mode**:
61
- - Identify source (current conversation, specified files, codebase scan)
62
- - Extract step sequence, prerequisites, expected outputs
63
-
64
- **Generate mode**:
65
- - Confirm tool name, applicable roles, target scenario
66
- - If unclear, ask user with AskUserQuestion
67
-
68
- **Optimize mode**:
69
- - Load existing tool: `maestro spec load --role implement --keyword <name>`
70
- - Analyze improvement points (step splitting, prerequisites, error handling)
71
-
72
- **For all modes** — identify the usage timing: when should an agent or user invoke this tool? This becomes the first line of the entry description (see Step 5).
73
-
74
- ### Step 3: Determine Roles
75
-
76
- Infer applicable roles from context, or ask user:
77
- - implementexecution tools (build, deploy, integrate)
78
- - testtesting tools (test flows, verification steps)
79
- - reviewreview tools (checklists, audit standards)
80
- - plan — planning tools (design flows, analysis steps)
81
- - analyze analysis tools (diagnostic flows, investigation steps)
82
-
83
- ### Step 4: Decide Inline vs Ref
84
-
85
- - Steps <10 and no code blocks → **inline mode**
86
- - Steps >=10 or contains code examples/config → **ref mode**
87
-
88
- ### Step 5: Write
89
-
90
- **Description format**: First line after `### Title` must state **when to use** this tool (the usage timing from Step 2). This is critical for ref entries — `spec load` only shows the first 200 chars after the heading as the summary.
91
-
92
- ```
93
- ### {Title}
94
-
95
- Use when {timing/trigger condition}.
96
-
97
- 1. Step one ...
98
- ```
99
-
100
- **Inline mode**:
101
- ```bash
102
- maestro spec add tools "<title>" "Use when <timing>.\n\n1. <step1>\n2. <step2>" --roles "<csv>" --keywords "<csv>"
103
- ```
104
-
105
- **Ref mode**:
106
- 1. Generate knowhow detail document (RCP- or DOC- prefix). YAML frontmatter must include `summary` with usage timing — this is what `wiki list` and wiki-role-loader show to agents:
107
- ```yaml
108
- ---
109
- title: <Title>
110
- type: recipe
111
- category: recipe
112
- summary: "Use when <timing>. <scope description>"
113
- tags: [<keywords>]
114
- roles: [<roles>]
115
- ---
116
- ```
117
- 2. Register spec index entry — description must also include usage timing within 200 chars (this is what `spec load` shows):
118
- ```bash
119
- maestro spec add tools "<title>" "Use when <timing>. <scope summary>" --roles "<csv>" --keywords "<csv>" \
120
- --ref "knowhow/RCP-<slug>.md" --knowhow-type recipe
121
- ```
122
-
123
- ### Step 6: Verify
124
-
125
- - `maestro spec load --role <role> --keyword <keyword>` to confirm loadable
126
- - Display result: title, roles, keywords, storage location
127
-
128
- </execution>
129
-
130
- <error_codes>
131
- | Code | Severity | Description |
132
- |------|----------|-------------|
133
- | E001 | fatal | `.workflow/specs/` does not exist — run `maestro spec init` |
134
- | E002 | warning | Duplicate tool name detected — confirm overwrite/optimize |
135
- | E003 | fatal | roles parameter empty — tools must declare applicable roles |
136
- </error_codes>
137
-
138
- <success_criteria>
139
- - [ ] Tool definition written to tools.md (or ref to knowhow)
140
- - [ ] roles attribute correctly set
141
- - [ ] keywords auto-extracted (3-5 terms)
142
- - [ ] Loadable via `spec load --role <role>`
143
- - [ ] Long processes use ref mode with knowhow file created
144
- </success_criteria>
1
+ ---
2
+ name: maestro-tools-register
3
+ description: Register tool specs - extract, generate, or optimize reusable process definitions
4
+ argument-hint: "[description or intent]"
5
+ allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Agent
6
+ ---
7
+
8
+ <purpose>
9
+ Codify reusable business processes as knowhow documents with `tool: true` in YAML frontmatter. Once registered, entries are auto-discovered by downstream agents via `spec load --category` — plan agents pick up design/architecture flows, test agents pick up verification methods, coding agents pick up execution steps.
10
+
11
+ Three modes:
12
+
13
+ 1. **Extract** — Pull reusable processes from conversations/code/docs
14
+ 2. **Generate** — Create new tool definitions from user description
15
+ 3. **Optimize** — Improve existing tool spec steps, structure, clarity
16
+
17
+ Short processes (<10 steps) inline; long processes (>=10 steps or with code examples) use ref mode with knowhow detail doc (RCP-/DOC-).
18
+ </purpose>
19
+
20
+ <context>
21
+ $ARGUMENTS — User intent description, or empty (interactive guidance)
22
+
23
+ ```bash
24
+ $maestro-tools-register "extract OAuth PKCE token exchange flow from src/auth/"
25
+ $maestro-tools-register "generate Stripe webhook idempotency verification"
26
+ $maestro-tools-register "generate E2E checkout flow with payment gateway mock setup"
27
+ $maestro-tools-register "optimize e2e-checkout tool"
28
+ ```
29
+
30
+ **Tool registration**: Creates knowhow documents in `knowhow/` folder with `tool: true` in YAML frontmatter. Tools are auto-discovered by `spec load` based on category + tool flag.
31
+
32
+ **Knowhow format**:
33
+ ```yaml
34
+ ---
35
+ title: Tool Name
36
+ type: recipe
37
+ category: coding
38
+ summary: "Use when <timing>. <scope description>"
39
+ tags: [testing, api]
40
+ tool: true
41
+ ---
42
+ Step content...
43
+ ```
44
+ </context>
45
+
46
+ <execution>
47
+
48
+ ### Step 1: Intent Detection
49
+
50
+ Parse $ARGUMENTS to determine mode:
51
+ - Contains "extract" → extract mode
52
+ - Contains "optimize/improve" optimize mode
53
+ - Othergenerate mode
54
+ - Emptyask user with AskUserQuestion
55
+
56
+ ### Step 2: Gather Information
57
+
58
+ **Extract mode**:
59
+ - Identify source (current conversation, specified files, codebase scan)
60
+ - Extract step sequence, prerequisites, expected outputs
61
+
62
+ **Generate mode**:
63
+ - Confirm tool name, applicable roles, target scenario
64
+ - If unclear, ask user with AskUserQuestion
65
+
66
+ **Optimize mode**:
67
+ - Load existing tool: `maestro spec load --category coding --keyword <name>`
68
+ - Analyze improvement points (step splitting, prerequisites, error handling)
69
+
70
+ **For all modes** identify the usage timing: when should an agent or user invoke this tool? This becomes the first line of the entry description (see Step 5).
71
+
72
+ ### Step 3: Determine Category
73
+
74
+ Infer applicable category from context, or ask user:
75
+ - coding — execution tools (build, deploy, integrate)
76
+ - test testing tools (test flows, verification steps)
77
+ - reviewreview tools (checklists, audit standards)
78
+ - archplanning tools (design flows, analysis steps)
79
+ - debuganalysis tools (diagnostic flows, investigation steps)
80
+
81
+ ### Step 4: Decide Inline vs Ref
82
+
83
+ - Steps <10 and no code blocks → **inline mode**
84
+ - Steps >=10 or contains code examples/config → **ref mode**
85
+
86
+ ### Step 5: Write
87
+
88
+ **Description format**: First line after `### Title` must state **when to use** this tool (the usage timing from Step 2). This is critical for ref entries — `spec load` only shows the first 200 chars after the heading as the summary.
89
+
90
+ ```
91
+ ### {Title}
92
+
93
+ Use when {timing/trigger condition}.
94
+
95
+ 1. Step one ...
96
+ ```
97
+
98
+ **Inline mode**:
99
+ Create a knowhow document in `knowhow/` with `tool: true` frontmatter:
100
+ ```yaml
101
+ ---
102
+ title: <Title>
103
+ type: recipe
104
+ category: <category>
105
+ summary: "Use when <timing>. <scope description>"
106
+ tags: [<keywords>]
107
+ tool: true
108
+ ---
109
+ Use when <timing>.
110
+
111
+ 1. <step1>
112
+ 2. <step2>
113
+ ```
114
+
115
+ **Ref mode**:
116
+ 1. Generate knowhow detail document (RCP- or DOC- prefix). YAML frontmatter must include `summary` with usage timing and `tool: true`:
117
+ ```yaml
118
+ ---
119
+ title: <Title>
120
+ type: recipe
121
+ category: <category>
122
+ summary: "Use when <timing>. <scope description>"
123
+ tags: [<keywords>]
124
+ tool: true
125
+ ---
126
+ ```
127
+
128
+ ### Step 6: Verify
129
+
130
+ - `maestro spec load --category <category> --keyword <keyword>` to confirm loadable
131
+ - Display result: title, category, keywords, storage location
132
+
133
+ </execution>
134
+
135
+ <error_codes>
136
+ | Code | Severity | Description |
137
+ |------|----------|-------------|
138
+ | E001 | fatal | `.workflow/specs/` does not exist — run `maestro spec init` |
139
+ | E002 | warning | Duplicate tool name detected confirm overwrite/optimize |
140
+ | E003 | fatal | category parameter empty — tools must declare applicable category |
141
+ </error_codes>
142
+
143
+ <success_criteria>
144
+ - [ ] Tool registered as knowhow document with `tool: true` frontmatter
145
+ - [ ] category attribute correctly set
146
+ - [ ] keywords auto-extracted (3-5 terms)
147
+ - [ ] Loadable via `spec load --category <category>`
148
+ - [ ] Long processes use ref mode with knowhow file created
149
+ </success_criteria>
@@ -361,7 +361,7 @@ Open preview:
361
361
  file://{absolute_path}/preview.html
362
362
 
363
363
  Next steps:
364
- maestro wiki list --role implement # Browse by role
364
+ maestro wiki list --category coding # Browse by role
365
365
  maestro spec load --keyword {package_name} # Load related specs
366
366
  ```
367
367
 
@@ -226,7 +226,7 @@ If exit code is 1, present warnings and ask whether to proceed.
226
226
  - Wave 2: artifact/substance + wiring (need existence confirmation from wave 1)
227
227
  - Wave 3: antipattern + nyquist (need substance/wiring context from wave 2)
228
228
 
229
- 7. **Specs loading**: `specs_content = maestro spec load --role review`
229
+ 7. **Specs loading**: `specs_content = maestro spec load --category review`
230
230
 
231
231
  8. **CSV generation**: One row per check task.
232
232
 
@@ -225,7 +225,7 @@ Initialize `discovery-state.json`:
225
225
  4. Store dimensions in `{discoveryDir}/exploration-plan.json`
226
226
  5. Generate N dimension rows (wave 1) + 1 dedup row (wave 2)
227
227
 
228
- **Specs loading**: `specs_content = maestro spec load --role implement` -- pass to agents for severity calibration.
228
+ **Specs loading**: `specs_content = maestro spec load --category coding` -- pass to agents for severity calibration.
229
229
 
230
230
  **User validation**: Display perspective/dimension breakdown (skip if AUTO_YES).
231
231
 
@@ -208,8 +208,8 @@ mkdir -p {sessionFolder}
208
208
  Resolve phase dir from `state.json` artifact registry (`type='execute'`, matching phase). Error E002 if not found.
209
209
 
210
210
  ```
211
- specs_test = maestro spec load --role test
212
- specs_arch = maestro spec load --role plan
211
+ specs_test = maestro spec load --category test
212
+ specs_arch = maestro spec load --category arch
213
213
  ```
214
214
 
215
215
  #### Step 1: Read State & Route
@@ -60,7 +60,7 @@ Create `.workflow/scratch/refactor-{slug}-{date}/` with `.task/` and `.summaries
60
60
 
61
61
  ### Step 3: Scope Analysis
62
62
 
63
- Load project specs if available (`maestro spec load --role implement`).
63
+ Load project specs if available (`maestro spec load --category coding`).
64
64
 
65
65
  Analyze scope for tech debt categories:
66
66
 
@@ -1,114 +1,104 @@
1
- ---
2
- name: spec-add
3
- description: Add spec entry by category with role tagging
4
- argument-hint: "<category> <content> [--roles <csv>]"
5
- allowed-tools: Read, Write, Bash, Glob, Grep
6
- ---
7
-
8
- <purpose>
9
- Add a spec entry using `<spec-entry>` closed-tag format. Each category maps 1:1 to a single target file.
10
-
11
- ```bash
12
- $spec-add "coding Always use named exports for utility functions"
13
- $spec-add "learning Off-by-one in pagination when page=0"
14
- $spec-add "arch Use Zod for runtime validation over io-ts"
15
- $spec-add "quality All API endpoints must return structured error objects"
16
- ```
17
-
18
- **Valid categories**: coding, arch, quality, debug, test, review, learning, tools, bug, pattern, decision, rule, validation.
19
-
20
- **CLI alternative**: `maestro spec add <category> "<title>" "<content>" --keywords kw1,kw2 --roles implement,test --source <src>`. Used by workflow agents (analyze, plan, execute) for programmatic spec enrichment.
21
- </purpose>
22
-
23
- <context>
24
- $ARGUMENTS — `<category> <content>` where category selects the target file.
25
-
26
- **Category-to-file mapping (1:1, same as spec-load):**
27
- | Category | Target file |
28
- |----------|------------|
29
- | `coding` | `coding-conventions.md` |
30
- | `arch` | `architecture-constraints.md` |
31
- | `quality` | `quality-rules.md` |
32
- | `debug` | `debug-notes.md` |
33
- | `test` | `test-conventions.md` |
34
- | `review` | `review-standards.md` |
35
- | `learning` | `learnings.md` |
36
- | `tools` | `tools.md` |
37
- | `bug` | `learnings.md` |
38
- | `pattern` | `coding-conventions.md` |
39
- | `decision` | `architecture-constraints.md` |
40
- | `rule` | `quality-rules.md` |
41
- | `validation` | `quality-rules.md` |
42
-
43
- Extended types (`bug`, `pattern`, `decision`, `rule`, `validation`) are stored in the file of their closest core category but retain their specific category in the `<spec-entry>` tag.
44
-
45
- **--roles option**: When `--roles` is provided, the entry uses `roles` attr instead of `category` attr. This declares which agent roles should load this entry via `spec load --role`.
46
- </context>
47
-
48
- <execution>
49
-
50
- ### Step 1: Parse Input
51
-
52
- Extract category (first token) and content (remainder) from arguments.
53
- - Validate category is one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation (E003 if invalid)
54
- - Validate content is non-empty (E001 if missing)
55
-
56
- ### Step 2: Validate Specs Directory
57
-
58
- Verify `.workflow/specs/` exists (E002).
59
-
60
- ### Step 3: Route to File
61
-
62
- Resolve target file from category-to-file mapping table. If the target file does not exist, create it with a basic header.
63
-
64
- ### Step 4: Extract Keywords
65
-
66
- Auto-extract 3-5 relevant keywords from the content. Keywords should be:
67
- - Lowercase, no spaces (use hyphens for multi-word)
68
- - Domain-specific terms that would help future lookup
69
- - Avoid generic words (code, file, function, etc.)
70
-
71
- ### Step 5: Write Entry
72
-
73
- Append `<spec-entry>` closed-tag block to target file:
74
-
75
- ```markdown
76
- <!-- With --roles (new format): -->
77
- <spec-entry roles="{role1},{role2}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
78
-
79
- ### {title extracted from content}
80
-
81
- {content}
82
-
83
- </spec-entry>
84
-
85
- <!-- Without --roles (legacy format): -->
86
- <spec-entry category="{category}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
87
-
88
- ### {title extracted from content}
89
-
90
- {content}
91
-
92
- </spec-entry>
93
- ```
94
-
95
- ### Step 6: Confirm
96
-
97
- Display: category, target file, extracted keywords, and commands for verify (`/spec-load`) and remove (`/spec-remove`).
98
- </execution>
99
-
100
- <error_codes>
101
- | Code | Severity | Description |
102
- |------|----------|-------------|
103
- | E001 | fatal | Category and content are both required |
104
- | E002 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
105
- | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation |
106
- </error_codes>
107
-
108
- <success_criteria>
109
- - [ ] Category and content parsed and validated
110
- - [ ] Keywords auto-extracted from content (3-5 terms)
111
- - [ ] Entry written in `<spec-entry>` closed-tag format with keywords attribute
112
- - [ ] Entry appended to correct target file
113
- - [ ] Confirmation displayed with keywords and verify command
114
- </success_criteria>
1
+ ---
2
+ name: spec-add
3
+ description: Add spec entry by category with role tagging
4
+ argument-hint: "<category> <content>"
5
+ allowed-tools: Read, Write, Bash, Glob, Grep
6
+ ---
7
+
8
+ <purpose>
9
+ Add a spec entry using `<spec-entry>` closed-tag format. Each category maps 1:1 to a single target file.
10
+
11
+ ```bash
12
+ $spec-add "coding Always use named exports for utility functions"
13
+ $spec-add "learning Off-by-one in pagination when page=0"
14
+ $spec-add "arch Use Zod for runtime validation over io-ts"
15
+ $spec-add "quality All API endpoints must return structured error objects"
16
+ ```
17
+
18
+ **Valid categories**: coding, arch, quality, debug, test, review, learning, tools, bug, pattern, decision, rule, validation.
19
+
20
+ **CLI alternative**: `maestro spec add <category> "<title>" "<content>" --keywords kw1,kw2 --source <src>`. Used by workflow agents (analyze, plan, execute) for programmatic spec enrichment.
21
+ </purpose>
22
+
23
+ <context>
24
+ $ARGUMENTS — `<category> <content>` where category selects the target file.
25
+
26
+ **Category-to-file mapping (1:1, same as spec-load):**
27
+ | Category | Target file |
28
+ |----------|------------|
29
+ | `coding` | `coding-conventions.md` |
30
+ | `arch` | `architecture-constraints.md` |
31
+ | `quality` | `quality-rules.md` |
32
+ | `debug` | `debug-notes.md` |
33
+ | `test` | `test-conventions.md` |
34
+ | `review` | `review-standards.md` |
35
+ | `learning` | `learnings.md` |
36
+ | `tools` | `tools.md` |
37
+ | `bug` | `learnings.md` |
38
+ | `pattern` | `coding-conventions.md` |
39
+ | `decision` | `architecture-constraints.md` |
40
+ | `rule` | `quality-rules.md` |
41
+ | `validation` | `quality-rules.md` |
42
+
43
+ Extended types (`bug`, `pattern`, `decision`, `rule`, `validation`) are stored in the file of their closest core category but retain their specific category in the `<spec-entry>` tag.
44
+
45
+ Category is determined by the first positional argument.
46
+ </context>
47
+
48
+ <execution>
49
+
50
+ ### Step 1: Parse Input
51
+
52
+ Extract category (first token) and content (remainder) from arguments.
53
+ - Validate category is one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation (E003 if invalid)
54
+ - Validate content is non-empty (E001 if missing)
55
+
56
+ ### Step 2: Validate Specs Directory
57
+
58
+ Verify `.workflow/specs/` exists (E002).
59
+
60
+ ### Step 3: Route to File
61
+
62
+ Resolve target file from category-to-file mapping table. If the target file does not exist, create it with a basic header.
63
+
64
+ ### Step 4: Extract Keywords
65
+
66
+ Auto-extract 3-5 relevant keywords from the content. Keywords should be:
67
+ - Lowercase, no spaces (use hyphens for multi-word)
68
+ - Domain-specific terms that would help future lookup
69
+ - Avoid generic words (code, file, function, etc.)
70
+
71
+ ### Step 5: Write Entry
72
+
73
+ Append `<spec-entry>` closed-tag block to target file:
74
+
75
+ ```markdown
76
+ <spec-entry category="{category}" keywords="{kw1},{kw2},{kw3}" date="{YYYY-MM-DD}">
77
+
78
+ ### {title extracted from content}
79
+
80
+ {content}
81
+
82
+ </spec-entry>
83
+ ```
84
+
85
+ ### Step 6: Confirm
86
+
87
+ Display: category, target file, extracted keywords, and commands for verify (`/spec-load`) and remove (`/spec-remove`).
88
+ </execution>
89
+
90
+ <error_codes>
91
+ | Code | Severity | Description |
92
+ |------|----------|-------------|
93
+ | E001 | fatal | Category and content are both required |
94
+ | E002 | fatal | `.workflow/specs/` not initialized -- run `Skill({ skill: "spec-setup" })` first |
95
+ | E003 | fatal | Invalid category -- must be one of: coding, arch, quality, debug, test, review, learning, bug, pattern, decision, rule, validation |
96
+ </error_codes>
97
+
98
+ <success_criteria>
99
+ - [ ] Category and content parsed and validated
100
+ - [ ] Keywords auto-extracted from content (3-5 terms)
101
+ - [ ] Entry written in `<spec-entry>` closed-tag format with keywords attribute
102
+ - [ ] Entry appended to correct target file
103
+ - [ ] Confirmation displayed with keywords and verify command
104
+ </success_criteria>