Common Pitfalls Prevention
Orchestrates specialized pitfall prevention skills learned from production issues. Use during code review to automatically check for common mistakes.
When to Use
- During code review (auto-triggered by full-review skill)
- Before committing changes
- When debugging production issues
- Reviewing unfamiliar code patterns
Workflow
Step 1: Identify Code Categories
Based on changed files, determine which sub-skills to invoke:
| File Pattern |
Sub-Skill |
**/hooks/**, useQuery, useMutation |
pitfalls-tanstack-query |
**/db/**, schema.ts, drizzle |
pitfalls-drizzle-orm |
**/routes/**, router., app. |
pitfalls-express-api |
**/components/**, **/pages/**, .tsx |
pitfalls-react |
websocket, wss, ws. |
pitfalls-websocket |
contract, rpc, multicall, gas |
pitfalls-blockchain |
session, key, cache, log |
pitfalls-security |
Step 2: Invoke Relevant Sub-Skills
For each category found, invoke the corresponding skill for detailed patterns.
Step 3: Generate Combined Report
Aggregate findings from all invoked sub-skills.
Sub-Skills Reference
| Skill |
Focus Area |
| pitfalls-tanstack-query |
Query keys, invalidation, v5 patterns |
| pitfalls-drizzle-orm |
Schema types, migrations, array columns |
| pitfalls-express-api |
Routes, status codes, storage patterns |
| pitfalls-react |
Components, forms, a11y, responsive |
| pitfalls-websocket |
Server setup, heartbeat, reconnection |
| pitfalls-blockchain |
RPC errors, gas, multicall, nonces |
| pitfalls-security |
Session keys, caching, logging, secrets |
Quick Reference Checklist
Core
Type Safety
Financial
Blockchain
Security
1---
2name: common-pitfalls
3description: Orchestrates pitfall prevention skills for common development issues. Auto-triggered during code review to check for TanStack Query, Drizzle ORM, Express API, React, WebSocket, blockchain RPC, and security pitfalls.
4metadata:
5 source: https://skillmd.com/skills/aibot88/common-pitfalls
6---
7
8# Common Pitfalls Prevention
9
10Orchestrates specialized pitfall prevention skills learned from production issues. Use during code review to automatically check for common mistakes.
11
12## When to Use
13
14- During code review (auto-triggered by full-review skill)
15- Before committing changes
16- When debugging production issues
17- Reviewing unfamiliar code patterns
18
19## Workflow
20
21### Step 1: Identify Code Categories
22
23Based on changed files, determine which sub-skills to invoke:
24
25| File Pattern | Sub-Skill |
26|-------------|-----------|
27| `**/hooks/**`, `useQuery`, `useMutation` | pitfalls-tanstack-query |
28| `**/db/**`, `schema.ts`, `drizzle` | pitfalls-drizzle-orm |
29| `**/routes/**`, `router.`, `app.` | pitfalls-express-api |
30| `**/components/**`, `**/pages/**`, `.tsx` | pitfalls-react |
31| `websocket`, `wss`, `ws.` | pitfalls-websocket |
32| `contract`, `rpc`, `multicall`, `gas` | pitfalls-blockchain |
33| `session`, `key`, `cache`, `log` | pitfalls-security |
34
35### Step 2: Invoke Relevant Sub-Skills
36
37For each category found, invoke the corresponding skill for detailed patterns.
38
39### Step 3: Generate Combined Report
40
41Aggregate findings from all invoked sub-skills.
42
43## Sub-Skills Reference
44
45| Skill | Focus Area |
46|-------|------------|
47| **pitfalls-tanstack-query** | Query keys, invalidation, v5 patterns |
48| **pitfalls-drizzle-orm** | Schema types, migrations, array columns |
49| **pitfalls-express-api** | Routes, status codes, storage patterns |
50| **pitfalls-react** | Components, forms, a11y, responsive |
51| **pitfalls-websocket** | Server setup, heartbeat, reconnection |
52| **pitfalls-blockchain** | RPC errors, gas, multicall, nonces |
53| **pitfalls-security** | Session keys, caching, logging, secrets |
54
55## Quick Reference Checklist
56
57### Core
58- [ ] TanStack Query keys use full URL paths
59- [ ] Mutations invalidate relevant queries
60- [ ] Drizzle types exported for all models
61- [ ] API routes return correct status codes
62- [ ] All RPC calls wrapped in try/catch
63- [ ] WebSocket has heartbeat/reconnection
64- [ ] React components handle loading/error states
65- [ ] No secrets in logs or frontend code
66
67### Type Safety
68- [ ] No `any` types - use `unknown` and narrow
69- [ ] Types inferred from schema ($inferSelect, z.infer)
70- [ ] Type guards for runtime validation
71
72### Financial
73- [ ] BigInt for all token amounts
74- [ ] Decimal.js for price calculations
75- [ ] Proper rounding (floor/ceil)
76
77### Blockchain
78- [ ] Gas estimation with buffer
79- [ ] EIP-1559 gas pricing
80- [ ] Transaction simulation before send
81- [ ] Multicall uses `allowFailure: true`
82
83### Security
84- [ ] Session keys have expiry and limits
85- [ ] AES-256-GCM for stored credentials
86- [ ] Audit logging for sensitive operations
87- [ ] Rate limiting with exponential backoff