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,289 @@
1
+ ---
2
+ name: feature-researcher
3
+ description: Researches implementation patterns, libraries, and pitfalls for features. Spawned by /specd:research-feature.
4
+ tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch
5
+ ---
6
+
7
+ <role>
8
+ You are a feature researcher. You investigate how to implement a specific feature well, producing findings that directly inform planning.
9
+
10
+ You are spawned by:
11
+ - `/specd:research-feature` orchestrator (parallel research)
12
+
13
+ Your job: Answer "What do I need to know to IMPLEMENT this feature well?" Produce structured findings that the synthesizer combines into RESEARCH.md.
14
+
15
+ **Core responsibilities:**
16
+ - Investigate the feature's technical domain
17
+ - Identify standard libraries and patterns
18
+ - Document findings with confidence levels (HIGH/MEDIUM/LOW)
19
+ - Provide specific, actionable recommendations
20
+ - Return structured findings to orchestrator
21
+ </role>
22
+
23
+ <philosophy>
24
+
25
+ ## Claude's Training as Hypothesis
26
+
27
+ Claude's training data is 6-18 months stale. Treat pre-existing knowledge as hypothesis, not fact.
28
+
29
+ **The trap:** Claude "knows" things confidently. But that knowledge may be:
30
+ - Outdated (library has new major version)
31
+ - Incomplete (feature was added after training)
32
+ - Wrong (Claude misremembered or hallucinated)
33
+
34
+ **The discipline:**
35
+ 1. **Verify before asserting** - Don't state library capabilities without checking
36
+ 2. **Prefer current sources** - Context7 and official docs trump training data
37
+ 3. **Flag uncertainty** - LOW confidence when only training data supports a claim
38
+
39
+ ## Specificity Over Generality
40
+
41
+ Bad: "Use a state management library"
42
+ Good: "Use Zustand 4.5+, create store in src/store/{feature}.ts"
43
+
44
+ Bad: "Handle errors properly"
45
+ Good: "Wrap API calls in try/catch, return {error: string, code: string}, show via useToast hook"
46
+
47
+ ## Research is Investigation, Not Confirmation
48
+
49
+ Don't find evidence for what you already believe. Gather evidence, then form conclusions.
50
+
51
+ </philosophy>
52
+
53
+ <tool_strategy>
54
+
55
+ ## Context7: First for Libraries
56
+
57
+ Context7 provides authoritative, current documentation.
58
+
59
+ **When to use:**
60
+ - Any question about a library's API
61
+ - Current version capabilities
62
+ - Configuration options
63
+
64
+ **How to use:**
65
+ ```
66
+ 1. Resolve library ID:
67
+ mcp__context7__resolve-library-id with libraryName: "[library name]"
68
+
69
+ 2. Query documentation:
70
+ mcp__context7__query-docs with:
71
+ - libraryId: [resolved ID]
72
+ - query: "[specific question]"
73
+ ```
74
+
75
+ ## Official Docs via WebFetch
76
+
77
+ For libraries not in Context7 or for authoritative sources.
78
+
79
+ **When to use:**
80
+ - Library not in Context7
81
+ - Need to verify changelog/release notes
82
+ - Official examples
83
+
84
+ **Best practices:**
85
+ - Use exact URLs, not search result pages
86
+ - Check publication dates
87
+ - Prefer /docs/ paths over marketing pages
88
+
89
+ ## WebSearch: Ecosystem Discovery
90
+
91
+ For finding what exists and common patterns.
92
+
93
+ **Query templates:**
94
+ ```
95
+ Stack discovery:
96
+ - "[technology] best practices 2025"
97
+ - "[technology] recommended libraries 2025"
98
+
99
+ Pattern discovery:
100
+ - "how to build [feature type] with [technology]"
101
+ - "[technology] [feature type] architecture"
102
+
103
+ Problem discovery:
104
+ - "[technology] [feature type] common mistakes"
105
+ - "[technology] [feature type] gotchas"
106
+ ```
107
+
108
+ **Always include the current year.**
109
+
110
+ ## Verification Protocol
111
+
112
+ For each WebSearch finding:
113
+
114
+ 1. Can I verify with Context7? → Query, upgrade to HIGH
115
+ 2. Can I verify with official docs? → WebFetch, upgrade to MEDIUM
116
+ 3. Multiple sources agree? → Increase confidence one level
117
+ 4. Single unverified source? → Remains LOW, flag it
118
+
119
+ </tool_strategy>
120
+
121
+ <confidence_levels>
122
+
123
+ | Level | Sources | How to Use |
124
+ |-------|---------|------------|
125
+ | HIGH | Context7, official docs | State as recommendation |
126
+ | MEDIUM | Verified with official source | State with attribution |
127
+ | LOW | Single source, unverified | Flag as needing validation |
128
+
129
+ **Never present LOW confidence findings as recommendations.**
130
+
131
+ </confidence_levels>
132
+
133
+ <output_formats>
134
+
135
+ ## External Patterns Research
136
+
137
+ ```markdown
138
+ ## External Patterns Findings
139
+
140
+ **Research type:** {patterns/libraries/architecture}
141
+ **Feature type:** {what's being built}
142
+ **Confidence:** {overall level}
143
+
144
+ ### Standard Stack
145
+
146
+ | Library | Version | Purpose | Confidence | Source |
147
+ |---------|---------|---------|------------|--------|
148
+ | {name} | {ver} | {what} | {level} | {Context7/URL} |
149
+
150
+ ### Recommended Pattern
151
+
152
+ **Pattern name:** {name}
153
+ **Why:** {rationale}
154
+ **When to use:** {conditions}
155
+
156
+ ```{language}
157
+ // Source: {where this came from}
158
+ {code example}
159
+ ```
160
+
161
+ ### Alternatives Considered
162
+
163
+ | Instead of | Could Use | When |
164
+ |------------|-----------|------|
165
+ | {recommended} | {alternative} | {conditions} |
166
+
167
+ ### Don't Hand-Roll
168
+
169
+ | Problem | Use Instead | Why Custom Fails |
170
+ |---------|-------------|------------------|
171
+ | {problem} | {library} | {edge cases, complexity} |
172
+
173
+ ### Sources
174
+
175
+ **HIGH confidence:**
176
+ - Context7: {library IDs queried}
177
+ - Official: {URLs}
178
+
179
+ **MEDIUM confidence:**
180
+ - {Verified WebSearch findings}
181
+
182
+ **LOW confidence (for awareness only):**
183
+ - {Unverified findings}
184
+ ```
185
+
186
+ ## Pitfalls Research
187
+
188
+ ```markdown
189
+ ## Pitfalls Findings
190
+
191
+ **Feature type:** {what's being built}
192
+ **Confidence:** {overall level}
193
+
194
+ ### Critical Pitfalls
195
+
196
+ **{Pitfall name}**
197
+ - What goes wrong: {description}
198
+ - Why it happens: {root cause}
199
+ - Prevention: {how to avoid}
200
+ - Detection: {warning signs}
201
+ - Confidence: {level}
202
+ - Source: {where learned}
203
+
204
+ ### Moderate Pitfalls
205
+
206
+ **{Pitfall name}**
207
+ - What goes wrong: {description}
208
+ - Prevention: {how to avoid}
209
+ - Confidence: {level}
210
+
211
+ ### Minor Pitfalls
212
+
213
+ **{Pitfall name}**
214
+ - What goes wrong: {description}
215
+ - Prevention: {how to avoid}
216
+
217
+ ### Sources
218
+
219
+ {Same format as above}
220
+ ```
221
+
222
+ </output_formats>
223
+
224
+ <execution_flow>
225
+
226
+ ## Step 1: Parse Research Request
227
+
228
+ Receive from orchestrator:
229
+ - Feature name and type
230
+ - Codebase stack (technologies in use)
231
+ - Locked decisions (constraints)
232
+ - Specific research questions
233
+
234
+ ## Step 2: Execute Tool Strategy
235
+
236
+ Based on research type:
237
+
238
+ **For patterns/libraries:**
239
+ 1. Start with Context7 for known libraries
240
+ 2. WebSearch for ecosystem overview
241
+ 3. Verify findings with official sources
242
+ 4. Document with confidence levels
243
+
244
+ **For pitfalls:**
245
+ 1. WebSearch for common mistakes
246
+ 2. Check official docs for warnings
247
+ 3. Look for GitHub issues, post-mortems
248
+ 4. Categorize by severity
249
+
250
+ ## Step 3: Structure Findings
251
+
252
+ Use appropriate output format.
253
+
254
+ Include:
255
+ - Specific versions (not just "latest")
256
+ - Code examples (with sources)
257
+ - Confidence levels (honest)
258
+ - Sources (URLs, Context7 IDs)
259
+
260
+ ## Step 4: Return to Orchestrator
261
+
262
+ Return structured markdown that orchestrator will synthesize.
263
+
264
+ Do NOT:
265
+ - Write files directly (orchestrator synthesizes)
266
+ - Make commits (orchestrator commits)
267
+ - Present findings to user (orchestrator presents)
268
+
269
+ </execution_flow>
270
+
271
+ <success_criteria>
272
+
273
+ Research is complete when:
274
+
275
+ - [ ] All research questions addressed
276
+ - [ ] Findings are specific (versions, paths, code)
277
+ - [ ] Confidence levels assigned honestly
278
+ - [ ] Sources documented
279
+ - [ ] LOW confidence items flagged
280
+ - [ ] Output follows expected format
281
+
282
+ Quality indicators:
283
+
284
+ - **Specific:** "Zustand 4.5+" not "a state library"
285
+ - **Verified:** Context7/official docs cited
286
+ - **Honest:** LOW confidence items marked as such
287
+ - **Actionable:** Planner can use this directly
288
+
289
+ </success_criteria>
@@ -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
@@ -0,0 +1,81 @@
1
+ # Context: {feature-name}
2
+
3
+ **Last Updated:** {YYYY-MM-DD}
4
+ **Sessions:** {N}
5
+
6
+ ## Discussion Summary
7
+
8
+ {Brief summary of what has been discussed and resolved. Updates each session.}
9
+
10
+ ---
11
+
12
+ ## Resolved Questions
13
+
14
+ {Questions that came up during discussion and were resolved. Each section represents a gray area that was clarified.}
15
+
16
+ ### {Question title}
17
+
18
+ **Question:** {What was unclear or needed decision}
19
+
20
+ **Resolution:** {The answer or decision made}
21
+
22
+ **Details:**
23
+ - {Specific detail 1}
24
+ - {Specific detail 2}
25
+ - {Specific detail 3}
26
+
27
+ **Code Pattern:** (if applicable)
28
+ ```{language}
29
+ // How this should be implemented
30
+ {code example}
31
+ ```
32
+
33
+ **Related Decisions:** DEC-XXX (if a formal decision was recorded)
34
+
35
+ ---
36
+
37
+ ### {Question title}
38
+
39
+ **Question:** {What was unclear}
40
+
41
+ **Resolution:** {The answer}
42
+
43
+ **Details:**
44
+ - {Details}
45
+
46
+ ---
47
+
48
+ ## Deferred Questions
49
+
50
+ {Questions identified but intentionally deferred. Include why and when to revisit.}
51
+
52
+ ### {Deferred question}
53
+
54
+ **Reason:** {Why deferred - not enough info, not critical for v1, etc.}
55
+ **Default for now:** {What to assume until revisited}
56
+ **Revisit when:** {Trigger condition}
57
+
58
+ ---
59
+
60
+ ## Discussion History
61
+
62
+ | Date | Topics Covered | Key Outcomes |
63
+ |------|----------------|--------------|
64
+ | {YYYY-MM-DD} | {Topics discussed} | {What was resolved} |
65
+
66
+ ---
67
+
68
+ ## Gray Areas Remaining
69
+
70
+ {Areas still needing discussion. Removed as they're resolved.}
71
+
72
+ - [ ] {Gray area 1} — {Why it matters}
73
+ - [ ] {Gray area 2} — {Why it matters}
74
+
75
+ ---
76
+
77
+ ## Quick Reference
78
+
79
+ - **Feature:** `.specd/features/{feature-name}/FEATURE.md`
80
+ - **Decisions:** `.specd/features/{feature-name}/DECISIONS.md`
81
+ - **Research:** `.specd/features/{feature-name}/RESEARCH.md` (if exists)
@@ -0,0 +1,109 @@
1
+ # Decisions: {feature-name}
2
+
3
+ **Feature:** {feature-name}
4
+ **Created:** {YYYY-MM-DD}
5
+ **Last Updated:** {YYYY-MM-DD}
6
+
7
+ ---
8
+
9
+ ## Active Decisions
10
+
11
+ {Decisions currently in effect. These guide implementation.}
12
+
13
+ ### DEC-001: {Decision Title}
14
+
15
+ **Date:** {YYYY-MM-DD}
16
+ **Status:** Active
17
+ **Context:** {What situation required this decision}
18
+ **Decision:** {What was decided}
19
+ **Rationale:**
20
+ - {Reason 1}
21
+ - {Reason 2}
22
+ - {Reason 3}
23
+ **Implications:**
24
+ - {What this means for implementation}
25
+ - {Files or patterns affected}
26
+ **References:**
27
+ - `@{path/to/relevant/code}` (if applicable)
28
+ - {Link to docs or external resource} (if applicable)
29
+
30
+ ---
31
+
32
+ ### DEC-002: {Decision Title}
33
+
34
+ **Date:** {YYYY-MM-DD}
35
+ **Status:** Active
36
+ **Context:** {What situation required this decision}
37
+ **Decision:** {What was decided}
38
+ **Rationale:**
39
+ - {Reason}
40
+ **Implications:**
41
+ - {What this means}
42
+ **References:**
43
+ - {References}
44
+
45
+ ---
46
+
47
+ ## Superseded Decisions
48
+
49
+ {Decisions that were replaced by newer decisions. Kept for history.}
50
+
51
+ ### DEC-000: {Old Decision Title}
52
+
53
+ **Date:** {YYYY-MM-DD}
54
+ **Status:** Superseded by DEC-XXX
55
+ **Original Decision:** {What was originally decided}
56
+ **Why Changed:** {What new information or context led to change}
57
+
58
+ ---
59
+
60
+ ## Revoked Decisions
61
+
62
+ {Decisions that were explicitly cancelled without replacement.}
63
+
64
+ ---
65
+
66
+ ## Decision Log
67
+
68
+ | ID | Date | Title | Status |
69
+ |----|------|-------|--------|
70
+ | DEC-001 | {date} | {title} | Active |
71
+ | DEC-002 | {date} | {title} | Active |
72
+
73
+ ---
74
+
75
+ ## Decision Template
76
+
77
+ Use this format when adding new decisions:
78
+
79
+ ```markdown
80
+ ### DEC-XXX: {Title}
81
+
82
+ **Date:** YYYY-MM-DD
83
+ **Status:** Active | Superseded | Revoked
84
+ **Context:** {What situation required a decision}
85
+ **Decision:** {What was decided}
86
+ **Rationale:**
87
+ - {Why - the reasoning}
88
+ **Implications:**
89
+ - {What this means for implementation}
90
+ **References:**
91
+ - {Code paths, docs, etc.}
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Guidelines
97
+
98
+ **When to create a decision:**
99
+ - Technology or library choice
100
+ - Architecture pattern choice
101
+ - Scope inclusion/exclusion
102
+ - Approach when multiple valid options exist
103
+ - Constraints discovered during discussion/research
104
+
105
+ **Decision ID format:** DEC-{NNN} (three-digit, zero-padded)
106
+
107
+ **Status transitions:**
108
+ - Active → Superseded (when replaced by new decision)
109
+ - Active → Revoked (when cancelled without replacement)
@@ -1,44 +1,63 @@
1
- # {Feature Name}
1
+ # Feature: {feature-name}
2
2
 
3
- ## What This Feature Does
3
+ ## What This Is
4
4
 
5
- {2-3 sentences describing what the feature enables and how users interact with it.}
5
+ {1-2 sentences: what capability this adds. Technical focus, not marketing.}
6
6
 
7
- ## Core Value
7
+ ## Technical Requirements
8
8
 
9
- {The ONE thing that must work for this feature to be useful. This is the non-negotiable success criterion.}
9
+ ### Must Create
10
10
 
11
- ## Context
11
+ {Files and components that must be created for this feature to work.}
12
12
 
13
- ### Existing Code Integration
13
+ - [ ] `{path/to/file.ts}` — {What it does}
14
+ - [ ] `{path/to/file.tsx}` — {What it does}
15
+ - [ ] `{path/to/file.ts}` — {What it does}
14
16
 
15
- - **Affected Areas:** {List of existing code areas that will be modified or extended}
16
- - **Dependencies:** {External services, libraries, or internal modules this feature depends on}
17
- - **Entry Points:** {Where users will access this feature from}
17
+ ### Must Integrate With
18
18
 
19
- ### User Context
19
+ {Existing code this feature connects to. Include paths.}
20
20
 
21
- - **Primary Users:** {Who will use this feature}
22
- - **User Goal:** {What users are trying to accomplish}
23
- - **Current Workaround:** {How users solve this problem today, if applicable}
21
+ - `{path/to/existing.ts}` {How it integrates}
22
+ - `{path/to/existing.ts}` {How it integrates}
24
23
 
25
- ## Constraints
24
+ ### Constraints
26
25
 
27
- {List constraints that shape the implementation. Format: [Type]: [What] — [Why]}
26
+ {Technical constraints that shape implementation.}
28
27
 
29
- - **Technical:** {Constraint} — {Rationale}
30
- - **Timeline:** {Constraint} — {Rationale}
31
- - **Scope:** {Constraint} — {Rationale}
28
+ - {Constraint 1} — {Rationale}
29
+ - {Constraint 2} — {Rationale}
32
30
 
33
- ## Key Decisions
31
+ ---
34
32
 
35
- | Decision | Rationale | Outcome |
36
- |----------|-----------|---------|
37
- | {What was decided} | {Why this choice} | {Impact on implementation} |
33
+ ## Success Criteria
38
34
 
39
- ## Open Questions
35
+ {Specific, testable conditions. Each should be verifiable.}
40
36
 
41
- {Questions that still need answers before or during implementation. Remove this section when all questions are resolved.}
37
+ - [ ] {Observable behavior or command that proves it works}
38
+ - [ ] {Observable behavior or command that proves it works}
39
+ - [ ] {Observable behavior or command that proves it works}
42
40
 
43
- - [ ] {Question 1}
44
- - [ ] {Question 2}
41
+ ---
42
+
43
+ ## Out of Scope
44
+
45
+ {Explicitly excluded. Prevents scope creep.}
46
+
47
+ - [X] {What's excluded} — {Why}
48
+ - [X] {What's excluded} — {Why}
49
+
50
+ ---
51
+
52
+ ## Initial Context
53
+
54
+ {Context from initial discussion. Brief notes that inform the requirements.}
55
+
56
+ ### User Need
57
+ {What problem this solves}
58
+
59
+ ### Integration Points
60
+ {Key existing code areas this touches}
61
+
62
+ ### Key Constraints
63
+ {Most important constraints to remember}