start-vibing 2.0.3 → 2.0.5

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 (87) 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/hooks/user-prompt-submit.py +574 -169
  83. package/template/.claude/hooks/user-prompt-submit.ts +578 -96
  84. package/template/.claude/skills/debugging-patterns/SKILL.md +484 -0
  85. package/template/.claude/skills/docker-patterns/SKILL.md +547 -0
  86. package/template/.claude/skills/git-workflow/SKILL.md +454 -0
  87. package/template/.claude/skills/performance-patterns/SKILL.md +549 -0
@@ -13,6 +13,9 @@ Output is sent to Claude as context before processing the user's request.
13
13
 
14
14
  Based on official Claude Code documentation:
15
15
  https://code.claude.com/docs/en/hooks.md
16
+
17
+ AGENT SYSTEM: 82 specialized agents in 14 categories
18
+ SKILL SYSTEM: 22 skills auto-loaded by agents
16
19
  """
17
20
 
18
21
  import json
@@ -47,85 +50,531 @@ STRICT_WORKFLOW = """
47
50
  - Documenter agent not executed for code changes
48
51
  """
49
52
 
50
- # Agent definitions with triggers
51
- AGENTS = {
52
- 'orchestrator': {
53
- 'description': 'Coordinates entire development flow',
54
- 'triggers': ['implement feature', 'build', 'create', 'fix and test', 'full workflow', 'multi-step'],
55
- 'priority': 1,
56
- 'when': 'Task requires >2 agents or touches >3 files'
53
+ # ============================================================================
54
+ # AGENT SYSTEM - 82 Specialized Agents in 14 Categories
55
+ # ============================================================================
56
+
57
+ AGENT_CATEGORIES = {
58
+ '01-orchestration': {
59
+ 'description': 'Workflow coordination and task management',
60
+ 'agents': {
61
+ 'orchestrator': {
62
+ 'triggers': ['implement feature', 'build', 'create', 'full workflow', 'multi-step'],
63
+ 'when': 'Task requires >2 agents or touches >3 files',
64
+ 'skills': ['codebase-knowledge']
65
+ },
66
+ 'task-decomposer': {
67
+ 'triggers': ['complex task', 'break down', 'multiple steps'],
68
+ 'when': 'Task has >3 steps or touches >3 files',
69
+ 'skills': ['codebase-knowledge']
70
+ },
71
+ 'workflow-router': {
72
+ 'triggers': ['route', 'which agent', 'unclear'],
73
+ 'when': 'At task start to route to correct agent',
74
+ 'skills': ['codebase-knowledge']
75
+ },
76
+ 'parallel-coordinator': {
77
+ 'triggers': ['parallel', 'concurrent', 'simultaneous'],
78
+ 'when': 'Multiple independent agents should run simultaneously',
79
+ 'skills': ['codebase-knowledge']
80
+ },
81
+ 'context-manager': {
82
+ 'triggers': ['context', 'compress', 'long conversation'],
83
+ 'when': 'Context grows large or between major phases',
84
+ 'skills': ['codebase-knowledge']
85
+ },
86
+ 'checkpoint-manager': {
87
+ 'triggers': ['checkpoint', 'save state', 'backup'],
88
+ 'when': 'BEFORE risky operations (git, deletions, refactors)',
89
+ 'skills': ['codebase-knowledge']
90
+ },
91
+ 'error-recovery': {
92
+ 'triggers': ['failed', 'retry', 'timeout', 'unexpected error'],
93
+ 'when': 'An agent fails or returns unexpected results',
94
+ 'skills': ['codebase-knowledge', 'debugging-patterns']
95
+ },
96
+ 'agent-selector': {
97
+ 'triggers': ['select agent', 'best agent', 'which agent'],
98
+ 'when': 'Multiple agents could handle a task',
99
+ 'skills': ['codebase-knowledge']
100
+ }
101
+ }
57
102
  },
58
- 'analyzer': {
59
- 'description': 'Analyzes impact before code modification',
60
- 'triggers': ['implement', 'add feature', 'fix bug', 'refactor', 'change', 'modify', 'update code'],
61
- 'priority': 2,
62
- 'when': 'BEFORE any Edit/Write to source files'
103
+ '02-typescript': {
104
+ 'description': 'TypeScript strict mode, types, and module resolution',
105
+ 'agents': {
106
+ 'ts-strict-checker': {
107
+ 'triggers': ['strict mode', 'null check', 'process.env'],
108
+ 'when': 'AFTER editing any .ts file',
109
+ 'skills': ['typescript-strict']
110
+ },
111
+ 'ts-types-analyzer': {
112
+ 'triggers': ['type error', 'inference', 'generic problem'],
113
+ 'when': 'On type errors or typecheck fails',
114
+ 'skills': ['typescript-strict']
115
+ },
116
+ 'ts-generics-helper': {
117
+ 'triggers': ['generic', 'type parameter', 'complex type'],
118
+ 'when': 'Creating generic functions/types',
119
+ 'skills': ['typescript-strict']
120
+ },
121
+ 'ts-migration-helper': {
122
+ 'triggers': ['migrate', 'convert to typescript', '.js'],
123
+ 'when': 'Migrating JavaScript to TypeScript',
124
+ 'skills': ['typescript-strict']
125
+ },
126
+ 'type-definition-writer': {
127
+ 'triggers': ['new model', 'new entity', 'interface needed'],
128
+ 'when': 'BEFORE implementing new entities',
129
+ 'skills': ['typescript-strict']
130
+ },
131
+ 'import-alias-enforcer': {
132
+ 'triggers': ['import', 'alias', '@types'],
133
+ 'when': 'AFTER editing .ts files - enforces $types/*, @common, @db',
134
+ 'skills': ['typescript-strict']
135
+ },
136
+ 'esm-resolver': {
137
+ 'triggers': ['module error', 'import error', 'cannot find module'],
138
+ 'when': 'On module errors',
139
+ 'skills': ['typescript-strict', 'bun-runtime']
140
+ },
141
+ 'bun-runtime-expert': {
142
+ 'triggers': ['bun', 'runtime', 'package management'],
143
+ 'when': 'Using Bun runtime',
144
+ 'skills': ['bun-runtime']
145
+ },
146
+ 'zod-validator': {
147
+ 'triggers': ['validation', 'zod', 'schema'],
148
+ 'when': 'BEFORE commit when API routes exist',
149
+ 'skills': ['zod-validation']
150
+ },
151
+ 'zod-schema-designer': {
152
+ 'triggers': ['new endpoint', 'form input', 'user input'],
153
+ 'when': 'BEFORE implementing any API endpoint',
154
+ 'skills': ['zod-validation', 'typescript-strict']
155
+ }
156
+ }
63
157
  },
64
- 'research': {
65
- 'description': 'Researches best practices (2024-2025) - MANDATORY for new features',
66
- 'triggers': ['research', 'investigate', 'study', 'best practice', 'how to', 'pattern', 'new feature', 'implement'],
67
- 'priority': 3,
68
- 'when': 'MANDATORY for ANY new feature or complex bug fix',
69
- 'mandatory_for': ['feature', 'fix']
158
+ '03-testing': {
159
+ 'description': 'Unit tests (Vitest) and E2E tests (Playwright)',
160
+ 'agents': {
161
+ 'vitest-config': {
162
+ 'triggers': ['test setup', 'vitest config', 'coverage config'],
163
+ 'when': 'Setting up tests or coverage issues arise',
164
+ 'skills': ['test-coverage']
165
+ },
166
+ 'tester-unit': {
167
+ 'triggers': ['unit test', 'function test', 'utility test'],
168
+ 'when': 'AFTER implementing any function or utility',
169
+ 'skills': ['test-coverage']
170
+ },
171
+ 'tester-integration': {
172
+ 'triggers': ['integration test', 'api test', 'service test'],
173
+ 'when': 'AFTER implementing API endpoints or services',
174
+ 'skills': ['test-coverage']
175
+ },
176
+ 'test-data-generator': {
177
+ 'triggers': ['mock data', 'test fixture', 'factory'],
178
+ 'when': 'BEFORE writing tests that need data',
179
+ 'skills': ['test-coverage']
180
+ },
181
+ 'test-cleanup-manager': {
182
+ 'triggers': ['flaky test', 'test isolation', 'state leakage'],
183
+ 'when': 'Tests are flaky or share state',
184
+ 'skills': ['test-coverage']
185
+ },
186
+ 'playwright-e2e': {
187
+ 'triggers': ['e2e test', 'user flow', 'end to end'],
188
+ 'when': 'AFTER implementing any user-facing feature',
189
+ 'skills': ['test-coverage', 'playwright-automation']
190
+ },
191
+ 'playwright-fixtures': {
192
+ 'triggers': ['fixture', 'shared setup', 'auth helper'],
193
+ 'when': 'Creating E2E tests that need shared setup',
194
+ 'skills': ['test-coverage', 'playwright-automation']
195
+ },
196
+ 'playwright-page-objects': {
197
+ 'triggers': ['page object', 'page model', 'page interaction'],
198
+ 'when': 'Creating E2E tests for new pages',
199
+ 'skills': ['test-coverage', 'playwright-automation']
200
+ },
201
+ 'playwright-multi-viewport': {
202
+ 'triggers': ['viewport', 'responsive test', 'mobile test'],
203
+ 'when': 'AFTER any UI implementation - tests desktop/tablet/mobile',
204
+ 'skills': ['test-coverage', 'playwright-automation']
205
+ },
206
+ 'playwright-assertions': {
207
+ 'triggers': ['assertion', 'expect', 'test validation'],
208
+ 'when': 'Creating comprehensive test assertions',
209
+ 'skills': ['test-coverage', 'playwright-automation']
210
+ }
211
+ }
70
212
  },
71
- 'ui-ux-reviewer': {
72
- 'description': 'Reviews UI/UX - ENFORCES separate mobile/tablet/desktop UIs',
73
- 'triggers': ['ui', 'component', 'page', 'design', 'layout', 'style', 'frontend', 'mobile', 'desktop'],
74
- 'priority': 3,
75
- 'when': 'Files in components/, app/, or .tsx with JSX',
76
- 'enforces': 'SEPARATE UIs for each platform (NOT just responsive)'
213
+ '04-docker': {
214
+ 'description': 'Docker containerization and deployment',
215
+ 'agents': {
216
+ 'dockerfile-optimizer': {
217
+ 'triggers': ['dockerfile', 'docker build', 'image size'],
218
+ 'when': 'Creating or modifying Dockerfile',
219
+ 'skills': ['docker-patterns']
220
+ },
221
+ 'docker-multi-stage': {
222
+ 'triggers': ['multi-stage', 'build optimization', 'production docker'],
223
+ 'when': 'Dockerfile can benefit from multi-stage',
224
+ 'skills': ['docker-patterns']
225
+ },
226
+ 'docker-compose-designer': {
227
+ 'triggers': ['docker-compose', 'multi-service', 'local dev'],
228
+ 'when': 'Multi-service setup is needed',
229
+ 'skills': ['docker-patterns']
230
+ },
231
+ 'docker-env-manager': {
232
+ 'triggers': ['docker env', 'secrets', 'env vars'],
233
+ 'when': 'Docker uses environment variables',
234
+ 'skills': ['docker-patterns']
235
+ },
236
+ 'container-health': {
237
+ 'triggers': ['health check', 'container monitoring', 'service health'],
238
+ 'when': 'Creating Docker containers',
239
+ 'skills': ['docker-patterns']
240
+ },
241
+ 'deployment-validator': {
242
+ 'triggers': ['deploy', 'pre-deploy', 'docker validation'],
243
+ 'when': 'BEFORE deploying',
244
+ 'skills': ['docker-patterns']
245
+ }
246
+ }
77
247
  },
78
- 'documenter': {
79
- 'description': 'Documents results with commit hash references',
80
- 'triggers': ['document', 'readme', 'docs', 'explain'],
81
- 'priority': 4,
82
- 'when': 'After implementation - MUST include commit hash for audit trail'
248
+ '05-database': {
249
+ 'description': 'MongoDB/Mongoose database operations',
250
+ 'agents': {
251
+ 'mongoose-schema-designer': {
252
+ 'triggers': ['schema', 'model', 'collection'],
253
+ 'when': 'BEFORE creating any database model',
254
+ 'skills': ['mongoose-patterns']
255
+ },
256
+ 'mongoose-index-optimizer': {
257
+ 'triggers': ['index', 'slow query', 'query performance'],
258
+ 'when': 'Database queries are slow',
259
+ 'skills': ['mongoose-patterns']
260
+ },
261
+ 'mongoose-aggregation': {
262
+ 'triggers': ['aggregation', 'pipeline', 'reporting'],
263
+ 'when': 'Complex data queries needed',
264
+ 'skills': ['mongoose-patterns']
265
+ },
266
+ 'mongodb-query-optimizer': {
267
+ 'triggers': ['n+1', 'query optimizer', 'database performance'],
268
+ 'when': 'Queries are slow',
269
+ 'skills': ['mongoose-patterns']
270
+ },
271
+ 'database-seeder': {
272
+ 'triggers': ['seed', 'sample data', 'dev data'],
273
+ 'when': 'Setting up development environment',
274
+ 'skills': ['mongoose-patterns']
275
+ },
276
+ 'data-migration': {
277
+ 'triggers': ['migration', 'schema change', 'data transform'],
278
+ 'when': 'Schema changes are needed',
279
+ 'skills': ['mongoose-patterns']
280
+ }
281
+ }
83
282
  },
84
- 'tester': {
85
- 'description': 'Creates unit tests (Vitest) and E2E tests (Playwright)',
86
- 'triggers': ['test', 'coverage', 'spec', 'e2e'],
87
- 'priority': 5,
88
- 'when': 'After any code implementation'
283
+ '06-security': {
284
+ 'description': 'Security auditing and OWASP compliance (CAN VETO)',
285
+ 'agents': {
286
+ 'security-auditor': {
287
+ 'triggers': ['security', 'audit', 'vulnerability'],
288
+ 'when': 'BEFORE committing auth/user/API code',
289
+ 'can_veto': True,
290
+ 'skills': ['security-scan']
291
+ },
292
+ 'owasp-checker': {
293
+ 'triggers': ['owasp', 'top 10', 'security review'],
294
+ 'when': 'BEFORE committing any API or security code',
295
+ 'can_veto': True,
296
+ 'skills': ['security-scan']
297
+ },
298
+ 'input-sanitizer': {
299
+ 'triggers': ['sanitize', 'user input', 'xss'],
300
+ 'when': 'Handling user input',
301
+ 'skills': ['security-scan', 'zod-validation']
302
+ },
303
+ 'auth-session-validator': {
304
+ 'triggers': ['auth', 'session', 'login', 'jwt'],
305
+ 'when': 'Implementing auth or session code',
306
+ 'skills': ['security-scan']
307
+ },
308
+ 'permission-auditor': {
309
+ 'triggers': ['permission', 'authorization', 'access control'],
310
+ 'when': 'Implementing protected routes',
311
+ 'skills': ['security-scan']
312
+ },
313
+ 'sensitive-data-scanner': {
314
+ 'triggers': ['sensitive', 'pii', 'data leak'],
315
+ 'when': 'Implementing API responses or logging',
316
+ 'skills': ['security-scan']
317
+ }
318
+ }
89
319
  },
90
- 'security-auditor': {
91
- 'description': 'Audits security (CAN VETO)',
92
- 'triggers': ['auth', 'session', 'password', 'token', 'api', 'database', 'user data', 'security'],
93
- 'priority': 6,
94
- 'when': 'Code touches auth/, api/, server/, or sensitive data',
95
- 'can_veto': True
320
+ '07-documentation': {
321
+ 'description': 'Documentation and domain knowledge updates',
322
+ 'agents': {
323
+ 'documenter': {
324
+ 'triggers': ['document', 'docs', 'explain code'],
325
+ 'when': 'AFTER any code implementation completes',
326
+ 'skills': ['docs-tracker', 'codebase-knowledge']
327
+ },
328
+ 'domain-updater': {
329
+ 'triggers': ['domain', 'learnings', 'session end'],
330
+ 'when': 'BEFORE commit-manager at session end',
331
+ 'skills': ['codebase-knowledge', 'docs-tracker']
332
+ },
333
+ 'readme-generator': {
334
+ 'triggers': ['readme', 'project docs', 'setup guide'],
335
+ 'when': 'Project structure changes significantly',
336
+ 'skills': ['docs-tracker']
337
+ },
338
+ 'jsdoc-generator': {
339
+ 'triggers': ['jsdoc', 'function docs', 'api docs'],
340
+ 'when': 'Complex functions lack documentation',
341
+ 'skills': ['docs-tracker', 'typescript-strict']
342
+ },
343
+ 'changelog-manager': {
344
+ 'triggers': ['changelog', 'release notes', 'version'],
345
+ 'when': 'BEFORE committing any feature or fix',
346
+ 'skills': ['docs-tracker', 'git-workflow']
347
+ },
348
+ 'api-documenter': {
349
+ 'triggers': ['api docs', 'swagger', 'openapi'],
350
+ 'when': 'AFTER creating or modifying API endpoints',
351
+ 'skills': ['docs-tracker']
352
+ }
353
+ }
96
354
  },
97
- 'quality-checker': {
98
- 'description': 'Runs typecheck, lint, test, build (Husky pre-commit)',
99
- 'triggers': ['check', 'verify', 'validate', 'run tests', 'quality'],
100
- 'priority': 7,
101
- 'when': 'BEFORE any commit - Husky enforces this'
355
+ '08-git': {
356
+ 'description': 'Git workflow and version control',
357
+ 'agents': {
358
+ 'branch-manager': {
359
+ 'triggers': ['branch', 'feature branch', 'fix branch'],
360
+ 'when': 'BEFORE making source changes on main branch',
361
+ 'skills': ['git-workflow']
362
+ },
363
+ 'commit-manager': {
364
+ 'triggers': ['commit', 'push', 'finalize'],
365
+ 'when': 'FINAL AGENT when implementation is complete',
366
+ 'skills': ['git-workflow', 'docs-tracker', 'codebase-knowledge']
367
+ },
368
+ 'pr-creator': {
369
+ 'triggers': ['pr', 'pull request', 'merge'],
370
+ 'when': 'AFTER commit-manager when feature is ready',
371
+ 'skills': ['git-workflow']
372
+ }
373
+ }
102
374
  },
103
- 'final-validator': {
104
- 'description': 'Final validation before commit (CAN VETO)',
105
- 'triggers': ['final', 'commit ready', 'approve'],
106
- 'priority': 8,
107
- 'when': 'Before any commit operation',
108
- 'can_veto': True
375
+ '09-quality': {
376
+ 'description': 'Code quality and review',
377
+ 'agents': {
378
+ 'quality-checker': {
379
+ 'triggers': ['quality', 'typecheck', 'lint', 'build'],
380
+ 'when': 'BEFORE any commit',
381
+ 'skills': ['quality-gate', 'codebase-knowledge']
382
+ },
383
+ 'code-reviewer': {
384
+ 'triggers': ['review', 'pr review', 'code quality'],
385
+ 'when': 'AFTER significant code is written',
386
+ 'skills': ['quality-gate', 'codebase-knowledge']
387
+ }
388
+ }
389
+ },
390
+ '10-research': {
391
+ 'description': 'Web research and best practices (MANDATORY for new features)',
392
+ 'agents': {
393
+ 'research-web': {
394
+ 'triggers': ['search', 'find info', 'look up'],
395
+ 'when': 'BEFORE implementing any new feature or technology',
396
+ 'mandatory_for': ['feature'],
397
+ 'skills': ['research-cache']
398
+ },
399
+ 'research-cache-manager': {
400
+ 'triggers': ['cache', 'cached research', 'previous research'],
401
+ 'when': 'BEFORE any web research',
402
+ 'skills': ['research-cache']
403
+ },
404
+ 'best-practices-finder': {
405
+ 'triggers': ['best practice', 'recommended', 'how should'],
406
+ 'when': 'BEFORE implementing any new pattern',
407
+ 'skills': ['research-cache']
408
+ },
409
+ 'pattern-researcher': {
410
+ 'triggers': ['pattern', 'architecture', 'design decision'],
411
+ 'when': 'Facing architectural decisions',
412
+ 'skills': ['research-cache']
413
+ },
414
+ 'competitor-analyzer': {
415
+ 'triggers': ['competitor', 'similar app', 'how does'],
416
+ 'when': 'Designing UI or features with existing market solutions',
417
+ 'skills': ['research-cache']
418
+ },
419
+ 'tech-evaluator': {
420
+ 'triggers': ['compare', 'evaluate', 'which library'],
421
+ 'when': 'Choosing between technologies',
422
+ 'skills': ['research-cache']
423
+ }
424
+ }
425
+ },
426
+ '11-ui-ux': {
427
+ 'description': 'UI/UX - SEPARATE UIs for mobile/tablet/desktop (NOT just responsive)',
428
+ 'agents': {
429
+ 'ui-mobile': {
430
+ 'triggers': ['mobile', 'touch', '375px'],
431
+ 'when': 'Implementing any UI feature',
432
+ 'skills': ['ui-ux-audit', 'react-patterns', 'tailwind-patterns', 'shadcn-ui']
433
+ },
434
+ 'ui-tablet': {
435
+ 'triggers': ['tablet', 'ipad', '768px'],
436
+ 'when': 'Implementing any UI feature',
437
+ 'skills': ['ui-ux-audit', 'react-patterns', 'tailwind-patterns', 'shadcn-ui']
438
+ },
439
+ 'ui-desktop': {
440
+ 'triggers': ['desktop', 'sidebar', '1280px'],
441
+ 'when': 'Implementing any UI feature',
442
+ 'skills': ['ui-ux-audit', 'react-patterns', 'tailwind-patterns', 'shadcn-ui']
443
+ },
444
+ 'skeleton-generator': {
445
+ 'triggers': ['skeleton', 'loading', 'placeholder'],
446
+ 'when': 'AFTER creating any component that loads data',
447
+ 'skills': ['react-patterns', 'tailwind-patterns']
448
+ },
449
+ 'design-system-enforcer': {
450
+ 'triggers': ['design system', 'consistency', 'component style'],
451
+ 'when': 'AFTER creating UI components',
452
+ 'skills': ['ui-ux-audit', 'shadcn-ui', 'tailwind-patterns']
453
+ },
454
+ 'accessibility-auditor': {
455
+ 'triggers': ['a11y', 'accessibility', 'wcag', 'screen reader'],
456
+ 'when': 'AFTER any UI implementation',
457
+ 'skills': ['ui-ux-audit']
458
+ }
459
+ }
460
+ },
461
+ '12-performance': {
462
+ 'description': 'Performance profiling and optimization',
463
+ 'agents': {
464
+ 'performance-profiler': {
465
+ 'triggers': ['slow', 'performance', 'profile', 'bottleneck'],
466
+ 'when': 'Application is slow',
467
+ 'skills': ['performance-patterns']
468
+ },
469
+ 'memory-leak-detector': {
470
+ 'triggers': ['memory', 'leak', 'heap'],
471
+ 'when': 'Memory issues are suspected',
472
+ 'skills': ['performance-patterns']
473
+ },
474
+ 'bundle-analyzer': {
475
+ 'triggers': ['bundle', 'build size', 'lighthouse'],
476
+ 'when': 'Build is large or slow',
477
+ 'skills': ['performance-patterns']
478
+ },
479
+ 'api-latency-analyzer': {
480
+ 'triggers': ['api slow', 'response time', 'latency'],
481
+ 'when': 'API endpoints are slow',
482
+ 'skills': ['performance-patterns']
483
+ },
484
+ 'query-optimizer': {
485
+ 'triggers': ['slow query', 'n+1', 'database slow'],
486
+ 'when': 'Database queries are slow',
487
+ 'skills': ['performance-patterns', 'mongoose-patterns']
488
+ },
489
+ 'render-optimizer': {
490
+ 'triggers': ['re-render', 'react slow', 'component slow'],
491
+ 'when': 'React components re-render excessively',
492
+ 'skills': ['performance-patterns', 'react-patterns']
493
+ }
494
+ }
109
495
  },
110
- 'commit-manager': {
111
- 'description': 'Creates conventional commits and completes workflow',
112
- 'triggers': ['commit', 'save changes', 'push', 'finalize', 'git'],
113
- 'priority': 10,
114
- 'when': 'FINAL step - after domain-updater, runs complete-task'
496
+ '13-debugging': {
497
+ 'description': 'Error analysis and debugging',
498
+ 'agents': {
499
+ 'debugger': {
500
+ 'triggers': ['bug', 'error', 'not working', 'broken', 'fails'],
501
+ 'when': 'Any bug or error occurs',
502
+ 'skills': ['debugging-patterns']
503
+ },
504
+ 'type-error-resolver': {
505
+ 'triggers': ['ts error', 'type error', 'typecheck fails'],
506
+ 'when': 'On TypeScript type errors',
507
+ 'skills': ['debugging-patterns', 'typescript-strict']
508
+ },
509
+ 'runtime-error-fixer': {
510
+ 'triggers': ['crash', 'exception', 'runtime error'],
511
+ 'when': 'On runtime crashes or exceptions',
512
+ 'skills': ['debugging-patterns']
513
+ },
514
+ 'network-debugger': {
515
+ 'triggers': ['fetch error', 'api error', 'cors', 'network'],
516
+ 'when': 'On network or API errors',
517
+ 'skills': ['debugging-patterns']
518
+ },
519
+ 'error-stack-analyzer': {
520
+ 'triggers': ['stack trace', 'trace', 'call stack'],
521
+ 'when': 'Error includes stack trace',
522
+ 'skills': ['debugging-patterns']
523
+ },
524
+ 'build-error-fixer': {
525
+ 'triggers': ['build failed', 'compile error', 'bundler error'],
526
+ 'when': 'Build fails',
527
+ 'skills': ['debugging-patterns']
528
+ }
529
+ }
115
530
  },
116
- 'domain-updater': {
117
- 'description': 'Updates domain knowledge with session learnings',
118
- 'triggers': ['update domain', 'document learnings', 'session end'],
119
- 'priority': 9,
120
- 'when': 'BEFORE commit-manager - updates domains so git stays clean'
531
+ '14-validation': {
532
+ 'description': 'Final validation before commit (CAN VETO)',
533
+ 'agents': {
534
+ 'final-validator': {
535
+ 'triggers': ['final check', 'validate', 'ready to commit'],
536
+ 'when': 'BEFORE commit-manager - last check',
537
+ 'can_veto': True,
538
+ 'skills': ['final-check']
539
+ }
540
+ }
121
541
  }
122
542
  }
123
543
 
124
- # Workflow sequences (research after analyzer, domain-updater BEFORE commit-manager for clean git)
544
+ # ============================================================================
545
+ # SKILL SYSTEM - 22 Skills Auto-loaded by Agents
546
+ # ============================================================================
547
+
548
+ SKILLS = {
549
+ 'bun-runtime': 'Bun runtime patterns, package management, scripts',
550
+ 'codebase-knowledge': 'Project domain knowledge, file mapping, recent commits',
551
+ 'debugging-patterns': 'Stack traces, runtime errors, build errors, network issues',
552
+ 'docker-patterns': 'Containerization, multi-stage builds, Docker Compose, security',
553
+ 'docs-tracker': 'Documentation maintenance, git diff detection, changelog',
554
+ 'final-check': 'Final validation, tests pass, docs updated, security audited',
555
+ 'git-workflow': 'Branch management, conventional commits, PR creation, hooks',
556
+ 'mongoose-patterns': 'MongoDB schema design, queries, indexes, aggregations',
557
+ 'nextjs-app-router': 'Next.js 15 App Router, Server/Client components, data fetching',
558
+ 'performance-patterns': 'React optimization, bundle analysis, memory leaks, API latency',
559
+ 'playwright-automation': 'E2E tests, browser automation, visual testing, API testing',
560
+ 'quality-gate': 'Quality checks (typecheck, lint, test, build)',
561
+ 'react-patterns': 'React 19 patterns, hooks, state management, performance',
562
+ 'research-cache': 'Cached research findings, best practices by topic',
563
+ 'security-scan': 'OWASP Top 10, user ID validation, sensitive data detection',
564
+ 'shadcn-ui': 'shadcn/ui components, customization, theming, accessibility',
565
+ 'tailwind-patterns': 'Tailwind CSS, responsive design, dark mode, animations',
566
+ 'test-coverage': 'Playwright E2E, Vitest unit tests, coverage tracking',
567
+ 'trpc-api': 'tRPC type-safe APIs, routers, procedures, middleware',
568
+ 'typescript-strict': 'TypeScript strict mode, index access, null checks, generics',
569
+ 'ui-ux-audit': 'UI/UX audits, competitor research, WCAG 2.1, responsiveness',
570
+ 'zod-validation': 'Zod schemas, input validation, type inference, error handling'
571
+ }
572
+
573
+ # Workflow sequences
125
574
  WORKFLOWS = {
126
- 'feature': ['analyzer', 'research', 'ui-ux-reviewer', 'documenter', 'tester', 'security-auditor', 'quality-checker', 'final-validator', 'domain-updater', 'commit-manager'],
127
- 'fix': ['analyzer', 'research', 'tester', 'security-auditor', 'quality-checker', 'final-validator', 'domain-updater', 'commit-manager'],
128
- 'refactor': ['analyzer', 'tester', 'quality-checker', 'final-validator', 'domain-updater', 'commit-manager'],
575
+ 'feature': ['analyzer', 'research-web', 'ui-ux-reviewer', 'documenter', 'tester', 'security-auditor', 'quality-checker', 'final-validator', 'domain-updater', 'commit-manager'],
576
+ 'fix': ['debugger', 'analyzer', 'tester', 'security-auditor', 'quality-checker', 'final-validator', 'domain-updater', 'commit-manager'],
577
+ 'refactor': ['analyzer', 'code-reviewer', 'tester', 'quality-checker', 'final-validator', 'domain-updater', 'commit-manager'],
129
578
  'config': ['quality-checker', 'domain-updater', 'commit-manager']
130
579
  }
131
580
 
@@ -145,9 +594,9 @@ def detect_task_type(prompt: str) -> str:
145
594
  """Detect task type from prompt"""
146
595
  prompt_lower = prompt.lower()
147
596
 
148
- if any(word in prompt_lower for word in ['bug', 'fix', 'error', 'broken', 'not working', 'issue']):
597
+ if any(word in prompt_lower for word in ['bug', 'fix', 'error', 'broken', 'not working', 'issue', 'debug']):
149
598
  return 'fix'
150
- elif any(word in prompt_lower for word in ['refactor', 'restructure', 'reorganize', 'clean up']):
599
+ elif any(word in prompt_lower for word in ['refactor', 'restructure', 'reorganize', 'clean up', 'improve']):
151
600
  return 'refactor'
152
601
  elif any(word in prompt_lower for word in ['config', 'setting', 'env', 'package.json', 'tsconfig']):
153
602
  return 'config'
@@ -155,38 +604,44 @@ def detect_task_type(prompt: str) -> str:
155
604
  return 'feature'
156
605
 
157
606
 
158
- def detect_best_agent(prompt: str) -> tuple[str, str]:
159
- """Detect best agent for the task"""
607
+ def detect_best_agents(prompt: str) -> list[tuple[str, str, str]]:
608
+ """Detect best agents for the task, returns list of (category, agent, reason)"""
160
609
  prompt_lower = prompt.lower()
610
+ matches = []
161
611
 
162
- # Check for multi-step tasks first
163
- multi_step_indicators = ['and then', 'after that', 'also', 'implement', 'build', 'create feature']
164
- if any(indicator in prompt_lower for indicator in multi_step_indicators):
165
- return 'orchestrator', 'Multi-step task detected - orchestrator will coordinate all agents'
612
+ for category, info in AGENT_CATEGORIES.items():
613
+ for agent_name, agent_info in info['agents'].items():
614
+ for trigger in agent_info['triggers']:
615
+ if trigger in prompt_lower:
616
+ matches.append((category, agent_name, f"Matched '{trigger}'"))
617
+ break
166
618
 
167
- # Check each agent's triggers
168
- matches = []
169
- for agent_name, agent_info in AGENTS.items():
170
- for trigger in agent_info['triggers']:
171
- if trigger in prompt_lower:
172
- matches.append((agent_name, agent_info['priority'], trigger))
619
+ # Sort by category number (priority)
620
+ matches.sort(key=lambda x: x[0])
621
+
622
+ # Return top 3 matches or orchestrator if none
623
+ if not matches:
624
+ return [('01-orchestration', 'orchestrator', 'No specific trigger - orchestrator will analyze')]
625
+
626
+ return matches[:3]
173
627
 
174
- if matches:
175
- # Sort by priority (lower is better)
176
- matches.sort(key=lambda x: x[1])
177
- best = matches[0]
178
- return best[0], f"Matched trigger '{best[2]}'"
179
628
 
180
- # Default to orchestrator for unknown tasks
181
- return 'orchestrator', 'No specific trigger matched - orchestrator will analyze'
629
+ def format_agent_categories() -> str:
630
+ """Format all agent categories for display"""
631
+ lines = []
632
+ for category, info in sorted(AGENT_CATEGORIES.items()):
633
+ agent_count = len(info['agents'])
634
+ veto_agents = [name for name, a in info['agents'].items() if a.get('can_veto')]
635
+ veto_str = f" [VETO: {', '.join(veto_agents)}]" if veto_agents else ""
636
+ lines.append(f" {category}: {info['description']} ({agent_count} agents){veto_str}")
637
+ return '\n'.join(lines)
182
638
 
183
639
 
184
- def format_agent_list() -> str:
185
- """Format agent list for display"""
640
+ def format_skills() -> str:
641
+ """Format all skills for display"""
186
642
  lines = []
187
- for name, info in sorted(AGENTS.items(), key=lambda x: x[1]['priority']):
188
- veto = ' [CAN VETO]' if info.get('can_veto') else ''
189
- lines.append(f" - {name}: {info['description']}{veto}")
643
+ for name, description in sorted(SKILLS.items()):
644
+ lines.append(f" {name}: {description}")
190
645
  return '\n'.join(lines)
191
646
 
192
647
 
@@ -217,19 +672,23 @@ def main():
217
672
  except json.JSONDecodeError:
218
673
  hook_input = {}
219
674
 
220
- # Get user prompt (may not be available in all hook contexts)
675
+ # Get user prompt
221
676
  prompt = hook_input.get('user_prompt', hook_input.get('prompt', ''))
222
677
 
223
678
  # Load current state
224
679
  state = load_workflow_state()
225
680
 
226
- # Detect task type and best agent
681
+ # Detect task type and best agents
227
682
  task_type = detect_task_type(prompt) if prompt else 'unknown'
228
- best_agent, reason = detect_best_agent(prompt) if prompt else ('orchestrator', 'Default')
683
+ best_agents = detect_best_agents(prompt) if prompt else [('01-orchestration', 'orchestrator', 'Default')]
229
684
 
230
- # Check if task is new feature (requires research)
231
- is_new_feature = task_type in ['feature'] or any(word in prompt.lower() for word in ['new', 'implement', 'create', 'add'])
685
+ # Check task characteristics
686
+ is_new_feature = task_type == 'feature' or any(word in prompt.lower() for word in ['new', 'implement', 'create', 'add'])
232
687
  is_ui_task = any(word in prompt.lower() for word in ['ui', 'component', 'page', 'design', 'layout', 'mobile', 'desktop', 'tablet'])
688
+ is_debug_task = any(word in prompt.lower() for word in ['bug', 'error', 'broken', 'not working', 'debug', 'fix'])
689
+
690
+ # Format recommended agents
691
+ recommended_str = '\n'.join([f" {i+1}. {cat}/{agent} - {reason}" for i, (cat, agent, reason) in enumerate(best_agents)])
233
692
 
234
693
  # Build output message
235
694
  output = f"""
@@ -240,6 +699,7 @@ STRICT WORKFLOW ENFORCEMENT - UserPromptSubmit Hook
240
699
 
241
700
  {"⚠️ NEW FEATURE DETECTED - RESEARCH AGENT IS MANDATORY!" if is_new_feature else ""}
242
701
  {"⚠️ UI TASK DETECTED - SEPARATE UIs FOR MOBILE/TABLET/DESKTOP REQUIRED!" if is_ui_task else ""}
702
+ {"🐛 DEBUG TASK DETECTED - Use debugger or type-error-resolver agents" if is_debug_task else ""}
243
703
 
244
704
  ================================================================================
245
705
  STEP 1: CREATE DETAILED TODO LIST (MANDATORY)
@@ -248,36 +708,31 @@ STEP 1: CREATE DETAILED TODO LIST (MANDATORY)
248
708
  BEFORE doing anything, you MUST use TodoWrite to create a detailed todo list.
249
709
  Break down the user's prompt into specific, actionable items.
250
710
 
251
- Example:
252
- User prompt: "Add login feature"
253
- Todo list:
254
- 1. Research login best practices 2024-2025
255
- 2. Check existing auth documentation
256
- 3. Create feature/login branch
257
- 4. Implement login form (mobile UI)
258
- 5. Implement login form (tablet UI)
259
- 6. Implement login form (desktop UI)
260
- 7. Add validation with visual feedback
261
- 8. Create unit tests
262
- 9. Create E2E tests
263
- 10. Document implementation with commit hash
264
- 11. Run quality gates
265
- 12. Create PR to main
266
-
267
711
  ================================================================================
268
- AVAILABLE AGENTS:
269
- {format_agent_list()}
712
+ AGENT SYSTEM: 82 Specialized Agents in 14 Categories
713
+ ================================================================================
714
+
715
+ CATEGORIES:
716
+ {format_agent_categories()}
270
717
 
271
718
  TASK ANALYSIS:
272
719
  Detected type: {task_type}
273
- Recommended agent: {best_agent}
274
- Reason: {reason}
720
+ Recommended agents:
721
+ {recommended_str}
275
722
  Research required: {"YES (MANDATORY)" if is_new_feature else "Optional"}
276
723
  Separate UIs required: {"YES (MANDATORY)" if is_ui_task else "N/A"}
277
724
  Workflow sequence: {' -> '.join(WORKFLOWS.get(task_type, WORKFLOWS['feature']))}
278
725
 
279
726
  {format_workflow_status(state)}
280
727
 
728
+ ================================================================================
729
+ SKILL SYSTEM: 22 Skills Auto-loaded by Agents
730
+ ================================================================================
731
+
732
+ {format_skills()}
733
+
734
+ Skills are auto-loaded when an agent starts. Agents don't inherit parent skills.
735
+
281
736
  ================================================================================
282
737
  UI ARCHITECTURE RULES (MANDATORY FOR WEB APPS)
283
738
  ================================================================================
@@ -301,12 +756,6 @@ DESKTOP (1280px+):
301
756
  - Top navbar: centered Levenshtein search
302
757
  - High information density
303
758
 
304
- SHARED:
305
- - Featured carousel section
306
- - Hidden scrollbars (but scroll works)
307
- - Scroll indicators (arrows)
308
- - Framer Motion transitions
309
-
310
759
  ================================================================================
311
760
  INPUT VALIDATION RULES (ALL INPUTS)
312
761
  ================================================================================
@@ -341,17 +790,9 @@ AGENT INVOCATION (VIA TASK TOOL ONLY)
341
790
  You MUST use the Task tool with subagent_type to invoke agents.
342
791
  DO NOT execute agent logic manually - INVOKE the agent properly.
343
792
 
344
- AGENTS INVOCABLE VIA TASK TOOL:
345
- - research: Task(subagent_type="research", prompt="...") {"<-- MANDATORY FOR THIS TASK" if is_new_feature else ""}
346
- - analyzer: Task(subagent_type="analyzer", prompt="...")
347
- - ui-ux-reviewer: Task(subagent_type="ui-ux-reviewer", prompt="...") {"<-- MANDATORY FOR THIS TASK" if is_ui_task else ""}
348
- - tester: Task(subagent_type="tester", prompt="...")
349
- - security-auditor: Task(subagent_type="security-auditor", prompt="...")
350
- - quality-checker: Task(subagent_type="quality-checker", prompt="...")
351
- - final-validator: Task(subagent_type="final-validator", prompt="...")
352
- - documenter: Task(subagent_type="documenter", prompt="...")
353
- - commit-manager: Task(subagent_type="commit-manager", prompt="...")
354
- - orchestrator: Task(subagent_type="orchestrator", prompt="...")
793
+ Example:
794
+ Task(subagent_type="debugger", prompt="Fix the TypeError in user.ts")
795
+ Task(subagent_type="playwright-e2e", prompt="Create E2E tests for login")
355
796
 
356
797
  ================================================================================
357
798
  MANDATORY RULES CHECKLIST:
@@ -368,42 +809,6 @@ MANDATORY RULES CHECKLIST:
368
809
  [ ] 9. I WILL create PR to main with doc references
369
810
  [ ] 10. I WILL use Task tool to invoke agents (NOT manually)
370
811
 
371
- ================================================================================
372
- COMPONENT DESIGN RULES (SELF-AWARE RESPONSIVE):
373
- ================================================================================
374
-
375
- Components CAN be responsive internally (detect their own device type).
376
- But layouts MUST be separate for each platform.
377
-
378
- CARD COMPONENTS:
379
- - NO BORDERS - Use shadows and backgrounds instead
380
- - Use useDeviceType() hook for self-awareness
381
- - Adapt padding/layout based on device
382
- - Desktop: hover effects (scale, shadow)
383
- - Mobile: touch-optimized (44px targets)
384
-
385
- ```typescript
386
- // GOOD - Self-aware component
387
- const device = useDeviceType();
388
- <div className={{cn(
389
- 'rounded-2xl shadow-lg', // NO borders
390
- device === 'mobile' ? 'p-4' : 'p-6 hover:scale-[1.02]'
391
- )}} />
392
- ```
393
-
394
- ================================================================================
395
- END OF WORKFLOW MANDATORY:
396
- ================================================================================
397
-
398
- After completing any task, you MUST:
399
-
400
- 1. Run commit-manager agent via Task tool
401
- 2. Commit all changes with conventional commit format
402
- 3. Create PR to main if on feature/fix branch
403
- 4. NEVER leave uncommitted changes
404
-
405
- This is MANDATORY - workflow is NOT complete until committed.
406
-
407
812
  ================================================================================
408
813
  """
409
814