start-vibing 2.0.3 → 2.0.4

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 (85) hide show
  1. package/package.json +1 -1
  2. package/template/.claude/agents/01-orchestration/agent-selector.md +1 -0
  3. package/template/.claude/agents/01-orchestration/checkpoint-manager.md +1 -0
  4. package/template/.claude/agents/01-orchestration/context-manager.md +1 -0
  5. package/template/.claude/agents/01-orchestration/error-recovery.md +1 -0
  6. package/template/.claude/agents/01-orchestration/parallel-coordinator.md +1 -0
  7. package/template/.claude/agents/01-orchestration/workflow-router.md +1 -0
  8. package/template/.claude/agents/02-typescript/bun-runtime-expert.md +1 -0
  9. package/template/.claude/agents/02-typescript/esm-resolver.md +1 -0
  10. package/template/.claude/agents/02-typescript/import-alias-enforcer.md +1 -0
  11. package/template/.claude/agents/02-typescript/ts-generics-helper.md +1 -0
  12. package/template/.claude/agents/02-typescript/ts-migration-helper.md +1 -0
  13. package/template/.claude/agents/02-typescript/ts-strict-checker.md +1 -0
  14. package/template/.claude/agents/02-typescript/ts-types-analyzer.md +1 -0
  15. package/template/.claude/agents/02-typescript/type-definition-writer.md +1 -0
  16. package/template/.claude/agents/02-typescript/zod-schema-designer.md +1 -1
  17. package/template/.claude/agents/02-typescript/zod-validator.md +1 -0
  18. package/template/.claude/agents/03-testing/playwright-assertions.md +1 -0
  19. package/template/.claude/agents/03-testing/playwright-e2e.md +2 -2
  20. package/template/.claude/agents/03-testing/playwright-fixtures.md +2 -2
  21. package/template/.claude/agents/03-testing/playwright-multi-viewport.md +2 -2
  22. package/template/.claude/agents/03-testing/playwright-page-objects.md +2 -1
  23. package/template/.claude/agents/03-testing/test-cleanup-manager.md +2 -1
  24. package/template/.claude/agents/03-testing/test-data-generator.md +2 -1
  25. package/template/.claude/agents/03-testing/tester-integration.md +1 -1
  26. package/template/.claude/agents/03-testing/tester-unit.md +1 -1
  27. package/template/.claude/agents/03-testing/vitest-config.md +2 -1
  28. package/template/.claude/agents/04-docker/container-health.md +2 -1
  29. package/template/.claude/agents/04-docker/deployment-validator.md +2 -1
  30. package/template/.claude/agents/04-docker/docker-compose-designer.md +2 -1
  31. package/template/.claude/agents/04-docker/docker-env-manager.md +2 -1
  32. package/template/.claude/agents/04-docker/docker-multi-stage.md +2 -1
  33. package/template/.claude/agents/04-docker/dockerfile-optimizer.md +2 -1
  34. package/template/.claude/agents/05-database/data-migration.md +2 -1
  35. package/template/.claude/agents/05-database/database-seeder.md +2 -1
  36. package/template/.claude/agents/05-database/mongodb-query-optimizer.md +2 -1
  37. package/template/.claude/agents/05-database/mongoose-aggregation.md +2 -1
  38. package/template/.claude/agents/05-database/mongoose-index-optimizer.md +2 -1
  39. package/template/.claude/agents/05-database/mongoose-schema-designer.md +2 -2
  40. package/template/.claude/agents/06-security/auth-session-validator.md +1 -1
  41. package/template/.claude/agents/06-security/input-sanitizer.md +2 -1
  42. package/template/.claude/agents/06-security/owasp-checker.md +1 -1
  43. package/template/.claude/agents/06-security/permission-auditor.md +2 -1
  44. package/template/.claude/agents/06-security/security-auditor.md +1 -1
  45. package/template/.claude/agents/06-security/sensitive-data-scanner.md +2 -1
  46. package/template/.claude/agents/07-documentation/api-documenter.md +2 -1
  47. package/template/.claude/agents/07-documentation/changelog-manager.md +2 -1
  48. package/template/.claude/agents/07-documentation/documenter.md +1 -1
  49. package/template/.claude/agents/07-documentation/domain-updater.md +1 -1
  50. package/template/.claude/agents/07-documentation/jsdoc-generator.md +2 -1
  51. package/template/.claude/agents/07-documentation/readme-generator.md +2 -1
  52. package/template/.claude/agents/08-git/branch-manager.md +2 -1
  53. package/template/.claude/agents/08-git/commit-manager.md +2 -2
  54. package/template/.claude/agents/08-git/pr-creator.md +2 -1
  55. package/template/.claude/agents/09-quality/code-reviewer.md +2 -1
  56. package/template/.claude/agents/09-quality/quality-checker.md +1 -1
  57. package/template/.claude/agents/10-research/best-practices-finder.md +1 -1
  58. package/template/.claude/agents/10-research/competitor-analyzer.md +1 -1
  59. package/template/.claude/agents/10-research/pattern-researcher.md +1 -1
  60. package/template/.claude/agents/10-research/research-cache-manager.md +1 -1
  61. package/template/.claude/agents/10-research/research-web.md +1 -1
  62. package/template/.claude/agents/10-research/tech-evaluator.md +1 -1
  63. package/template/.claude/agents/11-ui-ux/accessibility-auditor.md +1 -1
  64. package/template/.claude/agents/11-ui-ux/design-system-enforcer.md +2 -2
  65. package/template/.claude/agents/11-ui-ux/skeleton-generator.md +2 -2
  66. package/template/.claude/agents/11-ui-ux/ui-desktop.md +2 -2
  67. package/template/.claude/agents/11-ui-ux/ui-mobile.md +2 -2
  68. package/template/.claude/agents/11-ui-ux/ui-tablet.md +2 -2
  69. package/template/.claude/agents/12-performance/api-latency-analyzer.md +2 -1
  70. package/template/.claude/agents/12-performance/bundle-analyzer.md +2 -1
  71. package/template/.claude/agents/12-performance/memory-leak-detector.md +2 -1
  72. package/template/.claude/agents/12-performance/performance-profiler.md +2 -1
  73. package/template/.claude/agents/12-performance/query-optimizer.md +2 -2
  74. package/template/.claude/agents/12-performance/render-optimizer.md +2 -1
  75. package/template/.claude/agents/13-debugging/build-error-fixer.md +2 -1
  76. package/template/.claude/agents/13-debugging/debugger.md +2 -1
  77. package/template/.claude/agents/13-debugging/error-stack-analyzer.md +2 -1
  78. package/template/.claude/agents/13-debugging/network-debugger.md +2 -1
  79. package/template/.claude/agents/13-debugging/runtime-error-fixer.md +2 -1
  80. package/template/.claude/agents/13-debugging/type-error-resolver.md +2 -1
  81. package/template/.claude/agents/14-validation/final-validator.md +1 -1
  82. package/template/.claude/skills/debugging-patterns/SKILL.md +484 -0
  83. package/template/.claude/skills/docker-patterns/SKILL.md +547 -0
  84. package/template/.claude/skills/git-workflow/SKILL.md +454 -0
  85. package/template/.claude/skills/performance-patterns/SKILL.md +549 -0
@@ -0,0 +1,484 @@
1
+ ---
2
+ name: debugging-patterns
3
+ description: Debugging strategies and error resolution patterns. Stack trace analysis, runtime errors, build errors, network issues. Use when debugging any type of error.
4
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob
5
+ ---
6
+
7
+ # Debugging Patterns - Error Resolution Best Practices
8
+
9
+ ## Purpose
10
+
11
+ Expert guidance for debugging:
12
+
13
+ - **Error Analysis** - Stack traces, error messages
14
+ - **Runtime Issues** - Type errors, null references
15
+ - **Build Errors** - Compilation, bundling
16
+ - **Network Issues** - API, CORS, HTTP errors
17
+ - **Performance Bugs** - Slow operations, memory leaks
18
+
19
+ ---
20
+
21
+ ## Debug Process
22
+
23
+ ```
24
+ 1. UNDERSTAND - What should happen vs what happens
25
+
26
+ 2. REPRODUCE - Consistent steps to trigger bug
27
+
28
+ 3. ISOLATE - Narrow down to specific code
29
+
30
+ 4. IDENTIFY - Find root cause
31
+
32
+ 5. FIX - Implement solution
33
+
34
+ 6. VERIFY - Confirm fix works + no regressions
35
+ ```
36
+
37
+ ---
38
+
39
+ ## Stack Trace Analysis
40
+
41
+ ### Reading Error Stack
42
+
43
+ ```
44
+ TypeError: Cannot read properties of undefined (reading 'name')
45
+ at getUserName (src/utils/user.ts:45:23)
46
+ at ProfileCard (src/components/ProfileCard.tsx:12:18)
47
+ at renderWithHooks (node_modules/react-dom/...)
48
+ ```
49
+
50
+ **Key Information:**
51
+ - **Error Type**: `TypeError`
52
+ - **Message**: `Cannot read properties of undefined`
53
+ - **Property**: `name`
54
+ - **Location**: `src/utils/user.ts:45:23` (file:line:column)
55
+ - **Call Stack**: Shows how we got here
56
+
57
+ ### Fix Pattern
58
+
59
+ ```typescript
60
+ // Error at line 45
61
+ function getUserName(user: User) {
62
+ return user.name; // ERROR: user is undefined
63
+ }
64
+
65
+ // Fix: Add null check
66
+ function getUserName(user: User | undefined): string {
67
+ return user?.name ?? 'Unknown';
68
+ }
69
+
70
+ // Or use assertion with clear error
71
+ function getUserName(user: User | undefined): string {
72
+ if (!user) {
73
+ throw new Error('User is required for getUserName');
74
+ }
75
+ return user.name;
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Common Error Patterns
82
+
83
+ ### TypeError: Cannot read properties of undefined
84
+
85
+ ```typescript
86
+ // Pattern: Accessing property on undefined
87
+ const name = user.profile.name;
88
+
89
+ // Fix 1: Optional chaining
90
+ const name = user?.profile?.name ?? 'Unknown';
91
+
92
+ // Fix 2: Early return
93
+ if (!user?.profile) return null;
94
+ const name = user.profile.name;
95
+
96
+ // Fix 3: Default value
97
+ const profile = user?.profile ?? { name: 'Unknown' };
98
+ ```
99
+
100
+ ### TypeError: X is not a function
101
+
102
+ ```typescript
103
+ // Pattern: Calling non-function
104
+ onClick(); // onClick is undefined
105
+
106
+ // Fix 1: Check before calling
107
+ onClick?.();
108
+
109
+ // Fix 2: Provide default
110
+ const handleClick = onClick ?? (() => {});
111
+ handleClick();
112
+ ```
113
+
114
+ ### ReferenceError: X is not defined
115
+
116
+ ```typescript
117
+ // Pattern: Using undefined variable
118
+ console.log(userData); // userData not imported/declared
119
+
120
+ // Fix: Import or declare
121
+ import { userData } from './data';
122
+ // or
123
+ const userData = await fetchUserData();
124
+ ```
125
+
126
+ ### SyntaxError: Unexpected token
127
+
128
+ ```typescript
129
+ // Pattern: Invalid JSON
130
+ const data = JSON.parse(response);
131
+ // SyntaxError: Unexpected token '<'
132
+
133
+ // Fix: Check response before parsing
134
+ if (!response.ok) {
135
+ throw new Error(`HTTP ${response.status}`);
136
+ }
137
+ const text = await response.text();
138
+ try {
139
+ return JSON.parse(text);
140
+ } catch {
141
+ throw new Error(`Invalid JSON: ${text.slice(0, 100)}`);
142
+ }
143
+ ```
144
+
145
+ ---
146
+
147
+ ## TypeScript Errors
148
+
149
+ ### TS2339: Property does not exist
150
+
151
+ ```typescript
152
+ // Error
153
+ const env = process.env.NODE_ENV;
154
+ // Property 'NODE_ENV' does not exist on type 'ProcessEnv'
155
+
156
+ // Fix: Use bracket notation
157
+ const env = process.env['NODE_ENV'];
158
+ ```
159
+
160
+ ### TS2532: Object is possibly undefined
161
+
162
+ ```typescript
163
+ // Error
164
+ const items = array.map(x => x.value);
165
+ // Object is possibly 'undefined'
166
+
167
+ // Fix 1: Non-null assertion (if certain)
168
+ const items = array!.map(x => x.value);
169
+
170
+ // Fix 2: Default value
171
+ const items = (array ?? []).map(x => x.value);
172
+
173
+ // Fix 3: Conditional
174
+ const items = array ? array.map(x => x.value) : [];
175
+ ```
176
+
177
+ ### TS2345: Argument type mismatch
178
+
179
+ ```typescript
180
+ // Error
181
+ function greet(name: string) { }
182
+ greet(user.name); // Argument of type 'string | undefined'
183
+
184
+ // Fix 1: Provide default
185
+ greet(user.name ?? 'Guest');
186
+
187
+ // Fix 2: Assert
188
+ greet(user.name!);
189
+
190
+ // Fix 3: Guard
191
+ if (user.name) greet(user.name);
192
+ ```
193
+
194
+ ### TS7053: Index signature
195
+
196
+ ```typescript
197
+ // Error
198
+ const value = obj[key];
199
+ // Element implicitly has 'any' type
200
+
201
+ // Fix: Type the index
202
+ const value = (obj as Record<string, unknown>)[key];
203
+
204
+ // Or define proper type
205
+ interface MyObj {
206
+ [key: string]: string | undefined;
207
+ }
208
+ ```
209
+
210
+ ---
211
+
212
+ ## Build Errors
213
+
214
+ ### Module Not Found
215
+
216
+ ```bash
217
+ # Error
218
+ Cannot find module './utils' or its corresponding type declarations
219
+
220
+ # Check 1: File exists?
221
+ ls src/utils.ts
222
+
223
+ # Check 2: Extension needed?
224
+ import { helper } from './utils.js'; # ESM requires extension
225
+
226
+ # Check 3: Path alias configured?
227
+ # Check tsconfig.json paths
228
+ ```
229
+
230
+ ### Duplicate Identifier
231
+
232
+ ```bash
233
+ # Error
234
+ Duplicate identifier 'User'
235
+
236
+ # Fix: Check imports for conflicts
237
+ # May have both named and default import
238
+ import User from './User';
239
+ import { User } from './types'; # Conflict!
240
+
241
+ # Solution: Rename one
242
+ import { User as UserType } from './types';
243
+ ```
244
+
245
+ ### ESM/CJS Compatibility
246
+
247
+ ```typescript
248
+ // Error: require is not defined in ES module
249
+ const fs = require('fs');
250
+
251
+ // Fix: Use ESM import
252
+ import fs from 'fs';
253
+ import { readFileSync } from 'fs';
254
+
255
+ // If must use require in ESM
256
+ import { createRequire } from 'module';
257
+ const require = createRequire(import.meta.url);
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Network & API Errors
263
+
264
+ ### CORS Errors
265
+
266
+ ```
267
+ Access to fetch at 'https://api.example.com' has been blocked by CORS policy
268
+ ```
269
+
270
+ ```typescript
271
+ // Server-side fix (add headers)
272
+ res.setHeader('Access-Control-Allow-Origin', 'https://yoursite.com');
273
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS');
274
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
275
+
276
+ // Client-side workaround (proxy in dev)
277
+ // vite.config.ts
278
+ export default {
279
+ server: {
280
+ proxy: {
281
+ '/api': {
282
+ target: 'https://api.example.com',
283
+ changeOrigin: true,
284
+ },
285
+ },
286
+ },
287
+ };
288
+ ```
289
+
290
+ ### HTTP Error Handling
291
+
292
+ ```typescript
293
+ async function fetchWithErrorHandling<T>(url: string): Promise<T> {
294
+ const response = await fetch(url);
295
+
296
+ if (!response.ok) {
297
+ // Get error details
298
+ let message: string;
299
+ try {
300
+ const error = await response.json();
301
+ message = error.message || response.statusText;
302
+ } catch {
303
+ message = response.statusText;
304
+ }
305
+
306
+ throw new Error(`${response.status} ${message}`);
307
+ }
308
+
309
+ return response.json();
310
+ }
311
+ ```
312
+
313
+ ### Network Timeout
314
+
315
+ ```typescript
316
+ async function fetchWithTimeout(url: string, timeout = 5000) {
317
+ const controller = new AbortController();
318
+ const id = setTimeout(() => controller.abort(), timeout);
319
+
320
+ try {
321
+ const response = await fetch(url, { signal: controller.signal });
322
+ clearTimeout(id);
323
+ return response;
324
+ } catch (error) {
325
+ clearTimeout(id);
326
+ if (error instanceof Error && error.name === 'AbortError') {
327
+ throw new Error(`Request timeout after ${timeout}ms`);
328
+ }
329
+ throw error;
330
+ }
331
+ }
332
+ ```
333
+
334
+ ---
335
+
336
+ ## React Debugging
337
+
338
+ ### "Cannot update a component while rendering"
339
+
340
+ ```typescript
341
+ // Error: State update during render
342
+ function Component({ value }) {
343
+ const [state, setState] = useState(0);
344
+ setState(value); // ERROR!
345
+
346
+ // Fix: Use useEffect
347
+ useEffect(() => {
348
+ setState(value);
349
+ }, [value]);
350
+ }
351
+ ```
352
+
353
+ ### "Too many re-renders"
354
+
355
+ ```typescript
356
+ // Error: Infinite loop
357
+ function Component() {
358
+ const [count, setCount] = useState(0);
359
+ setCount(count + 1); // Causes re-render, which sets count...
360
+
361
+ // Fix: Add condition or use effect
362
+ useEffect(() => {
363
+ if (count < 10) {
364
+ setCount(c => c + 1);
365
+ }
366
+ }, [count]);
367
+ }
368
+ ```
369
+
370
+ ### "Invalid hook call"
371
+
372
+ ```typescript
373
+ // Error: Hook outside component or conditional
374
+ function Component() {
375
+ if (condition) {
376
+ const [state] = useState(0); // ERROR!
377
+ }
378
+ }
379
+
380
+ // Fix: Hooks must be at top level
381
+ function Component() {
382
+ const [state] = useState(0); // OK
383
+ if (condition) {
384
+ // use state here
385
+ }
386
+ }
387
+ ```
388
+
389
+ ---
390
+
391
+ ## Debug Commands
392
+
393
+ ### Git - Find Breaking Commit
394
+
395
+ ```bash
396
+ # Start bisect
397
+ git bisect start
398
+ git bisect bad HEAD
399
+ git bisect good abc123 # Last known good commit
400
+
401
+ # Test and mark each commit
402
+ git bisect good # or bad
403
+
404
+ # End bisect
405
+ git bisect reset
406
+ ```
407
+
408
+ ### Find Error in Code
409
+
410
+ ```bash
411
+ # Search for error message
412
+ grep -rn "specific error text" src/
413
+
414
+ # Search for pattern
415
+ grep -rn "throw new Error" src/ --include="*.ts"
416
+
417
+ # Find file with symbol
418
+ grep -rn "functionName" src/ --include="*.ts" -l
419
+ ```
420
+
421
+ ### Bun Debugging
422
+
423
+ ```bash
424
+ # Debug mode
425
+ bun --inspect src/index.ts
426
+
427
+ # With breakpoint on start
428
+ bun --inspect-brk src/index.ts
429
+
430
+ # Low memory mode (for memory issues)
431
+ bun --smol src/index.ts
432
+ ```
433
+
434
+ ---
435
+
436
+ ## Debugging Checklist
437
+
438
+ ### Before You Start
439
+
440
+ - [ ] Can you reproduce the bug?
441
+ - [ ] Do you have the exact error message?
442
+ - [ ] What changed recently? (`git log`, `git diff`)
443
+
444
+ ### Investigation
445
+
446
+ - [ ] Read the full error message and stack trace
447
+ - [ ] Check the line number mentioned in error
448
+ - [ ] Add console.log at key points
449
+ - [ ] Check network tab for API errors
450
+
451
+ ### After Fix
452
+
453
+ - [ ] Does the fix work for all cases?
454
+ - [ ] Did you add tests to prevent regression?
455
+ - [ ] Did you handle edge cases?
456
+
457
+ ---
458
+
459
+ ## Agent Integration
460
+
461
+ This skill is used by:
462
+
463
+ - **debugger** agent
464
+ - **error-stack-analyzer** agent
465
+ - **type-error-resolver** agent
466
+ - **runtime-error-fixer** agent
467
+ - **network-debugger** agent
468
+ - **build-error-fixer** agent
469
+
470
+ ---
471
+
472
+ ## FORBIDDEN
473
+
474
+ 1. **Swallowing errors silently** - Always log or handle
475
+ 2. **Using `any` to hide errors** - Fix the actual type issue
476
+ 3. **`@ts-ignore` without comment** - Use `@ts-expect-error` with explanation
477
+ 4. **Empty catch blocks** - At minimum, log the error
478
+ 5. **Fixing symptoms not causes** - Find and fix root cause
479
+
480
+ ---
481
+
482
+ ## Version
483
+
484
+ - **v1.0.0** - Initial implementation based on 2024-2025 debugging patterns