specdacular 0.2.1 → 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.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: specd:plan-feature
3
+ description: Create executable task plans for implementing a feature
4
+ argument-hint: "[feature-name]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - AskUserQuestion
12
+ ---
13
+
14
+ <objective>
15
+ Create executable task plans that an agent can implement without asking clarifying questions.
16
+
17
+ **Creates:**
18
+ - `.specd/features/{name}/ROADMAP.md` — Phase overview with dependencies
19
+ - `.specd/features/{name}/plans/phase-{NN}/{NN}-PLAN.md` — Executable task plans
20
+
21
+ **Each PLAN.md is a prompt** for an implementing agent with:
22
+ - Files to create/modify with specific paths
23
+ - Code patterns to follow (from codebase)
24
+ - Verification commands
25
+ - Clear completion criteria
26
+
27
+ **Prerequisite:** Feature should have sufficient discussion context (FEATURE.md, CONTEXT.md, DECISIONS.md). Research (RESEARCH.md) recommended but optional.
28
+ </objective>
29
+
30
+ <execution_context>
31
+ @~/.claude/specdacular/workflows/plan-feature.md
32
+ </execution_context>
33
+
34
+ <context>
35
+ Feature name: $ARGUMENTS
36
+
37
+ **Load ALL feature context:**
38
+ @.specd/features/{name}/FEATURE.md — Technical requirements
39
+ @.specd/features/{name}/CONTEXT.md — Resolved gray areas
40
+ @.specd/features/{name}/DECISIONS.md — Implementation decisions
41
+ @.specd/features/{name}/RESEARCH.md — Research findings (if exists)
42
+
43
+ **Load codebase context:**
44
+ @.specd/codebase/PATTERNS.md — Code patterns to follow
45
+ @.specd/codebase/STRUCTURE.md — Where files go
46
+ @.specd/codebase/MAP.md — System overview
47
+ </context>
48
+
49
+ <process>
50
+ 1. **Validate** — Check feature exists, has required context
51
+ 2. **Load Context** — Read ALL feature and codebase docs
52
+ 3. **Assess Readiness** — Check if enough context to plan
53
+ 4. **Derive Phases** — Based on dependencies (types→API→UI pattern)
54
+ 5. **Break Into Tasks** — 2-3 tasks per plan, sized for agent execution
55
+ 6. **Write PLAN Files** — As prompts for implementing agent
56
+ 7. **Write ROADMAP.md** — Phase overview
57
+ 8. **Commit and Present**
58
+ </process>
59
+
60
+ <success_criteria>
61
+ - [ ] Feature validated with sufficient context
62
+ - [ ] All context loaded (feature, codebase, research)
63
+ - [ ] Phases derived from dependency analysis
64
+ - [ ] Tasks are specific (files, actions, verification)
65
+ - [ ] PLAN.md files are self-contained prompts
66
+ - [ ] ROADMAP.md provides clear overview
67
+ - [ ] Committed to git
68
+ - [ ] User knows how to execute plans
69
+ </success_criteria>
@@ -0,0 +1,457 @@
1
+ ---
2
+ name: specd:research-feature
3
+ description: Research how to implement a feature - spawns parallel agents for codebase, external, and pitfalls research
4
+ argument-hint: "[feature-name]"
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Bash
9
+ - Glob
10
+ - Grep
11
+ - Task
12
+ - AskUserQuestion
13
+ ---
14
+
15
+ <objective>
16
+ Research how to implement a feature before planning. Spawns parallel research agents to investigate:
17
+
18
+ 1. **Codebase Integration** - How does this fit with existing code? (uses Claude Code Explore agent)
19
+ 2. **External Patterns** - What libraries/patterns are standard for this?
20
+ 3. **Pitfalls** - What commonly goes wrong?
21
+
22
+ **Output:** `.specd/features/{name}/RESEARCH.md` with prescriptive guidance for the planner.
23
+
24
+ **Why parallel agents:** Research burns context fast. Fresh context per dimension = thorough investigation. Synthesize results into single RESEARCH.md.
25
+ </objective>
26
+
27
+ <execution_context>
28
+ @~/.claude/specdacular/workflows/research-feature.md
29
+ </execution_context>
30
+
31
+ <context>
32
+ Feature name: $ARGUMENTS
33
+
34
+ **Load feature context:**
35
+ @.specd/features/{name}/FEATURE.md
36
+ @.specd/features/{name}/DECISIONS.md
37
+ @.specd/features/{name}/CONTEXT.md (if exists)
38
+
39
+ **Load codebase context:**
40
+ @.specd/codebase/ARCHITECTURE.md
41
+ @.specd/codebase/CONVENTIONS.md
42
+ @.specd/codebase/STACK.md
43
+ </context>
44
+
45
+ <process>
46
+
47
+ ## Phase 1: Validate Feature
48
+
49
+ ```bash
50
+ # Check feature exists
51
+ [ -d ".specd/features/$ARGUMENTS" ] || { echo "Feature not found. Run /specd:new-feature first."; exit 1; }
52
+
53
+ # Check if RESEARCH.md exists
54
+ [ -f ".specd/features/$ARGUMENTS/RESEARCH.md" ] && echo "existing"
55
+ ```
56
+
57
+ **If RESEARCH.md exists:**
58
+ Use AskUserQuestion:
59
+ - header: "Research Exists"
60
+ - question: "Research already exists for this feature. What would you like to do?"
61
+ - options:
62
+ - "Update research" — Re-run research, incorporate new findings
63
+ - "View existing" — Show current RESEARCH.md
64
+ - "Continue anyway" — Skip research, use existing
65
+
66
+ ## Phase 2: Load Feature Context
67
+
68
+ Read and parse:
69
+ - `FEATURE.md` - What needs to be built
70
+ - `DECISIONS.md` - Constraints already decided
71
+ - `CONTEXT.md` - Gray areas already resolved (if exists)
72
+
73
+ Extract:
74
+ - Technical requirements (files to create, integrations needed)
75
+ - Locked decisions (don't research alternatives)
76
+ - Open questions (areas to investigate)
77
+
78
+ ## Phase 3: Identify Research Dimensions
79
+
80
+ Based on feature requirements, determine what needs research:
81
+
82
+ **Always research:**
83
+ - Codebase integration patterns
84
+ - Pitfalls for this type of feature
85
+
86
+ **Conditionally research:**
87
+ - External libraries (if new dependencies needed)
88
+ - API patterns (if building APIs)
89
+ - UI patterns (if building UI components)
90
+ - Data modeling (if new models needed)
91
+
92
+ Present research plan:
93
+ ```
94
+ I'll research these dimensions for {feature-name}:
95
+
96
+ 1. **Codebase Integration** — How this fits with existing code
97
+ - Integration points in current architecture
98
+ - Patterns to follow from existing code
99
+ - Files that will need modification
100
+
101
+ 2. **External Patterns** — Standard approaches for {feature-type}
102
+ - Libraries commonly used
103
+ - Architecture patterns
104
+ - Code examples
105
+
106
+ 3. **Pitfalls** — What commonly goes wrong
107
+ - Implementation mistakes
108
+ - Integration gotchas
109
+ - Performance traps
110
+
111
+ Estimated: 3 parallel research agents
112
+
113
+ [Start research] / [Adjust scope]
114
+ ```
115
+
116
+ ## Phase 4: Spawn Parallel Research Agents
117
+
118
+ ### Agent 1: Codebase Integration (using Explore agent)
119
+
120
+ ```
121
+ Task(
122
+ prompt="Research how {feature-name} should integrate with the existing codebase.
123
+
124
+ <feature_context>
125
+ {FEATURE.md content}
126
+ </feature_context>
127
+
128
+ <locked_decisions>
129
+ {Relevant decisions from DECISIONS.md}
130
+ </locked_decisions>
131
+
132
+ <research_questions>
133
+ 1. What existing files/modules will this feature need to import from?
134
+ 2. What patterns do similar features in this codebase follow?
135
+ 3. Where should new files be created based on project structure?
136
+ 4. What types/interfaces already exist that this feature should use?
137
+ 5. What utility functions or hooks can be reused?
138
+ </research_questions>
139
+
140
+ <output_format>
141
+ Return findings as structured markdown:
142
+
143
+ ## Codebase Integration Findings
144
+
145
+ ### Import Dependencies
146
+ - `path/to/file` — what it provides, why needed
147
+
148
+ ### Patterns to Follow
149
+ - Pattern name: description, example file reference
150
+
151
+ ### File Locations
152
+ - New files should go in: path/reason
153
+ - Existing files to modify: path/what change
154
+
155
+ ### Reusable Code
156
+ - Types: list with paths
157
+ - Utilities: list with paths
158
+ - Components: list with paths
159
+
160
+ ### Integration Points
161
+ - Where this connects to existing code
162
+ - What interfaces to implement
163
+ </output_format>
164
+ ",
165
+ subagent_type="Explore",
166
+ description="Codebase integration research"
167
+ )
168
+ ```
169
+
170
+ ### Agent 2: External Patterns Research
171
+
172
+ ```
173
+ Task(
174
+ prompt="First, read ~/.claude/specdacular/agents/feature-researcher.md for your role.
175
+
176
+ <research_type>
177
+ External patterns research for {feature-type}.
178
+ </research_type>
179
+
180
+ <feature_context>
181
+ {FEATURE.md content}
182
+ </feature_context>
183
+
184
+ <codebase_stack>
185
+ {From .specd/codebase/STACK.md}
186
+ </codebase_stack>
187
+
188
+ <locked_decisions>
189
+ {Decisions that constrain library/pattern choices}
190
+ </locked_decisions>
191
+
192
+ <research_questions>
193
+ 1. What's the standard approach for {feature-type} in {stack}?
194
+ 2. What libraries are commonly used? (verify versions with Context7)
195
+ 3. What architecture patterns work well?
196
+ 4. What code patterns are recommended?
197
+ 5. What should NOT be hand-rolled?
198
+ </research_questions>
199
+
200
+ <tool_strategy>
201
+ 1. Context7 first for any library questions
202
+ 2. Official docs via WebFetch for gaps
203
+ 3. WebSearch for ecosystem patterns (include current year)
204
+ 4. Verify all findings - no LOW confidence recommendations
205
+ </tool_strategy>
206
+
207
+ <output_format>
208
+ Return findings as structured markdown with confidence levels.
209
+ </output_format>
210
+ ",
211
+ subagent_type="general-purpose",
212
+ model="sonnet",
213
+ description="External patterns research"
214
+ )
215
+ ```
216
+
217
+ ### Agent 3: Pitfalls Research
218
+
219
+ ```
220
+ Task(
221
+ prompt="First, read ~/.claude/specdacular/agents/feature-researcher.md for your role.
222
+
223
+ <research_type>
224
+ Pitfalls research for {feature-type}.
225
+ </research_type>
226
+
227
+ <feature_context>
228
+ {FEATURE.md content}
229
+ </feature_context>
230
+
231
+ <codebase_context>
232
+ {Relevant architecture/conventions}
233
+ </codebase_context>
234
+
235
+ <research_questions>
236
+ 1. What do developers commonly get wrong with {feature-type}?
237
+ 2. What are the performance pitfalls?
238
+ 3. What security issues should be avoided?
239
+ 4. What integration mistakes happen?
240
+ 5. What looks simple but is actually complex?
241
+ </research_questions>
242
+
243
+ <tool_strategy>
244
+ 1. WebSearch for common mistakes (include current year)
245
+ 2. Look for post-mortems, issue discussions
246
+ 3. Check official docs for warnings/caveats
247
+ 4. Consider edge cases specific to this stack
248
+ </tool_strategy>
249
+
250
+ <output_format>
251
+ Return pitfalls as structured markdown:
252
+
253
+ ## Pitfalls for {feature-type}
254
+
255
+ ### Critical (causes failures/rewrites)
256
+ - Pitfall: description
257
+ - Why it happens: reason
258
+ - Prevention: how to avoid
259
+ - Detection: warning signs
260
+
261
+ ### Moderate (causes bugs/debt)
262
+ - Pitfall: description
263
+ - Prevention: how to avoid
264
+
265
+ ### Minor (causes friction)
266
+ - Pitfall: description
267
+ - Prevention: how to avoid
268
+ </output_format>
269
+ ",
270
+ subagent_type="general-purpose",
271
+ model="sonnet",
272
+ description="Pitfalls research"
273
+ )
274
+ ```
275
+
276
+ ## Phase 5: Synthesize Results
277
+
278
+ After all agents complete, synthesize into single RESEARCH.md:
279
+
280
+ ```markdown
281
+ # Research: {feature-name}
282
+
283
+ **Researched:** {date}
284
+ **Feature:** {feature-type}
285
+ **Confidence:** {overall level}
286
+
287
+ ## Summary
288
+
289
+ {2-3 paragraphs synthesizing all findings}
290
+
291
+ **Key recommendation:** {one-liner actionable guidance}
292
+
293
+ ---
294
+
295
+ ## Codebase Integration
296
+
297
+ {From Agent 1 - Explore findings}
298
+
299
+ ### Import From
300
+ | Module | Provides | Path |
301
+ |--------|----------|------|
302
+ | ... | ... | ... |
303
+
304
+ ### Patterns to Follow
305
+ {Patterns with file references}
306
+
307
+ ### File Structure
308
+ ```
309
+ src/
310
+ ├── {where new files go}
311
+ └── {existing files to modify}
312
+ ```
313
+
314
+ ### Reusable Code
315
+ - **Types:** {list with @paths}
316
+ - **Utilities:** {list with @paths}
317
+ - **Components:** {list with @paths}
318
+
319
+ ---
320
+
321
+ ## Implementation Approach
322
+
323
+ {From Agent 2 - External patterns}
324
+
325
+ ### Standard Stack
326
+ | Library | Version | Purpose | Confidence |
327
+ |---------|---------|---------|------------|
328
+ | ... | ... | ... | HIGH/MED |
329
+
330
+ ### Architecture Pattern
331
+ {Recommended pattern with rationale}
332
+
333
+ ### Code Patterns
334
+ ```typescript
335
+ // Pattern name - source: {Context7/docs URL}
336
+ {code example}
337
+ ```
338
+
339
+ ### Don't Hand-Roll
340
+ | Problem | Use Instead | Why |
341
+ |---------|-------------|-----|
342
+ | ... | ... | ... |
343
+
344
+ ---
345
+
346
+ ## Pitfalls
347
+
348
+ {From Agent 3 - Pitfalls research}
349
+
350
+ ### Critical
351
+ {List with prevention strategies}
352
+
353
+ ### Moderate
354
+ {List with prevention strategies}
355
+
356
+ ### Task-Specific Warnings
357
+ | When Implementing | Watch Out For | Prevention |
358
+ |-------------------|---------------|------------|
359
+ | ... | ... | ... |
360
+
361
+ ---
362
+
363
+ ## Confidence Assessment
364
+
365
+ | Area | Level | Reason |
366
+ |------|-------|--------|
367
+ | Codebase integration | {level} | {reason} |
368
+ | Implementation approach | {level} | {reason} |
369
+ | Pitfalls | {level} | {reason} |
370
+
371
+ ## Open Questions
372
+
373
+ {Anything that couldn't be resolved - planner should be aware}
374
+
375
+ ## Sources
376
+
377
+ ### Codebase (from Explore)
378
+ - {file references used}
379
+
380
+ ### External (verified)
381
+ - {Context7 queries}
382
+ - {Official docs URLs}
383
+
384
+ ### Community (for awareness)
385
+ - {WebSearch findings - lower confidence}
386
+ ```
387
+
388
+ ## Phase 6: Update DECISIONS.md
389
+
390
+ Any technology choices or pattern decisions from research should be recorded:
391
+
392
+ ```markdown
393
+ ### DEC-XXX: {Decision from research}
394
+ **Date:** {today}
395
+ **Status:** Active
396
+ **Context:** Identified during feature research
397
+ **Decision:** {what was decided}
398
+ **Rationale:** {from research findings}
399
+ **Implications:** {what this means for implementation}
400
+ **References:** {sources}
401
+ ```
402
+
403
+ ## Phase 7: Commit and Complete
404
+
405
+ ```bash
406
+ git add .specd/features/{name}/RESEARCH.md .specd/features/{name}/DECISIONS.md
407
+ git commit -m "docs({feature}): complete feature research
408
+
409
+ Dimensions researched:
410
+ - Codebase integration
411
+ - External patterns
412
+ - Pitfalls
413
+
414
+ Key findings:
415
+ - {one-liner from summary}"
416
+ ```
417
+
418
+ Present completion:
419
+ ```
420
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
421
+ RESEARCH COMPLETE ✓
422
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
423
+
424
+ **Feature:** {name}
425
+ **Confidence:** {level}
426
+
427
+ ## Key Findings
428
+
429
+ {3-5 bullet points}
430
+
431
+ ## Files Created
432
+
433
+ - `.specd/features/{name}/RESEARCH.md`
434
+ - Updated `DECISIONS.md` with {N} new decisions
435
+
436
+ ───────────────────────────────────────────────────────
437
+
438
+ ## Next Steps
439
+
440
+ /specd:plan-feature {name} — Create executable task plans
441
+
442
+ <sub>/clear first — fresh context window</sub>
443
+ ```
444
+
445
+ </process>
446
+
447
+ <success_criteria>
448
+ - [ ] Feature validated (exists, has FEATURE.md)
449
+ - [ ] Feature context loaded (requirements, decisions)
450
+ - [ ] Codebase research completed (Explore agent)
451
+ - [ ] External patterns researched (with verification)
452
+ - [ ] Pitfalls catalogued (with prevention strategies)
453
+ - [ ] Results synthesized into RESEARCH.md
454
+ - [ ] Decisions recorded in DECISIONS.md
455
+ - [ ] Files committed
456
+ - [ ] User knows next step is /specd:plan-feature
457
+ </success_criteria>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specdacular",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Feature planning system for existing codebases. Map, understand, and plan features in large projects.",
5
5
  "bin": {
6
6
  "specdacular": "bin/install.js"