tribunal-kit 2.4.6 → 3.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 (142) hide show
  1. package/.agent/agents/accessibility-reviewer.md +220 -134
  2. package/.agent/agents/ai-code-reviewer.md +233 -129
  3. package/.agent/agents/backend-specialist.md +238 -178
  4. package/.agent/agents/code-archaeologist.md +181 -119
  5. package/.agent/agents/database-architect.md +207 -164
  6. package/.agent/agents/debugger.md +218 -151
  7. package/.agent/agents/dependency-reviewer.md +136 -55
  8. package/.agent/agents/devops-engineer.md +238 -175
  9. package/.agent/agents/documentation-writer.md +221 -137
  10. package/.agent/agents/explorer-agent.md +180 -142
  11. package/.agent/agents/frontend-reviewer.md +194 -80
  12. package/.agent/agents/frontend-specialist.md +237 -188
  13. package/.agent/agents/game-developer.md +52 -184
  14. package/.agent/agents/logic-reviewer.md +149 -78
  15. package/.agent/agents/mobile-developer.md +223 -152
  16. package/.agent/agents/mobile-reviewer.md +195 -79
  17. package/.agent/agents/orchestrator.md +211 -170
  18. package/.agent/agents/penetration-tester.md +174 -131
  19. package/.agent/agents/performance-optimizer.md +203 -139
  20. package/.agent/agents/performance-reviewer.md +211 -108
  21. package/.agent/agents/product-manager.md +162 -108
  22. package/.agent/agents/project-planner.md +162 -142
  23. package/.agent/agents/qa-automation-engineer.md +242 -138
  24. package/.agent/agents/security-auditor.md +194 -170
  25. package/.agent/agents/seo-specialist.md +213 -132
  26. package/.agent/agents/sql-reviewer.md +194 -73
  27. package/.agent/agents/supervisor-agent.md +203 -156
  28. package/.agent/agents/test-coverage-reviewer.md +193 -81
  29. package/.agent/agents/type-safety-reviewer.md +208 -65
  30. package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
  31. package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
  32. package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
  33. package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
  34. package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
  35. package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
  36. package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
  37. package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
  38. package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
  39. package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
  40. package/.agent/skills/agent-organizer/SKILL.md +126 -132
  41. package/.agent/skills/ai-prompt-injection-defense/SKILL.md +155 -66
  42. package/.agent/skills/api-patterns/SKILL.md +289 -257
  43. package/.agent/skills/api-security-auditor/SKILL.md +172 -70
  44. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
  45. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
  46. package/.agent/skills/appflow-wireframe/SKILL.md +107 -100
  47. package/.agent/skills/architecture/SKILL.md +331 -200
  48. package/.agent/skills/authentication-best-practices/SKILL.md +168 -67
  49. package/.agent/skills/bash-linux/SKILL.md +154 -215
  50. package/.agent/skills/brainstorming/SKILL.md +104 -210
  51. package/.agent/skills/building-native-ui/SKILL.md +169 -70
  52. package/.agent/skills/clean-code/SKILL.md +360 -206
  53. package/.agent/skills/config-validator/SKILL.md +141 -165
  54. package/.agent/skills/csharp-developer/SKILL.md +528 -107
  55. package/.agent/skills/database-design/SKILL.md +455 -275
  56. package/.agent/skills/deployment-procedures/SKILL.md +145 -188
  57. package/.agent/skills/devops-engineer/SKILL.md +332 -134
  58. package/.agent/skills/devops-incident-responder/SKILL.md +113 -98
  59. package/.agent/skills/edge-computing/SKILL.md +157 -213
  60. package/.agent/skills/extract-design-system/SKILL.md +129 -69
  61. package/.agent/skills/framer-motion-expert/SKILL.md +939 -0
  62. package/.agent/skills/game-design-expert/SKILL.md +105 -0
  63. package/.agent/skills/game-engineering-expert/SKILL.md +122 -0
  64. package/.agent/skills/geo-fundamentals/SKILL.md +124 -215
  65. package/.agent/skills/github-operations/SKILL.md +314 -354
  66. package/.agent/skills/gsap-expert/SKILL.md +901 -0
  67. package/.agent/skills/i18n-localization/SKILL.md +138 -216
  68. package/.agent/skills/intelligent-routing/SKILL.md +127 -139
  69. package/.agent/skills/llm-engineering/SKILL.md +357 -258
  70. package/.agent/skills/local-first/SKILL.md +154 -203
  71. package/.agent/skills/mcp-builder/SKILL.md +118 -224
  72. package/.agent/skills/nextjs-react-expert/SKILL.md +783 -203
  73. package/.agent/skills/nodejs-best-practices/SKILL.md +559 -280
  74. package/.agent/skills/observability/SKILL.md +330 -285
  75. package/.agent/skills/parallel-agents/SKILL.md +122 -181
  76. package/.agent/skills/performance-profiling/SKILL.md +254 -197
  77. package/.agent/skills/plan-writing/SKILL.md +118 -188
  78. package/.agent/skills/platform-engineer/SKILL.md +123 -135
  79. package/.agent/skills/playwright-best-practices/SKILL.md +157 -76
  80. package/.agent/skills/powershell-windows/SKILL.md +146 -230
  81. package/.agent/skills/python-pro/SKILL.md +879 -114
  82. package/.agent/skills/react-specialist/SKILL.md +931 -108
  83. package/.agent/skills/realtime-patterns/SKILL.md +304 -296
  84. package/.agent/skills/rust-pro/SKILL.md +701 -240
  85. package/.agent/skills/seo-fundamentals/SKILL.md +154 -181
  86. package/.agent/skills/server-management/SKILL.md +190 -212
  87. package/.agent/skills/shadcn-ui-expert/SKILL.md +201 -68
  88. package/.agent/skills/sql-pro/SKILL.md +633 -104
  89. package/.agent/skills/swiftui-expert/SKILL.md +171 -70
  90. package/.agent/skills/systematic-debugging/SKILL.md +118 -186
  91. package/.agent/skills/tailwind-patterns/SKILL.md +576 -232
  92. package/.agent/skills/tdd-workflow/SKILL.md +137 -209
  93. package/.agent/skills/testing-patterns/SKILL.md +573 -205
  94. package/.agent/skills/vue-expert/SKILL.md +964 -119
  95. package/.agent/skills/vulnerability-scanner/SKILL.md +269 -316
  96. package/.agent/skills/web-accessibility-auditor/SKILL.md +188 -71
  97. package/.agent/skills/webapp-testing/SKILL.md +145 -236
  98. package/.agent/workflows/api-tester.md +151 -279
  99. package/.agent/workflows/audit.md +138 -168
  100. package/.agent/workflows/brainstorm.md +110 -146
  101. package/.agent/workflows/changelog.md +112 -144
  102. package/.agent/workflows/create.md +124 -139
  103. package/.agent/workflows/debug.md +189 -196
  104. package/.agent/workflows/deploy.md +189 -153
  105. package/.agent/workflows/enhance.md +151 -139
  106. package/.agent/workflows/fix.md +135 -143
  107. package/.agent/workflows/generate.md +157 -164
  108. package/.agent/workflows/migrate.md +160 -163
  109. package/.agent/workflows/orchestrate.md +168 -151
  110. package/.agent/workflows/performance-benchmarker.md +123 -305
  111. package/.agent/workflows/plan.md +173 -151
  112. package/.agent/workflows/preview.md +80 -137
  113. package/.agent/workflows/refactor.md +183 -153
  114. package/.agent/workflows/review-ai.md +129 -140
  115. package/.agent/workflows/review.md +116 -155
  116. package/.agent/workflows/session.md +94 -154
  117. package/.agent/workflows/status.md +79 -125
  118. package/.agent/workflows/strengthen-skills.md +139 -99
  119. package/.agent/workflows/swarm.md +179 -194
  120. package/.agent/workflows/test.md +211 -166
  121. package/.agent/workflows/tribunal-backend.md +113 -111
  122. package/.agent/workflows/tribunal-database.md +115 -132
  123. package/.agent/workflows/tribunal-frontend.md +118 -115
  124. package/.agent/workflows/tribunal-full.md +133 -136
  125. package/.agent/workflows/tribunal-mobile.md +119 -123
  126. package/.agent/workflows/tribunal-performance.md +133 -152
  127. package/.agent/workflows/ui-ux-pro-max.md +143 -171
  128. package/README.md +11 -15
  129. package/package.json +1 -1
  130. package/.agent/skills/dotnet-core-expert/SKILL.md +0 -103
  131. package/.agent/skills/framer-motion-animations/SKILL.md +0 -74
  132. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  133. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  134. package/.agent/skills/game-development/SKILL.md +0 -236
  135. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  136. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  137. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  138. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  139. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  140. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  141. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  142. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
@@ -1,210 +1,104 @@
1
- ---
2
- name: brainstorming
3
- description: Socratic questioning protocol + user communication. MANDATORY for complex requests, new features, or unclear requirements. Includes progress reporting and error handling.
4
- allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 1.0.0
6
- last-updated: 2026-03-12
7
- applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
- ---
9
-
10
- # Brainstorming & Discovery Protocol
11
-
12
- > The most expensive part of building software is building the wrong thing.
13
- > Ask the questions that prevent that.
14
-
15
- ---
16
-
17
- ## When This Skill Is Required
18
-
19
- Activate before generating any implementation plan when:
20
-
21
- - A new feature or system is being created
22
- - The request is vague or uses words like "something like" or "maybe"
23
- - Multiple valid technical approaches exist and the right one depends on context
24
- - The user hasn't described their users, scale, or constraints
25
-
26
- ---
27
-
28
- ## The Socratic Method Applied to Software
29
-
30
- The goal is not to interrogate. It is to surface hidden assumptions before they become hard-coded decisions.
31
-
32
- ### Discovery Questions by Layer
33
-
34
- **Purpose (What problem does this solve?)**
35
- - What outcome does the user need — not what feature do they want?
36
- - What happens today without this?
37
- - What does success look like in 30 days?
38
-
39
- **Users (Who is this for?)**
40
- - Who are the actual end users?
41
- - What is their technical level?
42
- - Are there multiple user types with different needs?
43
-
44
- **Scope (What is and isn't included?)**
45
- - What is explicitly out of scope for this version?
46
- - What data already exists vs. what needs to be created?
47
- - Are there integrations with other systems?
48
-
49
- **Market & Psychology (Why will they use it?)**
50
- - Who are the current competitors or alternatives, and how are we different?
51
- - What is the launch strategy and monetization approach?
52
- - What emotional state is the user in when they need this product?
53
-
54
- **Superpowers & Creative Constraints (Breaking the mold)**
55
- - If we had to solve this without writing any code, how would we do it?
56
- - What is the most unconventional, "fun", or high-leverage way to achieve this outcome?
57
- - Can we leverage existing external super-APIs (LLMs, edge networks, managed integrations) to bypass traditional development?
58
-
59
- **Constraints (What limits the design?)**
60
- - Existing tech stack?
61
- - Performance requirements? (users, requests/sec, data volume)
62
- - Deadline?
63
- - Budget for paid services?
64
-
65
- ---
66
-
67
- ## Question Protocol
68
-
69
- For complex requests: ask **minimum 3 strategic questions** before proposing anything.
70
-
71
- For simple but vague requests: ask **1 focused question** on the most blocking unknown.
72
-
73
- **Format:**
74
- ```
75
- Before I propose a solution, a few questions:
76
-
77
- 1. [Most critical unknown]
78
- 2. [Second most important]
79
- 3. [Clarifies scope or constraints]
80
-
81
- [Optional: brief note on why these matter]
82
- ```
83
-
84
- **Rules:**
85
- - Ask about one topic per question not compound questions (`and`/`or` in a question = split it)
86
- - Numbered list, not a wall of text
87
- - Never more than 5 questions at once
88
- - Always inject at least one highly creative, out-of-the-box alternative approach ("Superpower Option") when proposing paths.
89
- - If answers create new unknowns, ask a follow-up round
90
-
91
- ---
92
-
93
- ## Anti-Patterns in Discovery
94
-
95
- **What to avoid:**
96
-
97
- | Pattern | Why It's Harmful |
98
- |---|---|
99
- | Assuming the tech stack | Leads to architecture that fits you, not the project |
100
- | Solving the stated feature, not the problem | User asks for X but needs Y — you build X |
101
- | Treating "I want a dashboard" as a spec | Dashboards have hundreds of valid forms |
102
- | Jumping to implementation to seem helpful | Wastes both parties' time if direction is wrong |
103
- | Asking leading questions | "Should we use Next.js?" vs "What matters most for deployment?" |
104
-
105
- ---
106
-
107
- ## Reporting During Complex Work
108
-
109
- When working on multi-step tasks, report progress proactively.
110
-
111
- **Status update format:**
112
- ```
113
- ✅ [Completed step]
114
- 🔄 [Current step — what you're doing right now]
115
- ⏳ [Next step]
116
- ```
117
-
118
- Report at natural breakpoints — not after every file edit.
119
-
120
- ---
121
-
122
- ## Error Handling During Implementation
123
-
124
- When something fails or an assumption is proven wrong mid-task:
125
-
126
- 1. Stop immediately — don't continue building on a broken assumption
127
- 2. State what was expected vs. what was found
128
- 3. Propose 2–3 corrected approaches with trade-offs
129
- 4. Ask which direction to proceed
130
-
131
- ```
132
- ❌ Found an issue:
133
- Expected: users table has an `email` column
134
- Found: email is in a separate `user_contacts` table
135
-
136
- Options:
137
- A) Join through user_contacts (correct but slower queries)
138
- B) Denormalize email onto users table (faster, requires migration)
139
- C) Ask what the schema decision was intended to be
140
-
141
- Which should I proceed with?
142
- ```
143
-
144
- ---
145
-
146
- ## File Index
147
-
148
- | File | Covers | Load When |
149
- |---|---|---|
150
- | `dynamic-questioning.md` | Advanced question frameworks by domain | Discovery for complex systems |
151
-
152
- ---
153
-
154
- ## Output Format
155
-
156
- When this skill produces a recommendation or design decision, structure your output as:
157
-
158
- ```
159
- ━━━ Brainstorming Recommendation ━━━━━━━━━━━━━━━━
160
- Decision: [what was chosen / proposed]
161
- Rationale: [why — one concise line]
162
- Trade-offs: [what is consciously accepted]
163
- Next action: [concrete next step for the user]
164
- ─────────────────────────────────────────────────
165
- Pre-Flight: ✅ All checks passed
166
- or ❌ [blocking item that must be resolved first]
167
- ```
168
-
169
-
170
-
171
- ---
172
-
173
- ## 🤖 LLM-Specific Traps
174
-
175
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
176
-
177
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
178
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
179
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
180
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
181
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
182
-
183
- ---
184
-
185
- ## 🏛️ Tribunal Integration (Anti-Hallucination)
186
-
187
- **Slash command: `/review` or `/tribunal-full`**
188
- **Active reviewers: `logic-reviewer` · `security-auditor`**
189
-
190
- ### ❌ Forbidden AI Tropes
191
-
192
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
193
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
194
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
195
-
196
- ### ✅ Pre-Flight Self-Audit
197
-
198
- Review these questions before confirming output:
199
- ```
200
- ✅ Did I rely ONLY on real, verified tools and methods?
201
- ✅ Is this solution appropriately scoped to the user's constraints?
202
- ✅ Did I handle potential failure modes and edge cases?
203
- ✅ Have I avoided generic boilerplate that doesn't add value?
204
- ```
205
-
206
- ### 🛑 Verification-Before-Completion (VBC) Protocol
207
-
208
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
209
- - ❌ **Forbidden:** Declaring a task complete because the output "looks correct."
210
- - ✅ **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
+ ---
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,75 +1,174 @@
1
1
  ---
2
2
  name: building-native-ui
3
- description: Cross-platform App UI expert specialized in React Native and Expo. Focuses on safe areas, keyboard handling, layout performance, and platform-specific heuristics.
3
+ description: Cross-platform Native UI mastery (React Native / Expo). Building seamless, 60fps mobile interfaces, handling safe areas, navigation architectures (Expo Router), native modules, gestures/animations (Reanimated), and platform-specific styling. Use when building React Native or Expo mobile apps.
4
4
  allowed-tools: Read, Write, Edit, Glob, Grep
5
- version: 1.0.0
6
- last-updated: 2026-03-30
7
- applies-to-model: claude-3-7-sonnet, gemini-2.5-pro
5
+ version: 2.0.0
6
+ last-updated: 2026-04-02
7
+ applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
8
8
  ---
9
9
 
10
- # Building Native UI (React Native / Expo)
11
-
12
- You are an expert Mobile Frontend Engineer. You understand the profound differences between building a website and building a fluid, responsive native application for iOS and Android.
13
-
14
- ## Core Directives
15
-
16
- 1. **Environmental Safety First:**
17
- - Always wrap root navigational components or edge-touching screens in `SafeAreaView` (from `react-native-safe-area-context`).
18
- - Any screen containing text inputs MUST utilize `KeyboardAvoidingView` or `KeyboardAwareScrollView` to prevent the software keyboard from occluding input fields.
19
-
20
- 2. **Platform Tropes:**
21
- - Rely heavily on `Platform.OS` or `Platform.select()` to gracefully adapt UI components.
22
- - Shadows on iOS (`shadowOpacity`, `shadowRadius`) do not work the same stringently on Android (`elevation`). Provide robust fallback implementations to both.
23
-
24
- 3. **Performance Boundaries:**
25
- - Never use deeply generic or unbound nested `.map()` loops for massive UI layouts. Always use `FlatList` or `FlashList` for heavy lists to optimize memory via view recycling.
26
- - Avoid massive functional component re-renders. Use standard `useMemo` strictly for expensive list data formatting.
27
-
28
- 4. **Animations & Gestures:**
29
- - Use `react-native-reanimated` instead of standard `Animated` for anything complex. Run animations completely natively on the UI thread without dropping JS bridge frames.
30
- - Pair interactive swipes/drags directly with `react-native-gesture-handler`.
31
-
32
- ## Execution
33
- When outputting React Native application markup, always default to importing high-performance primitives (`Pressable` over `TouchableOpacity`, `FlashList` over `ScrollView(map)`).
34
-
35
-
36
- ---
37
-
38
- ## 🤖 LLM-Specific Traps
39
-
40
- AI coding assistants often fall into specific bad habits when dealing with this domain. These are strictly forbidden:
41
-
42
- 1. **Over-engineering:** Proposing complex abstractions or distributed systems when a simpler approach suffices.
43
- 2. **Hallucinated Libraries/Methods:** Using non-existent methods or packages. Always `// VERIFY` or check `package.json` / `requirements.txt`.
44
- 3. **Skipping Edge Cases:** Writing the "happy path" and ignoring error handling, timeouts, or data validation.
45
- 4. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
46
- 5. **Silent Degradation:** Catching and suppressing errors without logging or re-raising.
47
-
48
- ---
49
-
50
- ## 🏛️ Tribunal Integration (Anti-Hallucination)
51
-
52
- **Slash command: `/review` or `/tribunal-full`**
53
- **Active reviewers: `logic-reviewer` · `security-auditor`**
54
-
55
- ### ❌ Forbidden AI Tropes
56
-
57
- 1. **Blind Assumptions:** Never make an assumption without documenting it clearly with `// VERIFY: [reason]`.
58
- 2. **Silent Degradation:** Catching and suppressing errors without logging or handling.
59
- 3. **Context Amnesia:** Forgetting the user's constraints and offering generic advice instead of tailored solutions.
60
-
61
- ### ✅ Pre-Flight Self-Audit
62
-
63
- Review these questions before confirming output:
64
- ```
65
- Did I rely ONLY on real, verified tools and methods?
66
- Is this solution appropriately scoped to the user's constraints?
67
- ✅ Did I handle potential failure modes and edge cases?
68
- ✅ Have I avoided generic boilerplate that doesn't add value?
69
- ```
70
-
71
- ### 🛑 Verification-Before-Completion (VBC) Protocol
72
-
73
- **CRITICAL:** You must follow a strict "evidence-based closeout" state machine.
74
- - **Forbidden:** Declaring a task complete because the output "looks correct."
75
- - ✅ **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.
10
+ # Building Native UI React Native & Expo Mastery
11
+
12
+ > A mobile app isn't a website confined to a small screen.
13
+ > 60 FPS is not a goal; it is a rigid requirement. The JS thread is a fragile bottleneck.
14
+
15
+ ---
16
+
17
+ ## 1. The Expo Router Architecture
18
+
19
+ File-based routing replaces legacy imperative React Navigation boilerplates.
20
+
21
+ ```typescript
22
+ // Directory structure dictates routes
23
+ // app/
24
+ // ├── _layout.tsx (Global wrap, e.g. Stack or Tabs)
25
+ // ├── index.tsx (Matches '/')
26
+ // ├── (auth)/ (Route group, invisible in URL)
27
+ // │ └── login.tsx (Matches '/login')
28
+ // └── user/
29
+ // └── [id].tsx (Dynamic route, matches '/user/123')
30
+
31
+ // Link navigation (Strongly typed in Expo Router v3+)
32
+ import { Link, router } from 'expo-router';
33
+
34
+ export default function Home() {
35
+ return (
36
+ <View>
37
+ {/* Declarative */}
38
+ <Link href="/user/123" asChild>
39
+ <Pressable><Text>Go to Profile</Text></Pressable>
40
+ </Link>
41
+
42
+ {/* Imperative */}
43
+ <Button onPress={() => router.push('/(auth)/login')} title="Login" />
44
+ </View>
45
+ );
46
+ }
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 2. Platform Nuances & Safe Areas
52
+
53
+ Mobile devices have notches, home indicators, and varied status bars.
54
+
55
+ ```typescript
56
+ // ❌ BAD: Ignoring notches
57
+ export const Header = () => <View style={{ paddingTop: 20 }} />
58
+
59
+ // GOOD: react-native-safe-area-context
60
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
61
+
62
+ export const Header = () => {
63
+ const insets = useSafeAreaInsets();
64
+ return (
65
+ <View style={{ paddingTop: insets.top, paddingBottom: insets.bottom }}>
66
+ <Text>Header Content</Text>
67
+ </View>
68
+ );
69
+ }
70
+
71
+ // Platform-specific logic
72
+ import { Platform, StyleSheet } from 'react-native';
73
+
74
+ const styles = StyleSheet.create({
75
+ shadow: {
76
+ ...Platform.select({
77
+ ios: { shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.2 },
78
+ android: { elevation: 4 }, // Android requires elevation for shadows
79
+ }),
80
+ }
81
+ });
82
+ ```
83
+
84
+ ---
85
+
86
+ ## 3. High-Performance Animations (Reanimated)
87
+
88
+ Never animate over the React Native bridge. Keep animations strictly on the native UI thread using `react-native-reanimated`.
89
+
90
+ ```typescript
91
+ // ❌ BAD: Animated.Value across the bridge, or setState driven animations
92
+ // setState -> JS Thread calculate -> Bridge JSON -> Native UI (Drops frames!)
93
+
94
+ // ✅ GOOD: Reanimated UI thread execution
95
+ import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
96
+
97
+ export function BouncyBox() {
98
+ const offset = useSharedValue(0); // Lives natively
99
+
100
+ const animatedStyles = useAnimatedStyle(() => {
101
+ return {
102
+ transform: [{ translateY: offset.value }], // Syncs natively
103
+ };
104
+ });
105
+
106
+ return (
107
+ <>
108
+ <Animated.View style={[styles.box, animatedStyles]} />
109
+ <Button onPress={() => (offset.value = withSpring(Math.random() * 255))} title="Bounce" />
110
+ </>
111
+ );
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ## 4. List Performance
118
+
119
+ FlatList rendering is the #1 cause of React Native app crashes due to OOM (Out of Memory).
120
+
121
+ ```typescript
122
+ import { FlashList } from "@shopify/flash-list";
123
+
124
+ // ❌ BAD: Standard ScrollView for massive lists
125
+ // Maps every item instantly. Crashes on large data sets.
126
+
127
+ // ❌ MEDIOCRE: FlatList
128
+ // Blank spaces when scrolling fast due to JS thread bridge bottlenecks.
129
+
130
+ // ✅ BEST: FlashList (Shopify)
131
+ // Recycles views instantly like native UICollectionView / RecyclerView.
132
+ export function FastList({ data }) {
133
+ return (
134
+ <FlashList
135
+ data={data}
136
+ renderItem={({ item }) => <Text>{item.title}</Text>}
137
+ estimatedItemSize={50} // CRUCIAL for performance
138
+ />
139
+ );
140
+ }
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 🤖 LLM-Specific Traps (React Native UI)
146
+
147
+ 1. **HTML Elements:** AI frequently hallucinates `<div>`, `<span>`, and `<p>` tags inside React Native code. React Native STRICTLY requires `<View>`, `<Text>`, and `<Pressable>`.
148
+ 2. **CSS properties:** AI writes `box-shadow` or `border-radius: 10px`. React Native styling uses `shadowColor / elevation` and numeric `borderRadius: 10`.
149
+ 3. **Bridge Animations:** AI suggests legacy `Animated.timing` or `setState` loops for animations. Demand `react-native-reanimated` shared values on the UI thread.
150
+ 4. **Ignoring Safe Areas:** Bounding UI boxes against the absolute physical screen edge, resulting in text hidden behind iPhone dynamic islands or Android navigation bars.
151
+ 5. **ScrollView Data Dumps:** Rendering a `.map()` inside a `<ScrollView>` for 1000 items, crashing the mobile memory constraint.
152
+ 6. **`onClick` instead of `onPress`:** Using standard web synthetic events. React Native buttons use `onPress`.
153
+ 7. **Absolute SVGs:** Attempting to render standard `<svg>` tags. Requires `react-native-svg` with precise React-friendly props.
154
+ 8. **Keyboard Avoidance:** Failing to wrap inputs in `<KeyboardAvoidingView>`, meaning the digital keyboard pops up and permanently obscures the text input.
155
+ 9. **Platform Blindness:** Applying `shadowOpacity` expecting it to work on Android (it doesn't, requires `elevation`).
156
+ 10. **Legacy Navigation:** Generating sprawling `react-navigation` stack files instead of utilizing modern Expo Router file-based topologies.
157
+
158
+ ---
159
+
160
+ ## 🏛️ Tribunal Integration
161
+
162
+ ### ✅ Pre-Flight Self-Audit
163
+ ```
164
+ ✅ Did I exclusively use native primitives (<View>, <Text>, <Pressable>) and NO HTML tags?
165
+ ✅ Is `react-native-reanimated` handling all physics and animations on the UI thread?
166
+ ✅ Are large lists utilizing `<FlashList>` with a declared `estimatedItemSize`?
167
+ ✅ Is UI guarded from notches using `useSafeAreaInsets`?
168
+ ✅ Are styles written strictly via `StyleSheet.create` with numeric values, not string CSS?
169
+ ✅ Are interactive touch points using `onPress`, not `onClick`?
170
+ ✅ Is the Keyboard explicitly handled via `KeyboardAvoidingView` or `KeyboardAwareScrollView`?
171
+ ✅ Is routing leveraging modern Expo Router file systems?
172
+ ✅ Are shadows handled specifically for iOS (shadowProps) and Android (elevation)?
173
+ ✅ Have I avoided sending massive state updates back and forth across the JS bridge?
174
+ ```