specweave 0.23.12 → 0.23.16

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 (90) hide show
  1. package/CLAUDE.md +55 -0
  2. package/dist/src/core/progress/error-logger.d.ts +58 -0
  3. package/dist/src/core/progress/error-logger.d.ts.map +1 -0
  4. package/dist/src/core/progress/error-logger.js +99 -0
  5. package/dist/src/core/progress/error-logger.js.map +1 -0
  6. package/dist/src/core/spec-detector.d.ts +5 -0
  7. package/dist/src/core/spec-detector.d.ts.map +1 -1
  8. package/dist/src/core/spec-detector.js +91 -33
  9. package/dist/src/core/spec-detector.js.map +1 -1
  10. package/package.json +1 -1
  11. package/plugins/specweave/hooks/docs-changed.sh +9 -1
  12. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  13. package/plugins/specweave/hooks/human-input-required.sh +9 -1
  14. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  15. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  16. package/plugins/specweave/hooks/post-increment-change.sh +6 -1
  17. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  18. package/plugins/specweave/hooks/post-increment-completion.sh +6 -1
  19. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  20. package/plugins/specweave/hooks/post-increment-planning.sh +6 -1
  21. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  22. package/plugins/specweave/hooks/post-increment-status-change.sh +6 -1
  23. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  24. package/plugins/specweave/hooks/post-metadata-change.sh +7 -1
  25. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  26. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  27. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  28. package/plugins/specweave/hooks/pre-implementation.sh +9 -1
  29. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  30. package/plugins/specweave/hooks/pre-task-completion.sh +9 -1
  31. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  32. package/plugins/specweave/hooks/pre-tool-use.sh +9 -1
  33. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  34. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  35. package/plugins/specweave-ado/hooks/post-living-docs-update.sh +9 -2
  36. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  37. package/plugins/specweave-ado/hooks/post-task-completion.sh +9 -1
  38. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  39. package/plugins/specweave-github/.claude-plugin/plugin.json +15 -1
  40. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +16 -0
  41. package/plugins/specweave-github/hooks/post-task-completion.sh +62 -1
  42. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  43. package/plugins/specweave-jira/hooks/post-task-completion.sh +9 -1
  44. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  45. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +48 -0
  46. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
  47. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +0 -21
  48. package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +0 -626
  49. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +0 -318
  50. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +0 -208
  51. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +0 -1149
  52. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +0 -340
  53. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +0 -1010
  54. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +0 -20
  55. package/plugins/specweave-cost-optimizer/skills/cost-optimizer/SKILL.md +0 -190
  56. package/plugins/specweave-docs/.claude-plugin/plugin.json +0 -19
  57. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +0 -613
  58. package/plugins/specweave-docs/skills/spec-driven-brainstorming/README.md +0 -264
  59. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +0 -439
  60. package/plugins/specweave-docs/skills/spec-driven-debugging/README.md +0 -479
  61. package/plugins/specweave-docs/skills/spec-driven-debugging/SKILL.md +0 -652
  62. package/plugins/specweave-figma/.claude-plugin/.mcp.json +0 -12
  63. package/plugins/specweave-figma/.claude-plugin/plugin.json +0 -20
  64. package/plugins/specweave-figma/ARCHITECTURE.md +0 -453
  65. package/plugins/specweave-figma/README.md +0 -728
  66. package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +0 -632
  67. package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +0 -29
  68. package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +0 -27
  69. package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +0 -28
  70. package/plugins/specweave-frontend/.claude-plugin/plugin.json +0 -21
  71. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +0 -107
  72. package/plugins/specweave-frontend/skills/frontend/SKILL.md +0 -177
  73. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +0 -176
  74. package/plugins/specweave-testing/.claude-plugin/plugin.json +0 -20
  75. package/plugins/specweave-testing/skills/e2e-playwright/README.md +0 -506
  76. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +0 -457
  77. package/plugins/specweave-testing/skills/e2e-playwright/execute.js +0 -373
  78. package/plugins/specweave-testing/skills/e2e-playwright/lib/utils.js +0 -514
  79. package/plugins/specweave-testing/skills/e2e-playwright/package.json +0 -33
  80. package/plugins/specweave-tooling/.claude-plugin/plugin.json +0 -19
  81. package/plugins/specweave-tooling/skills/skill-creator/LICENSE.txt +0 -202
  82. package/plugins/specweave-tooling/skills/skill-creator/SKILL.md +0 -209
  83. package/plugins/specweave-tooling/skills/skill-creator/scripts/init_skill.py +0 -303
  84. package/plugins/specweave-tooling/skills/skill-creator/scripts/package_skill.py +0 -110
  85. package/plugins/specweave-tooling/skills/skill-creator/scripts/quick_validate.py +0 -65
  86. package/plugins/specweave-tooling/skills/skill-router/SKILL.md +0 -479
  87. package/plugins/specweave-ui/.claude-plugin/plugin.json +0 -26
  88. package/plugins/specweave-ui/.mcp.json +0 -10
  89. package/plugins/specweave-ui/README.md +0 -492
  90. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +0 -676
@@ -1,652 +0,0 @@
1
- ---
2
- name: spec-driven-debugging
3
- description: Use when encountering ANY bug, test failure, or unexpected behavior before proposing fixes - systematic five-phase framework (context loading, root cause investigation, pattern analysis, hypothesis testing, implementation with documentation) that ensures understanding and spec alignment before attempting solutions. Activates for: bug, error, test failure, failing test, unexpected behavior, crash, exception, debug, troubleshoot, fix issue, investigate problem, ultrathink bug.
4
- ---
5
-
6
- # Spec-Driven Debugging
7
-
8
- ## Overview
9
-
10
- Random fixes waste time and create new bugs. Quick patches mask underlying issues and create spec-code divergence.
11
-
12
- **Core principle:** ALWAYS find root cause AND verify spec alignment before attempting fixes. Symptom fixes are failure.
13
-
14
- **SpecWeave addition:** Bugs reveal either code issues OR spec misalignment. Fix at the right level.
15
-
16
- **Violating the letter of this process is violating the spirit of debugging.**
17
-
18
- ## The Iron Law
19
-
20
- ```
21
- NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
22
- NO FIXES WITHOUT CHECKING SPEC ALIGNMENT
23
- ```
24
-
25
- If you haven't completed Phase 0 and Phase 1, you cannot propose fixes.
26
-
27
- ## When to Use
28
-
29
- Use for ANY technical issue:
30
- - Test failures (unit, integration, E2E)
31
- - Bugs in development or production
32
- - Unexpected behavior vs spec.md
33
- - Performance problems
34
- - Build failures
35
- - Integration issues
36
- - Security vulnerabilities
37
- - Race conditions or concurrency bugs
38
-
39
- **Use this ESPECIALLY when:**
40
- - Under time pressure (emergencies make guessing tempting)
41
- - "Just one quick fix" seems obvious
42
- - You've already tried multiple fixes
43
- - Previous fix didn't work
44
- - You don't fully understand the issue
45
- - **Behavior differs from spec.md** (spec-code misalignment)
46
- - **Complex distributed systems bug** (use ultrathink)
47
-
48
- **Don't skip when:**
49
- - Issue seems simple (simple bugs have root causes too)
50
- - You're in a hurry (systematic is faster than thrashing)
51
- - Manager wants it fixed NOW (systematic prevents rework)
52
- - **Working in brownfield code** (may need retroactive specs)
53
-
54
- ## The Five Phases
55
-
56
- You MUST complete each phase before proceeding to the next.
57
-
58
- ### Phase 0: Context Loading (SpecWeave-Specific)
59
-
60
- **BEFORE investigating, load SpecWeave context:**
61
-
62
- 1. **Check if Bug is in SpecWeave Increment**
63
- ```bash
64
- # Find which increment contains the buggy file
65
- find .specweave/increments -name "context-manifest.yaml" -exec grep -l "path/to/buggy/file" {} \;
66
- ```
67
-
68
- 2. **Load Increment Documentation** (if found)
69
- - Read `.specweave/increments/XXXX/spec.md` - What SHOULD happen?
70
- - Read `.specweave/increments/XXXX/plan.md` - How was it SUPPOSED to work?
71
- - Read `.specweave/increments/XXXX/tests.md` - What tests were planned?
72
- - Read `.specweave/increments/XXXX/tasks.md` - Was this a known issue?
73
-
74
- 3. **Load Architecture Context**
75
- - Check `.specweave/docs/internal/architecture/adr/` for relevant ADRs
76
- - Why was this designed this way?
77
- - What trade-offs were made?
78
- - What assumptions were documented?
79
-
80
- 4. **Load Strategy Context** (if domain-specific)
81
- - Check `.specweave/docs/internal/strategy/` for requirements
82
- - What are the acceptance criteria (TC-0001, TC-0002)?
83
- - Are there non-functional requirements (performance, security)?
84
-
85
- 5. **Identify Bug Type**
86
- - **Code bug:** Implementation doesn't match spec → Fix code
87
- - **Spec bug:** Spec is unclear/wrong/incomplete → Update spec first, then code
88
- - **Missing spec:** Behavior undocumented (brownfield) → Create retroactive spec
89
- - **Architectural issue:** Design is fundamentally flawed → Create ADR, refactor
90
-
91
- **🧠 Ultrathink Trigger:** If bug involves distributed systems, race conditions, security vulnerabilities, or complex architecture → Ask: "Should I **ultrathink** this bug to analyze edge cases?"
92
-
93
- **Output of Phase 0:**
94
- - Understanding of WHAT SHOULD HAPPEN (from specs)
95
- - Understanding of HOW IT WAS DESIGNED (from plan/ADRs)
96
- - Classification: Code bug vs Spec bug vs Architectural issue
97
-
98
- ### Phase 1: Root Cause Investigation
99
-
100
- **BEFORE attempting ANY fix:**
101
-
102
- 1. **Read Error Messages Carefully**
103
- - Don't skip past errors or warnings
104
- - They often contain the exact solution
105
- - Read stack traces completely
106
- - Note line numbers, file paths, error codes
107
- - **Cross-reference with spec.md:** Does error indicate spec violation?
108
-
109
- 2. **Reproduce Consistently**
110
- - Can you trigger it reliably?
111
- - What are the exact steps?
112
- - Does it happen every time?
113
- - If not reproducible → gather more data, don't guess
114
- - **Check tests.md:** Is there already a test case for this scenario?
115
-
116
- 3. **Check Recent Changes**
117
- - What changed that could cause this?
118
- - Git diff, recent commits
119
- - New dependencies, config changes
120
- - Environmental differences
121
- - **Check increment history:** Was this file modified in recent increments?
122
-
123
- 4. **Compare Behavior vs Specification**
124
- - What does spec.md say should happen?
125
- - What is actually happening?
126
- - Is the discrepancy:
127
- - Code not implementing spec? → Code bug
128
- - Spec unclear about this case? → Spec bug (update spec first)
129
- - Behavior not documented? → Missing spec (create retroactive spec)
130
-
131
- 5. **Gather Evidence in Multi-Component Systems**
132
-
133
- **WHEN system has multiple components (frontend → API → database, CI → build → deploy):**
134
-
135
- **BEFORE proposing fixes, add diagnostic instrumentation:**
136
- ```
137
- For EACH component boundary:
138
- - Log what data enters component
139
- - Log what data exits component
140
- - Verify spec compliance at each layer
141
- - Check state at each layer
142
-
143
- Run once to gather evidence showing WHERE it breaks
144
- THEN analyze evidence to identify failing component
145
- THEN investigate that specific component
146
- ```
147
-
148
- **Example (full-stack bug):**
149
- ```typescript
150
- // Frontend (React component)
151
- console.log('[Frontend] Sending request:', { userId, data });
152
- const response = await api.updateUser(userId, data);
153
- console.log('[Frontend] Received response:', response);
154
-
155
- // API route (Next.js)
156
- console.log('[API] Request received:', { params, body });
157
- const result = await db.users.update(userId, body);
158
- console.log('[API] DB result:', result);
159
-
160
- // Database layer (Prisma)
161
- console.log('[DB] Query:', { where: { id: userId }, data });
162
- ```
163
-
164
- **This reveals:** Which layer violates spec (frontend ✓, API ✗, DB ✓)
165
-
166
- 6. **Trace Data Flow** (Deep Call Stack Bugs)
167
-
168
- **WHEN error is deep in call stack:**
169
-
170
- **Quick version:**
171
- - Where does bad value originate?
172
- - What called this with bad value?
173
- - Keep tracing up until you find the source
174
- - **Check spec:** Does source component have correct requirements?
175
- - Fix at source, not at symptom
176
-
177
- 7. **Check for Architectural Issues**
178
-
179
- **Signs of architectural problem (not just code bug):**
180
- - Multiple components affected by single change
181
- - Fix would require "massive refactoring"
182
- - Similar bugs keep appearing in different places
183
- - Design violates SOLID principles or best practices
184
- - **ADR contradicts current requirements** (requirements evolved)
185
-
186
- **If architectural issue detected:**
187
- - STOP normal debugging flow
188
- - Suggest: "This seems like an architectural issue. Should I **ultrathink** the design to propose a refactor?"
189
- - If confirmed, create ADR and new increment for refactoring
190
-
191
- ### Phase 2: Pattern Analysis
192
-
193
- **Find the pattern before fixing:**
194
-
195
- 1. **Find Working Examples in Codebase**
196
- - Locate similar working code in same codebase
197
- - What works that's similar to what's broken?
198
- - **Check other increments:** Has this pattern been implemented successfully elsewhere?
199
-
200
- 2. **Compare Against Spec and References**
201
- - **Spec comparison:** Read spec.md section for this feature COMPLETELY
202
- - **ADR comparison:** Check if ADRs document this pattern
203
- - **Reference implementation:** If implementing external pattern, read reference completely
204
- - Don't skim - read every line
205
- - Understand the pattern fully before applying
206
-
207
- 3. **Identify Differences**
208
- - What's different between working and broken?
209
- - List every difference, however small
210
- - Don't assume "that can't matter"
211
- - **Spec differences:** Does working example follow spec more closely?
212
-
213
- 4. **Understand Dependencies**
214
- - What other components does this need?
215
- - What settings, config, environment?
216
- - What assumptions does it make?
217
- - **Check context-manifest.yaml:** Are all dependencies loaded?
218
-
219
- 5. **Consult SpecWeave Skills** (Domain-Specific Knowledge)
220
- - **For Next.js bugs:** Check `nextjs` skill for patterns
221
- - **For Node.js backend bugs:** Check `nodejs-backend` skill
222
- - **For Python bugs:** Check `python-backend` skill
223
- - **For .NET bugs:** Check `dotnet-backend` skill
224
- - **For frontend bugs:** Check `frontend` skill
225
- - **For E2E test failures:** Check `e2e-playwright` skill
226
-
227
- ### Phase 3: Hypothesis and Testing
228
-
229
- **Scientific method:**
230
-
231
- 1. **Form Single Hypothesis**
232
- - State clearly: "I think X is the root cause because Y"
233
- - Write it down explicitly
234
- - Be specific, not vague
235
- - **Include spec alignment:** "Code violates spec.md section Z by doing A instead of B"
236
-
237
- 2. **Classify Hypothesis Type**
238
- - **Code hypothesis:** "Function X has logic bug on line Y"
239
- - **Spec hypothesis:** "Spec.md doesn't cover edge case Z, causing confusion"
240
- - **Architecture hypothesis:** "Current design can't support requirement R"
241
- - **Test hypothesis:** "Test assumes incorrect behavior (test bug, not code bug)"
242
-
243
- 3. **Test Minimally**
244
- - Make the SMALLEST possible change to test hypothesis
245
- - One variable at a time
246
- - Don't fix multiple things at once
247
- - **For spec hypotheses:** Update spec.md first, then verify code needs change
248
-
249
- 4. **Verify Before Continuing**
250
- - Did it work? Yes → Phase 4
251
- - Didn't work? Form NEW hypothesis
252
- - DON'T add more fixes on top
253
- - **Count attempts:** How many hypotheses have you tested?
254
-
255
- 5. **When You Don't Know**
256
- - Say "I don't understand X"
257
- - Don't pretend to know
258
- - **Ultrathink option:** For complex bugs, suggest: "This is complex - should I **ultrathink** this to explore edge cases?"
259
- - Ask user for clarification
260
- - Research more (read docs, check StackOverflow, read source code)
261
-
262
- 6. **If 3+ Hypotheses Failed: Ultrathink Required**
263
-
264
- **After 3 failed attempts, STOP and ultrathink:**
265
- ```
266
- "I've tested 3 hypotheses without success. This suggests a deeper issue.
267
- Let me **ultrathink** this bug to:
268
- - Analyze edge cases thoroughly
269
- - Consider architectural implications
270
- - Trace full data flow across all components
271
- - Review thread safety / race conditions
272
- - Check for resource leaks or state corruption
273
- "
274
- ```
275
-
276
- **Ultrathink mode allocates 31,999 thinking tokens for:**
277
- - Deep call stack analysis
278
- - Race condition investigation
279
- - Memory leak detection
280
- - Security vulnerability analysis
281
- - Architectural pattern evaluation
282
-
283
- ### Phase 4: Implementation (with Spec Alignment)
284
-
285
- **Fix the root cause at the right level:**
286
-
287
- 1. **Determine Fix Level**
288
- - **Code-level fix:** Code doesn't match spec → Fix code
289
- - **Spec-level fix:** Spec is wrong/unclear → Update spec.md FIRST, then code
290
- - **Test-level fix:** Test expects wrong behavior → Fix test
291
- - **Architecture-level fix:** Design is flawed → Create ADR + new increment for refactor
292
-
293
- 2. **Create Failing Test Case** (at appropriate level)
294
-
295
- **SpecWeave has 4 test levels - choose appropriately:**
296
-
297
- **Level 1: Specification Tests** (`.specweave/docs/internal/strategy/`)
298
- - For acceptance criteria violations
299
- - Format: TC-0001, TC-0002 in requirements.md
300
-
301
- **Level 2: Feature Tests** (`.specweave/increments/XXXX/tests.md`)
302
- - For feature-specific bugs
303
- - Update tests.md with new test case
304
-
305
- **Level 3: Code Tests** (`tests/` directory)
306
- - **Unit tests:** Single function/class bug
307
- - **Integration tests:** Multi-component interaction bug
308
- - **E2E tests:** User-facing workflow bug (use `e2e-playwright` skill)
309
-
310
- **Level 4: Skill Tests** (`src/skills/*/test-cases/`)
311
- - For skill-specific bugs
312
- - Create .yaml test case
313
-
314
- **Process:**
315
- - Write failing test that reproduces bug
316
- - MUST fail before fix (proves test catches the bug)
317
- - Test should be MINIMAL (smallest reproduction)
318
- - **For E2E tests:** Use `e2e-playwright` skill to create Playwright test
319
-
320
- 3. **Update Spec if Needed** (BEFORE code fix)
321
-
322
- **If bug revealed spec issue:**
323
- - Update `.specweave/increments/XXXX/spec.md` with clarified requirements
324
- - Add missing edge case documentation
325
- - Update acceptance criteria if needed
326
- - Commit spec changes BEFORE code changes
327
-
328
- **If bug revealed missing spec (brownfield):**
329
- - Create retroactive spec documenting intended behavior
330
- - Place in appropriate increment or create new increment
331
- - Document "as-is" behavior first, then planned changes
332
-
333
- 4. **Implement Single Fix**
334
- - Address the root cause identified
335
- - ONE change at a time
336
- - No "while I'm here" improvements
337
- - No bundled refactoring
338
- - **Follow spec:** Ensure fix aligns with updated spec.md
339
-
340
- 5. **Verify Fix**
341
- - Test passes now? ✓
342
- - No other tests broken? ✓
343
- - Issue actually resolved? ✓
344
- - **Spec alignment:** Does behavior match spec.md now? ✓
345
- - Run full test suite (not just the one test)
346
-
347
- 6. **If Fix Doesn't Work**
348
- - STOP
349
- - Count: How many fixes have you tried?
350
- - If < 3: Return to Phase 1, re-analyze with new information
351
- - **If ≥ 3: MANDATORY ULTRATHINK** (see Phase 4.7 below)
352
- - DON'T attempt Fix #4 without ultrathinking
353
-
354
- 7. **If 3+ Fixes Failed: Ultrathink Architecture** 🧠
355
-
356
- **Pattern indicating architectural problem:**
357
- - Each fix reveals new shared state/coupling/problem in different place
358
- - Fixes require "massive refactoring" to implement
359
- - Each fix creates new symptoms elsewhere
360
- - **Spec-code gap is too large** (fundamental design mismatch)
361
-
362
- **MANDATORY ULTRATHINK MODE:**
363
- ```
364
- "After 3 failed fixes, this is an architectural issue. Let me **ultrathink** this:
365
-
366
- Analyzing:
367
- - Is this pattern fundamentally sound?
368
- - Are we maintaining it through inertia?
369
- - What architectural refactor would eliminate this bug class?
370
- - What are the trade-offs of different refactoring approaches?
371
- - Should we create a new ADR to document this decision?
372
- "
373
- ```
374
-
375
- **Ultrathink will explore:**
376
- - Alternative architectural patterns
377
- - Refactoring strategies (strangler fig, big bang, incremental)
378
- - Impact analysis (what else breaks?)
379
- - Cost-benefit of refactor vs maintain
380
- - ADR recommendations
381
-
382
- **After ultrathink:**
383
- - Discuss with user before attempting more fixes
384
- - Create ADR if architectural decision is made
385
- - Create new increment for refactoring work
386
- - Update strategy docs if requirements changed
387
-
388
- **This is NOT a failed hypothesis - this is a wrong architecture.**
389
-
390
- ### Phase 5: Living Documentation Update (SpecWeave-Specific)
391
-
392
- **After fix is verified, update documentation:**
393
-
394
- 1. **Update Increment Documentation**
395
- - **spec.md:** If requirements were clarified, update spec
396
- - **plan.md:** If implementation approach changed, document it
397
- - **tests.md:** Add new test case that caught this bug
398
- - **tasks.md:** Mark related task complete or add follow-up task
399
-
400
- 2. **Update Architecture Documentation** (if architectural change)
401
- - **Create ADR:** If architectural decision was made
402
- - Location: `.specweave/docs/internal/architecture/adr/XXXX-decision-title.md`
403
- - Document: Context, Decision, Consequences, Alternatives Considered
404
- - **Update system-design.md:** If component architecture changed
405
- - **Update component-design.md:** If internal design changed
406
-
407
- 3. **Update Strategy Documentation** (if requirements changed)
408
- - **requirements.md:** If functional/non-functional requirements clarified
409
- - **success-criteria.md:** If acceptance criteria updated
410
-
411
- 4. **Create New Increment** (if fix is substantial)
412
- - **When to create new increment:**
413
- - Fix involves > 3 files
414
- - Architectural refactoring
415
- - Breaking change
416
- - New feature added to fix bug (scope creep)
417
- - **Use:** `increment-planner` skill to create proper increment
418
-
419
- 5. **Commit with Proper Documentation**
420
- ```bash
421
- git add .
422
- git commit -m "$(cat <<'EOF'
423
- fix: [brief description of bug fix]
424
-
425
- Root cause: [what was broken and why]
426
- Solution: [what was changed and why this fixes it]
427
- Spec alignment: [how this aligns with spec.md or what spec was updated]
428
-
429
- Test coverage:
430
- - Added: [new test case]
431
- - Verified: [existing tests still pass]
432
-
433
- Documentation updated:
434
- - spec.md: [clarified requirements for edge case X]
435
- - tests.md: [added TC-007 for regression prevention]
436
-
437
- Fixes: #123 (if GitHub issue exists)
438
-
439
- 🤖 Generated with Claude Code
440
- Co-Authored-By: Claude <noreply@anthropic.com>
441
- EOF
442
- )"
443
- ```
444
-
445
- 6. **Update Context Manifest** (if dependencies changed)
446
- - Add new files to `context-manifest.yaml` if needed
447
- - Update max_context_tokens if context grew significantly
448
-
449
- ## Red Flags - STOP and Follow Process
450
-
451
- If you catch yourself thinking:
452
- - "Quick fix for now, investigate later"
453
- - "Just try changing X and see if it works"
454
- - "Add multiple changes, run tests"
455
- - "Skip the test, I'll manually verify"
456
- - "It's probably X, let me fix that"
457
- - "I don't fully understand but this might work"
458
- - "Pattern says X but I'll adapt it differently"
459
- - "Here are the main problems: [lists fixes without investigation]"
460
- - Proposing solutions before tracing data flow
461
- - **Proposing code fix before checking spec.md**
462
- - **"One more fix attempt" (when already tried 2+) WITHOUT ultrathinking**
463
- - **Each fix reveals new problem in different place**
464
- - **"Spec is probably right, code is wrong"** (verify, don't assume)
465
-
466
- **ALL of these mean: STOP. Return to Phase 0 and Phase 1.**
467
-
468
- **If 3+ fixes failed:** MANDATORY ultrathink mode (see Phase 4.7)
469
-
470
- ## User Signals You're Doing It Wrong
471
-
472
- **Watch for these redirections:**
473
- - "Is that not happening?" - You assumed without verifying
474
- - "Will it show us...?" - You should have added evidence gathering
475
- - "Stop guessing" - You're proposing fixes without understanding
476
- - **"What does the spec say?"** - You skipped Phase 0
477
- - **"Ultrathink this"** - Question fundamentals, not just symptoms
478
- - "We're stuck?" (frustrated) - Your approach isn't working
479
- - **"Does that match the requirements?"** - Spec alignment check missed
480
-
481
- **When you see these:** STOP. Return to Phase 0 and Phase 1.
482
-
483
- ## Ultrathink Debugging Mode 🧠
484
-
485
- **What is Ultrathink Debugging?**
486
- - Allocates **31,999 thinking tokens** for deep analysis
487
- - Used for complex bugs requiring extensive reasoning
488
- - Mandatory after 3 failed fix attempts
489
- - Suggested for architectural issues, race conditions, security bugs
490
-
491
- **When to Use Ultrathink:**
492
-
493
- **Mandatory:**
494
- - 3+ failed fix attempts (architectural issue)
495
- - Security vulnerability analysis
496
- - Distributed systems bugs (consensus, consistency, partitions)
497
-
498
- **Suggested:**
499
- - Race conditions or concurrency bugs
500
- - Memory leaks or performance degradation
501
- - Complex data flow across many components
502
- - Novel bug patterns not seen before
503
- - Brownfield code with no documentation
504
-
505
- **How to Activate:**
506
-
507
- **User-initiated:**
508
- ```
509
- User: "This bug is complex - can you ultrathink it?"
510
- ```
511
-
512
- **Agent-suggested:**
513
- ```
514
- Assistant: "After 3 failed fixes, this is an architectural issue.
515
- Let me **ultrathink** this to analyze:
516
- - Alternative architectural patterns
517
- - Race condition analysis
518
- - Edge cases across distributed components
519
- - Security implications
520
- "
521
- ```
522
-
523
- **Ultrathink Analysis Includes:**
524
- - Full call stack analysis (every function, every parameter)
525
- - State machine analysis (all possible states and transitions)
526
- - Concurrency analysis (thread safety, locks, deadlocks)
527
- - Data flow analysis (every transformation, every validation)
528
- - Edge case exploration (boundary conditions, error paths)
529
- - Architectural pattern evaluation (current vs alternatives)
530
- - Security threat modeling (STRIDE, attack vectors)
531
- - Performance bottleneck identification
532
-
533
- ## Common Rationalizations
534
-
535
- | Excuse | Reality |
536
- |--------|---------|
537
- | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
538
- | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
539
- | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
540
- | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
541
- | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
542
- | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
543
- | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
544
- | **"Spec is probably right, no need to check"** | Specs can be wrong/unclear. Always verify. |
545
- | **"One more fix attempt" (after 2+ failures)** | 3+ failures = architectural problem. **Ultrathink required.** |
546
- | **"Ultrathink is overkill for this"** | If 3+ fixes failed, ultrathink is NOT overkill. |
547
-
548
- ## Quick Reference
549
-
550
- | Phase | Key Activities | SpecWeave Additions | Success Criteria |
551
- |-------|---------------|---------------------|------------------|
552
- | **0. Context** | Load increment docs, ADRs, specs | Identify bug type, check spec alignment | Understand WHAT SHOULD HAPPEN |
553
- | **1. Root Cause** | Read errors, reproduce, trace flow | Compare vs spec.md, check tests.md | Understand WHAT and WHY |
554
- | **2. Pattern** | Find working examples, compare | Check other increments, consult skills | Identify differences |
555
- | **3. Hypothesis** | Form theory, test minimally, count attempts | Classify hypothesis type, ultrathink if 3+ failures | Confirmed or new hypothesis |
556
- | **4. Implementation** | Create test, fix, verify | Fix at right level (code/spec/architecture) | Bug resolved, tests pass, spec aligned |
557
- | **5. Documentation** | Update docs, commit | Update spec/plan/tests, create ADR if needed | Living docs updated |
558
-
559
- ## When Process Reveals Different Bug Types
560
-
561
- ### Code Bug (Most Common)
562
- - Spec is clear, code doesn't implement it correctly
563
- - **Fix:** Update code to match spec
564
- - **Update:** tests.md with new test case
565
-
566
- ### Spec Bug
567
- - Code works as designed, but spec is wrong/unclear
568
- - **Fix:** Update spec.md FIRST, then update code to match
569
- - **Update:** spec.md, plan.md, tests.md
570
-
571
- ### Missing Spec (Brownfield)
572
- - Behavior is undocumented
573
- - **Fix:** Create retroactive spec documenting current behavior
574
- - **Then:** Decide if current behavior is correct or needs fixing
575
- - **Update:** Create increment with retroactive spec
576
-
577
- ### Architectural Bug
578
- - Design is fundamentally flawed, can't support requirements
579
- - **Fix:** **Ultrathink required** to propose refactoring approach
580
- - **Update:** Create ADR, create new increment for refactoring
581
-
582
- ### Test Bug
583
- - Code and spec are correct, test expects wrong behavior
584
- - **Fix:** Update test to match spec
585
- - **Update:** tests.md with corrected test case
586
-
587
- ## Integration with SpecWeave
588
-
589
- ### Relationship to Other Skills
590
-
591
- **This skill coordinates with:**
592
- - **increment-planner** - Create new increment for large fixes
593
- - **e2e-playwright** - Create E2E tests for UI bugs
594
- - **nextjs** / **nodejs-backend** / **python-backend** / **dotnet-backend** - Domain-specific debugging patterns
595
- - **frontend** - React/Vue/Angular debugging patterns
596
- - **diagrams-architect** - Create sequence diagrams for complex data flow
597
- - **context-loader** - Load relevant context for bug investigation
598
-
599
- ### Relationship to SpecWeave Agents
600
-
601
- **This skill may invoke:**
602
- - **tech-lead** agent - Code review of complex fixes
603
- - **security** agent - Security vulnerability analysis (use ultrathink)
604
- - **sre** agent - Production incident investigation
605
- - **architect** agent - Architectural refactoring proposals
606
- - **qa-lead** agent - Test strategy for regression prevention
607
-
608
- ### Documentation Flow
609
-
610
- ```
611
- Bug reported
612
-
613
- Phase 0: Load context (spec.md, plan.md, ADRs)
614
-
615
- Phase 1-3: Investigate, analyze, test hypothesis
616
-
617
- Phase 4: Implement fix (code or spec)
618
-
619
- Phase 5: Update living docs
620
- ├─ spec.md (if requirements clarified)
621
- ├─ plan.md (if implementation changed)
622
- ├─ tests.md (add test case)
623
- ├─ ADR (if architectural decision)
624
- └─ Commit with documentation
625
- ```
626
-
627
- ## Real-World Impact
628
-
629
- From debugging sessions:
630
- - **Systematic approach:** 15-30 minutes to fix (with docs)
631
- - **Random fixes approach:** 2-3 hours of thrashing (no docs)
632
- - **First-time fix rate:** 95% vs 40%
633
- - **New bugs introduced:** Near zero vs common
634
- - **Spec-code alignment:** Maintained vs diverges
635
- - **Regression prevention:** Tests created vs no tests
636
- - **Ultrathink for complex bugs:** 30-45 minutes deep analysis vs days of random attempts
637
-
638
- ## Summary
639
-
640
- **spec-driven-debugging** extends systematic debugging with SpecWeave's spec-driven methodology:
641
-
642
- 1. ✅ **Phase 0: Context loading** - Load specs, ADRs, increment docs
643
- 2. ✅ **Spec alignment checks** - Verify behavior matches requirements
644
- 3. ✅ **Multi-level testing** - Create tests at appropriate level (spec/feature/code/skill)
645
- 4. ✅ **Living documentation** - Update specs, plans, ADRs after fix
646
- 5. ✅ **Ultrathink mode** - Deep analysis for complex bugs (31,999 tokens)
647
- 6. ✅ **Architectural awareness** - Recognize design issues vs code bugs
648
- 7. ✅ **Brownfield support** - Create retroactive specs for undocumented code
649
-
650
- **The Iron Law remains:** NO FIXES WITHOUT ROOT CAUSE INVESTIGATION + SPEC ALIGNMENT CHECK.
651
-
652
- **New addition:** 3+ failed fixes = MANDATORY ULTRATHINK.
@@ -1,12 +0,0 @@
1
- {
2
- "$schema": "https://spec-weave.com/schemas/mcp-config.json",
3
- "mcpServers": {
4
- "figma": {
5
- "command": "npx",
6
- "args": ["-y", "@modelcontextprotocol/server-figma"],
7
- "env": {
8
- "FIGMA_PERSONAL_ACCESS_TOKEN": "${FIGMA_PERSONAL_ACCESS_TOKEN}"
9
- }
10
- }
11
- }
12
- }
@@ -1,20 +0,0 @@
1
- {
2
- "name": "specweave-figma",
3
- "description": "Design-to-code workflow patterns for Figma (MCP-first). Requires Figma MCP server. Extracts design tokens, generates components (React/Angular/Vue/Svelte), scaffolds tests. Uses Atomic Design and TypeScript.",
4
- "version": "0.22.14",
5
- "author": {
6
- "name": "SpecWeave Team",
7
- "url": "https://spec-weave.com"
8
- },
9
- "homepage": "https://spec-weave.com",
10
- "repository": "https://github.com/anton-abyzov/specweave",
11
- "license": "MIT",
12
- "keywords": [
13
- "figma",
14
- "design",
15
- "design-system",
16
- "mcp",
17
- "design-tokens",
18
- "specweave"
19
- ]
20
- }