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.
- package/.agent/agents/accessibility-reviewer.md +220 -134
- package/.agent/agents/ai-code-reviewer.md +233 -129
- package/.agent/agents/backend-specialist.md +238 -178
- package/.agent/agents/code-archaeologist.md +181 -119
- package/.agent/agents/database-architect.md +207 -164
- package/.agent/agents/debugger.md +218 -151
- package/.agent/agents/dependency-reviewer.md +136 -55
- package/.agent/agents/devops-engineer.md +238 -175
- package/.agent/agents/documentation-writer.md +221 -137
- package/.agent/agents/explorer-agent.md +180 -142
- package/.agent/agents/frontend-reviewer.md +194 -80
- package/.agent/agents/frontend-specialist.md +237 -188
- package/.agent/agents/game-developer.md +52 -184
- package/.agent/agents/logic-reviewer.md +149 -78
- package/.agent/agents/mobile-developer.md +223 -152
- package/.agent/agents/mobile-reviewer.md +195 -79
- package/.agent/agents/orchestrator.md +211 -170
- package/.agent/agents/penetration-tester.md +174 -131
- package/.agent/agents/performance-optimizer.md +203 -139
- package/.agent/agents/performance-reviewer.md +211 -108
- package/.agent/agents/product-manager.md +162 -108
- package/.agent/agents/project-planner.md +162 -142
- package/.agent/agents/qa-automation-engineer.md +242 -138
- package/.agent/agents/security-auditor.md +194 -170
- package/.agent/agents/seo-specialist.md +213 -132
- package/.agent/agents/sql-reviewer.md +194 -73
- package/.agent/agents/supervisor-agent.md +203 -156
- package/.agent/agents/test-coverage-reviewer.md +193 -81
- package/.agent/agents/type-safety-reviewer.md +208 -65
- package/.agent/scripts/__pycache__/auto_preview.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/bundle_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/checklist.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/dependency_analyzer.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/security_scan.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/session_manager.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/skill_integrator.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/swarm_dispatcher.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/test_runner.cpython-311.pyc +0 -0
- package/.agent/scripts/__pycache__/verify_all.cpython-311.pyc +0 -0
- package/.agent/skills/agent-organizer/SKILL.md +126 -132
- package/.agent/skills/ai-prompt-injection-defense/SKILL.md +155 -66
- package/.agent/skills/api-patterns/SKILL.md +289 -257
- package/.agent/skills/api-security-auditor/SKILL.md +172 -70
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +1 -1
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +1 -1
- package/.agent/skills/appflow-wireframe/SKILL.md +107 -100
- package/.agent/skills/architecture/SKILL.md +331 -200
- package/.agent/skills/authentication-best-practices/SKILL.md +168 -67
- package/.agent/skills/bash-linux/SKILL.md +154 -215
- package/.agent/skills/brainstorming/SKILL.md +104 -210
- package/.agent/skills/building-native-ui/SKILL.md +169 -70
- package/.agent/skills/clean-code/SKILL.md +360 -206
- package/.agent/skills/config-validator/SKILL.md +141 -165
- package/.agent/skills/csharp-developer/SKILL.md +528 -107
- package/.agent/skills/database-design/SKILL.md +455 -275
- package/.agent/skills/deployment-procedures/SKILL.md +145 -188
- package/.agent/skills/devops-engineer/SKILL.md +332 -134
- package/.agent/skills/devops-incident-responder/SKILL.md +113 -98
- package/.agent/skills/edge-computing/SKILL.md +157 -213
- package/.agent/skills/extract-design-system/SKILL.md +129 -69
- package/.agent/skills/framer-motion-expert/SKILL.md +939 -0
- package/.agent/skills/game-design-expert/SKILL.md +105 -0
- package/.agent/skills/game-engineering-expert/SKILL.md +122 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +124 -215
- package/.agent/skills/github-operations/SKILL.md +314 -354
- package/.agent/skills/gsap-expert/SKILL.md +901 -0
- package/.agent/skills/i18n-localization/SKILL.md +138 -216
- package/.agent/skills/intelligent-routing/SKILL.md +127 -139
- package/.agent/skills/llm-engineering/SKILL.md +357 -258
- package/.agent/skills/local-first/SKILL.md +154 -203
- package/.agent/skills/mcp-builder/SKILL.md +118 -224
- package/.agent/skills/nextjs-react-expert/SKILL.md +783 -203
- package/.agent/skills/nodejs-best-practices/SKILL.md +559 -280
- package/.agent/skills/observability/SKILL.md +330 -285
- package/.agent/skills/parallel-agents/SKILL.md +122 -181
- package/.agent/skills/performance-profiling/SKILL.md +254 -197
- package/.agent/skills/plan-writing/SKILL.md +118 -188
- package/.agent/skills/platform-engineer/SKILL.md +123 -135
- package/.agent/skills/playwright-best-practices/SKILL.md +157 -76
- package/.agent/skills/powershell-windows/SKILL.md +146 -230
- package/.agent/skills/python-pro/SKILL.md +879 -114
- package/.agent/skills/react-specialist/SKILL.md +931 -108
- package/.agent/skills/realtime-patterns/SKILL.md +304 -296
- package/.agent/skills/rust-pro/SKILL.md +701 -240
- package/.agent/skills/seo-fundamentals/SKILL.md +154 -181
- package/.agent/skills/server-management/SKILL.md +190 -212
- package/.agent/skills/shadcn-ui-expert/SKILL.md +201 -68
- package/.agent/skills/sql-pro/SKILL.md +633 -104
- package/.agent/skills/swiftui-expert/SKILL.md +171 -70
- package/.agent/skills/systematic-debugging/SKILL.md +118 -186
- package/.agent/skills/tailwind-patterns/SKILL.md +576 -232
- package/.agent/skills/tdd-workflow/SKILL.md +137 -209
- package/.agent/skills/testing-patterns/SKILL.md +573 -205
- package/.agent/skills/vue-expert/SKILL.md +964 -119
- package/.agent/skills/vulnerability-scanner/SKILL.md +269 -316
- package/.agent/skills/web-accessibility-auditor/SKILL.md +188 -71
- package/.agent/skills/webapp-testing/SKILL.md +145 -236
- package/.agent/workflows/api-tester.md +151 -279
- package/.agent/workflows/audit.md +138 -168
- package/.agent/workflows/brainstorm.md +110 -146
- package/.agent/workflows/changelog.md +112 -144
- package/.agent/workflows/create.md +124 -139
- package/.agent/workflows/debug.md +189 -196
- package/.agent/workflows/deploy.md +189 -153
- package/.agent/workflows/enhance.md +151 -139
- package/.agent/workflows/fix.md +135 -143
- package/.agent/workflows/generate.md +157 -164
- package/.agent/workflows/migrate.md +160 -163
- package/.agent/workflows/orchestrate.md +168 -151
- package/.agent/workflows/performance-benchmarker.md +123 -305
- package/.agent/workflows/plan.md +173 -151
- package/.agent/workflows/preview.md +80 -137
- package/.agent/workflows/refactor.md +183 -153
- package/.agent/workflows/review-ai.md +129 -140
- package/.agent/workflows/review.md +116 -155
- package/.agent/workflows/session.md +94 -154
- package/.agent/workflows/status.md +79 -125
- package/.agent/workflows/strengthen-skills.md +139 -99
- package/.agent/workflows/swarm.md +179 -194
- package/.agent/workflows/test.md +211 -166
- package/.agent/workflows/tribunal-backend.md +113 -111
- package/.agent/workflows/tribunal-database.md +115 -132
- package/.agent/workflows/tribunal-frontend.md +118 -115
- package/.agent/workflows/tribunal-full.md +133 -136
- package/.agent/workflows/tribunal-mobile.md +119 -123
- package/.agent/workflows/tribunal-performance.md +133 -152
- package/.agent/workflows/ui-ux-pro-max.md +143 -171
- package/README.md +11 -15
- package/package.json +1 -1
- package/.agent/skills/dotnet-core-expert/SKILL.md +0 -103
- package/.agent/skills/framer-motion-animations/SKILL.md +0 -74
- package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
- package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
- package/.agent/skills/game-development/SKILL.md +0 -236
- package/.agent/skills/game-development/game-art/SKILL.md +0 -185
- package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
- package/.agent/skills/game-development/game-design/SKILL.md +0 -129
- package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
- package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
- package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
- package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
- package/.agent/skills/game-development/web-games/SKILL.md +0 -150
|
@@ -1,210 +1,104 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: brainstorming
|
|
3
|
-
description: Socratic
|
|
4
|
-
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
-
version:
|
|
6
|
-
last-updated: 2026-
|
|
7
|
-
applies-to-model: gemini-2.5-pro, claude-3-7-sonnet
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Brainstorming
|
|
11
|
-
|
|
12
|
-
>
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
- What
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
1.
|
|
78
|
-
2.
|
|
79
|
-
3.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
|
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:
|
|
6
|
-
last-updated: 2026-
|
|
7
|
-
applies-to-model: claude-3-7-sonnet
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
```
|