react-performance
Qué hace
Este agente ayuda a optimizar el rendimiento de sitios web creados con React y Next.js. Organiza más de 70 reglas para que tu código sea más rápido y eficiente.
Cuándo usarla
- ✓Al escribir o revisar código de React/Next.js.
- ✓Cuando un sitio web tarda en cargar o responde lento.
- ✓Para reducir el tamaño de los archivos que descarga el navegador.
Link de la skill
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/react-performance/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Cómo puedo optimizar la carga de imágenes en mi sitio web de React?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Analiza tu código y sugiere mejoras basadas en patrones de ingeniería de alto rendimiento. Las reglas están divididas por importancia, desde las críticas hasta las avanzadas.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
React Performance
Performance optimization patterns for React 18/19 and Next.js, adapted from Vercel Labs react-best-practices (MIT, v1.0.0). This skill organizes rules by priority and provides decision-tree guidance for active code review and refactoring.
When to Activate
- Writing or reviewing React/Next.js code for performance
- Diagnosing slow page loads, slow interactions, or high CPU on the client
- Auditing bundle size or Lighthouse Core Web Vitals regressions
- Removing waterfalls in Server Components / API routes
- Reducing client-side re-renders
- Optimizing long lists, animations, or hydration
- Auditing optimization choices in PRs touching
app/,pages/,components/, or data layers
Priority Index
| Priority | Category | Prefix | When it matters |
|---|---|---|---|
| 1 — CRITICAL | Eliminating Waterfalls | async- |
Anytime await is followed by independent await |
| 2 — CRITICAL | Bundle Size Optimization | bundle- |
First-load JS, route-level imports, third-party libs |
| 3 — HIGH | Server-Side Performance | server- |
RSC, Server Actions, API routes, SSR |
| 4 — MEDIUM-HIGH | Client-Side Data Fetching | client- |
SWR / TanStack Query / raw fetch in hooks |
| 5 — MEDIUM | Re-render Optimization | rerender- |
High-frequency state updates, parent-child fan-out |
| 6 — MEDIUM | Rendering Performance | rendering- |
Long lists, animations, hydration |
| 7 — LOW-MEDIUM | JavaScript Performance | js- |
Hot loops, frequent allocations |
| 8 — LOW | Advanced Patterns | advanced- |
Effect-event integration, stable refs |
1. Eliminating Waterfalls (CRITICAL)
"Waterfalls are the #1 performance killer" — every sequential
awaitadds full network latency.
Cheap conditions before await
Check sync conditions (props, env, hardcoded flags) before awaiting remote data.
// INCORRECT
async function Page({ id }: { id: string }) {
const flag = await getFlag("show-page");
if (!flag || !id) return null;
const data = await getData(id);
// ...
}
// CORRECT — short-circuit on cheap sync condition first
async function Page({ id }: { id: string }) {
if (!id) return null;
const flag = await getFlag("show-page");
if (!flag) return null;
const data = await getData(id);
}
Defer awaits until used
Move await into the branch that uses it.
// INCORRECT — awaits before deciding it needs the data
const user = await getUser(id);
if (mode === "guest") return renderGuest();
return renderUser(user);
// CORRECT
if (mode === "guest") return renderGuest();
const user = await getUser(id);
return renderUser(user);
Promise.all for independent work
// INCORRECT — sequential
const user = await getUser(id);
const posts = await getPosts(id);
const followers = await getFollowers(id);
// CORRECT — parallel
const [user, posts, followers] = await Promise.all([
getUser(id),
getPosts(id),
getFollowers(id),
]);
Partial dependencies — start early, await late
// CORRECT — kick off all promises, await only when each result is needed
const userP = getUser(id);
const postsP = getPosts(id);
const profile = await getProfile(id);
if (profile.private) return null;
const [user, posts] = await Promise.all([userP, postsP]);
Suspense for streaming
Push <Suspense> boundaries close to the data so the page paints what it can while slower sub-trees stream in. The trade-off: layout shift when content arrives — reserve space (skeleton or min-height).
Server Components: parallel through composition
// INCORRECT — sibling awaits run sequentially inside one component
export default async function Page() {
const user = await getUser();
const cart = await getCart();
return <View user={user} cart={cart} />;
}
// CORRECT — split into children, React runs them in parallel
export default async function Page() {
return (
<View>
<UserSection />
<CartSection />
</View>
);
}
2. Bundle Size Optimization (CRITICAL)
Direct imports, not barrels
Barrel index.ts files force the bundler to walk the entire module graph even when tree-shaking removes most of it. Direct imports save 200-800ms of first-load JS in many real-world apps.
// INCORRECT
import { Button, Card, Modal } from "@/components";
// CORRECT
import { Button } from "@/components/Button";
import { Card } from "@/components/Card";
…
Preguntas frecuentes
¿Qué son los 'waterfalls' o cascadas?
Son llamadas secuenciales que retrasan la carga. El agente ayuda a hacer estas llamadas en paralelo para acelerar el proceso.
¿Qué es el 'tamaño del bundle'?
Es el tamaño total de los archivos JavaScript que el navegador necesita descargar. Reducirlo hace que el sitio web sea más rápido, sobre todo con conexiones lentas.
¿Necesito saber mucho de React para usar esto?
No. El agente explica los conceptos de forma sencilla y se centra en aplicar buenas prácticas para mejorar el rendimiento.
Detalles
Descripción original del autor
React and Next.js performance optimization patterns adapted from Vercel Engineering's React Best Practices (https://github.com/vercel-labs/agent-skills). Organizes 70+ rules across 8 priority categories — waterfalls, bundle size, server-side, client fetching, re-render, rendering, JS micro-perf, advanced. Use when writing, reviewing, or refactoring React/Next.js code for performance.
repo: affaan-m/ECC
Popularidad
- Estrellas en GitHub
- 280 mil
- Posición en el ranking
- #238
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
accessibility
280 milAyuda a tu agente a crear interfaces accesibles para todos. Asegura que webs y apps funcionen bien para personas con discapacidad, como ciegas o con movilidad reducida.
agent-architecture-audit
280 milHace que tu agente compruebe que todo funciona bien. Encuentra y corrige problemas en sistemas de IA para que se comporten como se espera.
agent-eval
280 milAyuda a tu agente a comparar distintas herramientas de programación con IA. Mide cuál es más rápida, más barata y más fiable para tareas concretas.
agent-harness-construction
280 milHace que tu agente entienda mejor cómo realizar tareas. Optimiza las herramientas e instrucciones que usa para aumentar sus probabilidades de éxito.
Skills parecidas
dream-loop
260 milPermite que tu agente lleve una escena 3D o una app visual hacia una alta calidad gráfica, comparando sus capturas de pantalla con arte conceptual e iterando.
pretext
260 milCrea demos de navegador lúdicas en las que el texto se reajusta alrededor de formas en movimiento, forma niveles de juego o se rompe en partículas.
page-agent
260 milAyuda a tu agente a añadir un asistente de IA integrado en una app web, para que los usuarios den órdenes en lenguaje natural que la página ejecuta.