specdacular 0.8.1 → 0.10.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 (46) hide show
  1. package/README.md +194 -78
  2. package/agents/specd-codebase-mapper.md +1 -1
  3. package/bin/install.js +46 -12
  4. package/commands/{specd/map-codebase.md → specd.codebase.map.md} +1 -1
  5. package/commands/specd.codebase.review.md +39 -0
  6. package/commands/{specd/config.md → specd.config.md} +1 -1
  7. package/commands/specd.continue.md +67 -0
  8. package/commands/{specd/help.md → specd.help.md} +1 -1
  9. package/commands/{specd/new.md → specd.new.md} +4 -4
  10. package/commands/{specd/status.md → specd.status.md} +1 -1
  11. package/commands/{specd/toolbox.md → specd.toolbox.md} +19 -15
  12. package/commands/{specd/update.md → specd.update.md} +1 -1
  13. package/hooks/specd-statusline.js +1 -1
  14. package/package.json +1 -1
  15. package/specdacular/HELP.md +81 -22
  16. package/specdacular/STATE-MACHINE.md +376 -0
  17. package/specdacular/agents/feature-researcher.md +4 -4
  18. package/specdacular/pipeline.json +76 -0
  19. package/specdacular/references/brain-routing.md +168 -0
  20. package/specdacular/references/commit-code.md +9 -6
  21. package/specdacular/references/commit-docs.md +9 -6
  22. package/specdacular/references/execute-hooks.md +127 -0
  23. package/specdacular/references/resolve-pipeline.md +74 -0
  24. package/specdacular/references/select-feature.md +1 -1
  25. package/specdacular/references/select-phase.md +1 -1
  26. package/specdacular/references/validate-task.md +3 -3
  27. package/specdacular/templates/context/review-diff.md +60 -0
  28. package/specdacular/templates/context/section-display.md +51 -0
  29. package/specdacular/templates/tasks/STATE.md +1 -1
  30. package/specdacular/workflows/brain.md +378 -0
  31. package/specdacular/workflows/config.md +1 -1
  32. package/specdacular/workflows/context-add.md +242 -0
  33. package/specdacular/workflows/context-manual-review.md +410 -0
  34. package/specdacular/workflows/continue.md +17 -259
  35. package/specdacular/workflows/execute.md +15 -42
  36. package/specdacular/workflows/map-codebase.md +14 -0
  37. package/specdacular/workflows/new.md +6 -6
  38. package/specdacular/workflows/orchestrator/new.md +3 -3
  39. package/specdacular/workflows/orchestrator/plan.md +1 -1
  40. package/specdacular/workflows/phase-plan.md +142 -0
  41. package/specdacular/workflows/plan.md +13 -40
  42. package/specdacular/workflows/research.md +25 -7
  43. package/specdacular/workflows/review.md +11 -136
  44. package/specdacular/workflows/revise.md +126 -0
  45. package/specdacular/workflows/status.md +3 -3
  46. package/commands/specd/continue.md +0 -59
package/README.md CHANGED
@@ -25,8 +25,10 @@ npx specdacular
25
25
  - [Utilities](#utilities)
26
26
  - [The Flow in Detail](#the-flow-in-detail)
27
27
  - [How It Works](#how-it-works)
28
+ - [The Brain](#the-brain)
29
+ - [Pipeline Configuration](#pipeline-configuration)
30
+ - [Hooks](#hooks)
28
31
  - [Parallel Agents](#parallel-agents)
29
- - [Task Flow](#task-flow)
30
32
  - [Multi-Project Support](#multi-project-support)
31
33
  - [Project Structure](#project-structure)
32
34
  - [Philosophy](#philosophy)
@@ -57,14 +59,14 @@ For monorepos and multi-repo setups, it maps each sub-project in parallel, then
57
59
  Three commands drive the entire task lifecycle:
58
60
 
59
61
  ```
60
- /specd:new my-feature # Initialize + first discussion
61
- /specd:continue my-feature # Everything else — discussion, research, planning, execution, review
62
- /specd:toolbox my-feature # Advanced operations menu
62
+ /specd.new my-feature # Initialize + first discussion
63
+ /specd.continue my-feature # Everything else — discussion, research, planning, execution, review
64
+ /specd.toolbox my-feature # Advanced operations menu
63
65
  ```
64
66
 
65
67
  `continue` reads your task's current state and offers the natural next step. You never need to remember which command comes next.
66
68
 
67
- `toolbox` gives you direct access to advanced operations — discuss, research, plan, execute, review when you want to jump to a specific action outside the normal flow.
69
+ `toolbox` gives you direct access to advanced task operations — discuss, research, plan, execute, review. Use `/specd.codebase.review` for section-by-section context file review with edit/re-map/add.
68
70
 
69
71
  Works with single projects and multi-project setups (monorepos, multi-repo). In multi-project mode, features are discussed at the system level and routed to the relevant sub-projects, with cross-project dependency tracking and contract validation.
70
72
 
@@ -92,7 +94,7 @@ Choose:
92
94
 
93
95
  In Claude Code:
94
96
  ```
95
- /specd:help
97
+ /specd.help
96
98
  ```
97
99
 
98
100
  ---
@@ -102,7 +104,7 @@ In Claude Code:
102
104
  ### Map a Codebase
103
105
 
104
106
  ```
105
- /specd:map-codebase
107
+ /specd.codebase.map
106
108
  ```
107
109
 
108
110
  Creates `.specd/codebase/` with 4 AI-optimized documents. This gives Claude context about your codebase's architecture, patterns, structure, and gotchas. For multi-project setups, it detects sub-projects automatically and maps each one in parallel before producing system-level documentation.
@@ -112,7 +114,7 @@ Creates `.specd/codebase/` with 4 AI-optimized documents. This gives Claude cont
112
114
  **Step 1: Initialize**
113
115
 
114
116
  ```
115
- /specd:new user-dashboard
117
+ /specd.new user-dashboard
116
118
  ```
117
119
 
118
120
  Creates `.specd/tasks/user-dashboard/` and starts the first discussion. Claude asks what you're building, follows the thread, and captures technical requirements. When done, offers to continue discussing or stop.
@@ -120,31 +122,31 @@ Creates `.specd/tasks/user-dashboard/` and starts the first discussion. Claude a
120
122
  **Step 2: Drive the lifecycle**
121
123
 
122
124
  ```
123
- /specd:continue user-dashboard
125
+ /specd.continue user-dashboard
124
126
  ```
125
127
 
126
128
  That's it. `continue` reads the current state and guides you through each stage:
127
129
 
128
130
  1. **Discussion** — Probes gray areas until clear
129
131
  2. **Research** — Spawns parallel agents for patterns/pitfalls
130
- 3. **Planning** — Creates roadmap with phases, one PLAN.md per phase
131
- 4. **Phase execution** — Implements with progress tracking
132
+ 3. **Planning** — Creates roadmap with phase goals
133
+ 4. **Phase execution** — Plans each phase just-in-time, then implements with progress tracking
132
134
  5. **Phase review** — Code review agent compares plans against actual code
133
135
 
134
- After each step, you can continue or stop. Resume anytime with `/specd:continue`.
136
+ After each step, you can continue or stop. Resume anytime with `/specd.continue`.
135
137
 
136
138
  **Execution modes:**
137
139
 
138
140
  ```
139
- /specd:continue user-dashboard # Interactive (default) pause after each step
140
- /specd:continue user-dashboard --semi-auto # Auto through planning, pause after review
141
- /specd:continue user-dashboard --auto # Run everything, stop only on review issues
141
+ /specd.continue user-dashboard # Defaultauto-runs, pauses at phase steps
142
+ /specd.continue user-dashboard --interactive # Prompt at every step with skip/jump options
143
+ /specd.continue user-dashboard --auto # Run everything, stop only on review issues
142
144
  ```
143
145
 
144
146
  **No argument? It picks for you:**
145
147
 
146
148
  ```
147
- /specd:continue
149
+ /specd.continue
148
150
  ```
149
151
 
150
152
  Scans for in-progress tasks and shows a picker.
@@ -152,10 +154,18 @@ Scans for in-progress tasks and shows a picker.
152
154
  **Need a specific operation?**
153
155
 
154
156
  ```
155
- /specd:toolbox user-dashboard
157
+ /specd.toolbox user-dashboard
156
158
  ```
157
159
 
158
- Opens a menu with: Discuss, Research, Plan, Execute, Review. Useful when you want to jump to a specific action outside the normal flow.
160
+ Opens a menu with task operations (Discuss, Research, Plan, Execute, Review). Useful when you want to jump to a specific action outside the normal flow.
161
+
162
+ **Need to review codebase context?**
163
+
164
+ ```
165
+ /specd.codebase.review
166
+ ```
167
+
168
+ Section-by-section review of any context file: confirm, edit, remove, re-map, or add new content.
159
169
 
160
170
  ---
161
171
 
@@ -165,24 +175,25 @@ Opens a menu with: Discuss, Research, Plan, Execute, Review. Useful when you wan
165
175
 
166
176
  | Command | Description |
167
177
  |---------|-------------|
168
- | `/specd:new [name]` | Initialize a task, start first discussion |
169
- | `/specd:continue [name] [--semi-auto\|--auto]` | **Drive the entire lifecycle** — picks up where you left off |
170
- | `/specd:toolbox [name]` | Advanced operations: discuss, research, plan, execute, review |
178
+ | `/specd.new [name]` | Initialize a task, start first discussion |
179
+ | `/specd.continue [name] [--interactive\|--auto]` | **Drive the entire lifecycle** — picks up where you left off |
180
+ | `/specd.toolbox [name]` | Advanced task operations |
171
181
 
172
182
  ### Codebase Documentation
173
183
 
174
184
  | Command | Description |
175
185
  |---------|-------------|
176
- | `/specd:map-codebase` | Analyze codebase with parallel agents |
186
+ | `/specd.codebase.map` | Analyze codebase with parallel agents |
187
+ | `/specd.codebase.review` | Review and edit codebase context files section by section |
177
188
 
178
189
  ### Utilities
179
190
 
180
191
  | Command | Description |
181
192
  |---------|-------------|
182
- | `/specd:config` | Configure auto-commit settings for docs and code |
183
- | `/specd:status [--all]` | Show task status dashboard |
184
- | `/specd:help` | Show available commands |
185
- | `/specd:update` | Update to latest version |
193
+ | `/specd.config` | Configure auto-commit settings for docs and code |
194
+ | `/specd.status [--all]` | Show task status dashboard |
195
+ | `/specd.help` | Show available commands |
196
+ | `/specd.update` | Update to latest version |
186
197
 
187
198
  ---
188
199
 
@@ -195,33 +206,173 @@ Opens a menu with: Discuss, Research, Plan, Execute, Review. Useful when you wan
195
206
  - `STATE.md` — Progress tracking
196
207
  - `config.json` — Task configuration
197
208
 
198
- **`continue`** is the smart state machine. It reads `config.json` and `STATE.md` to determine where the task is, shows a status summary, and offers the natural next step. After each action it loops back you keep going until you choose to stop. Under the hood it delegates to these stages:
209
+ **`continue`** delegates to the brain a config-driven orchestrator that reads `pipeline.json` and drives the lifecycle. It determines the next step from task state, executes pre-hooks step workflow post-hooks, updates state, and loops. The default pipeline stages:
199
210
 
200
211
  - **Discussion** — Probes gray areas, records decisions. Context accumulates across sessions.
201
212
  - **Research** — Spawns 3 parallel agents: codebase integration, external patterns, and pitfalls. Output: `RESEARCH.md`.
202
- - **Planning** — Creates `ROADMAP.md` with phases derived from dependency analysis, plus one `phases/phase-NN/PLAN.md` per phase. Plans are self-contained prompts for an implementing agent.
203
- - **Phase execution** — Implements plans with verification after each task, commits per task, and progress tracking in `STATE.md`.
204
- - **Phase review** — Code review agent inspects executed code against plan intent using semantic analysis and git diff. Generates fix plans (decimal phases like `phase-01.1`) if needed.
205
-
206
- **`toolbox`** provides direct access to advanced operations outside the normal flow:
213
+ - **Planning** — Creates `ROADMAP.md` with phases derived from dependency analysis. Phase goals only no detailed PLAN.md files yet.
214
+ - **Phase execution** — Nested sub-pipeline that loops per phase: plan → execute → review → revise. Each phase gets just-in-time planning (detailed PLAN.md from ROADMAP.md goal), then implementation with verification, commits per task, and progress tracking. Later phases can adapt based on earlier execution.
215
+ - **Phase review** — Code review agent inspects executed code against plan intent. Generates fix plans (decimal phases like `phase-01.1`) if needed.
216
+ - **Revise** — Collects feedback from review, creates fix plans, signals brain to re-execute.
207
217
 
218
+ **`toolbox`** (`/specd.toolbox my-feature`) provides direct access to task operations outside the normal flow:
208
219
  - **Discuss** — Explore open questions, record decisions
209
220
  - **Research** — Spawn parallel agents for patterns/pitfalls
210
221
  - **Plan** — Create execution phases from task context
211
222
  - **Execute** — Execute the next phase's plan
212
223
  - **Review** — Review executed phase, approve or request fixes
213
224
 
225
+ **`codebase.review`** (`/specd.codebase.review`) — Section-by-section review of any codebase context file: confirm, edit, remove, re-map (spawns a mapper agent to regenerate a section), or add new content. Sections are tracked with `AUTO_GENERATED` and `USER_MODIFIED` tags with dates.
226
+
214
227
  ---
215
228
 
216
229
  ## How It Works
217
230
 
231
+ ### The Brain
232
+
233
+ The brain (`brain.md`) is a config-driven orchestrator that reads `pipeline.json` and drives the entire task lifecycle. Step workflows are pure execution — they do their work and return. The brain decides what comes next.
234
+
235
+ ```
236
+ ┌─────────────────────┐
237
+ │ BRAIN │
238
+ │ (config-driven │
239
+ │ orchestrator) │
240
+ └────────┬────────────┘
241
+
242
+ ┌────────────┼────────────┐
243
+ ▼ ▼ ▼
244
+ Read State Load Pipeline Check Mode
245
+ │ │ │
246
+ └────────────┼────────────┘
247
+
248
+
249
+ ┌─────────────────────────┐
250
+ │ Main Pipeline │
251
+ │ │
252
+ │ discuss → research → │
253
+ │ plan → phase-execution │
254
+ └────────────┬────────────┘
255
+
256
+ ┌───────┴───────┐
257
+ ▼ │
258
+ ┌─────────────────────┐ │
259
+ │ Phase-Execution │ │
260
+ │ Sub-Pipeline │ │
261
+ │ │ │
262
+ │ plan → execute → │ │
263
+ │ review → revise │ │
264
+ │ ──loop──┘ │ │
265
+ │ │ │
266
+ │ Per phase, repeats │ │
267
+ │ until all phases │ │
268
+ │ complete │ │
269
+ └─────────────────────┘ │
270
+ │ │
271
+ └───────────────┘
272
+
273
+
274
+ TASK COMPLETE
275
+ ```
276
+
277
+ **The brain loop:**
278
+ 1. Read current state (`config.json`, `STATE.md`)
279
+ 2. Determine next step from pipeline config
280
+ 3. Execute pre-hooks → step workflow → post-hooks
281
+ 4. Update state → loop back
282
+
283
+ **Execution modes:**
284
+
285
+ | Mode | Behavior |
286
+ |------|----------|
287
+ | **Default** | Auto-runs steps, pauses where `pause: true`. Smart-skips unnecessary steps. |
288
+ | **Interactive** (`--interactive`) | Prompts at each stage transition with skip/jump options |
289
+ | **Auto** (`--auto`) | Runs everything, only stops on errors or task completion |
290
+
291
+ ### Pipeline Configuration
292
+
293
+ The pipeline is defined in `pipeline.json` — nothing is hardcoded. The default pipeline ships with Specdacular and can be fully replaced by placing a `.specd/pipeline.json` in your project (full replace, not merge).
294
+
295
+ **Default pipeline structure:**
296
+
297
+ ```json
298
+ {
299
+ "schema_version": "1.0",
300
+ "pipelines": {
301
+ "main": [
302
+ { "name": "discuss", "workflow": "discuss.md" },
303
+ { "name": "research", "workflow": "research.md" },
304
+ { "name": "plan", "workflow": "plan.md" },
305
+ { "name": "phase-execution", "pipeline": "phase-execution" }
306
+ ],
307
+ "phase-execution": [
308
+ { "name": "plan", "workflow": "phase-plan.md" },
309
+ { "name": "execute", "workflow": "execute.md", "pause": true },
310
+ { "name": "review", "workflow": "review.md", "pause": true },
311
+ { "name": "revise", "workflow": "revise.md", "pause": true }
312
+ ]
313
+ },
314
+ "hooks": { "pre-step": null, "post-step": null }
315
+ }
316
+ ```
317
+
318
+ **Customization options:**
319
+ - **Swap workflows:** Point any step's `workflow` to your own `.md` file
320
+ - **Add hooks:** Configure pre/post hooks per step or globally
321
+ - **Full replace:** Drop `.specd/pipeline.json` to replace the entire pipeline
322
+
323
+ ### Hooks
324
+
325
+ Hooks are markdown workflow files (`.md`) that run before and after pipeline steps. They can read and modify task files just like any other workflow.
326
+
327
+ ```
328
+ Global pre-step hook
329
+
330
+
331
+ Step pre-hook
332
+
333
+
334
+ ┌─────────────┐
335
+ │ Step runs │
336
+ │ (discuss, │
337
+ │ execute, │
338
+ │ etc.) │
339
+ └──────┬──────┘
340
+
341
+
342
+ Step post-hook
343
+
344
+
345
+ Global post-step hook
346
+ ```
347
+
348
+ **Configuration in pipeline.json:**
349
+
350
+ ```json
351
+ {
352
+ "name": "execute",
353
+ "workflow": "execute.md",
354
+ "hooks": {
355
+ "pre": { "workflow": ".specd/hooks/pre-execute.md", "mode": "inline", "optional": false },
356
+ "post": { "workflow": ".specd/hooks/post-execute.md", "mode": "subagent", "optional": true }
357
+ }
358
+ }
359
+ ```
360
+
361
+ **Hook modes:**
362
+ - **`inline`** — Runs in the brain's context (can see all state)
363
+ - **`subagent`** — Spawns a separate agent (fresh context, isolated)
364
+
365
+ **Convention fallback:** If no hooks are configured explicitly, the brain checks for `.specd/hooks/pre-{step}.md` and `.specd/hooks/post-{step}.md` automatically.
366
+
367
+ **Error handling:** Required hooks (`optional: false`) stop the pipeline on failure. Optional hooks log a warning and continue.
368
+
218
369
  ### Parallel Agents
219
370
 
220
371
  Specdacular spawns specialized agents that run simultaneously:
221
372
 
222
373
  ```
223
374
  ┌─────────────────────────────────────────────────────────┐
224
- │ /specd:map-codebase
375
+ │ /specd.codebase.map │
225
376
  └─────────────────────────────────────────────────────────┘
226
377
 
227
378
  ┌───────────────┼───────────────┐
@@ -240,46 +391,6 @@ Specdacular spawns specialized agents that run simultaneously:
240
391
  - Faster execution (parallel, not sequential)
241
392
  - Agents write directly to files
242
393
 
243
- ### Task Flow
244
-
245
- ```
246
- /specd:new /specd:continue
247
- │ │
248
- ▼ ▼
249
- Create task ┌─── Read state ◀──────────────┐
250
- First discussion │ Show status │
251
- Offer to continue │ Offer next step │
252
- │ │ │ │
253
- ▼ │ ▼ │
254
- "Keep discussing?" │ ┌──────────────┐ │
255
- Yes → discuss loop │ │ Execute the │ │
256
- No → continue │ │ next action │ │
257
- │ └──────────────┘ │
258
- │ │ │
259
- │ ┌────┴────┐ │
260
- │ │ Discuss │ Research │
261
- │ │ Plan │ Execute │
262
- │ │ Review │ │
263
- │ └────┬────┘ │
264
- │ │ │
265
- │ ▼ │
266
- │ "Continue or stop?" │
267
- │ Continue ──────────────────┘
268
- │ Stop → clean exit
269
-
270
- └─── No tasks? → /specd:new
271
- ```
272
-
273
- **Under the hood,** `continue` delegates to specialized workflows:
274
-
275
- ```
276
- discussion → discuss workflow
277
- research → research workflow (3 parallel agents)
278
- planning → plan workflow
279
- execution → execute workflow
280
- review → review workflow (code review agent)
281
- ```
282
-
283
394
  ---
284
395
 
285
396
  ## Multi-Project Support
@@ -289,7 +400,7 @@ Specdacular supports monorepos and multi-repo setups through an orchestrator lay
289
400
  ### Setup
290
401
 
291
402
  ```
292
- /specd:map-codebase
403
+ /specd.codebase.map
293
404
  ```
294
405
 
295
406
  When it detects multiple projects (via `package.json`, `go.mod`, `Cargo.toml`, etc.), it offers to enable multi-project mode. This:
@@ -316,8 +427,8 @@ Planning creates per-project roadmaps plus a cross-project dependency graph (`DE
316
427
  `continue` schedules across projects, respecting cross-project dependencies. After each phase, it performs contract review — comparing what was implemented against system-level expectations and flagging deviations before they cascade to downstream projects.
317
428
 
318
429
  ```
319
- /specd:continue auth-system # Auto-picks next unblocked phase across projects
320
- /specd:continue auth-system api # Target a specific sub-project
430
+ /specd.continue auth-system # Auto-picks next unblocked phase across projects
431
+ /specd.continue auth-system api # Target a specific sub-project
321
432
  ```
322
433
 
323
434
  ---
@@ -329,7 +440,12 @@ Planning creates per-project roadmaps plus a cross-project dependency graph (`DE
329
440
  ```
330
441
  your-project/
331
442
  ├── .specd/
332
- │ ├── codebase/ # From /specd:map-codebase
443
+ │ ├── pipeline.json # Optional — custom pipeline (full replace)
444
+ │ ├── hooks/ # Optional — convention-based hooks
445
+ │ │ ├── pre-execute.md
446
+ │ │ └── post-review.md
447
+ │ │
448
+ │ ├── codebase/ # From /specd.codebase.map
333
449
  │ │ ├── MAP.md
334
450
  │ │ ├── PATTERNS.md
335
451
  │ │ ├── STRUCTURE.md
@@ -425,7 +541,7 @@ npx specdacular@latest
425
541
 
426
542
  Or in Claude Code:
427
543
  ```
428
- /specd:update
544
+ /specd.update
429
545
  ```
430
546
 
431
547
  ---
@@ -8,7 +8,7 @@ color: cyan
8
8
  <role>
9
9
  You are a codebase mapper optimized for AI consumption. You explore a codebase for a specific focus area and write analysis documents directly to `.specd/codebase/`.
10
10
 
11
- You are spawned by `/specd:map-codebase` with one of four focus areas:
11
+ You are spawned by `/specd.codebase.map` with one of four focus areas:
12
12
  - **map**: Create navigation map → write MAP.md
13
13
  - **patterns**: Extract code patterns → write PATTERNS.md
14
14
  - **structure**: Document organization → write STRUCTURE.md
package/bin/install.js CHANGED
@@ -166,13 +166,27 @@ function uninstall(isGlobal) {
166
166
 
167
167
  let removedCount = 0;
168
168
 
169
- // Remove specd commands
169
+ // Remove specd commands (both old directory format and new flat format)
170
170
  const specCommandsDir = path.join(targetDir, 'commands', 'specd');
171
171
  if (fs.existsSync(specCommandsDir)) {
172
172
  fs.rmSync(specCommandsDir, { recursive: true });
173
173
  removedCount++;
174
174
  console.log(` ${green}✓${reset} Removed commands/specd/`);
175
175
  }
176
+ const commandsDir = path.join(targetDir, 'commands');
177
+ if (fs.existsSync(commandsDir)) {
178
+ let cmdCount = 0;
179
+ for (const file of fs.readdirSync(commandsDir)) {
180
+ if (file.startsWith('specd.') && file.endsWith('.md')) {
181
+ fs.unlinkSync(path.join(commandsDir, file));
182
+ cmdCount++;
183
+ }
184
+ }
185
+ if (cmdCount > 0) {
186
+ removedCount++;
187
+ console.log(` ${green}✓${reset} Removed ${cmdCount} specd commands`);
188
+ }
189
+ }
176
190
 
177
191
  // Remove specdacular directory
178
192
  const specDir = path.join(targetDir, 'specdacular');
@@ -292,14 +306,34 @@ function install(isGlobal) {
292
306
  const commandsDir = path.join(targetDir, 'commands');
293
307
  fs.mkdirSync(commandsDir, { recursive: true });
294
308
 
295
- const specSrc = path.join(src, 'commands', 'specd');
296
- const specDest = path.join(commandsDir, 'specd');
297
- if (fs.existsSync(specSrc)) {
298
- copyWithPathReplacement(specSrc, specDest, pathPrefix);
299
- if (verifyInstalled(specDest, 'commands/specd')) {
300
- console.log(` ${green}✓${reset} Installed commands/specd`);
309
+ // Remove old commands/specd/ directory if it exists (pre-0.10.0 format)
310
+ const oldSpecDir = path.join(commandsDir, 'specd');
311
+ if (fs.existsSync(oldSpecDir)) {
312
+ fs.rmSync(oldSpecDir, { recursive: true });
313
+ }
314
+
315
+ // Remove old specd.*.md command files before copying new ones
316
+ for (const file of fs.readdirSync(commandsDir)) {
317
+ if (file.startsWith('specd.') && file.endsWith('.md')) {
318
+ fs.unlinkSync(path.join(commandsDir, file));
319
+ }
320
+ }
321
+
322
+ const commandsSrc = path.join(src, 'commands');
323
+ if (fs.existsSync(commandsSrc)) {
324
+ let commandCount = 0;
325
+ for (const file of fs.readdirSync(commandsSrc)) {
326
+ if (file.startsWith('specd.') && file.endsWith('.md')) {
327
+ let content = fs.readFileSync(path.join(commandsSrc, file), 'utf8');
328
+ content = content.replace(/~\/\.claude\//g, pathPrefix);
329
+ fs.writeFileSync(path.join(commandsDir, file), content);
330
+ commandCount++;
331
+ }
332
+ }
333
+ if (commandCount > 0) {
334
+ console.log(` ${green}✓${reset} Installed ${commandCount} specd commands`);
301
335
  } else {
302
- failures.push('commands/specd');
336
+ failures.push('commands');
303
337
  }
304
338
  }
305
339
 
@@ -430,12 +464,12 @@ function install(isGlobal) {
430
464
  }
431
465
 
432
466
  console.log(`
433
- ${green}Done!${reset} Launch Claude Code and run ${cyan}/specd:help${reset}.
467
+ ${green}Done!${reset} Launch Claude Code and run ${cyan}/specd.help${reset}.
434
468
 
435
469
  ${yellow}Commands:${reset}
436
- /specd:map-codebase - Analyze and document your codebase
437
- /specd:update - Update to latest version
438
- /specd:help - Show all commands
470
+ /specd.codebase.map - Analyze and document your codebase
471
+ /specd.update - Update to latest version
472
+ /specd.help - Show all commands
439
473
  `);
440
474
  }
441
475
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specd:map-codebase
2
+ name: specd.codebase.map
3
3
  description: Analyze codebase with parallel agents to produce AI-optimized documentation
4
4
  argument-hint: ""
5
5
  allowed-tools:
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: specd.codebase.review
3
+ description: "Review and edit codebase context files section by section"
4
+ argument-hint: ""
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Task
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <objective>
17
+ Walk through and review a codebase context file (.specd/codebase/*.md) section by section. Confirm, edit, remove, or re-map individual sections.
18
+
19
+ Output: Updated context file with reviewed/edited sections and updated timestamps.
20
+ </objective>
21
+
22
+ <execution_context>
23
+ Follow the context-manual-review workflow:
24
+ @~/.claude/specdacular/workflows/context-manual-review.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ **Context workflows:**
29
+ @~/.claude/specdacular/workflows/context-manual-review.md
30
+ @~/.claude/specdacular/workflows/context-add.md
31
+ </context>
32
+
33
+ <success_criteria>
34
+ - [ ] User selects a context file to review
35
+ - [ ] Section list shown with tag status
36
+ - [ ] User can confirm, edit, remove, or re-map each section
37
+ - [ ] Timestamps updated after review
38
+ - [ ] Changes committed
39
+ </success_criteria>
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specd:config
2
+ name: specd.config
3
3
  description: Create or update .specd/config.json with commit settings
4
4
  argument-hint: ""
5
5
  allowed-tools:
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: specd.continue
3
+ description: Continue task lifecycle — picks up where you left off
4
+ argument-hint: "[task-name] [--interactive|--auto]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Glob
11
+ - Grep
12
+ - Task
13
+ - AskUserQuestion
14
+ ---
15
+
16
+ <objective>
17
+ Config-driven orchestrator that reads pipeline.json and drives the entire task lifecycle. One command from discussion through execution and review.
18
+
19
+ **Modes:**
20
+ - **Default:** Auto-runs steps, pauses where `pause: true`. Smart-skips unnecessary steps.
21
+ - **--interactive:** Prompts at every stage transition with skip/jump options
22
+ - **--auto:** Runs everything, only stops on errors or task completion
23
+
24
+ **How it works:**
25
+ 1. Select task (from argument or picker)
26
+ 2. Load pipeline.json (user override or default)
27
+ 3. Read current state → determine next step
28
+ 4. Execute pre-hooks → step → post-hooks
29
+ 5. Update state → loop back or stop
30
+
31
+ **Pipeline customization:**
32
+ - Place `.specd/pipeline.json` to fully replace the default pipeline
33
+ - Swap any step's workflow to a custom `.md` file
34
+ - Add pre/post hooks (markdown workflow files)
35
+ </objective>
36
+
37
+ <execution_context>
38
+ @~/.claude/specdacular/workflows/continue.md
39
+ </execution_context>
40
+
41
+ <context>
42
+ Task name and flags: $ARGUMENTS
43
+
44
+ **Pipeline config:**
45
+ @.specd/pipeline.json (user override, if exists)
46
+ @~/.claude/specdacular/pipeline.json (default)
47
+
48
+ **Scans for tasks:**
49
+ @.specd/tasks/*/config.json
50
+
51
+ **Delegates to brain which dispatches:**
52
+ @~/.claude/specdacular/workflows/discuss.md
53
+ @~/.claude/specdacular/workflows/research.md
54
+ @~/.claude/specdacular/workflows/plan.md
55
+ @~/.claude/specdacular/workflows/execute.md
56
+ @~/.claude/specdacular/workflows/review.md
57
+ @~/.claude/specdacular/workflows/revise.md
58
+ </context>
59
+
60
+ <success_criteria>
61
+ - [ ] Task selected (from argument or picker)
62
+ - [ ] Pipeline loaded and validated
63
+ - [ ] Current state accurately assessed
64
+ - [ ] Correct next step dispatched with hooks
65
+ - [ ] Mode flags (--interactive, --auto) respected
66
+ - [ ] User can stop at any natural boundary
67
+ </success_criteria>
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specd:help
2
+ name: specd.help
3
3
  description: Show all specdacular commands and usage guide
4
4
  allowed-tools:
5
5
  - Read