react-performance
यह क्या करती है
यह agent React और Next.js से बनी websites की performance सुधारने में मदद करता है। यह 70 से ज़्यादा rules को व्यवस्थित करता है ताकि आपका code तेज़ और कुशल बने।
कब इस्तेमाल करें
- ✓React/Next.js code लिखते या समीक्षा करते समय।
- ✓जब कोई website धीरे लोड हो या धीरे प्रतिक्रिया दे।
- ✓browser द्वारा download होने वाली files का आकार घटाने के लिए।
Skill का लिंक
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/react-performance/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“अपनी React website पर images लोड होने की गति कैसे बढ़ाऊँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह आपके code का विश्लेषण करता है और high-performance engineering patterns के आधार पर सुधार सुझाता है। Rules महत्व के हिसाब से बाँटे गए हैं, critical से लेकर advanced तक।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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";
…
अक्सर पूछे जाने वाले सवाल
'waterfalls' क्या होते हैं?
ये एक के बाद एक होने वाली calls हैं जो loading में देरी करती हैं। Agent इन calls को एक साथ (parallel) चलाने में मदद करता है ताकि चीज़ें तेज़ हों।
'bundle size' क्या है?
यह उन JavaScript files का कुल आकार है जो browser को download करनी पड़ती हैं। इसे घटाने से website तेज़ होती है, खासकर धीमे connection पर।
क्या इसे इस्तेमाल करने के लिए React की गहरी जानकारी चाहिए?
नहीं, Agent concepts को सरल तरीके से समझाता है और performance सुधारने के लिए best practices लागू करने पर ध्यान देता है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 280k
- रैंकिंग में स्थान
- #238
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
accessibility
280kयह आपके एजेंट को ऐसे इंटरफ़ेस बनाने में मदद करता है जिन्हें हर कोई इस्तेमाल कर सके। यह पक्का करता है कि वेबसाइट और ऐप दिव्यांग लोगों के लिए भी अच्छे से काम करें, जैसे नेत्रहीन या जिन्हें चलने-फिरने में दिक्कत होती है।
agent-architecture-audit
280kयह आपके एजेंट को जाँचने देता है कि सब कुछ सही से चल रहा है। यह AI सिस्टम में समस्याएँ ढूँढकर ठीक करता है, ताकि वे उम्मीद के मुताबिक काम करें।
agent-eval
280kयह आपके एजेंट को अलग-अलग AI coding tools की तुलना करने में मदद करता है। यह मापता है कि किसी खास काम के लिए कौन सा टूल ज़्यादा तेज़, सस्ता और भरोसेमंद है।
agent-harness-construction
280kयह आपके एजेंट को काम कैसे करना है, यह बेहतर समझने में मदद करता है। यह उन tools और instructions को बेहतर बनाता है जिनका एजेंट इस्तेमाल करता है, ताकि उसकी सफलता की संभावना बढ़े।
मिलती-जुलती skills
dream-loop
260kआपके एजेंट को 3D दृश्य या विज़ुअल ऐप के स्क्रीनशॉट को कॉन्सेप्ट आर्ट से मिलाकर बार-बार सुधारते हुए उच्च ग्राफ़िकल गुणवत्ता की ओर ले जाने देती है।
pretext
260kब्राउज़र के ऐसे खेल-भरे डेमो बनाती है जहां टेक्स्ट चलती आकृतियों के चारों ओर बहता है, गेम लेवल बनाता है, या कणों में टूट जाता है।
page-agent
260kआपके एजेंट को वेब ऐप में अंतर्निहित AI सहायक जोड़ने में मदद करती है, ताकि उपयोगकर्ता सादी भाषा में आदेश दे सकें, जिन्हें पेज पूरा करे।