@musashishao/agent-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
  2. package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
  3. package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
  4. package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
  5. package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
  6. package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
  7. package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
  8. package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  9. package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  10. package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  11. package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  12. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  13. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  14. package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  15. package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
  16. package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  17. package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  18. package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  19. package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  20. package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
  21. package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
  22. package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  23. package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  24. package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
  25. package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
  26. package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +487 -0
  27. package/.agent/.shared/ui-ux-pro-max/scripts/search.py +76 -0
  28. package/.agent/ARCHITECTURE.md +225 -0
  29. package/.agent/CONTEXT.md +229 -0
  30. package/.agent/FEATURE_ROADMAP.md +435 -0
  31. package/.agent/PROMPT_TEMPLATES.md +261 -0
  32. package/.agent/agents/backend-specialist.md +263 -0
  33. package/.agent/agents/database-architect.md +226 -0
  34. package/.agent/agents/debugger.md +225 -0
  35. package/.agent/agents/devops-engineer.md +242 -0
  36. package/.agent/agents/documentation-writer.md +104 -0
  37. package/.agent/agents/explorer-agent.md +73 -0
  38. package/.agent/agents/frontend-specialist.md +556 -0
  39. package/.agent/agents/game-developer.md +162 -0
  40. package/.agent/agents/mobile-developer.md +377 -0
  41. package/.agent/agents/orchestrator.md +416 -0
  42. package/.agent/agents/penetration-tester.md +188 -0
  43. package/.agent/agents/performance-optimizer.md +187 -0
  44. package/.agent/agents/project-planner.md +403 -0
  45. package/.agent/agents/security-auditor.md +170 -0
  46. package/.agent/agents/seo-specialist.md +111 -0
  47. package/.agent/agents/test-engineer.md +158 -0
  48. package/.agent/rules/GEMINI.md +251 -0
  49. package/.agent/skills/api-patterns/SKILL.md +81 -0
  50. package/.agent/skills/api-patterns/api-style.md +42 -0
  51. package/.agent/skills/api-patterns/auth.md +24 -0
  52. package/.agent/skills/api-patterns/documentation.md +26 -0
  53. package/.agent/skills/api-patterns/graphql.md +41 -0
  54. package/.agent/skills/api-patterns/rate-limiting.md +31 -0
  55. package/.agent/skills/api-patterns/response.md +37 -0
  56. package/.agent/skills/api-patterns/rest.md +40 -0
  57. package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  58. package/.agent/skills/api-patterns/security-testing.md +122 -0
  59. package/.agent/skills/api-patterns/trpc.md +41 -0
  60. package/.agent/skills/api-patterns/versioning.md +22 -0
  61. package/.agent/skills/app-builder/SKILL.md +75 -0
  62. package/.agent/skills/app-builder/agent-coordination.md +71 -0
  63. package/.agent/skills/app-builder/feature-building.md +53 -0
  64. package/.agent/skills/app-builder/project-detection.md +34 -0
  65. package/.agent/skills/app-builder/scaffolding.md +118 -0
  66. package/.agent/skills/app-builder/tech-stack.md +40 -0
  67. package/.agent/skills/app-builder/templates/SKILL.md +39 -0
  68. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  69. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  70. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  71. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  72. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  73. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  74. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  75. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
  76. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
  77. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
  78. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
  79. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  80. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
  81. package/.agent/skills/architecture/SKILL.md +55 -0
  82. package/.agent/skills/architecture/context-discovery.md +43 -0
  83. package/.agent/skills/architecture/examples.md +94 -0
  84. package/.agent/skills/architecture/pattern-selection.md +68 -0
  85. package/.agent/skills/architecture/patterns-reference.md +50 -0
  86. package/.agent/skills/architecture/trade-off-analysis.md +77 -0
  87. package/.agent/skills/bash-linux/SKILL.md +199 -0
  88. package/.agent/skills/behavioral-modes/SKILL.md +242 -0
  89. package/.agent/skills/brainstorming/SKILL.md +163 -0
  90. package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  91. package/.agent/skills/clean-code/SKILL.md +201 -0
  92. package/.agent/skills/code-review-checklist/SKILL.md +109 -0
  93. package/.agent/skills/database-design/SKILL.md +52 -0
  94. package/.agent/skills/database-design/database-selection.md +43 -0
  95. package/.agent/skills/database-design/indexing.md +39 -0
  96. package/.agent/skills/database-design/migrations.md +48 -0
  97. package/.agent/skills/database-design/optimization.md +36 -0
  98. package/.agent/skills/database-design/orm-selection.md +30 -0
  99. package/.agent/skills/database-design/schema-design.md +56 -0
  100. package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  101. package/.agent/skills/deployment-procedures/SKILL.md +241 -0
  102. package/.agent/skills/doc.md +177 -0
  103. package/.agent/skills/docker-expert/SKILL.md +409 -0
  104. package/.agent/skills/documentation-templates/SKILL.md +194 -0
  105. package/.agent/skills/frontend-design/SKILL.md +396 -0
  106. package/.agent/skills/frontend-design/animation-guide.md +331 -0
  107. package/.agent/skills/frontend-design/color-system.md +311 -0
  108. package/.agent/skills/frontend-design/decision-trees.md +418 -0
  109. package/.agent/skills/frontend-design/motion-graphics.md +306 -0
  110. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  111. package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  112. package/.agent/skills/frontend-design/typography-system.md +345 -0
  113. package/.agent/skills/frontend-design/ux-psychology.md +541 -0
  114. package/.agent/skills/frontend-design/visual-effects.md +383 -0
  115. package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  116. package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  117. package/.agent/skills/game-development/SKILL.md +167 -0
  118. package/.agent/skills/game-development/game-art/SKILL.md +185 -0
  119. package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  120. package/.agent/skills/game-development/game-design/SKILL.md +129 -0
  121. package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  122. package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  123. package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  124. package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  125. package/.agent/skills/game-development/web-games/SKILL.md +150 -0
  126. package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  127. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  128. package/.agent/skills/i18n-localization/SKILL.md +154 -0
  129. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  130. package/.agent/skills/lint-and-validate/SKILL.md +45 -0
  131. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
  132. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  133. package/.agent/skills/mcp-builder/SKILL.md +176 -0
  134. package/.agent/skills/mobile-design/SKILL.md +394 -0
  135. package/.agent/skills/mobile-design/decision-trees.md +516 -0
  136. package/.agent/skills/mobile-design/mobile-backend.md +491 -0
  137. package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  138. package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  139. package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  140. package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  141. package/.agent/skills/mobile-design/mobile-performance.md +767 -0
  142. package/.agent/skills/mobile-design/mobile-testing.md +356 -0
  143. package/.agent/skills/mobile-design/mobile-typography.md +433 -0
  144. package/.agent/skills/mobile-design/platform-android.md +666 -0
  145. package/.agent/skills/mobile-design/platform-ios.md +561 -0
  146. package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  147. package/.agent/skills/mobile-design/touch-psychology.md +537 -0
  148. package/.agent/skills/nestjs-expert/SKILL.md +552 -0
  149. package/.agent/skills/nextjs-best-practices/SKILL.md +203 -0
  150. package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  151. package/.agent/skills/parallel-agents/SKILL.md +175 -0
  152. package/.agent/skills/performance-profiling/SKILL.md +143 -0
  153. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  154. package/.agent/skills/plan-writing/SKILL.md +152 -0
  155. package/.agent/skills/powershell-windows/SKILL.md +167 -0
  156. package/.agent/skills/prisma-expert/SKILL.md +355 -0
  157. package/.agent/skills/python-patterns/SKILL.md +441 -0
  158. package/.agent/skills/react-patterns/SKILL.md +198 -0
  159. package/.agent/skills/red-team-tactics/SKILL.md +199 -0
  160. package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
  161. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  162. package/.agent/skills/server-management/SKILL.md +161 -0
  163. package/.agent/skills/systematic-debugging/SKILL.md +109 -0
  164. package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  165. package/.agent/skills/tdd-workflow/SKILL.md +149 -0
  166. package/.agent/skills/testing-patterns/SKILL.md +178 -0
  167. package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  168. package/.agent/skills/typescript-expert/SKILL.md +429 -0
  169. package/.agent/skills/typescript-expert/references/tsconfig-strict.json +92 -0
  170. package/.agent/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
  171. package/.agent/skills/typescript-expert/references/utility-types.ts +335 -0
  172. package/.agent/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
  173. package/.agent/skills/ui-ux-pro-max/SKILL.md +351 -0
  174. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  175. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  176. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  177. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  178. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  179. package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  180. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  181. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  182. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  183. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  184. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  185. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  186. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  187. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  188. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  189. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  190. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  191. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  192. package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
  193. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  194. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  195. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  196. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  197. package/.agent/skills/ui-ux-pro-max/scripts/core.py +257 -0
  198. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +487 -0
  199. package/.agent/skills/ui-ux-pro-max/scripts/search.py +76 -0
  200. package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  201. package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  202. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  203. package/.agent/skills/webapp-testing/SKILL.md +187 -0
  204. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  205. package/.agent/workflows/brainstorm.md +113 -0
  206. package/.agent/workflows/create.md +59 -0
  207. package/.agent/workflows/debug.md +103 -0
  208. package/.agent/workflows/deploy.md +176 -0
  209. package/.agent/workflows/enhance.md +63 -0
  210. package/.agent/workflows/orchestrate.md +237 -0
  211. package/.agent/workflows/plan.md +89 -0
  212. package/.agent/workflows/preview.md +80 -0
  213. package/.agent/workflows/status.md +86 -0
  214. package/.agent/workflows/test.md +144 -0
  215. package/.agent/workflows/ui-ux-pro-max.md +231 -0
  216. package/LICENSE +21 -0
  217. package/README.md +101 -0
  218. package/bin/cli.js +235 -0
  219. package/index.js +1 -0
  220. package/package.json +43 -0
@@ -0,0 +1,203 @@
1
+ ---
2
+ name: nextjs-best-practices
3
+ description: Next.js App Router principles. Server Components, data fetching, routing patterns.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ ---
6
+
7
+ # Next.js Best Practices
8
+
9
+ > Principles for Next.js App Router development.
10
+
11
+ ---
12
+
13
+ ## 1. Server vs Client Components
14
+
15
+ ### Decision Tree
16
+
17
+ ```
18
+ Does it need...?
19
+
20
+ ├── useState, useEffect, event handlers
21
+ │ └── Client Component ('use client')
22
+
23
+ ├── Direct data fetching, no interactivity
24
+ │ └── Server Component (default)
25
+
26
+ └── Both?
27
+ └── Split: Server parent + Client child
28
+ ```
29
+
30
+ ### By Default
31
+
32
+ | Type | Use |
33
+ |------|-----|
34
+ | **Server** | Data fetching, layout, static content |
35
+ | **Client** | Forms, buttons, interactive UI |
36
+
37
+ ---
38
+
39
+ ## 2. Data Fetching Patterns
40
+
41
+ ### Fetch Strategy
42
+
43
+ | Pattern | Use |
44
+ |---------|-----|
45
+ | **Default** | Static (cached at build) |
46
+ | **Revalidate** | ISR (time-based refresh) |
47
+ | **No-store** | Dynamic (every request) |
48
+
49
+ ### Data Flow
50
+
51
+ | Source | Pattern |
52
+ |--------|---------|
53
+ | Database | Server Component fetch |
54
+ | API | fetch with caching |
55
+ | User input | Client state + server action |
56
+
57
+ ---
58
+
59
+ ## 3. Routing Principles
60
+
61
+ ### File Conventions
62
+
63
+ | File | Purpose |
64
+ |------|---------|
65
+ | `page.tsx` | Route UI |
66
+ | `layout.tsx` | Shared layout |
67
+ | `loading.tsx` | Loading state |
68
+ | `error.tsx` | Error boundary |
69
+ | `not-found.tsx` | 404 page |
70
+
71
+ ### Route Organization
72
+
73
+ | Pattern | Use |
74
+ |---------|-----|
75
+ | Route groups `(name)` | Organize without URL |
76
+ | Parallel routes `@slot` | Multiple same-level pages |
77
+ | Intercepting `(.)` | Modal overlays |
78
+
79
+ ---
80
+
81
+ ## 4. API Routes
82
+
83
+ ### Route Handlers
84
+
85
+ | Method | Use |
86
+ |--------|-----|
87
+ | GET | Read data |
88
+ | POST | Create data |
89
+ | PUT/PATCH | Update data |
90
+ | DELETE | Remove data |
91
+
92
+ ### Best Practices
93
+
94
+ - Validate input with Zod
95
+ - Return proper status codes
96
+ - Handle errors gracefully
97
+ - Use Edge runtime when possible
98
+
99
+ ---
100
+
101
+ ## 5. Performance Principles
102
+
103
+ ### Image Optimization
104
+
105
+ - Use next/image component
106
+ - Set priority for above-fold
107
+ - Provide blur placeholder
108
+ - Use responsive sizes
109
+
110
+ ### Bundle Optimization
111
+
112
+ - Dynamic imports for heavy components
113
+ - Route-based code splitting (automatic)
114
+ - Analyze with bundle analyzer
115
+
116
+ ---
117
+
118
+ ## 6. Metadata
119
+
120
+ ### Static vs Dynamic
121
+
122
+ | Type | Use |
123
+ |------|-----|
124
+ | Static export | Fixed metadata |
125
+ | generateMetadata | Dynamic per-route |
126
+
127
+ ### Essential Tags
128
+
129
+ - title (50-60 chars)
130
+ - description (150-160 chars)
131
+ - Open Graph images
132
+ - Canonical URL
133
+
134
+ ---
135
+
136
+ ## 7. Caching Strategy
137
+
138
+ ### Cache Layers
139
+
140
+ | Layer | Control |
141
+ |-------|---------|
142
+ | Request | fetch options |
143
+ | Data | revalidate/tags |
144
+ | Full route | route config |
145
+
146
+ ### Revalidation
147
+
148
+ | Method | Use |
149
+ |--------|-----|
150
+ | Time-based | `revalidate: 60` |
151
+ | On-demand | `revalidatePath/Tag` |
152
+ | No cache | `no-store` |
153
+
154
+ ---
155
+
156
+ ## 8. Server Actions
157
+
158
+ ### Use Cases
159
+
160
+ - Form submissions
161
+ - Data mutations
162
+ - Revalidation triggers
163
+
164
+ ### Best Practices
165
+
166
+ - Mark with 'use server'
167
+ - Validate all inputs
168
+ - Return typed responses
169
+ - Handle errors
170
+
171
+ ---
172
+
173
+ ## 9. Anti-Patterns
174
+
175
+ | ❌ Don't | ✅ Do |
176
+ |----------|-------|
177
+ | 'use client' everywhere | Server by default |
178
+ | Fetch in client components | Fetch in server |
179
+ | Skip loading states | Use loading.tsx |
180
+ | Ignore error boundaries | Use error.tsx |
181
+ | Large client bundles | Dynamic imports |
182
+
183
+ ---
184
+
185
+ ## 10. Project Structure
186
+
187
+ ```
188
+ app/
189
+ ├── (marketing)/ # Route group
190
+ │ └── page.tsx
191
+ ├── (dashboard)/
192
+ │ ├── layout.tsx # Dashboard layout
193
+ │ └── page.tsx
194
+ ├── api/
195
+ │ └── [resource]/
196
+ │ └── route.ts
197
+ └── components/
198
+ └── ui/
199
+ ```
200
+
201
+ ---
202
+
203
+ > **Remember:** Server Components are the default for a reason. Start there, add client only when needed.
@@ -0,0 +1,333 @@
1
+ ---
2
+ name: nodejs-best-practices
3
+ description: Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ ---
6
+
7
+ # Node.js Best Practices
8
+
9
+ > Principles and decision-making for Node.js development in 2025.
10
+ > **Learn to THINK, not memorize code patterns.**
11
+
12
+ ---
13
+
14
+ ## ⚠️ How to Use This Skill
15
+
16
+ This skill teaches **decision-making principles**, not fixed code to copy.
17
+
18
+ - ASK user for preferences when unclear
19
+ - Choose framework/pattern based on CONTEXT
20
+ - Don't default to same solution every time
21
+
22
+ ---
23
+
24
+ ## 1. Framework Selection (2025)
25
+
26
+ ### Decision Tree
27
+
28
+ ```
29
+ What are you building?
30
+
31
+ ├── Edge/Serverless (Cloudflare, Vercel)
32
+ │ └── Hono (zero-dependency, ultra-fast cold starts)
33
+
34
+ ├── High Performance API
35
+ │ └── Fastify (2-3x faster than Express)
36
+
37
+ ├── Enterprise/Team familiarity
38
+ │ └── NestJS (structured, DI, decorators)
39
+
40
+ ├── Legacy/Stable/Maximum ecosystem
41
+ │ └── Express (mature, most middleware)
42
+
43
+ └── Full-stack with frontend
44
+ └── Next.js API Routes or tRPC
45
+ ```
46
+
47
+ ### Comparison Principles
48
+
49
+ | Factor | Hono | Fastify | Express |
50
+ |--------|------|---------|---------|
51
+ | **Best for** | Edge, serverless | Performance | Legacy, learning |
52
+ | **Cold start** | Fastest | Fast | Moderate |
53
+ | **Ecosystem** | Growing | Good | Largest |
54
+ | **TypeScript** | Native | Excellent | Good |
55
+ | **Learning curve** | Low | Medium | Low |
56
+
57
+ ### Selection Questions to Ask:
58
+ 1. What's the deployment target?
59
+ 2. Is cold start time critical?
60
+ 3. Does team have existing experience?
61
+ 4. Is there legacy code to maintain?
62
+
63
+ ---
64
+
65
+ ## 2. Runtime Considerations (2025)
66
+
67
+ ### Native TypeScript
68
+
69
+ ```
70
+ Node.js 22+: --experimental-strip-types
71
+ ├── Run .ts files directly
72
+ ├── No build step needed for simple projects
73
+ └── Consider for: scripts, simple APIs
74
+ ```
75
+
76
+ ### Module System Decision
77
+
78
+ ```
79
+ ESM (import/export)
80
+ ├── Modern standard
81
+ ├── Better tree-shaking
82
+ ├── Async module loading
83
+ └── Use for: new projects
84
+
85
+ CommonJS (require)
86
+ ├── Legacy compatibility
87
+ ├── More npm packages support
88
+ └── Use for: existing codebases, some edge cases
89
+ ```
90
+
91
+ ### Runtime Selection
92
+
93
+ | Runtime | Best For |
94
+ |---------|----------|
95
+ | **Node.js** | General purpose, largest ecosystem |
96
+ | **Bun** | Performance, built-in bundler |
97
+ | **Deno** | Security-first, built-in TypeScript |
98
+
99
+ ---
100
+
101
+ ## 3. Architecture Principles
102
+
103
+ ### Layered Structure Concept
104
+
105
+ ```
106
+ Request Flow:
107
+
108
+ ├── Controller/Route Layer
109
+ │ ├── Handles HTTP specifics
110
+ │ ├── Input validation at boundary
111
+ │ └── Calls service layer
112
+
113
+ ├── Service Layer
114
+ │ ├── Business logic
115
+ │ ├── Framework-agnostic
116
+ │ └── Calls repository layer
117
+
118
+ └── Repository Layer
119
+ ├── Data access only
120
+ ├── Database queries
121
+ └── ORM interactions
122
+ ```
123
+
124
+ ### Why This Matters:
125
+ - **Testability**: Mock layers independently
126
+ - **Flexibility**: Swap database without touching business logic
127
+ - **Clarity**: Each layer has single responsibility
128
+
129
+ ### When to Simplify:
130
+ - Small scripts → Single file OK
131
+ - Prototypes → Less structure acceptable
132
+ - Always ask: "Will this grow?"
133
+
134
+ ---
135
+
136
+ ## 4. Error Handling Principles
137
+
138
+ ### Centralized Error Handling
139
+
140
+ ```
141
+ Pattern:
142
+ ├── Create custom error classes
143
+ ├── Throw from any layer
144
+ ├── Catch at top level (middleware)
145
+ └── Format consistent response
146
+ ```
147
+
148
+ ### Error Response Philosophy
149
+
150
+ ```
151
+ Client gets:
152
+ ├── Appropriate HTTP status
153
+ ├── Error code for programmatic handling
154
+ ├── User-friendly message
155
+ └── NO internal details (security!)
156
+
157
+ Logs get:
158
+ ├── Full stack trace
159
+ ├── Request context
160
+ ├── User ID (if applicable)
161
+ └── Timestamp
162
+ ```
163
+
164
+ ### Status Code Selection
165
+
166
+ | Situation | Status | When |
167
+ |-----------|--------|------|
168
+ | Bad input | 400 | Client sent invalid data |
169
+ | No auth | 401 | Missing or invalid credentials |
170
+ | No permission | 403 | Valid auth, but not allowed |
171
+ | Not found | 404 | Resource doesn't exist |
172
+ | Conflict | 409 | Duplicate or state conflict |
173
+ | Validation | 422 | Schema valid but business rules fail |
174
+ | Server error | 500 | Our fault, log everything |
175
+
176
+ ---
177
+
178
+ ## 5. Async Patterns Principles
179
+
180
+ ### When to Use Each
181
+
182
+ | Pattern | Use When |
183
+ |---------|----------|
184
+ | `async/await` | Sequential async operations |
185
+ | `Promise.all` | Parallel independent operations |
186
+ | `Promise.allSettled` | Parallel where some can fail |
187
+ | `Promise.race` | Timeout or first response wins |
188
+
189
+ ### Event Loop Awareness
190
+
191
+ ```
192
+ I/O-bound (async helps):
193
+ ├── Database queries
194
+ ├── HTTP requests
195
+ ├── File system
196
+ └── Network operations
197
+
198
+ CPU-bound (async doesn't help):
199
+ ├── Crypto operations
200
+ ├── Image processing
201
+ ├── Complex calculations
202
+ └── → Use worker threads or offload
203
+ ```
204
+
205
+ ### Avoiding Event Loop Blocking
206
+
207
+ - Never use sync methods in production (fs.readFileSync, etc.)
208
+ - Offload CPU-intensive work
209
+ - Use streaming for large data
210
+
211
+ ---
212
+
213
+ ## 6. Validation Principles
214
+
215
+ ### Validate at Boundaries
216
+
217
+ ```
218
+ Where to validate:
219
+ ├── API entry point (request body/params)
220
+ ├── Before database operations
221
+ ├── External data (API responses, file uploads)
222
+ └── Environment variables (startup)
223
+ ```
224
+
225
+ ### Validation Library Selection
226
+
227
+ | Library | Best For |
228
+ |---------|----------|
229
+ | **Zod** | TypeScript first, inference |
230
+ | **Valibot** | Smaller bundle (tree-shakeable) |
231
+ | **ArkType** | Performance critical |
232
+ | **Yup** | Existing React Form usage |
233
+
234
+ ### Validation Philosophy
235
+
236
+ - Fail fast: Validate early
237
+ - Be specific: Clear error messages
238
+ - Don't trust: Even "internal" data
239
+
240
+ ---
241
+
242
+ ## 7. Security Principles
243
+
244
+ ### Security Checklist (Not Code)
245
+
246
+ - [ ] **Input validation**: All inputs validated
247
+ - [ ] **Parameterized queries**: No string concatenation for SQL
248
+ - [ ] **Password hashing**: bcrypt or argon2
249
+ - [ ] **JWT verification**: Always verify signature and expiry
250
+ - [ ] **Rate limiting**: Protect from abuse
251
+ - [ ] **Security headers**: Helmet.js or equivalent
252
+ - [ ] **HTTPS**: Everywhere in production
253
+ - [ ] **CORS**: Properly configured
254
+ - [ ] **Secrets**: Environment variables only
255
+ - [ ] **Dependencies**: Regularly audited
256
+
257
+ ### Security Mindset
258
+
259
+ ```
260
+ Trust nothing:
261
+ ├── Query params → validate
262
+ ├── Request body → validate
263
+ ├── Headers → verify
264
+ ├── Cookies → validate
265
+ ├── File uploads → scan
266
+ └── External APIs → validate response
267
+ ```
268
+
269
+ ---
270
+
271
+ ## 8. Testing Principles
272
+
273
+ ### Test Strategy Selection
274
+
275
+ | Type | Purpose | Tools |
276
+ |------|---------|-------|
277
+ | **Unit** | Business logic | node:test, Vitest |
278
+ | **Integration** | API endpoints | Supertest |
279
+ | **E2E** | Full flows | Playwright |
280
+
281
+ ### What to Test (Priorities)
282
+
283
+ 1. **Critical paths**: Auth, payments, core business
284
+ 2. **Edge cases**: Empty inputs, boundaries
285
+ 3. **Error handling**: What happens when things fail?
286
+ 4. **Not worth testing**: Framework code, trivial getters
287
+
288
+ ### Built-in Test Runner (Node.js 22+)
289
+
290
+ ```
291
+ node --test src/**/*.test.ts
292
+ ├── No external dependency
293
+ ├── Good coverage reporting
294
+ └── Watch mode available
295
+ ```
296
+
297
+ ---
298
+
299
+ ## 10. Anti-Patterns to Avoid
300
+
301
+ ### ❌ DON'T:
302
+ - Use Express for new edge projects (use Hono)
303
+ - Use sync methods in production code
304
+ - Put business logic in controllers
305
+ - Skip input validation
306
+ - Hardcode secrets
307
+ - Trust external data without validation
308
+ - Block event loop with CPU work
309
+
310
+ ### ✅ DO:
311
+ - Choose framework based on context
312
+ - Ask user for preferences when unclear
313
+ - Use layered architecture for growing projects
314
+ - Validate all inputs
315
+ - Use environment variables for secrets
316
+ - Profile before optimizing
317
+
318
+ ---
319
+
320
+ ## 11. Decision Checklist
321
+
322
+ Before implementing:
323
+
324
+ - [ ] **Asked user about stack preference?**
325
+ - [ ] **Chosen framework for THIS context?** (not just default)
326
+ - [ ] **Considered deployment target?**
327
+ - [ ] **Planned error handling strategy?**
328
+ - [ ] **Identified validation points?**
329
+ - [ ] **Considered security requirements?**
330
+
331
+ ---
332
+
333
+ > **Remember**: Node.js best practices are about decision-making, not memorizing patterns. Every project deserves fresh consideration based on its requirements.
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: parallel-agents
3
+ description: Multi-agent orchestration patterns. Use when multiple independent tasks can run with different domain expertise or when comprehensive analysis requires multiple perspectives.
4
+ allowed-tools: Read, Glob, Grep
5
+ ---
6
+
7
+ # Native Parallel Agents
8
+
9
+ > Orchestration through Claude Code's built-in Agent Tool
10
+
11
+ ## Overview
12
+
13
+ This skill enables coordinating multiple specialized agents through Claude Code's native agent system. Unlike external scripts, this approach keeps all orchestration within Claude's control.
14
+
15
+ ## When to Use Orchestration
16
+
17
+ ✅ **Good for:**
18
+ - Complex tasks requiring multiple expertise domains
19
+ - Code analysis from security, performance, and quality perspectives
20
+ - Comprehensive reviews (architecture + security + testing)
21
+ - Feature implementation needing backend + frontend + database work
22
+
23
+ ❌ **Not for:**
24
+ - Simple, single-domain tasks
25
+ - Quick fixes or small changes
26
+ - Tasks where one agent suffices
27
+
28
+ ---
29
+
30
+ ## Native Agent Invocation
31
+
32
+ ### Single Agent
33
+ ```
34
+ Use the security-auditor agent to review authentication
35
+ ```
36
+
37
+ ### Sequential Chain
38
+ ```
39
+ First, use the explorer-agent to discover project structure.
40
+ Then, use the backend-specialist to review API endpoints.
41
+ Finally, use the test-engineer to identify test gaps.
42
+ ```
43
+
44
+ ### With Context Passing
45
+ ```
46
+ Use the frontend-specialist to analyze React components.
47
+ Based on those findings, have the test-engineer generate component tests.
48
+ ```
49
+
50
+ ### Resume Previous Work
51
+ ```
52
+ Resume agent [agentId] and continue with additional requirements.
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Orchestration Patterns
58
+
59
+ ### Pattern 1: Comprehensive Analysis
60
+ ```
61
+ Agents: explorer-agent → [domain-agents] → synthesis
62
+
63
+ 1. explorer-agent: Map codebase structure
64
+ 2. security-auditor: Security posture
65
+ 3. backend-specialist: API quality
66
+ 4. frontend-specialist: UI/UX patterns
67
+ 5. test-engineer: Test coverage
68
+ 6. Synthesize all findings
69
+ ```
70
+
71
+ ### Pattern 2: Feature Review
72
+ ```
73
+ Agents: affected-domain-agents → test-engineer
74
+
75
+ 1. Identify affected domains (backend? frontend? both?)
76
+ 2. Invoke relevant domain agents
77
+ 3. test-engineer verifies changes
78
+ 4. Synthesize recommendations
79
+ ```
80
+
81
+ ### Pattern 3: Security Audit
82
+ ```
83
+ Agents: security-auditor → penetration-tester → synthesis
84
+
85
+ 1. security-auditor: Configuration and code review
86
+ 2. penetration-tester: Active vulnerability testing
87
+ 3. Synthesize with prioritized remediation
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Available Agents
93
+
94
+ | Agent | Expertise | Trigger Phrases |
95
+ |-------|-----------|-----------------|
96
+ | `orchestrator` | Coordination | "comprehensive", "multi-perspective" |
97
+ | `security-auditor` | Security | "security", "auth", "vulnerabilities" |
98
+ | `penetration-tester` | Security Testing | "pentest", "red team", "exploit" |
99
+ | `backend-specialist` | Backend | "API", "server", "Node.js", "Express" |
100
+ | `frontend-specialist` | Frontend | "React", "UI", "components", "Next.js" |
101
+ | `test-engineer` | Testing | "tests", "coverage", "TDD" |
102
+ | `devops-engineer` | DevOps | "deploy", "CI/CD", "infrastructure" |
103
+ | `database-architect` | Database | "schema", "Prisma", "migrations" |
104
+ | `mobile-developer` | Mobile | "React Native", "Flutter", "mobile" |
105
+ | `api-designer` | API Design | "REST", "GraphQL", "OpenAPI" |
106
+ | `debugger` | Debugging | "bug", "error", "not working" |
107
+ | `explorer-agent` | Discovery | "explore", "map", "structure" |
108
+ | `documentation-writer` | Documentation | "write docs", "create README", "generate API docs" |
109
+ | `performance-optimizer` | Performance | "slow", "optimize", "profiling" |
110
+ | `project-planner` | Planning | "plan", "roadmap", "milestones" |
111
+ | `seo-specialist` | SEO | "SEO", "meta tags", "search ranking" |
112
+ | `game-developer` | Game Development | "game", "Unity", "Godot", "Phaser" |
113
+
114
+ ---
115
+
116
+ ## Claude Code Built-in Agents
117
+
118
+ These work alongside custom agents:
119
+
120
+ | Agent | Model | Purpose |
121
+ |-------|-------|---------|
122
+ | **Explore** | Haiku | Fast read-only codebase search |
123
+ | **Plan** | Sonnet | Research during plan mode |
124
+ | **General-purpose** | Sonnet | Complex multi-step modifications |
125
+
126
+ Use **Explore** for quick searches, **custom agents** for domain expertise.
127
+
128
+ ---
129
+
130
+ ## Synthesis Protocol
131
+
132
+ After all agents complete, synthesize:
133
+
134
+ ```markdown
135
+ ## Orchestration Synthesis
136
+
137
+ ### Task Summary
138
+ [What was accomplished]
139
+
140
+ ### Agent Contributions
141
+ | Agent | Finding |
142
+ |-------|---------|
143
+ | security-auditor | Found X |
144
+ | backend-specialist | Identified Y |
145
+
146
+ ### Consolidated Recommendations
147
+ 1. **Critical**: [Issue from Agent A]
148
+ 2. **Important**: [Issue from Agent B]
149
+ 3. **Nice-to-have**: [Enhancement from Agent C]
150
+
151
+ ### Action Items
152
+ - [ ] Fix critical security issue
153
+ - [ ] Refactor API endpoint
154
+ - [ ] Add missing tests
155
+ ```
156
+
157
+ ---
158
+
159
+ ## Best Practices
160
+
161
+ 1. **Available agents** - 17 specialized agents can be orchestrated
162
+ 2. **Logical order** - Discovery → Analysis → Implementation → Testing
163
+ 3. **Share context** - Pass relevant findings to subsequent agents
164
+ 4. **Single synthesis** - One unified report, not separate outputs
165
+ 5. **Verify changes** - Always include test-engineer for code modifications
166
+
167
+ ---
168
+
169
+ ## Key Benefits
170
+
171
+ - ✅ **Single session** - All agents share context
172
+ - ✅ **AI-controlled** - Claude orchestrates autonomously
173
+ - ✅ **Native integration** - Works with built-in Explore, Plan agents
174
+ - ✅ **Resume support** - Can continue previous agent work
175
+ - ✅ **Context passing** - Findings flow between agents