moicle 2.0.0 → 2.1.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.
@@ -3,514 +3,206 @@ name: research-spike
3
3
  description: Spike/Research workflow for exploring unknowns before committing to implementation. Use when researching, prototyping, doing proof of concept, or when user says "spike", "research", "prototype", "poc", "explore", "investigate".
4
4
  ---
5
5
 
6
- # Spike/Research Workflow
6
+ # Spike / Research Workflow
7
7
 
8
- Time-boxed exploration workflow for investigating unknowns, validating assumptions, and de-risking decisions before committing to full implementation.
8
+ Time-boxed exploration to de-risk a decision by **building** (not just reading). Produces a recommendation + ADR, not production code.
9
9
 
10
10
  ## When to use this skill
11
11
 
12
- - ✅ Need to validate a technical assumption by building (not just reading)
13
- - ✅ Picking between 2+ technical options and need real comparison
14
- - ✅ De-risking a critical path before committing to it
15
- - ❌ Want to compare options via docs / SO / blogs only → use `/research:web`
12
+ - ✅ Need to validate a technical assumption by building
13
+ - ✅ Picking between 2+ options and need real comparison
14
+ - ✅ De-risking a critical path before committing
15
+ - ❌ Want to compare options via docs only → use `/research:web`
16
16
  - ❌ Already decided on the approach → use `/feature:new`
17
17
  - ❌ Stuck on a known bug → use `/fix:root-cause`
18
18
 
19
19
  ## Read Architecture First
20
20
 
21
- Read `ddd-architecture.md` + stack-specific doc to understand current patterns before exploring alternatives.
21
+ Detect stack via `~/.claude/architecture/_shared/stack-detection.md`. Skim stack doc to understand current patterns the spike output should fit the architecture or explicitly say why it doesn't.
22
22
 
23
- ## Workflow Overview
23
+ ---
24
+
25
+ ## Workflow
24
26
 
25
27
  ```
26
- ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
27
- 1. DEFINE│──▶│2. RESEARCH──▶│3. PROTOTYPE──▶│4. EVALUATE│
28
- └──────────┘ └──────────┘ └──────────┘ └──────────┘
29
- │ │
30
- │ Timebox Expired? │
31
- └──────────────────────────────────────────────┘
32
- End & Document
28
+ DEFINE → RESEARCH → PROTOTYPE → EVALUATE
29
+
30
+ └────── timebox expired ───────────┘
33
31
  ```
34
32
 
35
33
  ---
36
34
 
37
- ## Phase 1: DEFINE
38
-
39
- **Goal**: Define the question/problem to research and set timebox
40
-
41
- ### Actions
42
- 1. Clarify what's unknown:
43
- - What decision needs to be made?
44
- - What assumptions need validation?
45
- - What technical unknowns exist?
35
+ ## Phase 1: DEFINE (15-30 min — never skip)
46
36
 
47
- 2. **Identify project stack and read architecture doc**
37
+ **Goal:** lock the question, success criteria, timebox. Without these the spike has no exit condition.
48
38
 
49
- 3. Define research question:
50
- ```
51
- Good: "Can we integrate Auth0 with our React app without breaking Clean Architecture?"
52
- Bad: "Research authentication"
53
- ```
39
+ ### Spike brief
54
40
 
55
- 4. Set timebox based on spike type:
56
- - Quick spike: 2-4 hours
57
- - Medium spike: 1-2 days
58
- - Deep spike: 3-5 days
59
- - **Never exceed 1 week**
60
-
61
- 5. Define success criteria:
62
- ```
63
- Spike is successful when we know:
64
- - [ ] Criterion 1
65
- - [ ] Criterion 2
66
- - [ ] Criterion 3
67
- ```
68
-
69
- ### Output
70
41
  ```markdown
71
- ## Spike: [Name]
42
+ ## Spike: {short name}
72
43
 
73
- ### Type
74
- [Technical/Design/Functional]
44
+ ### Question
45
+ {ONE specific question — answerable yes/no or "pick A vs B vs C"}
75
46
 
76
- ### Stack & Architecture
77
- - Stack: [Flutter/React/Go/Laravel/Remix]
78
- - Architecture Doc: [path to architecture file]
47
+ ### Why now
48
+ {What decision blocks on this answer? When is the decision needed?}
79
49
 
80
- ### Research Question
81
- [Clear, specific question]
50
+ ### Options on the table
51
+ - Option A: {name + 1 line}
52
+ - Option B: {name + 1 line}
53
+ - (Option C: only if relevant)
82
54
 
83
- ### Why This Spike
84
- [Why we need this research before implementing]
55
+ ### Success criteria
56
+ - [ ] {Specific, observable e.g., "P95 latency <50ms at 1k req/s"}
57
+ - [ ] {e.g., "Integration with X library compiles + 1 test passes"}
58
+ - [ ] {e.g., "Estimated migration effort ≤2 sprints"}
85
59
 
86
60
  ### Timebox
87
- - Duration: [X hours/days]
88
- - Start: [timestamp]
89
- - End: [timestamp]
90
-
91
- ### Success Criteria
92
- We will know enough when:
93
- - [ ] Criterion 1
94
- - [ ] Criterion 2
95
- - [ ] Criterion 3
96
-
97
- ### Out of Scope
98
- [What we're NOT exploring]
61
+ - Quick spike: 2-4 hours
62
+ - Standard: 1-2 days
63
+ - Deep spike: 3-5 days (rare — usually means scope is too big)
64
+
65
+ ### Red flags (stop early if hit)
66
+ - Scope creep into productionising
67
+ - Option requires breaking architecture rules
68
+ - Two options become "obviously the same" after 1 hour
99
69
  ```
100
70
 
101
71
  ### Gate
102
- - [ ] Research question clear and specific
103
- - [ ] Architecture doc identified
104
- - [ ] Timebox set (≤ 1 week)
105
- - [ ] Success criteria defined
106
- - [ ] Out of scope defined
72
+ - [ ] Question is ONE specific question
73
+ - [ ] Success criteria are observable (not "feels right")
74
+ - [ ] Timebox + red flags written
75
+ - [ ] User CONFIRMED brief before starting
107
76
 
108
77
  ---
109
78
 
110
- ## Phase 2: RESEARCH
111
-
112
- **Goal**: Gather information and explore options
79
+ ## Phase 2: RESEARCH (≤25% of timebox)
113
80
 
114
- ### Actions
115
- 1. **Read relevant architecture docs** for context
81
+ **Goal:** know enough to prototype intelligently, don't over-read.
116
82
 
117
- 2. Research approaches:
118
- - [ ] Read documentation/specs
119
- - [ ] Survey existing solutions
120
- - [ ] Check community best practices
121
- - [ ] Review similar projects
122
- - [ ] Consult with team/experts
83
+ Run `/research:web` for the topic if you haven't already. Capture:
123
84
 
124
- 3. Evaluate against architecture:
125
- - Does it fit our patterns?
126
- - Which layers would it affect?
127
- - Does it respect boundaries?
128
- - What's the integration complexity?
85
+ - Official docs URLs (read, don't just bookmark)
86
+ - Known gotchas / GitHub issues for each option
87
+ - Prior art: anyone tried this combo? what was their conclusion?
88
+ - Constraints from existing stack (versions, license, infra)
129
89
 
130
- 4. Document findings in real-time:
131
- ```markdown
132
- ## Research Log
133
-
134
- ### [Timestamp] - Option 1: [Name]
135
- **Source**: [link/person]
136
- **Pros**:
137
- - Pro 1
138
- - Pro 2
139
-
140
- **Cons**:
141
- - Con 1
142
- - Con 2
143
-
144
- **Architecture Fit**: [Good/Moderate/Poor]
145
- - [Notes on how it fits our architecture]
90
+ ### Gate
91
+ - [ ] At least 2 sources per option
92
+ - [ ] Known gotchas listed
93
+ - [ ] Constraints documented
146
94
 
147
- ### [Timestamp] - Option 2: [Name]
148
- ...
149
- ```
95
+ ---
150
96
 
151
- 5. Track time spent vs timebox
97
+ ## Phase 3: PROTOTYPE (the bulk of the timebox)
152
98
 
153
- ### Research Output
154
- ```markdown
155
- ## Research Findings
156
-
157
- ### Options Explored
158
- 1. **Option 1**: [brief description]
159
- - Architecture fit: [assessment]
160
- - Complexity: [Low/Medium/High]
161
- - Risk: [Low/Medium/High]
162
-
163
- 2. **Option 2**: [brief description]
164
- - Architecture fit: [assessment]
165
- - Complexity: [Low/Medium/High]
166
- - Risk: [Low/Medium/High]
167
-
168
- ### Architecture Impact
169
- **Affected Layers**: [list from architecture doc]
170
- **Pattern Changes**: [any changes to current patterns]
171
- **Dependencies**: [new dependencies needed]
172
-
173
- ### Initial Recommendation
174
- [Which option looks most promising and why]
175
- ```
99
+ **Goal:** build the smallest thing that answers the question.
176
100
 
177
- ### Gate
178
- - [ ] Multiple options explored (at least 2-3)
179
- - [ ] Architecture impact assessed
180
- - [ ] Pros/cons documented
181
- - [ ] Still within timebox
101
+ ### Rules
102
+ - **Quick and dirty** no tests beyond what's needed to verify the question
103
+ - **One option at a time** — full prototype for A, then full prototype for B
104
+ - **In a sandbox** — separate branch, never merge to main
105
+ - **Time-stamped commits** `spike: A reaches 1k req/s with sync handler` so the timeline is reviewable
106
+ - **Stop on red flag** — if scope creeps or hits a wall, do not push through
182
107
 
183
- ---
108
+ ### What "smallest" means
109
+ - Skip auth, skip error handling, skip pagination
110
+ - Hardcode config that you'd normally pull from env
111
+ - Stub anything not under test
112
+ - 1-2 happy-path scenarios is enough to verify success criteria
184
113
 
185
- ## Phase 3: PROTOTYPE
186
-
187
- **Goal**: Build quick proof of concept to validate approach
188
-
189
- ### Principles
190
- 1. **Quick & Dirty** - Don't worry about code quality
191
- 2. **Focused** - Prove one thing only
192
- 3. **Throwaway** - Code will likely be discarded
193
- 4. **Time-boxed** - Stop when time is up
194
-
195
- ### Actions
196
- 1. **Read architecture doc** for the affected areas
197
-
198
- 2. Set prototype scope:
199
- ```markdown
200
- ## Prototype Scope
201
- **Proving**: [the one thing we're validating]
202
- **NOT proving**: [everything else]
203
- **Time**: [X hours from total timebox]
204
- ```
205
-
206
- 3. Build minimal POC:
207
- - Create in separate branch/directory
208
- - Follow architecture patterns where reasonable
209
- - Mark as prototype:
210
- ```
211
- // PROTOTYPE - NOT PRODUCTION CODE
212
- // Spike: [spike name]
213
- ```
214
-
215
- 4. Test the critical path only:
216
- - Does it work?
217
- - Does it integrate?
218
- - Are there blockers?
219
-
220
- 5. Document observations:
221
- ```markdown
222
- ## Prototype Observations
223
-
224
- ### What Worked
225
- - [observation 1]
226
- - [observation 2]
227
-
228
- ### What Didn't Work
229
- - [issue 1]
230
- - [issue 2]
231
-
232
- ### Surprises
233
- - [unexpected finding 1]
234
- - [unexpected finding 2]
235
-
236
- ### Blockers Found
237
- - [blocker 1]
238
- - [blocker 2]
239
- ```
240
-
241
- ### Prototype Output
242
- ```markdown
243
- ## Prototype Results
244
-
245
- ### Implementation
246
- - Branch/Location: [path]
247
- - Time Spent: [X hours]
248
- - Status: [Working/Partially Working/Not Working]
249
-
250
- ### Key Learnings
251
- 1. [learning 1]
252
- 2. [learning 2]
253
- 3. [learning 3]
254
-
255
- ### Architecture Compliance
256
- - Fits patterns: [Yes/No/Partially]
257
- - Issues found: [list]
258
- - Workarounds needed: [list]
259
-
260
- ### Effort Estimate (if proceeding)
261
- - [Rough T-shirt size: XS/S/M/L/XL]
262
- - [Based on: what you learned]
263
- ```
114
+ ### Stop early when
115
+ - All success criteria met for one option (don't gold-plate)
116
+ - All options fail the same criterion (pivot the question)
117
+ - Timebox 75% used and not converging (something's wrong — stop, regroup)
264
118
 
265
119
  ### Gate
266
- - [ ] Prototype proves/disproves key assumption
267
- - [ ] Blockers identified
268
- - [ ] Effort estimated
269
- - [ ] Still within timebox (if not, stop and document)
120
+ - [ ] Each option prototyped to the point of answering the question
121
+ - [ ] Success criteria measured (numbers, not vibes)
122
+ - [ ] Findings captured in spike branch commits
270
123
 
271
124
  ---
272
125
 
273
126
  ## Phase 4: EVALUATE
274
127
 
275
- **Goal**: Assess results and make recommendation
276
-
277
- ### Actions
278
- 1. **Review findings against architecture doc**
279
-
280
- 2. Assess each option:
281
- ```markdown
282
- ## Option Assessment
283
-
284
- ### Option 1: [Name]
285
- **Architecture Fit**: ⭐⭐⭐⭐⭐ (5/5)
286
- - [why it fits/doesn't fit]
287
-
288
- **Complexity**: ⭐⭐⭐ (3/5)
289
- - [complexity assessment]
290
-
291
- **Risk**: ⭐⭐ (2/5 - lower is better)
292
- - [risk assessment]
293
-
294
- **Effort**: [T-shirt size]
295
- - [effort justification]
296
-
297
- **Prototype Result**: [Successful/Partial/Failed]
298
- ```
299
-
300
- 3. Make recommendation:
301
- ```markdown
302
- ## Recommendation
128
+ **Goal:** turn the prototype into a recommendation + ADR.
303
129
 
304
- ### Choice: [Option X]
130
+ ### Comparison matrix
305
131
 
306
- ### Reasoning
307
- 1. [reason 1]
308
- 2. [reason 2]
309
- 3. [reason 3]
132
+ | Criterion | Option A | Option B | Notes |
133
+ |-----------|----------|----------|-------|
134
+ | Success criterion 1 (e.g., latency) | 42ms ✅ | 87ms ❌ | A at 1k rps, B saturates earlier |
135
+ | Success criterion 2 (e.g., effort) | 1 sprint | 3 sprints | B requires new dependency |
136
+ | Fit with architecture | ✅ | ⚠️ Requires port redesign | |
137
+ | Risk | low | medium | B unknowns: lib maturity, no LTS |
138
+ | Team familiarity | high | low | |
310
139
 
311
- ### Trade-offs Accepted
312
- - [trade-off 1]
313
- - [trade-off 2]
140
+ ### ADR template
314
141
 
315
- ### Risks & Mitigations
316
- - Risk: [risk 1]
317
- Mitigation: [how to mitigate]
318
- - Risk: [risk 2]
319
- Mitigation: [how to mitigate]
320
-
321
- ### Implementation Plan (High-Level)
322
- 1. [phase 1]
323
- 2. [phase 2]
324
- 3. [phase 3]
325
-
326
- ### Next Steps
327
- - [ ] Next step 1
328
- - [ ] Next step 2
329
- - [ ] Next step 3
330
- ```
331
-
332
- 4. Create decision record:
333
- ```markdown
334
- # ADR: [Decision Title]
335
-
336
- Date: [date]
337
- Status: Proposed
338
-
339
- ## Context
340
- [What led to this spike]
341
-
342
- ## Decision
343
- [What we decided]
344
-
345
- ## Consequences
346
- - Positive: [list]
347
- - Negative: [list]
348
- - Neutral: [list]
349
-
350
- ## Alternatives Considered
351
- - Option A: [brief + why rejected]
352
- - Option B: [brief + why rejected]
353
- ```
354
-
355
- ### Final Deliverable
356
142
  ```markdown
357
- ## Spike Summary: [Name]
358
-
359
- **Duration**: [actual time spent] / [timebox]
360
- **Date**: [start] - [end]
361
- **Stack**: [stack]
362
- **Researcher**: [name/team]
143
+ # ADR-NNN: {Decision title}
363
144
 
364
- ### Question Answered
365
- [Original research question]
366
-
367
- ### Answer
368
- [Clear answer based on findings]
369
-
370
- ### Recommendation
371
- [Clear recommendation with reasoning]
145
+ ## Status
146
+ Accepted / Superseded / Deprecated
372
147
 
373
- ### Supporting Evidence
374
- - Research: [key findings]
375
- - Prototype: [what we built and learned]
376
- - Architecture: [how it fits]
148
+ ## Context
149
+ {What problem we faced, what alternatives we considered}
377
150
 
378
- ### Confidence Level
379
- [High/Medium/Low] - [why]
151
+ ## Decision
152
+ {The chosen option}
380
153
 
381
- ### Next Actions
382
- 1. [ ] Action 1
383
- 2. [ ] Action 2
384
- 3. [ ] Action 3
154
+ ## Consequences
155
+ **Positive:** {gains}
156
+ **Negative:** {tradeoffs / debt taken on}
385
157
 
386
- ### Artifacts
387
- - Research notes: [link]
388
- - Prototype code: [link/path]
389
- - Decision record: [link]
158
+ ## Spike evidence
159
+ {Link to spike branch + key benchmark numbers}
390
160
  ```
391
161
 
392
- ### Gate
393
- - [ ] Recommendation clear and justified
394
- - [ ] Risks identified and mitigated
395
- - [ ] Decision record created
396
- - [ ] Prototype cleaned up or archived
397
- - [ ] Findings documented
398
-
399
- ---
162
+ ### Cleanup
163
+ - [ ] Spike branch tagged (`spike/{name}-{date}`) so it can be referenced
164
+ - [ ] Spike code NOT merged — production should re-implement properly via `/feature:new`
165
+ - [ ] ADR committed to `docs/adr/` (or equivalent)
400
166
 
401
- ## Quick Reference
402
-
403
- ### Architecture Docs
404
- | Stack | Doc |
405
- |-------|-----|
406
- | All | `clean-architecture.md` |
407
- | Flutter | `flutter-mobile.md` |
408
- | React | `react-frontend.md` |
409
- | Go | `go-backend.md` |
410
- | Laravel | `laravel-backend.md` |
411
- | Remix | `remix-fullstack.md` |
412
- | Monorepo | `monorepo.md` |
413
-
414
- ### Spike Types
415
-
416
- | Type | Purpose | Example |
417
- |------|---------|---------|
418
- | **Technical** | Validate technical feasibility | Can we use WebSockets with our architecture? |
419
- | **Design** | Explore design options | What's the best state management for this feature? |
420
- | **Functional** | Understand requirements | How should offline sync work? |
421
-
422
- ### Timebox Guidelines
423
-
424
- | Complexity | Timebox | Output |
425
- |------------|---------|--------|
426
- | Quick | 2-4 hours | Research + decision |
427
- | Medium | 1-2 days | Research + small POC + decision |
428
- | Deep | 3-5 days | Research + full POC + ADR |
429
- | **Max** | **1 week** | **Stop and reassess** |
430
-
431
- ### When to Stop Early
432
- - ✅ Success criteria met early
433
- - ✅ Clear blocker found (no point continuing)
434
- - ✅ Obvious answer emerged
435
- - ❌ Timebox expired (stop and document)
436
-
437
- ### Red Flags
438
- - 🚩 Spike extending beyond 1 week
439
- - 🚩 Writing production-quality code
440
- - 🚩 Scope creeping beyond research question
441
- - 🚩 Not documenting findings
442
- - 🚩 Trying to prove pre-decided solution
443
-
444
- ### Success Criteria
445
- Spike is successful when:
446
- 1. Research question answered (even if answer is "no")
447
- 2. Clear recommendation made
448
- 3. Risks identified
449
- 4. Architecture impact understood
450
- 5. Findings documented
451
- 6. Completed within timebox
452
-
453
- ### Prototype Cleanup
454
- After spike:
455
- ```bash
456
- # Archive prototype
457
- git branch -D spike/[name] # Delete branch
458
- # OR move to /experiments directory
459
- mkdir -p experiments/spike-[name]
460
- mv [prototype] experiments/spike-[name]/
461
-
462
- # Update README
463
- echo "## Spike: [name]" >> experiments/README.md
464
- echo "Result: [recommendation]" >> experiments/README.md
465
- echo "Date: [date]" >> experiments/README.md
466
- ```
167
+ ### Gate
168
+ - [ ] Comparison matrix filled with real numbers
169
+ - [ ] Recommendation explicit (don't say "both are fine")
170
+ - [ ] ADR written
171
+ - [ ] Spike branch tagged + NOT merged
467
172
 
468
173
  ---
469
174
 
470
- ## Templates
175
+ ## Final Report
471
176
 
472
- ### Quick Spike Template (2-4 hours)
473
177
  ```markdown
474
- # Spike: [Name]
475
-
476
- ## Question
477
- [Clear question]
178
+ ## Spike Complete: {name}
478
179
 
479
- ## Research (2 hours)
480
- - [ ] Option 1 research
481
- - [ ] Option 2 research
482
- - [ ] Documentation review
180
+ ### Question
181
+ {From DEFINE}
483
182
 
484
- ## Decision (30 min)
485
- - Recommendation: [choice]
486
- - Reasoning: [why]
183
+ ### Recommendation
184
+ **Pick Option {X}** because {top reason backed by spike evidence}
487
185
 
488
- ## Next Steps
489
- - [ ] Next action
490
- ```
186
+ ### Evidence
187
+ {Benchmark numbers, screenshots, error logs — link to spike branch}
491
188
 
492
- ### Full Spike Template (3-5 days)
493
- ```markdown
494
- # Spike: [Name]
189
+ ### Next step
190
+ - If accepted: `/feature:new` to build it properly
191
+ - If rejected: document why + close the question
495
192
 
496
- ## Define (Day 1)
497
- - Question: [clear question]
498
- - Success criteria: [list]
499
- - Timebox: [X days]
193
+ ### Time spent
194
+ {Actual vs timebox — note overruns for retrospective}
195
+ ```
500
196
 
501
- ## Research (Day 1-2)
502
- - Options explored: [list]
503
- - Architecture impact: [assessment]
197
+ ---
504
198
 
505
- ## Prototype (Day 2-3)
506
- - What: [what we're building]
507
- - Result: [what we learned]
199
+ ## Hard Rules
508
200
 
509
- ## Evaluate (Day 4-5)
510
- - Recommendation: [choice]
511
- - ADR: [link]
512
- - Next steps: [list]
513
- ```
201
+ - **Define before building** — undefined spike = unbounded spike
202
+ - **Timebox is sacred** — overrun means the question is wrong, not the answer
203
+ - **Throwaway code** — spike branch never merges to main
204
+ - **Numbers, not vibes** — recommendation must cite measurements
205
+ - **One question per spike** — multiple questions = multiple spikes
514
206
 
515
207
  ---
516
208
 
@@ -518,8 +210,8 @@ echo "Date: [date]" >> experiments/README.md
518
210
 
519
211
  | When | Use |
520
212
  |------|-----|
521
- | Just need to compare options via docs (no code) | `/research:web` |
522
- | Spike done, ready to implement | `/feature:new` |
213
+ | Compare options via docs only (no code) | `/research:web` |
214
+ | Spike done, ready to implement properly | `/feature:new` |
523
215
  | Spike revealed a bug to investigate | `/fix:root-cause` |
524
216
  | Document the ADR as a doc page | `/docs:write` |
525
217
 
@@ -527,7 +219,7 @@ echo "Date: [date]" >> experiments/README.md
527
219
 
528
220
  | Phase | Agent | Purpose |
529
221
  |-------|-------|---------|
530
- | DEFINE | `@clean-architect` | Frame research questions |
222
+ | DEFINE | `@clean-architect` | Frame the question |
531
223
  | RESEARCH | `@api-designer` | API / integration research |
532
224
  | RESEARCH | `@db-designer` | Data model research |
533
225
  | RESEARCH | `@security-audit` | Security implications |