cp-toolkit 2.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 (196) hide show
  1. package/README.md +130 -0
  2. package/bin/cp-kit.js +72 -0
  3. package/package.json +46 -0
  4. package/src/commands/add.js +212 -0
  5. package/src/commands/doctor.js +149 -0
  6. package/src/commands/init.js +662 -0
  7. package/src/commands/list.js +128 -0
  8. package/src/index.js +13 -0
  9. package/templates/agents/backend-specialist.md +263 -0
  10. package/templates/agents/code-archaeologist.md +106 -0
  11. package/templates/agents/database-architect.md +226 -0
  12. package/templates/agents/debugger.md +225 -0
  13. package/templates/agents/devops-engineer.md +242 -0
  14. package/templates/agents/documentation-writer.md +104 -0
  15. package/templates/agents/explorer-agent.md +73 -0
  16. package/templates/agents/frontend-specialist.md +556 -0
  17. package/templates/agents/game-developer.md +162 -0
  18. package/templates/agents/mobile-developer.md +377 -0
  19. package/templates/agents/orchestrator.md +416 -0
  20. package/templates/agents/penetration-tester.md +188 -0
  21. package/templates/agents/performance-optimizer.md +187 -0
  22. package/templates/agents/product-manager.md +112 -0
  23. package/templates/agents/product-owner.md +95 -0
  24. package/templates/agents/project-planner.md +406 -0
  25. package/templates/agents/qa-automation-engineer.md +103 -0
  26. package/templates/agents/security-auditor.md +170 -0
  27. package/templates/agents/seo-specialist.md +111 -0
  28. package/templates/agents/test-engineer.md +158 -0
  29. package/templates/github/agents/backend-specialist.md +67 -0
  30. package/templates/github/agents/code-archaeologist.md +61 -0
  31. package/templates/github/agents/database-architect.md +73 -0
  32. package/templates/github/agents/debugger.md +71 -0
  33. package/templates/github/agents/devops-engineer.md +85 -0
  34. package/templates/github/agents/documentation-writer.md +107 -0
  35. package/templates/github/agents/explorer-agent.md +87 -0
  36. package/templates/github/agents/frontend-specialist.md +54 -0
  37. package/templates/github/agents/game-developer.md +94 -0
  38. package/templates/github/agents/mobile-developer.md +75 -0
  39. package/templates/github/agents/orchestrator.md +48 -0
  40. package/templates/github/agents/penetration-tester.md +87 -0
  41. package/templates/github/agents/performance-optimizer.md +70 -0
  42. package/templates/github/agents/product-manager.md +85 -0
  43. package/templates/github/agents/product-owner.md +77 -0
  44. package/templates/github/agents/project-planner.md +83 -0
  45. package/templates/github/agents/qa-automation-engineer.md +95 -0
  46. package/templates/github/agents/security-auditor.md +72 -0
  47. package/templates/github/agents/seo-specialist.md +78 -0
  48. package/templates/github/agents/test-engineer.md +79 -0
  49. package/templates/github/instructions/database.instructions.md +74 -0
  50. package/templates/github/instructions/python.instructions.md +76 -0
  51. package/templates/github/instructions/security.instructions.md +73 -0
  52. package/templates/github/instructions/typescript.instructions.md +50 -0
  53. package/templates/rules/GEMINI.md +273 -0
  54. package/templates/scripts/mcp-server.js +704 -0
  55. package/templates/skills/core/behavioral-modes/SKILL.md +242 -0
  56. package/templates/skills/core/brainstorming/SKILL.md +163 -0
  57. package/templates/skills/core/brainstorming/dynamic-questioning.md +350 -0
  58. package/templates/skills/core/clean-code/SKILL.md +201 -0
  59. package/templates/skills/core/intelligent-routing/SKILL.md +335 -0
  60. package/templates/skills/core/mcp-builder/SKILL.md +176 -0
  61. package/templates/skills/core/parallel-agents/SKILL.md +175 -0
  62. package/templates/skills/core/plan-writing/SKILL.md +152 -0
  63. package/templates/skills/optional/api-patterns/SKILL.md +81 -0
  64. package/templates/skills/optional/api-patterns/api-style.md +42 -0
  65. package/templates/skills/optional/api-patterns/auth.md +24 -0
  66. package/templates/skills/optional/api-patterns/documentation.md +26 -0
  67. package/templates/skills/optional/api-patterns/graphql.md +41 -0
  68. package/templates/skills/optional/api-patterns/rate-limiting.md +31 -0
  69. package/templates/skills/optional/api-patterns/response.md +37 -0
  70. package/templates/skills/optional/api-patterns/rest.md +40 -0
  71. package/templates/skills/optional/api-patterns/scripts/api_validator.py +211 -0
  72. package/templates/skills/optional/api-patterns/security-testing.md +122 -0
  73. package/templates/skills/optional/api-patterns/trpc.md +41 -0
  74. package/templates/skills/optional/api-patterns/versioning.md +22 -0
  75. package/templates/skills/optional/app-builder/SKILL.md +75 -0
  76. package/templates/skills/optional/app-builder/agent-coordination.md +71 -0
  77. package/templates/skills/optional/app-builder/feature-building.md +53 -0
  78. package/templates/skills/optional/app-builder/project-detection.md +34 -0
  79. package/templates/skills/optional/app-builder/scaffolding.md +118 -0
  80. package/templates/skills/optional/app-builder/tech-stack.md +40 -0
  81. package/templates/skills/optional/app-builder/templates/SKILL.md +39 -0
  82. package/templates/skills/optional/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  83. package/templates/skills/optional/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  84. package/templates/skills/optional/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  85. package/templates/skills/optional/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  86. package/templates/skills/optional/app-builder/templates/express-api/TEMPLATE.md +83 -0
  87. package/templates/skills/optional/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  88. package/templates/skills/optional/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  89. package/templates/skills/optional/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
  90. package/templates/skills/optional/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
  91. package/templates/skills/optional/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
  92. package/templates/skills/optional/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
  93. package/templates/skills/optional/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  94. package/templates/skills/optional/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
  95. package/templates/skills/optional/architecture/SKILL.md +55 -0
  96. package/templates/skills/optional/architecture/context-discovery.md +43 -0
  97. package/templates/skills/optional/architecture/examples.md +94 -0
  98. package/templates/skills/optional/architecture/pattern-selection.md +68 -0
  99. package/templates/skills/optional/architecture/patterns-reference.md +50 -0
  100. package/templates/skills/optional/architecture/trade-off-analysis.md +77 -0
  101. package/templates/skills/optional/bash-linux/SKILL.md +199 -0
  102. package/templates/skills/optional/code-review-checklist/SKILL.md +109 -0
  103. package/templates/skills/optional/database-design/SKILL.md +52 -0
  104. package/templates/skills/optional/database-design/database-selection.md +43 -0
  105. package/templates/skills/optional/database-design/indexing.md +39 -0
  106. package/templates/skills/optional/database-design/migrations.md +48 -0
  107. package/templates/skills/optional/database-design/optimization.md +36 -0
  108. package/templates/skills/optional/database-design/orm-selection.md +30 -0
  109. package/templates/skills/optional/database-design/schema-design.md +56 -0
  110. package/templates/skills/optional/database-design/scripts/schema_validator.py +172 -0
  111. package/templates/skills/optional/deployment-procedures/SKILL.md +241 -0
  112. package/templates/skills/optional/documentation-templates/SKILL.md +194 -0
  113. package/templates/skills/optional/frontend-design/SKILL.md +418 -0
  114. package/templates/skills/optional/frontend-design/animation-guide.md +331 -0
  115. package/templates/skills/optional/frontend-design/color-system.md +311 -0
  116. package/templates/skills/optional/frontend-design/decision-trees.md +418 -0
  117. package/templates/skills/optional/frontend-design/motion-graphics.md +306 -0
  118. package/templates/skills/optional/frontend-design/scripts/accessibility_checker.py +183 -0
  119. package/templates/skills/optional/frontend-design/scripts/ux_audit.py +722 -0
  120. package/templates/skills/optional/frontend-design/typography-system.md +345 -0
  121. package/templates/skills/optional/frontend-design/ux-psychology.md +541 -0
  122. package/templates/skills/optional/frontend-design/visual-effects.md +383 -0
  123. package/templates/skills/optional/game-development/2d-games/SKILL.md +119 -0
  124. package/templates/skills/optional/game-development/3d-games/SKILL.md +135 -0
  125. package/templates/skills/optional/game-development/SKILL.md +167 -0
  126. package/templates/skills/optional/game-development/game-art/SKILL.md +185 -0
  127. package/templates/skills/optional/game-development/game-audio/SKILL.md +190 -0
  128. package/templates/skills/optional/game-development/game-design/SKILL.md +129 -0
  129. package/templates/skills/optional/game-development/mobile-games/SKILL.md +108 -0
  130. package/templates/skills/optional/game-development/multiplayer/SKILL.md +132 -0
  131. package/templates/skills/optional/game-development/pc-games/SKILL.md +144 -0
  132. package/templates/skills/optional/game-development/vr-ar/SKILL.md +123 -0
  133. package/templates/skills/optional/game-development/web-games/SKILL.md +150 -0
  134. package/templates/skills/optional/geo-fundamentals/SKILL.md +156 -0
  135. package/templates/skills/optional/geo-fundamentals/scripts/geo_checker.py +289 -0
  136. package/templates/skills/optional/i18n-localization/SKILL.md +154 -0
  137. package/templates/skills/optional/i18n-localization/scripts/i18n_checker.py +241 -0
  138. package/templates/skills/optional/lint-and-validate/SKILL.md +45 -0
  139. package/templates/skills/optional/lint-and-validate/scripts/lint_runner.py +172 -0
  140. package/templates/skills/optional/lint-and-validate/scripts/type_coverage.py +173 -0
  141. package/templates/skills/optional/mobile-design/SKILL.md +394 -0
  142. package/templates/skills/optional/mobile-design/decision-trees.md +516 -0
  143. package/templates/skills/optional/mobile-design/mobile-backend.md +491 -0
  144. package/templates/skills/optional/mobile-design/mobile-color-system.md +420 -0
  145. package/templates/skills/optional/mobile-design/mobile-debugging.md +122 -0
  146. package/templates/skills/optional/mobile-design/mobile-design-thinking.md +357 -0
  147. package/templates/skills/optional/mobile-design/mobile-navigation.md +458 -0
  148. package/templates/skills/optional/mobile-design/mobile-performance.md +767 -0
  149. package/templates/skills/optional/mobile-design/mobile-testing.md +356 -0
  150. package/templates/skills/optional/mobile-design/mobile-typography.md +433 -0
  151. package/templates/skills/optional/mobile-design/platform-android.md +666 -0
  152. package/templates/skills/optional/mobile-design/platform-ios.md +561 -0
  153. package/templates/skills/optional/mobile-design/scripts/mobile_audit.py +670 -0
  154. package/templates/skills/optional/mobile-design/touch-psychology.md +537 -0
  155. package/templates/skills/optional/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
  156. package/templates/skills/optional/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  157. package/templates/skills/optional/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  158. package/templates/skills/optional/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  159. package/templates/skills/optional/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  160. package/templates/skills/optional/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  161. package/templates/skills/optional/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  162. package/templates/skills/optional/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  163. package/templates/skills/optional/nextjs-react-expert/SKILL.md +267 -0
  164. package/templates/skills/optional/nextjs-react-expert/scripts/convert_rules.py +222 -0
  165. package/templates/skills/optional/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  166. package/templates/skills/optional/nodejs-best-practices/SKILL.md +333 -0
  167. package/templates/skills/optional/performance-profiling/SKILL.md +143 -0
  168. package/templates/skills/optional/performance-profiling/scripts/lighthouse_audit.py +76 -0
  169. package/templates/skills/optional/powershell-windows/SKILL.md +167 -0
  170. package/templates/skills/optional/python-patterns/SKILL.md +441 -0
  171. package/templates/skills/optional/red-team-tactics/SKILL.md +199 -0
  172. package/templates/skills/optional/seo-fundamentals/SKILL.md +129 -0
  173. package/templates/skills/optional/seo-fundamentals/scripts/seo_checker.py +219 -0
  174. package/templates/skills/optional/server-management/SKILL.md +161 -0
  175. package/templates/skills/optional/systematic-debugging/SKILL.md +109 -0
  176. package/templates/skills/optional/tailwind-patterns/SKILL.md +269 -0
  177. package/templates/skills/optional/tdd-workflow/SKILL.md +149 -0
  178. package/templates/skills/optional/testing-patterns/SKILL.md +178 -0
  179. package/templates/skills/optional/testing-patterns/scripts/test_runner.py +219 -0
  180. package/templates/skills/optional/vulnerability-scanner/SKILL.md +276 -0
  181. package/templates/skills/optional/vulnerability-scanner/checklists.md +121 -0
  182. package/templates/skills/optional/vulnerability-scanner/scripts/security_scan.py +458 -0
  183. package/templates/skills/optional/web-design-guidelines/SKILL.md +57 -0
  184. package/templates/skills/optional/webapp-testing/SKILL.md +187 -0
  185. package/templates/skills/optional/webapp-testing/scripts/playwright_runner.py +173 -0
  186. package/templates/workflows/brainstorm.md +113 -0
  187. package/templates/workflows/create.md +59 -0
  188. package/templates/workflows/debug.md +103 -0
  189. package/templates/workflows/deploy.md +176 -0
  190. package/templates/workflows/enhance.md +63 -0
  191. package/templates/workflows/orchestrate.md +237 -0
  192. package/templates/workflows/plan.md +89 -0
  193. package/templates/workflows/preview.md +81 -0
  194. package/templates/workflows/status.md +86 -0
  195. package/templates/workflows/test.md +144 -0
  196. package/templates/workflows/ui-ux-pro-max.md +296 -0
@@ -0,0 +1,350 @@
1
+ # Dynamic Question Generation
2
+
3
+ > **PRINCIPLE:** Questions are not about gathering data—they are about **revealing architectural consequences**.
4
+ >
5
+ > Every question must connect to a concrete implementation decision that affects cost, complexity, or timeline.
6
+
7
+ ---
8
+
9
+ ## 🧠 Core Principles
10
+
11
+ ### 1. Questions Reveal Consequences
12
+
13
+ A good question is not "What color do you want?" but:
14
+
15
+ ```markdown
16
+ ❌ BAD: "What authentication method?"
17
+ ✅ GOOD: "Should users sign up with email/password or social login?
18
+
19
+ Impact:
20
+ - Email/Pass → Need password reset, hashing, 2FA infrastructure
21
+ - Social → OAuth providers, user profile mapping, less control
22
+
23
+ Trade-off: Security vs. Development time vs. User friction"
24
+ ```
25
+
26
+ ### 2. Context Before Content
27
+
28
+ First understand **where** this request fits:
29
+
30
+ | Context | Question Focus |
31
+ |---------|----------------|
32
+ | **Greenfield** (new project) | Foundation decisions: stack, hosting, scale |
33
+ | **Feature Addition** | Integration points, existing patterns, breaking changes |
34
+ | **Refactor** | Why refactor? Performance? Maintainability? What's broken? |
35
+ | **Debug** | Symptoms → Root cause → Reproduction path |
36
+
37
+ ### 3. Minimum Viable Questions
38
+
39
+ **PRINCIPLE:** Each question must eliminate a fork in the implementation road.
40
+
41
+ ```
42
+ Before Question:
43
+ ├── Path A: Do X (5 min)
44
+ ├── Path B: Do Y (15 min)
45
+ └── Path C: Do Z (1 hour)
46
+
47
+ After Question:
48
+ └── Path Confirmed: Do X (5 min)
49
+ ```
50
+
51
+ If a question doesn't reduce implementation paths → **DELETE IT**.
52
+
53
+ ### 4. Questions Generate Data, Not Assumptions
54
+
55
+ ```markdown
56
+ ❌ ASSUMPTION: "User probably wants Stripe for payments"
57
+ ✅ QUESTION: "Which payment provider fits your needs?
58
+
59
+ Stripe → Best documentation, 2.9% + $0.30, US-centric
60
+ LemonSqueezy → Merchant of Record, 5% + $0.50, global taxes
61
+ Paddle → Complex pricing, handles EU VAT, enterprise focus"
62
+ ```
63
+
64
+ ---
65
+
66
+ ## 📋 Question Generation Algorithm
67
+
68
+ ```
69
+ INPUT: User request + Context (greenfield/feature/refactor/debug)
70
+
71
+ ├── STEP 1: Parse Request
72
+ │ ├── Extract domain (ecommerce, auth, realtime, cms, etc.)
73
+ │ ├── Extract features (explicit and implied)
74
+ │ └── Extract scale indicators (users, data volume, frequency)
75
+
76
+ ├── STEP 2: Identify Decision Points
77
+ │ ├── What MUST be decided before coding? (blocking)
78
+ │ ├── What COULD be decided later? (deferable)
79
+ │ └── What has ARCHITECTURAL impact? (high-leverage)
80
+
81
+ ├── STEP 3: Generate Questions (Priority Order)
82
+ │ ├── P0: Blocking decisions (cannot proceed without answer)
83
+ │ ├── P1: High-leverage (affects >30% of implementation)
84
+ │ ├── P2: Medium-leverage (affects specific features)
85
+ │ └── P3: Nice-to-have (edge cases, optimization)
86
+
87
+ └── STEP 4: Format Each Question
88
+ ├── What: Clear question
89
+ ├── Why: Impact on implementation
90
+ ├── Options: Trade-offs (not just A vs B)
91
+ └── Default: What happens if user doesn't answer
92
+ ```
93
+
94
+ ---
95
+
96
+ ## 🎯 Domain-Specific Question Banks
97
+
98
+ ### E-Commerce
99
+
100
+ | Question | Why It Matters | Trade-offs |
101
+ |----------|----------------|------------|
102
+ | **Single or Multi-vendor?** | Multi-vendor → Commission logic, vendor dashboards, split payments | +Revenue, -Complexity |
103
+ | **Inventory Tracking?** | Needs stock tables, reservation logic, low-stock alerts | +Accuracy, -Development time |
104
+ | **Digital or Physical Products?** | Digital → Download links, no shipping | Physical → Shipping APIs, tracking |
105
+ | **Subscription or One-time?** | Subscription → Recurring billing, dunning, proration | +Revenue, -Complexity |
106
+
107
+ ### Authentication
108
+
109
+ | Question | Why It Matters | Trade-offs |
110
+ |----------|----------------|------------|
111
+ | **Social Login Needed?** | OAuth providers vs. password reset infrastructure | +UX, -Control |
112
+ | **Role-Based Permissions?** | RBAC tables, policy enforcement, admin UI | +Security, -Development time |
113
+ | **2FA Required?** | TOTP/SMI infrastructure, backup codes, recovery flow | +Security, -UX friction |
114
+ | **Email Verification?** | Verification tokens, email service, resend logic | +Security, -Sign-up friction |
115
+
116
+ ### Real-time
117
+
118
+ | Question | Why It Matters | Trade-offs |
119
+ |----------|----------------|------------|
120
+ | **WebSocket or Polling?** | WS → Server scaling, connection management | Polling → Simpler, higher latency |
121
+ | **Expected Concurrent Users?** | <100 → Single server, >1000 → Redis pub/sub, >10k → specialized infra | +Scale, -Complexity |
122
+ | **Message Persistence?** | History tables, storage costs, pagination | +UX, -Storage |
123
+ | **Ephemeral or Durable?** | Ephemeral → In-memory, Durable → Database write before emit | +Reliability, -Latency |
124
+
125
+ ### Content/CMS
126
+
127
+ | Question | Why It Matters | Trade-offs |
128
+ |----------|----------------|------------|
129
+ | **Rich Text or Markdown?** | Rich Text → Sanitization, XSS risks | Markdown → Simple, no WYSIWYG |
130
+ | **Draft/Publish Workflow?** | Status field, scheduled jobs, versioning | +Control, -Complexity |
131
+ | **Media Handling?** | Upload endpoints, storage, optimization | +Features, -Development time |
132
+ | **Multi-language?** | i18n tables, translation UI, fallback logic | +Reach, -Complexity |
133
+
134
+ ---
135
+
136
+ ## 📐 Dynamic Question Template
137
+
138
+ ```markdown
139
+ Based on your request for [DOMAIN] [FEATURE]:
140
+
141
+ ## 🔴 CRITICAL (Blocking Decisions)
142
+
143
+ ### 1. **[DECISION POINT]**
144
+
145
+ **Question:** [Clear, specific question]
146
+
147
+ **Why This Matters:**
148
+ - [Explain architectural consequence]
149
+ - [Affects: cost / complexity / timeline / scale]
150
+
151
+ **Options:**
152
+ | Option | Pros | Cons | Best For |
153
+ |--------|------|------|----------|
154
+ | A | [Advantage] | [Disadvantage] | [Use case] |
155
+ | B | [Advantage] | [Disadvantage] | [Use case] |
156
+
157
+ **If Not Specified:** [Default choice + rationale]
158
+
159
+ ---
160
+
161
+ ## 🟡 HIGH-LEVERAGE (Affects Implementation)
162
+
163
+ ### 2. **[DECISION POINT]**
164
+ [Same format]
165
+
166
+ ---
167
+
168
+ ## 🟢 NICE-TO-HAVE (Edge Cases)
169
+
170
+ ### 3. **[DECISION POINT]**
171
+ [Same format]
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 🔄 Iterative Questioning
177
+
178
+ ### First Pass (3-5 Questions)
179
+ Focus on **blocking decisions**. Don't proceed without answers.
180
+
181
+ ### Second Pass (After Initial Implementation)
182
+ As patterns emerge, ask:
183
+ - "This feature implies [X]. Should we handle [edge case] now or defer?"
184
+ - "We're using [Pattern A]. Should [Feature B] follow the same pattern?"
185
+
186
+ ### Third Pass (Optimization)
187
+ When functionality works:
188
+ - "Performance bottleneck at [X]. Optimize now or acceptable for now?"
189
+ - "Refactor [Y] for maintainability or ship as-is?"
190
+
191
+ ---
192
+
193
+ ## 🎭 Example: Full Question Generation
194
+
195
+ ```
196
+ USER REQUEST: "Build an Instagram clone"
197
+
198
+ STEP 1: Parse
199
+ ├── Domain: Social Media
200
+ ├── Features: Photo sharing, engagement (likes/comments), user profiles
201
+ ├── Implied: Feed, following, authentication
202
+ └── Scale: Potentially high (social apps go viral)
203
+
204
+ STEP 2: Decision Points
205
+ ├── Blocking: Storage strategy, authentication method, feed type
206
+ ├── High-leverage: Real-time notifications, data model complexity
207
+ └── Deferable: Analytics, advanced search, reels/video
208
+
209
+ STEP 3: Generate Questions (Priority)
210
+
211
+ P0 (Blocking):
212
+ 1. Storage Strategy → Affects architecture, cost, speed
213
+ 2. Feed Algorithm → Affects database queries, complexity
214
+ 3. Auth Method → Affects dev time, UX, security
215
+
216
+ P1 (High-leverage):
217
+ 4. Real-time Notifications → WebSocket vs polling
218
+ 5. Media Processing → Client-side vs server-side optimization
219
+
220
+ P2 (Deferable):
221
+ 6. Story/Reels → Major feature creep, defer to v2
222
+ 7. DM/Chat → Separate subsystem, defer to v2
223
+
224
+ STEP 4: Format Output
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 📊 Generated Output (Example)
230
+
231
+ ```
232
+ Based on your Instagram clone request:
233
+
234
+ ## 🔴 CRITICAL DECISIONS (Cannot Proceed Without Answers)
235
+
236
+ ### 1. **Photo Storage Strategy**
237
+
238
+ **Question:** Where will user photos be stored and served?
239
+
240
+ **Why This Matters:**
241
+ - Affects: Monthly hosting costs, page load speed, CDN complexity
242
+ - High-volume social apps: 1000 users × 10 photos × 2MB = 20GB storage
243
+
244
+ **Options:**
245
+ | Option | Cost | Speed | Complexity | Best For |
246
+ |--------|------|-------|------------|----------|
247
+ | **Cloudinary** | $89/mo (25GB) | Fast (CDN) | Low | MVP, rapid launch |
248
+ | **AWS S3 + CloudFront** | $0.023/GB | Fast (CDN) | Medium | Production, cost-optimized |
249
+ | **Supabase Storage** | Free tier 1GB | Medium | Low | Small scale, simple |
250
+ | **Local Storage** | Server cost | Slow | Low | Development only |
251
+
252
+ **If Not Specified:** Cloudinary (balanced for MVP)
253
+
254
+ ---
255
+
256
+ ### 2. **Feed Algorithm Choice**
257
+
258
+ **Question:** How should the main feed work?
259
+
260
+ **Why This Matters:**
261
+ - Affects: Database query complexity, caching strategy, development time
262
+ - Algorithmic feeds require ML infrastructure, ranking signals
263
+
264
+ **Options:**
265
+ | Option | Complexity | Database Impact | Best For |
266
+ |--------|------------|-----------------|----------|
267
+ | **Chronological** | Low | Simple query | Early stage, transparency |
268
+ | **Follow-Only** | Medium | JOIN with pagination | Most social apps |
269
+ | **Algorithmic** | High | Pre-computed feed tables | Instagram competitor |
270
+
271
+ **If Not Specified:** Follow-Only (balanced for social app)
272
+
273
+ ---
274
+
275
+ ### 3. **Authentication Approach**
276
+
277
+ **Question:** How do users sign up and login?
278
+
279
+ **Why This Matters:**
280
+ - Affects: Development time (2-5 hours), security posture, UX friction
281
+
282
+ **Options:**
283
+ | Option | Dev Time | Security | UX | Best For |
284
+ |--------|----------|----------|-----|----------|
285
+ | **Email/Password** | 4-5 hrs | High (if 2FA) | Medium | Full control needed |
286
+ | **Social Only** | 1-2 hrs | Provider-dependent | Smooth | B2C, rapid launch |
287
+ | **Magic Link** | 2-3 hrs | Medium | Very smooth | Security-focused |
288
+ | **Clerk/Auth0** | 1 hr | High | Smooth | Fastest to market |
289
+
290
+ **If Not Specified:** Clerk (fastest for MVP)
291
+
292
+ ---
293
+
294
+ ## 🟡 HIGH-LEVERAGE (Affects Architecture)
295
+
296
+ ### 4. **Real-time Notifications**
297
+
298
+ **Question:** Do users need instant notifications for likes/comments?
299
+
300
+ **Why This Matters:**
301
+ - WebSocket adds infrastructure complexity (Redis pub/sub for scaling)
302
+ - Polling is simpler but higher latency
303
+
304
+ **Options:**
305
+ | Option | Complexity | Scale Cost | Best For |
306
+ |--------|------------|------------|----------|
307
+ | **WebSocket + Redis** | High | $10+/mo | >1000 concurrent users |
308
+ | **Polling (30s)** | Low | DB queries | <1000 users |
309
+ | **No Real-time** | None | None | MVP, validate first |
310
+
311
+ **If Not Specified:** Polling for MVP (defer WebSocket until validated)
312
+
313
+ ---
314
+
315
+ ## 🟢 NICE-TO-HAVE (Defer to v2)
316
+
317
+ ### 5. **Video/Reels Support**
318
+ - Major complexity (video processing, streaming infrastructure)
319
+ - Recommendation: Launch with photos only, add video after validation
320
+
321
+ ### 6. **Direct Messaging**
322
+ - Separate subsystem (chat infrastructure different from feed)
323
+ - Recommendation: Use Pusher/Stream for real-time or defer entirely
324
+
325
+ ---
326
+
327
+ ## 📋 Summary
328
+
329
+ | Decision | Recommendation | If Changed |
330
+ |----------|----------------|------------|
331
+ | Storage | Cloudinary | +3 hrs setup |
332
+ | Feed | Follow-only | +2 hrs query optimization |
333
+ | Auth | Clerk | -3 hrs dev time |
334
+ | Real-time | Polling | +5 hrs WebSocket setup |
335
+ | Video | Defer to v2 | N/A |
336
+ | DM | Defer to v2 | N/A |
337
+
338
+ **Total Estimated MVP Time:** 15-20 hours with recommendations above
339
+ ```
340
+
341
+ ---
342
+
343
+ ## 🎯 Principles Recap
344
+
345
+ 1. **Every question = Architectural decision** → Not data gathering
346
+ 2. **Show trade-offs** → User understands consequences
347
+ 3. **Prioritize blocking decisions** → Cannot proceed without
348
+ 4. **Provide defaults** → If user doesn't answer, we proceed anyway
349
+ 5. **Domain-aware** → Ecommerce questions ≠ Auth questions ≠ Real-time questions
350
+ 6. **Iterative** → More questions as patterns emerge during implementation
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: clean-code
3
+ description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
4
+ allowed-tools: Read, Write, Edit
5
+ version: 2.0
6
+ priority: CRITICAL
7
+ ---
8
+
9
+ # Clean Code - Pragmatic AI Coding Standards
10
+
11
+ > **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
12
+
13
+ ---
14
+
15
+ ## Core Principles
16
+
17
+ | Principle | Rule |
18
+ |-----------|------|
19
+ | **SRP** | Single Responsibility - each function/class does ONE thing |
20
+ | **DRY** | Don't Repeat Yourself - extract duplicates, reuse |
21
+ | **KISS** | Keep It Simple - simplest solution that works |
22
+ | **YAGNI** | You Aren't Gonna Need It - don't build unused features |
23
+ | **Boy Scout** | Leave code cleaner than you found it |
24
+
25
+ ---
26
+
27
+ ## Naming Rules
28
+
29
+ | Element | Convention |
30
+ |---------|------------|
31
+ | **Variables** | Reveal intent: `userCount` not `n` |
32
+ | **Functions** | Verb + noun: `getUserById()` not `user()` |
33
+ | **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` |
34
+ | **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` |
35
+
36
+ > **Rule:** If you need a comment to explain a name, rename it.
37
+
38
+ ---
39
+
40
+ ## Function Rules
41
+
42
+ | Rule | Description |
43
+ |------|-------------|
44
+ | **Small** | Max 20 lines, ideally 5-10 |
45
+ | **One Thing** | Does one thing, does it well |
46
+ | **One Level** | One level of abstraction per function |
47
+ | **Few Args** | Max 3 arguments, prefer 0-2 |
48
+ | **No Side Effects** | Don't mutate inputs unexpectedly |
49
+
50
+ ---
51
+
52
+ ## Code Structure
53
+
54
+ | Pattern | Apply |
55
+ |---------|-------|
56
+ | **Guard Clauses** | Early returns for edge cases |
57
+ | **Flat > Nested** | Avoid deep nesting (max 2 levels) |
58
+ | **Composition** | Small functions composed together |
59
+ | **Colocation** | Keep related code close |
60
+
61
+ ---
62
+
63
+ ## AI Coding Style
64
+
65
+ | Situation | Action |
66
+ |-----------|--------|
67
+ | User asks for feature | Write it directly |
68
+ | User reports bug | Fix it, don't explain |
69
+ | No clear requirement | Ask, don't assume |
70
+
71
+ ---
72
+
73
+ ## Anti-Patterns (DON'T)
74
+
75
+ | ❌ Pattern | ✅ Fix |
76
+ |-----------|-------|
77
+ | Comment every line | Delete obvious comments |
78
+ | Helper for one-liner | Inline the code |
79
+ | Factory for 2 objects | Direct instantiation |
80
+ | utils.ts with 1 function | Put code where used |
81
+ | "First we import..." | Just write code |
82
+ | Deep nesting | Guard clauses |
83
+ | Magic numbers | Named constants |
84
+ | God functions | Split by responsibility |
85
+
86
+ ---
87
+
88
+ ## 🔴 Before Editing ANY File (THINK FIRST!)
89
+
90
+ **Before changing a file, ask yourself:**
91
+
92
+ | Question | Why |
93
+ |----------|-----|
94
+ | **What imports this file?** | They might break |
95
+ | **What does this file import?** | Interface changes |
96
+ | **What tests cover this?** | Tests might fail |
97
+ | **Is this a shared component?** | Multiple places affected |
98
+
99
+ **Quick Check:**
100
+ ```
101
+ File to edit: UserService.ts
102
+ └── Who imports this? → UserController.ts, AuthController.ts
103
+ └── Do they need changes too? → Check function signatures
104
+ ```
105
+
106
+ > 🔴 **Rule:** Edit the file + all dependent files in the SAME task.
107
+ > 🔴 **Never leave broken imports or missing updates.**
108
+
109
+ ---
110
+
111
+ ## Summary
112
+
113
+ | Do | Don't |
114
+ |----|-------|
115
+ | Write code directly | Write tutorials |
116
+ | Let code self-document | Add obvious comments |
117
+ | Fix bugs immediately | Explain the fix first |
118
+ | Inline small things | Create unnecessary files |
119
+ | Name things clearly | Use abbreviations |
120
+ | Keep functions small | Write 100+ line functions |
121
+
122
+ > **Remember: The user wants working code, not a programming lesson.**
123
+
124
+ ---
125
+
126
+ ## 🔴 Self-Check Before Completing (MANDATORY)
127
+
128
+ **Before saying "task complete", verify:**
129
+
130
+ | Check | Question |
131
+ |-------|----------|
132
+ | ✅ **Goal met?** | Did I do exactly what user asked? |
133
+ | ✅ **Files edited?** | Did I modify all necessary files? |
134
+ | ✅ **Code works?** | Did I test/verify the change? |
135
+ | ✅ **No errors?** | Lint and TypeScript pass? |
136
+ | ✅ **Nothing forgotten?** | Any edge cases missed? |
137
+
138
+ > 🔴 **Rule:** If ANY check fails, fix it before completing.
139
+
140
+ ---
141
+
142
+ ## Verification Scripts (MANDATORY)
143
+
144
+ > 🔴 **CRITICAL:** Each agent runs ONLY their own skill's scripts after completing work.
145
+
146
+ ### Agent → Script Mapping
147
+
148
+ | Agent | Script | Command |
149
+ |-------|--------|---------|
150
+ | **frontend-specialist** | UX Audit | `python .agent/skills/frontend-design/scripts/ux_audit.py .` |
151
+ | **frontend-specialist** | A11y Check | `python .agent/skills/frontend-design/scripts/accessibility_checker.py .` |
152
+ | **backend-specialist** | API Validator | `python .agent/skills/api-patterns/scripts/api_validator.py .` |
153
+ | **mobile-developer** | Mobile Audit | `python .agent/skills/mobile-design/scripts/mobile_audit.py .` |
154
+ | **database-architect** | Schema Validate | `python .agent/skills/database-design/scripts/schema_validator.py .` |
155
+ | **security-auditor** | Security Scan | `python .agent/skills/vulnerability-scanner/scripts/security_scan.py .` |
156
+ | **seo-specialist** | SEO Check | `python .agent/skills/seo-fundamentals/scripts/seo_checker.py .` |
157
+ | **seo-specialist** | GEO Check | `python .agent/skills/geo-fundamentals/scripts/geo_checker.py .` |
158
+ | **performance-optimizer** | Lighthouse | `python .agent/skills/performance-profiling/scripts/lighthouse_audit.py <url>` |
159
+ | **test-engineer** | Test Runner | `python .agent/skills/testing-patterns/scripts/test_runner.py .` |
160
+ | **test-engineer** | Playwright | `python .agent/skills/webapp-testing/scripts/playwright_runner.py <url>` |
161
+ | **Any agent** | Lint Check | `python .agent/skills/lint-and-validate/scripts/lint_runner.py .` |
162
+ | **Any agent** | Type Coverage | `python .agent/skills/lint-and-validate/scripts/type_coverage.py .` |
163
+ | **Any agent** | i18n Check | `python .agent/skills/i18n-localization/scripts/i18n_checker.py .` |
164
+
165
+ > ❌ **WRONG:** `test-engineer` running `ux_audit.py`
166
+ > ✅ **CORRECT:** `frontend-specialist` running `ux_audit.py`
167
+
168
+ ---
169
+
170
+ ### 🔴 Script Output Handling (READ → SUMMARIZE → ASK)
171
+
172
+ **When running a validation script, you MUST:**
173
+
174
+ 1. **Run the script** and capture ALL output
175
+ 2. **Parse the output** - identify errors, warnings, and passes
176
+ 3. **Summarize to user** in this format:
177
+
178
+ ```markdown
179
+ ## Script Results: [script_name.py]
180
+
181
+ ### ❌ Errors Found (X items)
182
+ - [File:Line] Error description 1
183
+ - [File:Line] Error description 2
184
+
185
+ ### ⚠️ Warnings (Y items)
186
+ - [File:Line] Warning description
187
+
188
+ ### ✅ Passed (Z items)
189
+ - Check 1 passed
190
+ - Check 2 passed
191
+
192
+ **Should I fix the X errors?**
193
+ ```
194
+
195
+ 4. **Wait for user confirmation** before fixing
196
+ 5. **After fixing** → Re-run script to confirm
197
+
198
+ > 🔴 **VIOLATION:** Running script and ignoring output = FAILED task.
199
+ > 🔴 **VIOLATION:** Auto-fixing without asking = Not allowed.
200
+ > 🔴 **Rule:** Always READ output → SUMMARIZE → ASK → then fix.
201
+