tribunal-kit 3.0.0 → 4.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 (233) hide show
  1. package/.agent/ARCHITECTURE.md +99 -99
  2. package/.agent/GEMINI.md +52 -52
  3. package/.agent/agents/accessibility-reviewer.md +187 -220
  4. package/.agent/agents/ai-code-reviewer.md +199 -233
  5. package/.agent/agents/backend-specialist.md +215 -238
  6. package/.agent/agents/code-archaeologist.md +161 -181
  7. package/.agent/agents/database-architect.md +184 -207
  8. package/.agent/agents/debugger.md +191 -218
  9. package/.agent/agents/dependency-reviewer.md +103 -136
  10. package/.agent/agents/devops-engineer.md +218 -238
  11. package/.agent/agents/documentation-writer.md +201 -221
  12. package/.agent/agents/explorer-agent.md +160 -180
  13. package/.agent/agents/frontend-reviewer.md +160 -194
  14. package/.agent/agents/frontend-specialist.md +248 -237
  15. package/.agent/agents/game-developer.md +48 -52
  16. package/.agent/agents/logic-reviewer.md +116 -149
  17. package/.agent/agents/mobile-developer.md +200 -223
  18. package/.agent/agents/mobile-reviewer.md +162 -195
  19. package/.agent/agents/orchestrator.md +181 -211
  20. package/.agent/agents/penetration-tester.md +157 -174
  21. package/.agent/agents/performance-optimizer.md +183 -203
  22. package/.agent/agents/performance-reviewer.md +178 -211
  23. package/.agent/agents/precedence-reviewer.md +213 -0
  24. package/.agent/agents/product-manager.md +142 -162
  25. package/.agent/agents/product-owner.md +6 -25
  26. package/.agent/agents/project-planner.md +142 -162
  27. package/.agent/agents/qa-automation-engineer.md +225 -242
  28. package/.agent/agents/security-auditor.md +174 -194
  29. package/.agent/agents/seo-specialist.md +193 -213
  30. package/.agent/agents/sql-reviewer.md +161 -194
  31. package/.agent/agents/supervisor-agent.md +184 -203
  32. package/.agent/agents/swarm-worker-contracts.md +17 -17
  33. package/.agent/agents/swarm-worker-registry.md +46 -46
  34. package/.agent/agents/test-coverage-reviewer.md +160 -193
  35. package/.agent/agents/test-engineer.md +0 -21
  36. package/.agent/agents/type-safety-reviewer.md +175 -208
  37. package/.agent/patterns/generator.md +9 -9
  38. package/.agent/patterns/inversion.md +12 -12
  39. package/.agent/patterns/pipeline.md +9 -9
  40. package/.agent/patterns/reviewer.md +13 -13
  41. package/.agent/patterns/tool-wrapper.md +9 -9
  42. package/.agent/rules/GEMINI.md +63 -63
  43. package/.agent/scripts/append_flow.js +72 -0
  44. package/.agent/scripts/case_law_manager.py +525 -0
  45. package/.agent/scripts/compress_skills.py +167 -0
  46. package/.agent/scripts/consolidate_skills.py +173 -0
  47. package/.agent/scripts/deep_compress.py +202 -0
  48. package/.agent/scripts/minify_context.py +80 -0
  49. package/.agent/scripts/security_scan.py +1 -1
  50. package/.agent/scripts/skill_evolution.py +563 -0
  51. package/.agent/scripts/strip_tribunal.py +41 -0
  52. package/.agent/skills/agent-organizer/SKILL.md +100 -126
  53. package/.agent/skills/agentic-patterns/SKILL.md +0 -70
  54. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +134 -160
  55. package/.agent/skills/api-patterns/SKILL.md +123 -215
  56. package/.agent/skills/api-security-auditor/SKILL.md +143 -177
  57. package/.agent/skills/app-builder/SKILL.md +334 -50
  58. package/.agent/skills/app-builder/templates/SKILL.md +13 -15
  59. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +16 -16
  60. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +22 -22
  61. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +18 -18
  62. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +20 -20
  63. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +17 -17
  64. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +18 -18
  65. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +21 -21
  66. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +19 -19
  67. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +26 -26
  68. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +26 -26
  69. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +19 -19
  70. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +18 -18
  71. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +20 -20
  72. package/.agent/skills/appflow-wireframe/SKILL.md +95 -121
  73. package/.agent/skills/architecture/SKILL.md +169 -331
  74. package/.agent/skills/authentication-best-practices/SKILL.md +139 -173
  75. package/.agent/skills/bash-linux/SKILL.md +129 -154
  76. package/.agent/skills/behavioral-modes/SKILL.md +8 -69
  77. package/.agent/skills/brainstorming/SKILL.md +436 -104
  78. package/.agent/skills/building-native-ui/SKILL.md +152 -174
  79. package/.agent/skills/clean-code/SKILL.md +331 -360
  80. package/.agent/skills/code-review-checklist/SKILL.md +0 -62
  81. package/.agent/skills/config-validator/SKILL.md +115 -141
  82. package/.agent/skills/csharp-developer/SKILL.md +468 -528
  83. package/.agent/skills/database-design/SKILL.md +104 -369
  84. package/.agent/skills/deployment-procedures/SKILL.md +119 -145
  85. package/.agent/skills/devops-engineer/SKILL.md +295 -332
  86. package/.agent/skills/devops-incident-responder/SKILL.md +87 -113
  87. package/.agent/skills/doc.md +5 -5
  88. package/.agent/skills/documentation-templates/SKILL.md +27 -63
  89. package/.agent/skills/edge-computing/SKILL.md +131 -157
  90. package/.agent/skills/extract-design-system/SKILL.md +108 -134
  91. package/.agent/skills/framer-motion-expert/SKILL.md +111 -855
  92. package/.agent/skills/frontend-design/SKILL.md +151 -499
  93. package/.agent/skills/game-design-expert/SKILL.md +79 -105
  94. package/.agent/skills/game-engineering-expert/SKILL.md +96 -122
  95. package/.agent/skills/geo-fundamentals/SKILL.md +97 -124
  96. package/.agent/skills/github-operations/SKILL.md +279 -314
  97. package/.agent/skills/gsap-expert/SKILL.md +119 -826
  98. package/.agent/skills/i18n-localization/SKILL.md +113 -138
  99. package/.agent/skills/intelligent-routing/SKILL.md +167 -127
  100. package/.agent/skills/lint-and-validate/SKILL.md +16 -52
  101. package/.agent/skills/llm-engineering/SKILL.md +344 -357
  102. package/.agent/skills/local-first/SKILL.md +128 -154
  103. package/.agent/skills/mcp-builder/SKILL.md +92 -118
  104. package/.agent/skills/mobile-design/SKILL.md +213 -219
  105. package/.agent/skills/motion-engineering/SKILL.md +184 -0
  106. package/.agent/skills/nextjs-react-expert/SKILL.md +99 -698
  107. package/.agent/skills/nodejs-best-practices/SKILL.md +498 -559
  108. package/.agent/skills/observability/SKILL.md +293 -330
  109. package/.agent/skills/parallel-agents/SKILL.md +96 -122
  110. package/.agent/skills/performance-profiling/SKILL.md +217 -254
  111. package/.agent/skills/plan-writing/SKILL.md +92 -118
  112. package/.agent/skills/platform-engineer/SKILL.md +97 -123
  113. package/.agent/skills/playwright-best-practices/SKILL.md +137 -162
  114. package/.agent/skills/powershell-windows/SKILL.md +112 -146
  115. package/.agent/skills/project-idioms/SKILL.md +87 -0
  116. package/.agent/skills/python-patterns/SKILL.md +15 -35
  117. package/.agent/skills/python-pro/SKILL.md +148 -754
  118. package/.agent/skills/react-specialist/SKILL.md +123 -827
  119. package/.agent/skills/readme-builder/SKILL.md +23 -85
  120. package/.agent/skills/realtime-patterns/SKILL.md +269 -304
  121. package/.agent/skills/red-team-tactics/SKILL.md +18 -51
  122. package/.agent/skills/rust-pro/SKILL.md +623 -701
  123. package/.agent/skills/seo-fundamentals/SKILL.md +129 -154
  124. package/.agent/skills/server-management/SKILL.md +164 -190
  125. package/.agent/skills/shadcn-ui-expert/SKILL.md +181 -206
  126. package/.agent/skills/skill-creator/SKILL.md +24 -56
  127. package/.agent/skills/sql-pro/SKILL.md +579 -633
  128. package/.agent/skills/supabase-postgres-best-practices/SKILL.md +35 -66
  129. package/.agent/skills/swiftui-expert/SKILL.md +151 -176
  130. package/.agent/skills/systematic-debugging/SKILL.md +92 -118
  131. package/.agent/skills/tailwind-patterns/SKILL.md +516 -576
  132. package/.agent/skills/tdd-workflow/SKILL.md +111 -137
  133. package/.agent/skills/test-result-analyzer/SKILL.md +33 -73
  134. package/.agent/skills/testing-patterns/SKILL.md +512 -573
  135. package/.agent/skills/trend-researcher/SKILL.md +30 -71
  136. package/.agent/skills/ui-ux-pro-max/SKILL.md +8 -41
  137. package/.agent/skills/ui-ux-researcher/SKILL.md +51 -91
  138. package/.agent/skills/vue-expert/SKILL.md +127 -866
  139. package/.agent/skills/vulnerability-scanner/SKILL.md +354 -269
  140. package/.agent/skills/web-accessibility-auditor/SKILL.md +168 -193
  141. package/.agent/skills/web-design-guidelines/SKILL.md +25 -61
  142. package/.agent/skills/webapp-testing/SKILL.md +119 -145
  143. package/.agent/skills/whimsy-injector/SKILL.md +58 -132
  144. package/.agent/skills/workflow-optimizer/SKILL.md +28 -68
  145. package/.agent/workflows/api-tester.md +151 -151
  146. package/.agent/workflows/audit.md +127 -138
  147. package/.agent/workflows/brainstorm.md +110 -110
  148. package/.agent/workflows/changelog.md +112 -112
  149. package/.agent/workflows/create.md +124 -124
  150. package/.agent/workflows/debug.md +165 -189
  151. package/.agent/workflows/deploy.md +180 -189
  152. package/.agent/workflows/enhance.md +128 -151
  153. package/.agent/workflows/fix.md +114 -135
  154. package/.agent/workflows/generate.md +13 -4
  155. package/.agent/workflows/migrate.md +160 -160
  156. package/.agent/workflows/orchestrate.md +168 -168
  157. package/.agent/workflows/performance-benchmarker.md +114 -123
  158. package/.agent/workflows/plan.md +173 -173
  159. package/.agent/workflows/preview.md +80 -80
  160. package/.agent/workflows/refactor.md +161 -183
  161. package/.agent/workflows/review-ai.md +101 -129
  162. package/.agent/workflows/review.md +116 -116
  163. package/.agent/workflows/session.md +94 -94
  164. package/.agent/workflows/status.md +79 -79
  165. package/.agent/workflows/strengthen-skills.md +138 -139
  166. package/.agent/workflows/swarm.md +179 -179
  167. package/.agent/workflows/test.md +189 -211
  168. package/.agent/workflows/tribunal-backend.md +94 -113
  169. package/.agent/workflows/tribunal-database.md +95 -115
  170. package/.agent/workflows/tribunal-frontend.md +96 -118
  171. package/.agent/workflows/tribunal-full.md +93 -133
  172. package/.agent/workflows/tribunal-mobile.md +95 -119
  173. package/.agent/workflows/tribunal-performance.md +110 -133
  174. package/.agent/workflows/ui-ux-pro-max.md +122 -143
  175. package/README.md +30 -1
  176. package/bin/tribunal-kit.js +175 -12
  177. package/package.json +25 -4
  178. package/.agent/skills/api-patterns/api-style.md +0 -42
  179. package/.agent/skills/api-patterns/auth.md +0 -24
  180. package/.agent/skills/api-patterns/documentation.md +0 -26
  181. package/.agent/skills/api-patterns/graphql.md +0 -41
  182. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  183. package/.agent/skills/api-patterns/response.md +0 -37
  184. package/.agent/skills/api-patterns/rest.md +0 -40
  185. package/.agent/skills/api-patterns/security-testing.md +0 -122
  186. package/.agent/skills/api-patterns/trpc.md +0 -41
  187. package/.agent/skills/api-patterns/versioning.md +0 -22
  188. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  189. package/.agent/skills/app-builder/feature-building.md +0 -53
  190. package/.agent/skills/app-builder/project-detection.md +0 -34
  191. package/.agent/skills/app-builder/scaffolding.md +0 -118
  192. package/.agent/skills/app-builder/tech-stack.md +0 -40
  193. package/.agent/skills/architecture/context-discovery.md +0 -43
  194. package/.agent/skills/architecture/examples.md +0 -94
  195. package/.agent/skills/architecture/pattern-selection.md +0 -68
  196. package/.agent/skills/architecture/patterns-reference.md +0 -50
  197. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  198. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -360
  199. package/.agent/skills/database-design/database-selection.md +0 -43
  200. package/.agent/skills/database-design/indexing.md +0 -39
  201. package/.agent/skills/database-design/migrations.md +0 -48
  202. package/.agent/skills/database-design/optimization.md +0 -36
  203. package/.agent/skills/database-design/orm-selection.md +0 -30
  204. package/.agent/skills/database-design/schema-design.md +0 -56
  205. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  206. package/.agent/skills/frontend-design/color-system.md +0 -329
  207. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  208. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  209. package/.agent/skills/frontend-design/typography-system.md +0 -363
  210. package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
  211. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  212. package/.agent/skills/intelligent-routing/router-manifest.md +0 -65
  213. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  214. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  215. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  216. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  217. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  218. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  219. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  220. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  221. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  222. package/.agent/skills/mobile-design/platform-android.md +0 -666
  223. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  224. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  225. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  226. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  227. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  228. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  229. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  230. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  231. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  232. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  233. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
@@ -9,9 +9,6 @@ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
9
9
 
10
10
  # Behavioral Modes
11
11
 
12
- > The same task handled carelessly vs. carefully looks identical until it fails.
13
- > Mode selection is about matching rigor to risk.
14
-
15
12
  ---
16
13
 
17
14
  ## Overview
@@ -130,15 +127,15 @@ This skill defines how to behave in each context — not just what to produce.
130
127
 
131
128
  ## Mode Selection Rules
132
129
 
133
- | Signal in Request | Activate |
130
+ |Signal in Request|Activate|
134
131
  |---|---|
135
- | "how does", "explain", "what is" | TEACH |
136
- | "why is X broken", "error:", traceback | DEBUG |
137
- | "review this", "audit", "check" | REVIEW |
138
- | "build", "create", "implement" | PLAN → BUILD |
139
- | "I'm not sure what I need" | DISCOVER |
140
- | "deploy", "release", "publish" | SHIP |
141
- | Multiple domains in one request | ORCHESTRATE |
132
+ |"how does", "explain", "what is"|TEACH|
133
+ |"why is X broken", "error:", traceback|DEBUG|
134
+ |"review this", "audit", "check"|REVIEW|
135
+ |"build", "create", "implement"|PLAN → BUILD|
136
+ |"I'm not sure what I need"|DISCOVER|
137
+ |"deploy", "release", "publish"|SHIP|
138
+ |Multiple domains in one request|ORCHESTRATE|
142
139
 
143
140
  ---
144
141
 
@@ -173,62 +170,4 @@ Pre-Flight: ✅ All checks passed
173
170
  or ❌ [blocking item that must be resolved first]
174
171
  ```
175
172
 
176
-
177
- ---
178
-
179
- ## 🏛️ Tribunal Integration
180
-
181
- **Slash command: Contextually applied based on user intent**
182
- **Active reviewers: `logic-reviewer` (monitors for mode adherence)**
183
-
184
- ### ✅ Pre-Flight Self-Audit
185
-
186
- Review these questions before sending any response to ensure you are in the correct mode:
187
- ```
188
- ✅ Have I explicitly announced which mode I am operating in?
189
- ✅ If in DISCOVER or TEACH, have I successfully suppressed the urge to write implementation code?
190
- ✅ If in DEBUG, am I proving a hypothesis or just guessing a fix?
191
- ✅ If in REVIEW, am I commenting on the existing code rather than silently rewriting it?
192
- ```
193
-
194
-
195
- ---
196
-
197
- ## 🤖 LLM-Specific Traps
198
-
199
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
200
-
201
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
202
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
203
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
204
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
205
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
206
-
207
173
  ---
208
-
209
- ## 🏛️ Tribunal Integration (Anti-Hallucination)
210
-
211
- **Slash command: `/review` or `/tribunal-full`**
212
- **Active reviewers: `logic-reviewer` · `security-auditor`**
213
-
214
- ### ❌ Forbidden AI Tropes
215
-
216
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
217
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
218
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
219
-
220
- ### ✅ Pre-Flight Self-Audit
221
-
222
- Review these questions before confirming output:
223
- ```
224
- ✅ Did I rely ONLY on real, verified tools and methods?
225
- ✅ Is this solution appropriately scoped to the user's constraints?
226
- ✅ Did I handle potential failure modes and edge cases?
227
- ✅ Have I avoided generic boilerplate that doesn't add value?
228
- ```
229
-
230
- ### 🛑 Verification-Before-Completion (VBC) Protocol
231
-
232
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
233
- - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
234
- - ✅ **Required:** You are explicitly forbidden from finalizing any task without providing **concrete evidence** (terminal output, passing tests, compile success, or equivalent proof) that your output works as intended.
@@ -1,104 +1,436 @@
1
- ---
2
- name: brainstorming
3
- description: Socratic methodology, ideation, and architectural exploration mastery. Generating extensive feature options, analyzing trade-offs, questioning assumptions, mind-mapping components, and delaying execution. Use when evaluating new features, defining project goals, or guiding users through ambiguous design spaces.
4
- allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 2.0.0
6
- last-updated: 2026-04-02
7
- applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
- ---
9
-
10
- # Brainstorming Socratic Exploration Mastery
11
-
12
- > Writing code is expensive. Deleting code is dangerous.
13
- > Thinking is cheap. Explore the permutation space rigorously before committing to an architecture.
14
-
15
- ---
16
-
17
- ## 1. The Socratic Protocol (Mandatory Delay)
18
-
19
- When a user provides a vague or complex prompt like *"I want to build a marketplace app,"* DO NOT start generating boilerplate code or database schemas.
20
-
21
- **You must act as a Socratic filter.**
22
- 1. Acknowledge the ambition of the goal.
23
- 2. Provide 3-5 distinct architectural/functional pathways the user could take.
24
- 3. Pause execution. Demand the user makes definitive decisions regarding the permutations before proceeding.
25
-
26
- ### Example Socratic Prompting:
27
- Instead of: *"Here is the React code for your marketplace,"*
28
- Output: *"Before we write the code, we must lock down the payment flow. Do you want to: A) Handle escrow directly (High liability, complex payout logic), B) Use Stripe Connect (Easy routing, strict KYC requirements), or C) Operate free-listing only (Zero liability, requires external monetization)?"*
29
-
30
- ---
31
-
32
- ## 2. Multi-Dimensional Tradeoff Analysis
33
-
34
- Every design choice has drawbacks. The brainstorming agent must illuminate the implicit consequences of the user's requests.
35
-
36
- When comparing options, strict tabular formatting clarifies friction:
37
-
38
- | Approach | Speed to Market | Operational Cost | Latency / UX | Maintenance Burden |
39
- |:---|:---|:---|:---|:---|
40
- | **Serverless Functions** | Very high | Low initially (pay-per-use) | Cold starts (500ms delay) | Complex local testing |
41
- | **Monolithic Node VPS** | Moderate | Flat ($10/mo fixed) | Extremely fast (0ms start) | Requires manual OS patching |
42
- | **Edge Compute (V8)** | Low | Moderate | Global low-latency | Strict 1MB limits / V8 restrictions |
43
-
44
- *Result:* The user chooses the approach mapped to their business reality, not a generic AI default.
45
-
46
- ---
47
-
48
- ## 3. Lateral Expansion (The "What If?" Matrix)
49
-
50
- Users frequently suffer from tunnel-vision regarding their requested feature. The Brainstormer introduces lateral features the user hasn't considered yet to solidify the schema boundaries.
51
-
52
- If user asks for: **"A habit tracking calendar."**
53
- *Expand laterally:*
54
- - "What if a user crosses timezones frequently? Do streaks break?"
55
- - "What if they track binary habits (Read: Yes/No) versus quantitative habits (Drink 6 Liters of water)?"
56
- - "What if they require offline capability while on airplanes?"
57
-
58
- ---
59
-
60
- ## 4. Distilling Decisions into Assertions
61
-
62
- Brainstorming is useless if it does not produce an actionable blueprint.
63
- At the end of a brainstorming session, the output MUST be distilled into a rigid requirements document or transition into `plan-writing`.
64
-
65
- ```markdown
66
- # Final Brainstorming Assertions
67
- 1. **Architecture:** Next.js SSR Monolith
68
- 2. **Database:** Postgres via Prisma (Required for complex relational queries)
69
- 3. **Payment:** Stripe Connect (Subverted liability)
70
- 4. **Auth:** NextAuth (Google Provider only for MVP)
71
- ```
72
-
73
- ---
74
-
75
- ## 🤖 LLM-Specific Traps (Brainstorming)
76
-
77
- 1. **Premature Execution:** The AI receives a vague feature idea and immediately dumps 600 lines of unproven boilerplate code, creating enormous context waste and confusing the user.
78
- 2. **Yes-Man Syndrome:** Agreeing with a user's terrible, insecure, or archaic technical proposal blindly. If a user asks to "store passwords in base64," the Brainstormer MUST aggressively intervene and correct the user.
79
- 3. **Analysis Paralysis:** Asking the user 25 minute unanswerable questions at once (e.g., "What will your AWS scaling limits be?"). Keep Socratic questions limited to 3-5 high-impact, immediate blockers.
80
- 4. **Binary Fallacy:** Trapping the user into "You must either use Python or JavaScript" scenarios, neglecting hybrid architectures or novel edge deployments.
81
- 5. **Ignoring The "Why":** Solving for the requested feature execution without asking *why* the user needs it. (e.g., User asks to build a complex PDF parser to extract totals. Ask if the vendor has a CSV/JSON API first).
82
- 6. **Framework Zealotry:** Defaulting exclusively to React/Next.js for simple static blogs instead of proposing Astro or Eleventy tradeoffs. Evaluate based on the precise domain.
83
- 7. **Scale Hallucination:** Architecting a system designed for 10 million DAU utilizing Kubernetes microservices when the user is explicitly building a local internal tool for 5 warehouse employees.
84
- 8. **Forgetting State Continuity:** Conducting a brilliant 10-message brainstorm session, and then beginning the implementation phase entirely forgetting the 3 tradeoff decisions the user made in message #2.
85
- 9. **Monolithic Summaries:** Providing a dense, impenetrable wall of text. Use bullet points, bolded keywords, and markdown tables to highlight divergent permutations.
86
- 10. **The Echo Chamber:** Repeating the user's prompt back to them in a slightly modified structure without adding any lateral expansion, novelty, or tradeoff friction.
87
-
88
- ---
89
-
90
- ## 🏛️ Tribunal Integration
91
-
92
- ### Pre-Flight Self-Audit
93
- ```
94
- ✅ Have I explicitly delayed code generation until unambiguous requirements are approved?
95
- Did I outline 3-5 structural pathways with explicit, balanced tradeoff comparisons?
96
- Were lateral considerations (edge cases, scale caps, timezones) introduced rigorously?
97
- ✅ Have Socratic questions been capped at ~3 digestible choices to avoid analysis paralysis?
98
- ✅ Did I aggressively correct any fundamentally insecure or anti-pattern directives from the user?
99
- Are architectural suggestions appropriately matched to the user's actual predicted traffic scale?
100
- Did I use structured tables to map divergent consequences efficiently?
101
- ✅ Are the user's business objectives deeply represented in the proposed technical choices?
102
- Is the final output distilled into rigorous functional assertions transitioning to execution?
103
- ✅ Has conversational "Yes-man" echo-looping been strictly expelled from the dialogue?
104
- ```
1
+ ---
2
+ name: brainstorming
3
+ description: Socratic methodology, ideation, and architectural exploration mastery. Generating extensive feature options, analyzing trade-offs, questioning assumptions, mind-mapping components, and delaying execution. Use when evaluating new features, defining project goals, or guiding users through ambiguous design spaces.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ version: 3.1.0
6
+ last-updated: 2026-04-06
7
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
+ ---
9
+
10
+ ## Hallucination Traps (Read First)
11
+ - ❌ Jumping to implementation during brainstorming -> ✅ Brainstorming is exploration only; no code is written in this phase
12
+ - Presenting only one option -> Always present 3+ distinct approaches with tradeoffs
13
+ - Assuming the user's first request is their real need -> Ask 'what problem does this solve for your users?' before generating ideas
14
+
15
+ ---
16
+
17
+
18
+ # Brainstorming — Socratic Exploration Mastery
19
+
20
+ ---
21
+
22
+ ## 1. The Socratic Protocol (Mandatory Delay)
23
+
24
+ When a user provides a vague or complex prompt like *"I want to build a marketplace app,"* DO NOT start generating boilerplate code or database schemas.
25
+
26
+ **You must act as a Socratic filter.**
27
+ 1. Acknowledge the ambition of the goal.
28
+ 2. Provide 3-5 distinct architectural/functional pathways the user could take.
29
+ 3. Pause execution. Demand the user makes definitive decisions regarding the permutations before proceeding.
30
+
31
+ ### Example Socratic Prompting:
32
+ Instead of: *"Here is the React code for your marketplace,"*
33
+ Output: *"Before we write the code, we must lock down the payment flow. Do you want to: A) Handle escrow directly (High liability, complex payout logic), B) Use Stripe Connect (Easy routing, strict KYC requirements), or C) Operate free-listing only (Zero liability, requires external monetization)?"*
34
+
35
+ ---
36
+
37
+ ## 2. Multi-Dimensional Tradeoff Analysis
38
+
39
+ Every design choice has drawbacks. The brainstorming agent must illuminate the implicit consequences of the user's requests.
40
+
41
+ When comparing options, strict tabular formatting clarifies friction:
42
+
43
+ |Approach|Speed to Market|Operational Cost|Latency / UX|Maintenance Burden|
44
+ |:---|:---|:---|:---|:---|
45
+ |**Serverless Functions**|Very high|Low initially (pay-per-use)|Cold starts (500ms delay)|Complex local testing|
46
+ |**Monolithic Node VPS**|Moderate|Flat ($10/mo fixed)|Extremely fast (0ms start)|Requires manual OS patching|
47
+ |**Edge Compute (V8)**|Low|Moderate|Global low-latency|Strict 1MB limits / V8 restrictions|
48
+
49
+ *Result:* The user chooses the approach mapped to their business reality, not a generic AI default.
50
+
51
+ ---
52
+
53
+ ## 3. Lateral Expansion (The "What If?" Matrix)
54
+
55
+ Users frequently suffer from tunnel-vision regarding their requested feature. The Brainstormer introduces lateral features the user hasn't considered yet to solidify the schema boundaries.
56
+
57
+ If user asks for: **"A habit tracking calendar."**
58
+ *Expand laterally:*
59
+ - "What if a user crosses timezones frequently? Do streaks break?"
60
+ - "What if they track binary habits (Read: Yes/No) versus quantitative habits (Drink 6 Liters of water)?"
61
+ - "What if they require offline capability while on airplanes?"
62
+
63
+ ---
64
+
65
+ ## 4. Distilling Decisions into Assertions
66
+
67
+ Brainstorming is useless if it does not produce an actionable blueprint.
68
+ At the end of a brainstorming session, the output MUST be distilled into a rigid requirements document or transition into `plan-writing`.
69
+
70
+ ```markdown
71
+ # Final Brainstorming Assertions
72
+ 1. **Architecture:** Next.js SSR Monolith
73
+ 2. **Database:** Postgres via Prisma (Required for complex relational queries)
74
+ 3. **Payment:** Stripe Connect (Subverted liability)
75
+ 4. **Auth:** NextAuth (Google Provider only for MVP)
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Dynamic Question Generation
81
+
82
+ **PRINCIPLE:** Questions are not about gathering data—they are about **revealing architectural consequences**.
83
+
84
+ Every question must connect to a concrete implementation decision that affects cost, complexity, or timeline.
85
+
86
+ ---
87
+
88
+ ### 🧠 Core Principles
89
+
90
+ #### 1. Questions Reveal Consequences
91
+
92
+ A good question is not "What color do you want?" but:
93
+
94
+ ```markdown
95
+ BAD: "What authentication method?"
96
+ GOOD: "Should users sign up with email/password or social login?
97
+
98
+ Impact:
99
+ - Email/Pass Need password reset, hashing, 2FA infrastructure
100
+ - Social OAuth providers, user profile mapping, less control
101
+
102
+ Trade-off: Security vs. Development time vs. User friction"
103
+ ```
104
+
105
+ #### 2. Context Before Content
106
+
107
+ First understand **where** this request fits:
108
+
109
+ |Context|Question Focus|
110
+ |---------|----------------|
111
+ |**Greenfield** (new project)|Foundation decisions: stack, hosting, scale|
112
+ |**Feature Addition**|Integration points, existing patterns, breaking changes|
113
+ |**Refactor**|Why refactor? Performance? Maintainability? What's broken?|
114
+
115
+ #### 3. Minimum Viable Questions
116
+
117
+ **PRINCIPLE:** Each question must eliminate a fork in the implementation road.
118
+
119
+ ```
120
+ Before Question:
121
+ ├── Path A: Do X (5 min)
122
+ ├── Path B: Do Y (15 min)
123
+ └── Path C: Do Z (1 hour)
124
+
125
+ After Question:
126
+ └── Path Confirmed: Do X (5 min)
127
+ ```
128
+
129
+ If a question doesn't reduce implementation paths → **DELETE IT**.
130
+
131
+ #### 4. Questions Generate Data, Not Assumptions
132
+
133
+ ```markdown
134
+ ❌ ASSUMPTION: "User probably wants Stripe for payments"
135
+ ✅ QUESTION: "Which payment provider fits your needs?
136
+
137
+ Stripe → Best documentation, 2.9% + $0.30, US-centric
138
+ LemonSqueezy → Merchant of Record, 5% + $0.50, global taxes
139
+ Paddle → Complex pricing, handles EU VAT, enterprise focus"
140
+ ```
141
+
142
+ ---
143
+
144
+ ### 📋 Question Generation Algorithm
145
+
146
+ ```
147
+ INPUT: User request + Context (greenfield/feature/refactor/debug)
148
+
149
+ ├── STEP 1: Parse Request
150
+ │ ├── Extract domain (ecommerce, auth, realtime, cms, etc.)
151
+ │ ├── Extract features (explicit and implied)
152
+ │ └── Extract scale indicators (users, data volume, frequency)
153
+
154
+ ├── STEP 2: Identify Decision Points
155
+ │ ├── What MUST be decided before coding? (blocking)
156
+ │ ├── What COULD be decided later? (deferable)
157
+ │ └── What has ARCHITECTURAL impact? (high-leverage)
158
+
159
+ ├── STEP 3: Generate Questions (Priority Order)
160
+ │ ├── P0: Blocking decisions (cannot proceed without answer)
161
+ │ ├── P1: High-leverage (affects >30% of implementation)
162
+ │ ├── P2: Medium-leverage (affects specific features)
163
+ │ └── P3: Nice-to-have (edge cases, optimization)
164
+
165
+ └── STEP 4: Format Each Question
166
+ ├── What: Clear question
167
+ ├── Why: Impact on implementation
168
+ ├── Options: Trade-offs (not just A vs B)
169
+ ├── Fun/Superpower Option: Inject at least one highly creative, unconventional approach
170
+ └── Default: What happens if user doesn't answer
171
+ ```
172
+
173
+ ---
174
+
175
+ ### 🎯 Domain-Specific Question Banks
176
+
177
+ #### E-Commerce
178
+
179
+ |Question|Why It Matters|Trade-offs|
180
+ |----------|----------------|------------|
181
+ |**Single or Multi-vendor?**|Multi-vendor → Commission logic, vendor dashboards, split payments|+Revenue, -Complexity|
182
+ |**Inventory Tracking?**|Needs stock tables, reservation logic, low-stock alerts|+Accuracy, -Development time|
183
+ |**Digital or Physical Products?**|Digital → Download links, no shipping|Physical → Shipping APIs, tracking|
184
+ |**Subscription or One-time?**|Subscription → Recurring billing, dunning, proration|+Revenue, -Complexity|
185
+
186
+ #### Authentication
187
+
188
+ |Question|Why It Matters|Trade-offs|
189
+ |----------|----------------|------------|
190
+ |**Social Login Needed?**|OAuth providers vs. password reset infrastructure|+UX, -Control|
191
+ |**Role-Based Permissions?**|RBAC tables, policy enforcement, admin UI|+Security, -Development time|
192
+ |**2FA Required?**|TOTP/SMI infrastructure, backup codes, recovery flow|+Security, -UX friction|
193
+ |**Email Verification?**|Verification tokens, email service, resend logic|+Security, -Sign-up friction|
194
+
195
+ #### Real-time
196
+
197
+ |Question|Why It Matters|Trade-offs|
198
+ |----------|----------------|------------|
199
+ |**WebSocket or Polling?**|WS → Server scaling, connection management|Polling → Simpler, higher latency|
200
+ |**Expected Concurrent Users?**|<100 → Single server, >1000 → Redis pub/sub, >10k → specialized infra|+Scale, -Complexity|
201
+ |**Message Persistence?**|History tables, storage costs, pagination|+UX, -Storage|
202
+ |**Ephemeral or Durable?**|Ephemeral → In-memory, Durable → Database write before emit|+Reliability, -Latency|
203
+
204
+ #### Content/CMS
205
+
206
+ |Question|Why It Matters|Trade-offs|
207
+ |----------|----------------|------------|
208
+ |**Rich Text or Markdown?**|Rich Text → Sanitization, XSS risks|Markdown → Simple, no WYSIWYG|
209
+ |**Draft/Publish Workflow?**|Status field, scheduled jobs, versioning|+Control, -Complexity|
210
+ |**Media Handling?**|Upload endpoints, storage, optimization|+Features, -Development time|
211
+ |**Multi-language?**|i18n tables, translation UI, fallback logic|+Reach, -Complexity|
212
+
213
+ #### Business & Product Strategy
214
+
215
+ |Question|Why It Matters|Trade-offs|
216
+ |----------|----------------|------------|
217
+ |**Monetization Approach?**|Freemium vs. Paywall vs. Ads affects user flow|+Revenue, -User Acquisition|
218
+ |**Onboarding CRO?**|Wizard vs. self-serve dictates state management|+Activation, -Dev Time|
219
+ |**Competitor Differentiator?**|Must highlight this UI feature above all else|+Standout, -Standardization|
220
+ |**Marketing Psychology?**|FOMO (urgency) vs. Trust (social proof) layout|+Conversion, -Aesthetics|
221
+
222
+ ---
223
+
224
+ ### 📐 Dynamic Question Template
225
+
226
+ ```markdown
227
+
228
+ ### 🔴 CRITICAL (Blocking Decisions)
229
+
230
+ #### 1. **[DECISION POINT]**
231
+
232
+ **Question:** [Clear, specific question]
233
+
234
+ **Why This Matters:**
235
+ - [Explain architectural consequence]
236
+ - [Affects: cost / complexity / timeline / scale]
237
+
238
+ **Options:**
239
+ |Option|Pros|Cons|Best For|
240
+ |--------|------|------|----------|
241
+ |A|[Advantage]|[Disadvantage]|[Use case]|
242
+ |B|[Advantage]|[Disadvantage]|[Use case]|
243
+
244
+ **If Not Specified:** [Default choice + rationale]
245
+
246
+ ---
247
+
248
+ ### 🟡 HIGH-LEVERAGE (Affects Implementation)
249
+
250
+ #### 2. **[DECISION POINT]**
251
+ [Same format]
252
+
253
+ ---
254
+
255
+ ### 🟢 NICE-TO-HAVE (Edge Cases)
256
+
257
+ #### 3. **[DECISION POINT]**
258
+ [Same format]
259
+ ```
260
+
261
+ ---
262
+
263
+ ### 🔄 Iterative Questioning
264
+
265
+ #### First Pass (3-5 Questions)
266
+ Focus on **blocking decisions**. Don't proceed without answers.
267
+
268
+ #### Second Pass (After Initial Implementation)
269
+ As patterns emerge, ask:
270
+ - "This feature implies [X]. Should we handle [edge case] now or defer?"
271
+ - "We're using [Pattern A]. Should [Feature B] follow the same pattern?"
272
+
273
+ #### Third Pass (Optimization)
274
+ When functionality works:
275
+ - "Performance bottleneck at [X]. Optimize now or acceptable for now?"
276
+ - "Refactor [Y] for maintainability or ship as-is?"
277
+
278
+ ---
279
+
280
+ ### 🎭 Example: Full Question Generation
281
+
282
+ ```
283
+ USER REQUEST: "Build an Instagram clone"
284
+
285
+ STEP 1: Parse
286
+ ├── Domain: Social Media
287
+ ├── Features: Photo sharing, engagement (likes/comments), user profiles
288
+ ├── Implied: Feed, following, authentication
289
+ └── Scale: Potentially high (social apps go viral)
290
+
291
+ STEP 2: Decision Points
292
+ ├── Blocking: Storage strategy, authentication method, feed type
293
+ ├── High-leverage: Real-time notifications, data model complexity
294
+ └── Deferable: Analytics, advanced search, reels/video
295
+
296
+ STEP 3: Generate Questions (Priority)
297
+
298
+ P0 (Blocking):
299
+ 1. Storage Strategy → Affects architecture, cost, speed
300
+ 2. Feed Algorithm → Affects database queries, complexity
301
+ 3. Auth Method → Affects dev time, UX, security
302
+
303
+ P1 (High-leverage):
304
+ 4. Real-time Notifications → WebSocket vs polling
305
+ 5. Media Processing → Client-side vs server-side optimization
306
+
307
+ P2 (Deferable):
308
+ 6. Story/Reels → Major feature creep, defer to v2
309
+ 7. DM/Chat → Separate subsystem, defer to v2
310
+
311
+ STEP 4: Format Output
312
+ ```
313
+
314
+ ---
315
+
316
+ ### 📊 Generated Output (Example)
317
+
318
+ ```
319
+
320
+ ### 🔴 CRITICAL DECISIONS (Cannot Proceed Without Answers)
321
+
322
+ #### 1. **Photo Storage Strategy**
323
+
324
+ **Question:** Where will user photos be stored and served?
325
+
326
+ **Why This Matters:**
327
+ - Affects: Monthly hosting costs, page load speed, CDN complexity
328
+ - High-volume social apps: 1000 users × 10 photos × 2MB = 20GB storage
329
+
330
+ **Options:**
331
+ |Option|Cost|Speed|Complexity|Best For|
332
+ |--------|------|-------|------------|----------|
333
+ |**Cloudinary**|$89/mo (25GB)|Fast (CDN)|Low|MVP, rapid launch|
334
+ |**AWS S3 + CloudFront**|$0.023/GB|Fast (CDN)|Medium|Production, cost-optimized|
335
+ |**Supabase Storage**|Free tier 1GB|Medium|Low|Small scale, simple|
336
+ |**Local Storage**|Server cost|Slow|Low|Development only|
337
+
338
+ **If Not Specified:** Cloudinary (balanced for MVP)
339
+
340
+ ---
341
+
342
+ #### 2. **Feed Algorithm Choice**
343
+
344
+ **Question:** How should the main feed work?
345
+
346
+ **Why This Matters:**
347
+ - Affects: Database query complexity, caching strategy, development time
348
+ - Algorithmic feeds require ML infrastructure, ranking signals
349
+
350
+ **Options:**
351
+ |Option|Complexity|Database Impact|Best For|
352
+ |--------|------------|-----------------|----------|
353
+ |**Chronological**|Low|Simple query|Early stage, transparency|
354
+ |**Follow-Only**|Medium|JOIN with pagination|Most social apps|
355
+ |**Algorithmic**|High|Pre-computed feed tables|Instagram competitor|
356
+
357
+ **If Not Specified:** Follow-Only (balanced for social app)
358
+
359
+ ---
360
+
361
+ #### 3. **Authentication Approach**
362
+
363
+ **Question:** How do users sign up and login?
364
+
365
+ **Why This Matters:**
366
+ - Affects: Development time (2-5 hours), security posture, UX friction
367
+
368
+ **Options:**
369
+ |Option|Dev Time|Security|UX|Best For|
370
+ |--------|----------|----------|-----|----------|
371
+ |**Email/Password**|4-5 hrs|High (if 2FA)|Medium|Full control needed|
372
+ |**Social Only**|1-2 hrs|Provider-dependent|Smooth|B2C, rapid launch|
373
+ |**Magic Link**|2-3 hrs|Medium|Very smooth|Security-focused|
374
+ |**Clerk/Auth0**|1 hr|High|Smooth|Fastest to market|
375
+
376
+ **If Not Specified:** Clerk (fastest for MVP)
377
+
378
+ ---
379
+
380
+ ### 🟡 HIGH-LEVERAGE (Affects Architecture)
381
+
382
+ #### 4. **Real-time Notifications**
383
+
384
+ **Question:** Do users need instant notifications for likes/comments?
385
+
386
+ **Why This Matters:**
387
+ - WebSocket adds infrastructure complexity (Redis pub/sub for scaling)
388
+ - Polling is simpler but higher latency
389
+
390
+ **Options:**
391
+ |Option|Complexity|Scale Cost|Best For|
392
+ |--------|------------|------------|----------|
393
+ |**WebSocket + Redis**|High|$10+/mo|>1000 concurrent users|
394
+ |**Polling (30s)**|Low|DB queries|<1000 users|
395
+ |**No Real-time**|None|None|MVP, validate first|
396
+
397
+ **If Not Specified:** Polling for MVP (defer WebSocket until validated)
398
+
399
+ ---
400
+
401
+ ### 🟢 NICE-TO-HAVE (Defer to v2)
402
+
403
+ #### 5. **Video/Reels Support**
404
+ - Major complexity (video processing, streaming infrastructure)
405
+ - Recommendation: Launch with photos only, add video after validation
406
+
407
+ #### 6. **Direct Messaging**
408
+ - Separate subsystem (chat infrastructure different from feed)
409
+ - Recommendation: Use Pusher/Stream for real-time or defer entirely
410
+
411
+ ---
412
+
413
+ ### 📋 Summary
414
+
415
+ |Decision|Recommendation|If Changed|
416
+ |----------|----------------|------------|
417
+ |Storage|Cloudinary|+3 hrs setup|
418
+ |Feed|Follow-only|+2 hrs query optimization|
419
+ |Auth|Clerk|-3 hrs dev time|
420
+ |Real-time|Polling|+5 hrs WebSocket setup|
421
+ |Video|Defer to v2|N/A|
422
+ |DM|Defer to v2|N/A|
423
+
424
+ **Total Estimated MVP Time:** 15-20 hours with recommendations above
425
+ ```
426
+
427
+ ---
428
+
429
+ ### 🎯 Principles Recap
430
+
431
+ 1. **Every question = Architectural decision** → Not data gathering
432
+ 2. **Show trade-offs** → User understands consequences
433
+ 3. **Prioritize blocking decisions** → Cannot proceed without
434
+ 4. **Provide defaults** → If user doesn't answer, we proceed anyway
435
+ 5. **Domain-aware** → Ecommerce questions ≠ Auth questions ≠ Real-time questions
436
+ 6. **Iterative** → More questions as patterns emerge during implementation