specdacular 0.2.2 → 0.2.3
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.
- package/README.md +160 -56
- package/commands/specd/execute-plan.md +68 -0
- package/commands/specd/help.md +5 -2
- package/package.json +1 -1
- package/specdacular/templates/features/CHANGELOG.md +34 -0
- package/specdacular/templates/features/PLAN.md +27 -0
- package/specdacular/templates/features/STATE.md +14 -0
- package/specdacular/workflows/execute-plan.md +395 -0
- package/specdacular/workflows/new-feature.md +15 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Specdacular
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**AI-optimized codebase documentation and feature planning for Claude.**
|
|
4
4
|
|
|
5
|
-
A Claude Code extension that
|
|
5
|
+
A Claude Code extension that helps you understand codebases and plan features specific enough that an agent can implement without asking questions.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx specdacular
|
|
@@ -12,19 +12,30 @@ npx specdacular
|
|
|
12
12
|
|
|
13
13
|
## What It Does
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### 1. Map Your Codebase
|
|
16
|
+
|
|
17
|
+
Spawns 4 parallel agents to analyze your codebase and generate AI-optimized documentation:
|
|
16
18
|
|
|
17
19
|
| Document | What It Answers |
|
|
18
20
|
|----------|-----------------|
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `STRUCTURE.md` | Where do
|
|
22
|
-
| `
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
| `MAP.md` | Where is X? What functions exist? |
|
|
22
|
+
| `PATTERNS.md` | How do I write code that fits here? |
|
|
23
|
+
| `STRUCTURE.md` | Where do I put new code? |
|
|
24
|
+
| `CONCERNS.md` | What will bite me? Gotchas? Tech debt? |
|
|
25
|
+
|
|
26
|
+
### 2. Plan Features
|
|
27
|
+
|
|
28
|
+
A structured flow for planning features with enough detail for agent implementation:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
new-feature → (discuss ↔ research)* → plan-feature
|
|
32
|
+
```
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
**You control the rhythm:**
|
|
35
|
+
- `new-feature` — Initialize and start first discussion
|
|
36
|
+
- `discuss-feature` — Refine understanding (call many times)
|
|
37
|
+
- `research-feature` — Investigate implementation approaches
|
|
38
|
+
- `plan-feature` — Create executable task plans
|
|
28
39
|
|
|
29
40
|
---
|
|
30
41
|
|
|
@@ -35,8 +46,8 @@ npx specdacular
|
|
|
35
46
|
```
|
|
36
47
|
|
|
37
48
|
Choose:
|
|
38
|
-
- **Global** (`~/.claude/`)
|
|
39
|
-
- **Local** (`./.claude/`)
|
|
49
|
+
- **Global** (`~/.claude/`) — Available in all projects
|
|
50
|
+
- **Local** (`./.claude/`) — This project only
|
|
40
51
|
|
|
41
52
|
### Verify Installation
|
|
42
53
|
|
|
@@ -47,36 +58,60 @@ In Claude Code:
|
|
|
47
58
|
|
|
48
59
|
---
|
|
49
60
|
|
|
50
|
-
##
|
|
61
|
+
## Commands
|
|
62
|
+
|
|
63
|
+
### Codebase Documentation
|
|
51
64
|
|
|
52
|
-
|
|
65
|
+
| Command | Description |
|
|
66
|
+
|---------|-------------|
|
|
67
|
+
| `/specd:map-codebase` | Analyze codebase with parallel agents |
|
|
68
|
+
|
|
69
|
+
### Feature Planning
|
|
70
|
+
|
|
71
|
+
| Command | Description |
|
|
72
|
+
|---------|-------------|
|
|
73
|
+
| `/specd:new-feature [name]` | Initialize a feature, start first discussion |
|
|
74
|
+
| `/specd:discuss-feature [name]` | Continue/deepen discussion (iterative) |
|
|
75
|
+
| `/specd:research-feature [name]` | Research implementation with parallel agents |
|
|
76
|
+
| `/specd:plan-feature [name]` | Create executable task plans |
|
|
77
|
+
|
|
78
|
+
### Utilities
|
|
79
|
+
|
|
80
|
+
| Command | Description |
|
|
81
|
+
|---------|-------------|
|
|
82
|
+
| `/specd:help` | Show available commands |
|
|
83
|
+
| `/specd:update` | Update to latest version |
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Quick Start
|
|
88
|
+
|
|
89
|
+
### Map a Codebase
|
|
53
90
|
|
|
54
91
|
```
|
|
55
92
|
/specd:map-codebase
|
|
56
93
|
```
|
|
57
94
|
|
|
58
|
-
|
|
59
|
-
1. Creates `.specd/codebase/` directory
|
|
60
|
-
2. Spawns 4 parallel agents (tech, architecture, quality, concerns)
|
|
61
|
-
3. Each agent explores and writes documents directly
|
|
62
|
-
4. Commits the codebase map
|
|
95
|
+
Creates `.specd/codebase/` with 4 AI-optimized documents.
|
|
63
96
|
|
|
64
|
-
###
|
|
97
|
+
### Plan a Feature
|
|
65
98
|
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
cat .specd/codebase/ARCHITECTURE.md
|
|
69
|
-
# etc.
|
|
99
|
+
```
|
|
100
|
+
/specd:new-feature user-dashboard
|
|
70
101
|
```
|
|
71
102
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
103
|
+
Creates `.specd/features/user-dashboard/` with:
|
|
104
|
+
- `FEATURE.md` — Technical requirements
|
|
105
|
+
- `CONTEXT.md` — Discussion context (accumulates)
|
|
106
|
+
- `DECISIONS.md` — Decisions with dates and rationale
|
|
107
|
+
- `STATE.md` — Progress tracking
|
|
75
108
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
109
|
+
Then refine and plan:
|
|
110
|
+
```
|
|
111
|
+
/specd:discuss-feature user-dashboard # Clarify gray areas
|
|
112
|
+
/specd:research-feature user-dashboard # Research implementation
|
|
113
|
+
/specd:plan-feature user-dashboard # Create executable plans
|
|
114
|
+
```
|
|
80
115
|
|
|
81
116
|
---
|
|
82
117
|
|
|
@@ -84,7 +119,7 @@ cat .specd/codebase/ARCHITECTURE.md
|
|
|
84
119
|
|
|
85
120
|
### Parallel Agents
|
|
86
121
|
|
|
87
|
-
|
|
122
|
+
Specdacular spawns specialized agents that run simultaneously:
|
|
88
123
|
|
|
89
124
|
```
|
|
90
125
|
┌─────────────────────────────────────────────────────────┐
|
|
@@ -94,58 +129,127 @@ Instead of one agent doing everything, Specdacular spawns 4 specialized agents t
|
|
|
94
129
|
┌───────────────┼───────────────┐
|
|
95
130
|
▼ ▼ ▼ ▼
|
|
96
131
|
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
97
|
-
│
|
|
132
|
+
│ Map │ │ Patterns │ │Structure │ │ Concerns │
|
|
98
133
|
│ Agent │ │ Agent │ │ Agent │ │ Agent │
|
|
99
134
|
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
100
135
|
│ │ │ │
|
|
101
136
|
▼ ▼ ▼ ▼
|
|
102
|
-
|
|
103
|
-
INTEG.md STRUCT.md TESTING.md
|
|
137
|
+
MAP.md PATTERNS.md STRUCTURE.md CONCERNS.md
|
|
104
138
|
```
|
|
105
139
|
|
|
106
140
|
**Benefits:**
|
|
107
141
|
- Fresh 200k context per agent (no token pollution)
|
|
108
142
|
- Faster execution (parallel, not sequential)
|
|
109
|
-
- Agents write directly to files
|
|
143
|
+
- Agents write directly to files
|
|
110
144
|
|
|
111
|
-
|
|
145
|
+
### Feature Flow
|
|
112
146
|
|
|
113
|
-
|
|
147
|
+
The feature planning flow accumulates context over multiple sessions:
|
|
114
148
|
|
|
115
|
-
```
|
|
116
|
-
|
|
149
|
+
```
|
|
150
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
151
|
+
│ new-feature │ ──▶ │ discuss │ ◀─▶ │ research │
|
|
152
|
+
│ │ │ feature │ │ feature │
|
|
153
|
+
└──────────────┘ └──────────────┘ └──────────────┘
|
|
154
|
+
│
|
|
155
|
+
▼
|
|
156
|
+
┌──────────────┐
|
|
157
|
+
│ plan-feature │
|
|
158
|
+
│ │
|
|
159
|
+
└──────────────┘
|
|
160
|
+
│
|
|
161
|
+
▼
|
|
162
|
+
Executable PLAN.md
|
|
163
|
+
files for agents
|
|
117
164
|
```
|
|
118
165
|
|
|
119
|
-
|
|
166
|
+
Each session updates:
|
|
167
|
+
- `CONTEXT.md` — Resolved questions accumulate
|
|
168
|
+
- `DECISIONS.md` — Decisions with rationale accumulate
|
|
120
169
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
170
|
+
Plans are prompts for implementing agents with:
|
|
171
|
+
- Specific file paths
|
|
172
|
+
- Code patterns to follow
|
|
173
|
+
- Verification commands
|
|
174
|
+
- Clear completion criteria
|
|
126
175
|
|
|
127
176
|
---
|
|
128
177
|
|
|
129
178
|
## Project Structure
|
|
130
179
|
|
|
131
|
-
After
|
|
180
|
+
After using Specdacular:
|
|
132
181
|
|
|
133
182
|
```
|
|
134
183
|
your-project/
|
|
135
184
|
├── .specd/
|
|
136
|
-
│
|
|
137
|
-
│
|
|
138
|
-
│
|
|
139
|
-
│
|
|
140
|
-
│
|
|
141
|
-
│
|
|
142
|
-
│
|
|
143
|
-
│ └──
|
|
185
|
+
│ ├── codebase/ # From /specd:map-codebase
|
|
186
|
+
│ │ ├── MAP.md
|
|
187
|
+
│ │ ├── PATTERNS.md
|
|
188
|
+
│ │ ├── STRUCTURE.md
|
|
189
|
+
│ │ └── CONCERNS.md
|
|
190
|
+
│ │
|
|
191
|
+
│ └── features/ # From feature commands
|
|
192
|
+
│ └── user-dashboard/
|
|
193
|
+
│ ├── FEATURE.md # Technical requirements
|
|
194
|
+
│ ├── CONTEXT.md # Discussion context
|
|
195
|
+
│ ├── DECISIONS.md # Decision log
|
|
196
|
+
│ ├── STATE.md # Progress tracking
|
|
197
|
+
│ ├── RESEARCH.md # Research findings
|
|
198
|
+
│ ├── ROADMAP.md # Phase overview
|
|
199
|
+
│ └── plans/ # Executable plans
|
|
200
|
+
│ ├── phase-01/
|
|
201
|
+
│ │ ├── 01-PLAN.md
|
|
202
|
+
│ │ └── 02-PLAN.md
|
|
203
|
+
│ └── phase-02/
|
|
204
|
+
│ └── 01-PLAN.md
|
|
144
205
|
└── ...
|
|
145
206
|
```
|
|
146
207
|
|
|
147
208
|
---
|
|
148
209
|
|
|
210
|
+
## Philosophy
|
|
211
|
+
|
|
212
|
+
### Documentation Is For Claude
|
|
213
|
+
|
|
214
|
+
These docs answer questions Claude can't get from reading code:
|
|
215
|
+
- Tribal knowledge
|
|
216
|
+
- Gotchas and pitfalls
|
|
217
|
+
- Patterns and conventions
|
|
218
|
+
- Where things go
|
|
219
|
+
|
|
220
|
+
**Principle:** Don't document what Claude can grep. Document what requires understanding.
|
|
221
|
+
|
|
222
|
+
### Plans Are Prompts
|
|
223
|
+
|
|
224
|
+
Each `PLAN.md` is literally what you'd send to an implementing agent. It contains everything needed to implement without asking questions.
|
|
225
|
+
|
|
226
|
+
### Decisions Are Permanent
|
|
227
|
+
|
|
228
|
+
Once recorded in `DECISIONS.md`, decisions aren't re-litigated. Each has date, context, rationale, and implications.
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Updating
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npx specdacular@latest
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Or in Claude Code:
|
|
239
|
+
```
|
|
240
|
+
/specd:update
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Uninstalling
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
npx specdacular --global --uninstall
|
|
247
|
+
# or
|
|
248
|
+
npx specdacular --local --uninstall
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
149
253
|
## License
|
|
150
254
|
|
|
151
255
|
MIT
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specd:execute-plan
|
|
3
|
+
description: Execute a feature plan with progress tracking
|
|
4
|
+
argument-hint: "[feature-name] [plan-path]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Execute a plan from a feature, tracking progress and logging deviations.
|
|
17
|
+
|
|
18
|
+
**What it does:**
|
|
19
|
+
1. Load context — STATE.md, DECISIONS.md, RESEARCH.md, codebase patterns
|
|
20
|
+
2. Find next plan — First incomplete plan, or accept path as argument
|
|
21
|
+
3. Execute tasks with:
|
|
22
|
+
- Auto-fix blockers/bugs → log to CHANGELOG.md
|
|
23
|
+
- Ask about architectural changes → wait for user
|
|
24
|
+
- Run verification after each task
|
|
25
|
+
- Stop on verification failure → ask user (retry/skip/stop)
|
|
26
|
+
- Commit after each task
|
|
27
|
+
4. Update progress — STATE.md with completed tasks
|
|
28
|
+
5. Suggest next — Next plan to execute
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<execution_context>
|
|
32
|
+
@~/.claude/specdacular/workflows/execute-plan.md
|
|
33
|
+
</execution_context>
|
|
34
|
+
|
|
35
|
+
<context>
|
|
36
|
+
Feature name: $ARGUMENTS (first argument)
|
|
37
|
+
Plan path: $ARGUMENTS (optional second argument)
|
|
38
|
+
|
|
39
|
+
**Load ALL feature context:**
|
|
40
|
+
@.specd/features/{name}/STATE.md — Progress tracking
|
|
41
|
+
@.specd/features/{name}/DECISIONS.md — Constraints to follow
|
|
42
|
+
@.specd/features/{name}/RESEARCH.md — Implementation notes (if exists)
|
|
43
|
+
@.specd/features/{name}/ROADMAP.md — Phase overview
|
|
44
|
+
|
|
45
|
+
**Load codebase context:**
|
|
46
|
+
@.specd/codebase/PATTERNS.md — Code patterns to follow
|
|
47
|
+
@.specd/codebase/STRUCTURE.md — Where files go
|
|
48
|
+
@.specd/codebase/MAP.md — System overview
|
|
49
|
+
</context>
|
|
50
|
+
|
|
51
|
+
<process>
|
|
52
|
+
1. **Validate** — Check feature exists with plans
|
|
53
|
+
2. **Load Context** — Read all feature and codebase docs
|
|
54
|
+
3. **Find Plan** — Next incomplete or specified plan
|
|
55
|
+
4. **Execute Tasks** — With verification and deviation handling
|
|
56
|
+
5. **Complete Plan** — Update STATE.md, suggest next
|
|
57
|
+
</process>
|
|
58
|
+
|
|
59
|
+
<success_criteria>
|
|
60
|
+
- [ ] Feature validated with plans
|
|
61
|
+
- [ ] Context loaded (feature, codebase)
|
|
62
|
+
- [ ] Tasks executed in order
|
|
63
|
+
- [ ] Verification run after each task
|
|
64
|
+
- [ ] Deviations logged to CHANGELOG.md
|
|
65
|
+
- [ ] STATE.md updated with progress
|
|
66
|
+
- [ ] Commits made after each task
|
|
67
|
+
- [ ] Next plan suggested
|
|
68
|
+
</success_criteria>
|
package/commands/specd/help.md
CHANGED
|
@@ -30,6 +30,7 @@ Display available specdacular commands and usage guidance.
|
|
|
30
30
|
| `/specd:discuss-feature [name]` | Continue/deepen feature discussion (can call many times) |
|
|
31
31
|
| `/specd:research-feature [name]` | Research implementation with parallel agents |
|
|
32
32
|
| `/specd:plan-feature [name]` | Create executable task plans for agents |
|
|
33
|
+
| `/specd:execute-plan [feature] [plan]` | Execute a plan with progress tracking |
|
|
33
34
|
|
|
34
35
|
### Utilities
|
|
35
36
|
|
|
@@ -45,7 +46,7 @@ Display available specdacular commands and usage guidance.
|
|
|
45
46
|
The feature flow helps you plan features specific enough that an agent can implement without asking questions.
|
|
46
47
|
|
|
47
48
|
```
|
|
48
|
-
new-feature → (discuss ↔ research)* → plan-feature
|
|
49
|
+
new-feature → (discuss ↔ research)* → plan-feature → execute-plan*
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
**You control the rhythm:**
|
|
@@ -53,6 +54,7 @@ new-feature → (discuss ↔ research)* → plan-feature
|
|
|
53
54
|
- `discuss-feature` — Can be called **many times** to refine understanding
|
|
54
55
|
- `research-feature` — Can be called **many times** to investigate
|
|
55
56
|
- `plan-feature` — When satisfied, creates executable plans for an agent
|
|
57
|
+
- `execute-plan` — Execute plans with progress tracking and deviation logging
|
|
56
58
|
|
|
57
59
|
### Quick Start
|
|
58
60
|
|
|
@@ -63,7 +65,8 @@ new-feature → (discuss ↔ research)* → plan-feature
|
|
|
63
65
|
This creates `.specd/features/user-dashboard/` with:
|
|
64
66
|
- `FEATURE.md` — Technical requirements
|
|
65
67
|
- `CONTEXT.md` — Discussion context (accumulates)
|
|
66
|
-
- `DECISIONS.md` —
|
|
68
|
+
- `DECISIONS.md` — User-driven decisions with dates and rationale
|
|
69
|
+
- `CHANGELOG.md` — Auto-captured implementation decisions during execution
|
|
67
70
|
- `STATE.md` — Progress tracking
|
|
68
71
|
|
|
69
72
|
After initialization, refine with discussion and research, then create plans:
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Changelog: {feature-name}
|
|
2
|
+
|
|
3
|
+
Implementation log - auto-captured decisions and deviations during execution.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Phase 1: {Phase Name}
|
|
8
|
+
|
|
9
|
+
### {YYYY-MM-DD} - Plan 01
|
|
10
|
+
|
|
11
|
+
**{Brief title}**
|
|
12
|
+
- **What:** {What was decided/changed}
|
|
13
|
+
- **Why:** {Reason}
|
|
14
|
+
- **Files:** `{path/to/file}`
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
**{Another decision}**
|
|
19
|
+
- **What:** {Description}
|
|
20
|
+
- **Why:** {Reason}
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Compacted Summary
|
|
25
|
+
|
|
26
|
+
{Space for human review - summarize key decisions after implementation}
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Notes
|
|
31
|
+
|
|
32
|
+
- Entries are auto-captured by executing agent
|
|
33
|
+
- Review after each phase to extract important decisions
|
|
34
|
+
- Move significant decisions to DECISIONS.md if needed
|
|
@@ -148,6 +148,33 @@ When this plan is complete:
|
|
|
148
148
|
|
|
149
149
|
---
|
|
150
150
|
|
|
151
|
+
## Implementation Log
|
|
152
|
+
|
|
153
|
+
During implementation, capture decisions and deviations to `.specd/features/{feature-name}/CHANGELOG.md`.
|
|
154
|
+
|
|
155
|
+
**When to log:**
|
|
156
|
+
- Choosing a different approach than specified
|
|
157
|
+
- Adding functionality not in the plan
|
|
158
|
+
- Skipping or modifying a task
|
|
159
|
+
- Discovering issues that change the approach
|
|
160
|
+
|
|
161
|
+
**Format:**
|
|
162
|
+
```markdown
|
|
163
|
+
### {YYYY-MM-DD} - Plan {NN}
|
|
164
|
+
|
|
165
|
+
**{Brief title}**
|
|
166
|
+
- **What:** {What you decided/changed}
|
|
167
|
+
- **Why:** {Reason for the change}
|
|
168
|
+
- **Files:** `{affected files}`
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Don't log:**
|
|
172
|
+
- Minor implementation details
|
|
173
|
+
- Standard coding patterns
|
|
174
|
+
- Things working as planned
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
151
178
|
## Notes
|
|
152
179
|
|
|
153
180
|
{Space for the implementing agent to record discoveries, blockers, or decisions made during implementation. Leave empty in template.}
|
|
@@ -28,6 +28,19 @@
|
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
+
## Execution Progress
|
|
32
|
+
|
|
33
|
+
### Current Plan
|
|
34
|
+
- Plan: none
|
|
35
|
+
- Task: —
|
|
36
|
+
- Started: —
|
|
37
|
+
|
|
38
|
+
### Completed Plans
|
|
39
|
+
| Plan | Completed | Tasks | Deviations |
|
|
40
|
+
|------|-----------|-------|------------|
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
31
44
|
## Discussion Sessions
|
|
32
45
|
|
|
33
46
|
| Date | Focus | Outcome |
|
|
@@ -65,6 +78,7 @@
|
|
|
65
78
|
- `/specd:discuss-feature {feature-name}` — Continue refining understanding
|
|
66
79
|
- `/specd:research-feature {feature-name}` — Research implementation approach
|
|
67
80
|
- `/specd:plan-feature {feature-name}` — Create executable plans (when ready)
|
|
81
|
+
- `/specd:execute-plan {feature-name}` — Execute plans with progress tracking
|
|
68
82
|
|
|
69
83
|
---
|
|
70
84
|
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
Execute a plan from a feature, tracking progress and logging deviations.
|
|
3
|
+
|
|
4
|
+
**Key principles:**
|
|
5
|
+
- Execute tasks in order with verification
|
|
6
|
+
- Auto-fix bugs/blockers, log to CHANGELOG.md
|
|
7
|
+
- Ask before architectural changes
|
|
8
|
+
- Stop on verification failure, let user decide
|
|
9
|
+
- Commit after each successful task
|
|
10
|
+
|
|
11
|
+
**Output:** Completed tasks, updated STATE.md, CHANGELOG.md entries
|
|
12
|
+
</purpose>
|
|
13
|
+
|
|
14
|
+
<philosophy>
|
|
15
|
+
|
|
16
|
+
## Deviations Are Normal
|
|
17
|
+
|
|
18
|
+
Plans are written in advance. Reality differs. The goal is controlled deviation:
|
|
19
|
+
- Small fixes: Just do it, log it
|
|
20
|
+
- Big changes: Ask first
|
|
21
|
+
|
|
22
|
+
## Auto-fix vs Ask First
|
|
23
|
+
|
|
24
|
+
**Auto-fix (log to CHANGELOG.md):**
|
|
25
|
+
- Bugs — Code doesn't work, logic errors, crashes
|
|
26
|
+
- Blockers — Missing imports, wrong paths, missing deps
|
|
27
|
+
- Missing critical — Error handling, validation needed for correctness
|
|
28
|
+
|
|
29
|
+
**Ask first:**
|
|
30
|
+
- New files not specified in plan
|
|
31
|
+
- Different approach than specified
|
|
32
|
+
- Architectural changes — new patterns, new dependencies
|
|
33
|
+
|
|
34
|
+
## Verification Is Non-Negotiable
|
|
35
|
+
|
|
36
|
+
Every task has verification. If it fails:
|
|
37
|
+
1. Show the output
|
|
38
|
+
2. Ask user: Retry / Skip / Stop
|
|
39
|
+
3. Log skips to CHANGELOG.md
|
|
40
|
+
|
|
41
|
+
## Progress Is Persistent
|
|
42
|
+
|
|
43
|
+
STATE.md tracks exactly where we are. If interrupted, we can resume.
|
|
44
|
+
|
|
45
|
+
</philosophy>
|
|
46
|
+
|
|
47
|
+
<process>
|
|
48
|
+
|
|
49
|
+
<step name="validate">
|
|
50
|
+
Validate feature exists and has plans.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Check feature exists
|
|
54
|
+
[ -d ".specd/features/$ARGUMENTS" ] || { echo "not found"; exit 1; }
|
|
55
|
+
|
|
56
|
+
# Check plans exist
|
|
57
|
+
[ -d ".specd/features/$ARGUMENTS/plans" ] || { echo "no plans"; exit 1; }
|
|
58
|
+
|
|
59
|
+
# Check ROADMAP exists
|
|
60
|
+
[ -f ".specd/features/$ARGUMENTS/ROADMAP.md" ] || { echo "no roadmap"; exit 1; }
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**If feature not found:**
|
|
64
|
+
```
|
|
65
|
+
Feature '{name}' not found.
|
|
66
|
+
|
|
67
|
+
Run /specd:new-feature {name} to create it.
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**If no plans:**
|
|
71
|
+
```
|
|
72
|
+
Feature '{name}' has no plans yet.
|
|
73
|
+
|
|
74
|
+
Run /specd:plan-feature {name} to create plans.
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Continue to load_context.
|
|
78
|
+
</step>
|
|
79
|
+
|
|
80
|
+
<step name="load_context">
|
|
81
|
+
Load ALL context needed for execution.
|
|
82
|
+
|
|
83
|
+
**Read feature context:**
|
|
84
|
+
- `STATE.md` — Current progress, completed plans
|
|
85
|
+
- `DECISIONS.md` — Constraints to follow during implementation
|
|
86
|
+
- `RESEARCH.md` — Implementation notes, pitfalls (if exists)
|
|
87
|
+
- `ROADMAP.md` — Phase overview, plan order
|
|
88
|
+
|
|
89
|
+
**Read codebase context (if available):**
|
|
90
|
+
- `PATTERNS.md` — Code patterns to follow
|
|
91
|
+
- `STRUCTURE.md` — Where files go
|
|
92
|
+
- `MAP.md` — System overview
|
|
93
|
+
|
|
94
|
+
**Internalize:**
|
|
95
|
+
- Which plans are complete (from STATE.md)
|
|
96
|
+
- Which phase we're in
|
|
97
|
+
- Key decisions affecting implementation
|
|
98
|
+
- Patterns to follow
|
|
99
|
+
|
|
100
|
+
Continue to find_plan.
|
|
101
|
+
</step>
|
|
102
|
+
|
|
103
|
+
<step name="find_plan">
|
|
104
|
+
Determine which plan to execute.
|
|
105
|
+
|
|
106
|
+
**If plan path provided in arguments:**
|
|
107
|
+
- Use that plan directly
|
|
108
|
+
- Verify it exists
|
|
109
|
+
|
|
110
|
+
**Else find next plan:**
|
|
111
|
+
1. Read STATE.md for current progress
|
|
112
|
+
2. Read ROADMAP.md for plan order
|
|
113
|
+
3. Find first plan without completion marker in STATE.md
|
|
114
|
+
4. Or first plan file in current phase directory
|
|
115
|
+
|
|
116
|
+
**If no plan found:**
|
|
117
|
+
```
|
|
118
|
+
All plans complete for '{name}'!
|
|
119
|
+
|
|
120
|
+
Feature execution finished. Review:
|
|
121
|
+
- STATE.md for summary
|
|
122
|
+
- CHANGELOG.md for deviations
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Present plan to execute:**
|
|
126
|
+
```
|
|
127
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
128
|
+
EXECUTE PLAN
|
|
129
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
130
|
+
|
|
131
|
+
**Feature:** {feature-name}
|
|
132
|
+
|
|
133
|
+
**Context loaded:**
|
|
134
|
+
- STATE.md: {phase X, N plans executed}
|
|
135
|
+
- DECISIONS.md: {N} decisions
|
|
136
|
+
- ROADMAP.md: {N} phases, {M} plans total
|
|
137
|
+
|
|
138
|
+
**Next plan:** {plans/phase-XX/YY-PLAN.md}
|
|
139
|
+
**Objective:** {one-line from plan}
|
|
140
|
+
|
|
141
|
+
Proceed? [Y/n]
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Use AskUserQuestion:
|
|
145
|
+
- header: "Execute"
|
|
146
|
+
- question: "Proceed with this plan?"
|
|
147
|
+
- options:
|
|
148
|
+
- "Yes, execute" — Continue to execute_tasks
|
|
149
|
+
- "Show plan first" — Read and display plan content, then ask again
|
|
150
|
+
- "Skip to different plan" — Ask for plan path
|
|
151
|
+
- "Cancel" — Exit workflow
|
|
152
|
+
|
|
153
|
+
Continue to execute_tasks.
|
|
154
|
+
</step>
|
|
155
|
+
|
|
156
|
+
<step name="execute_tasks">
|
|
157
|
+
Execute each task in the plan.
|
|
158
|
+
|
|
159
|
+
**Read plan file:**
|
|
160
|
+
Parse the plan to extract:
|
|
161
|
+
- Objective
|
|
162
|
+
- Tasks (numbered)
|
|
163
|
+
- For each task: files, action, pattern, verification, done criteria
|
|
164
|
+
|
|
165
|
+
**Update STATE.md:**
|
|
166
|
+
Set current plan and task:
|
|
167
|
+
```markdown
|
|
168
|
+
### Current Plan
|
|
169
|
+
- Plan: {path to current plan}
|
|
170
|
+
- Task: 1 of {N}
|
|
171
|
+
- Started: {YYYY-MM-DD HH:MM}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**For each task:**
|
|
175
|
+
|
|
176
|
+
### 1. Announce task
|
|
177
|
+
```
|
|
178
|
+
───────────────────────────────────────────────────────
|
|
179
|
+
Executing Task {N}: {Title}
|
|
180
|
+
Files: {file list}
|
|
181
|
+
───────────────────────────────────────────────────────
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 2. Implement task
|
|
185
|
+
Follow the plan's instructions:
|
|
186
|
+
- Create/modify specified files
|
|
187
|
+
- Follow patterns from codebase docs
|
|
188
|
+
- Reference DECISIONS.md for constraints
|
|
189
|
+
- Use code patterns from PATTERNS.md
|
|
190
|
+
|
|
191
|
+
### 3. Handle deviations during implementation
|
|
192
|
+
|
|
193
|
+
**If bug/blocker discovered:**
|
|
194
|
+
- Fix it immediately
|
|
195
|
+
- Log to CHANGELOG.md:
|
|
196
|
+
```markdown
|
|
197
|
+
### {YYYY-MM-DD} - Plan {phase-XX/YY}
|
|
198
|
+
|
|
199
|
+
**[Auto-fix] {Short description}**
|
|
200
|
+
- **What:** {What was fixed}
|
|
201
|
+
- **Why:** {Why it was needed}
|
|
202
|
+
- **Files:** `{affected files}`
|
|
203
|
+
```
|
|
204
|
+
- Continue implementation
|
|
205
|
+
|
|
206
|
+
**If architectural change needed:**
|
|
207
|
+
- Stop implementation
|
|
208
|
+
- Present to user:
|
|
209
|
+
```
|
|
210
|
+
Architectural change needed:
|
|
211
|
+
|
|
212
|
+
**What:** {Description of change}
|
|
213
|
+
**Why:** {Why plan approach won't work}
|
|
214
|
+
**Proposed:** {Alternative approach}
|
|
215
|
+
|
|
216
|
+
This differs from the plan. How to proceed?
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Use AskUserQuestion:
|
|
220
|
+
- header: "Change"
|
|
221
|
+
- question: "This requires a change from the plan. Approve?"
|
|
222
|
+
- options:
|
|
223
|
+
- "Approve change" — Implement and log to CHANGELOG.md
|
|
224
|
+
- "Try plan approach" — Attempt original approach
|
|
225
|
+
- "Stop and discuss" — Pause execution
|
|
226
|
+
|
|
227
|
+
**If user approves change:**
|
|
228
|
+
- Implement the change
|
|
229
|
+
- Log to CHANGELOG.md:
|
|
230
|
+
```markdown
|
|
231
|
+
### {YYYY-MM-DD} - Plan {phase-XX/YY}
|
|
232
|
+
|
|
233
|
+
**[User-approved] {Short description}**
|
|
234
|
+
- **What:** {What was changed}
|
|
235
|
+
- **Why:** {Why plan approach didn't work}
|
|
236
|
+
- **Decision:** User approved alternative
|
|
237
|
+
- **Files:** `{affected files}`
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### 4. Run verification
|
|
241
|
+
Execute the verification command from the task:
|
|
242
|
+
```bash
|
|
243
|
+
{verification command from plan}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**If verification passes:**
|
|
247
|
+
- Show: `Verification: {command} ✓`
|
|
248
|
+
- Continue to commit
|
|
249
|
+
|
|
250
|
+
**If verification fails:**
|
|
251
|
+
- Show output:
|
|
252
|
+
```
|
|
253
|
+
Verification failed for Task {N}: {Title}
|
|
254
|
+
|
|
255
|
+
Command: {verification command}
|
|
256
|
+
Output:
|
|
257
|
+
{actual output}
|
|
258
|
+
|
|
259
|
+
How to proceed?
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Use AskUserQuestion:
|
|
263
|
+
- header: "Failed"
|
|
264
|
+
- question: "Verification failed. How to proceed?"
|
|
265
|
+
- options:
|
|
266
|
+
- "Retry task" — Go back to step 2 for this task
|
|
267
|
+
- "Skip task" — Log to CHANGELOG.md and continue
|
|
268
|
+
- "Stop execution" — Pause, save progress
|
|
269
|
+
|
|
270
|
+
**If skip:**
|
|
271
|
+
- Log to CHANGELOG.md:
|
|
272
|
+
```markdown
|
|
273
|
+
### {YYYY-MM-DD} - Plan {phase-XX/YY}
|
|
274
|
+
|
|
275
|
+
**[Skipped] Task {N}: {Title}**
|
|
276
|
+
- **Reason:** Verification failed, user chose to skip
|
|
277
|
+
- **Command:** `{verification command}`
|
|
278
|
+
- **Output:** {truncated output}
|
|
279
|
+
- **Files:** `{affected files}`
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### 5. Commit task
|
|
283
|
+
```bash
|
|
284
|
+
git add {files from task}
|
|
285
|
+
git commit -m "feat({feature}): {task description}"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### 6. Update STATE.md
|
|
289
|
+
Update current task number:
|
|
290
|
+
```markdown
|
|
291
|
+
- Task: {N+1} of {M}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Continue to next task.**
|
|
295
|
+
|
|
296
|
+
After all tasks, continue to complete_plan.
|
|
297
|
+
</step>
|
|
298
|
+
|
|
299
|
+
<step name="complete_plan">
|
|
300
|
+
Mark plan complete and suggest next.
|
|
301
|
+
|
|
302
|
+
**Update STATE.md:**
|
|
303
|
+
|
|
304
|
+
1. Clear current plan section:
|
|
305
|
+
```markdown
|
|
306
|
+
### Current Plan
|
|
307
|
+
- Plan: none
|
|
308
|
+
- Task: —
|
|
309
|
+
- Started: —
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
2. Add to completed plans table:
|
|
313
|
+
```markdown
|
|
314
|
+
### Completed Plans
|
|
315
|
+
| Plan | Completed | Tasks | Deviations |
|
|
316
|
+
|------|-----------|-------|------------|
|
|
317
|
+
| {path} | {YYYY-MM-DD} | {N} | {count} |
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
3. Update stage progress checkboxes
|
|
321
|
+
|
|
322
|
+
**Commit STATE.md update:**
|
|
323
|
+
```bash
|
|
324
|
+
git add .specd/features/{feature}/STATE.md
|
|
325
|
+
git commit -m "docs({feature}): complete plan {phase-XX/YY}"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Find next plan:**
|
|
329
|
+
- Check ROADMAP.md for next plan in sequence
|
|
330
|
+
- Or next phase if current phase complete
|
|
331
|
+
|
|
332
|
+
**Present summary:**
|
|
333
|
+
```
|
|
334
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
335
|
+
PLAN COMPLETE
|
|
336
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
337
|
+
|
|
338
|
+
**Plan:** {path}
|
|
339
|
+
**Tasks executed:** {N}
|
|
340
|
+
**Deviations logged:** {count}
|
|
341
|
+
|
|
342
|
+
{If deviations:}
|
|
343
|
+
## Deviations
|
|
344
|
+
|
|
345
|
+
{List from CHANGELOG.md for this plan}
|
|
346
|
+
|
|
347
|
+
───────────────────────────────────────────────────────
|
|
348
|
+
|
|
349
|
+
**Next plan:** {path or "None - all plans complete"}
|
|
350
|
+
|
|
351
|
+
{If next plan exists:}
|
|
352
|
+
Run `/specd:execute-plan {feature}` to continue.
|
|
353
|
+
|
|
354
|
+
{If all complete:}
|
|
355
|
+
All plans complete! Feature '{feature}' is implemented.
|
|
356
|
+
Review STATE.md and CHANGELOG.md for summary.
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
End workflow.
|
|
360
|
+
</step>
|
|
361
|
+
|
|
362
|
+
</process>
|
|
363
|
+
|
|
364
|
+
<changelog_format>
|
|
365
|
+
When logging to CHANGELOG.md, use this format:
|
|
366
|
+
|
|
367
|
+
```markdown
|
|
368
|
+
### {YYYY-MM-DD} - Plan {phase-XX/YY}
|
|
369
|
+
|
|
370
|
+
**[{Type}] {Short description}**
|
|
371
|
+
- **What:** {Description of change}
|
|
372
|
+
- **Why:** {Reason for deviation}
|
|
373
|
+
- **Files:** `{comma-separated file paths}`
|
|
374
|
+
|
|
375
|
+
{If relevant:}
|
|
376
|
+
- **Decision:** {User decision if asked}
|
|
377
|
+
- **Output:** {Truncated verification output if skipped}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Types:
|
|
381
|
+
- `[Auto-fix]` — Bug, blocker, or missing critical item fixed automatically
|
|
382
|
+
- `[User-approved]` — Architectural change approved by user
|
|
383
|
+
- `[Skipped]` — Task skipped due to verification failure
|
|
384
|
+
</changelog_format>
|
|
385
|
+
|
|
386
|
+
<success_criteria>
|
|
387
|
+
- Feature validated with plans
|
|
388
|
+
- All context loaded and internalized
|
|
389
|
+
- Tasks executed in plan order
|
|
390
|
+
- Verification run after each task
|
|
391
|
+
- Deviations logged appropriately
|
|
392
|
+
- Commits made with proper format
|
|
393
|
+
- STATE.md updated with progress
|
|
394
|
+
- Next plan identified or completion announced
|
|
395
|
+
</success_criteria>
|
|
@@ -8,7 +8,7 @@ new-feature → (discuss ↔ research)* → plan-feature
|
|
|
8
8
|
|
|
9
9
|
The user controls the rhythm after initialization. This command is just the entry point.
|
|
10
10
|
|
|
11
|
-
**Output:** `.specd/features/{feature-name}/` folder with FEATURE.md, CONTEXT.md, DECISIONS.md, STATE.md, config.json
|
|
11
|
+
**Output:** `.specd/features/{feature-name}/` folder with FEATURE.md, CONTEXT.md, DECISIONS.md, CHANGELOG.md, STATE.md, config.json
|
|
12
12
|
</purpose>
|
|
13
13
|
|
|
14
14
|
<philosophy>
|
|
@@ -229,6 +229,17 @@ If any decisions were made during discussion (technology choices, scope decision
|
|
|
229
229
|
|
|
230
230
|
If no decisions yet, leave with just the template structure.
|
|
231
231
|
|
|
232
|
+
Continue to initialize_changelog.
|
|
233
|
+
</step>
|
|
234
|
+
|
|
235
|
+
<step name="initialize_changelog">
|
|
236
|
+
Initialize CHANGELOG.md (empty, ready for implementation).
|
|
237
|
+
|
|
238
|
+
**Write CHANGELOG.md:**
|
|
239
|
+
Use template at `~/.claude/specdacular/templates/features/CHANGELOG.md`
|
|
240
|
+
|
|
241
|
+
Replace `{feature-name}` with actual feature name. Leave the rest as template structure — entries will be added during plan execution.
|
|
242
|
+
|
|
232
243
|
Continue to initialize_state.
|
|
233
244
|
</step>
|
|
234
245
|
|
|
@@ -268,6 +279,7 @@ Creates feature structure with:
|
|
|
268
279
|
- FEATURE.md: Technical requirements
|
|
269
280
|
- CONTEXT.md: Discussion context
|
|
270
281
|
- DECISIONS.md: Decision log ({N} decisions)
|
|
282
|
+
- CHANGELOG.md: Implementation log (empty)
|
|
271
283
|
- STATE.md: Progress tracking
|
|
272
284
|
- config.json: Configuration"
|
|
273
285
|
```
|
|
@@ -291,6 +303,7 @@ Present what was created and next options.
|
|
|
291
303
|
- `.specd/features/{feature-name}/FEATURE.md` — Technical requirements
|
|
292
304
|
- `.specd/features/{feature-name}/CONTEXT.md` — Discussion context
|
|
293
305
|
- `.specd/features/{feature-name}/DECISIONS.md` — {N} decisions recorded
|
|
306
|
+
- `.specd/features/{feature-name}/CHANGELOG.md` — Implementation log (empty)
|
|
294
307
|
- `.specd/features/{feature-name}/STATE.md` — Progress tracking
|
|
295
308
|
- `.specd/features/{feature-name}/config.json` — Configuration
|
|
296
309
|
|
|
@@ -331,6 +344,7 @@ End workflow.
|
|
|
331
344
|
- FEATURE.md has specific technical requirements (files to create, integrations)
|
|
332
345
|
- CONTEXT.md captures the discussion state
|
|
333
346
|
- DECISIONS.md initialized (with any decisions made)
|
|
347
|
+
- CHANGELOG.md initialized (empty, ready for implementation)
|
|
334
348
|
- STATE.md tracks current stage
|
|
335
349
|
- config.json created
|
|
336
350
|
- Committed to git
|