chore: vendor react-best-practices agent skill for cursor agents
CI / checks (push) Successful in 1m51s
CI / build (push) Successful in 3m34s

Adds the Vercel skill under .agents with famapp path patterns.

Includes skills-lock.json pin.
This commit is contained in:
ginnoir
2026-07-03 03:33:57 -05:00
parent 9c60b58947
commit 3d825fba20
138 changed files with 14153 additions and 0 deletions
@@ -0,0 +1,35 @@
---
title: Prevent Waterfall Chains in API Routes
impact: CRITICAL
impactDescription: 2-10× improvement
tags: api-routes, server-actions, waterfalls, parallelization
---
## Prevent Waterfall Chains in API Routes
In API routes and Server Actions, start independent operations immediately, even if you don't await them yet.
**Incorrect (config waits for auth, data waits for both):**
```typescript
export async function GET(request: Request) {
const session = await auth();
const config = await fetchConfig();
const data = await fetchData(session.user.id);
return Response.json({ data, config });
}
```
**Correct (auth and config start immediately):**
```typescript
export async function GET(request: Request) {
const sessionPromise = auth();
const configPromise = fetchConfig();
const session = await sessionPromise;
const [config, data] = await Promise.all([configPromise, fetchData(session.user.id)]);
return Response.json({ data, config });
}
```
For operations with more complex dependency chains, use `better-all` to automatically maximize parallelism (see Dependency-Based Parallelization).