
Performance Optimization
- 3 installs
- 404 repo stars
- Updated August 5, 2026
- aiskillstore/marketplace
performance-optimization is a Claude Code skill that measures and improves application performance across React rendering, bundle size, images, and database queries.
About
performance-optimization is a Claude Code skill for improving application speed and scalability. It measures with Lighthouse and web-vitals, then optimizes React rendering (React.memo, useMemo, useCallback), applies lazy loading and code splitting, reduces bundle size via tree shaking and dynamic imports, optimizes images, and fixes slow database queries like the N+1 problem. A developer uses it when page loads are slow, bundles are large, or queries bottleneck.
- Optimizes app performance: page load, bundle size, rendering, and DB queries
- Covers React.memo/useMemo, lazy loading, code splitting, and image optimization
- Measures with Lighthouse and web-vitals, analyzes bundles, fixes N+1 queries
Performance Optimization by the numbers
- 3 all-time installs (skills.sh)
- Ranked #1,841 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
performance-optimization capabilities & compatibility
- Capabilities
- performance tuning · bundle analysis · query optimization · frontend
- Use cases
- frontend · database
- Pricing
- Free
What performance-optimization says it does
Optimize application performance for speed, efficiency, and scalability. Use when improving page load times, reducing bundle size, optimizing database queries, or fixing performance bottlenecks.
Handles React optimization, lazy loading, caching, code splitting, and profiling.
npx skills add https://github.com/aiskillstore/marketplace --skill performance-optimizationAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 3 |
|---|---|
| repo stars | ★ 404 |
| Last updated | August 5, 2026 |
| Repository | aiskillstore/marketplace ↗ |
What it does
Measure and fix app performance: page load, React rendering, bundle size, images, and slow database queries.
Who is it for?
Developers fixing slow page loads, large bundles, slow rendering, or slow queries
Skip if: Green-field feature work unrelated to performance
When should I use this skill?
improving page load times, reducing bundle size, optimizing database queries, or fixing performance bottlenecks
What you get
Performance bottlenecks are measured and fixed, improving load time, bundle size, rendering, and query speed.
- Lighthouse/web-vitals measurements
- optimized React components and bundles
By the numbers
- 5 optimization steps (measure, React, bundle, images, queries)
- 5 web-vitals metrics tracked
Files
Performance Optimization
When to use this skill
- Slow page loads: low Lighthouse score
- Slow rendering: delayed user interactions
- Large bundle size: increased download time
- Slow queries: database bottlenecks
Instructions
Step 1: Measure performance
Lighthouse (Chrome DevTools):
# CLI
npm install -g lighthouse
lighthouse https://example.com --view
# Automate in CI
lighthouse https://example.com --output=json --output-path=./report.jsonMeasure Web Vitals (React):
import { getCLS, getFID, getFCP, getLCP, getTTFB } from 'web-vitals';
function sendToAnalytics(metric: any) {
// Send to Google Analytics, Datadog, etc.
console.log(metric);
}
getCLS(sendToAnalytics);
getFID(sendToAnalytics);
getFCP(sendToAnalytics);
getLCP(sendToAnalytics);
getTTFB(sendToAnalytics);Step 2: Optimize React
React.memo (prevent unnecessary re-renders):
// ❌ Bad: child re-renders whenever the parent re-renders
function ExpensiveComponent({ data }: { data: Data }) {
return <div>{/* complex rendering */}</div>;
}
// ✅ Good: re-render only when props change
const ExpensiveComponent = React.memo(({ data }: { data: Data }) => {
return <div>{/* complex rendering */}</div>;
});useMemo & useCallback:
function ProductList({ products, category }: Props) {
// ✅ Memoize filtered results
const filteredProducts = useMemo(() => {
return products.filter(p => p.category === category);
}, [products, category]);
// ✅ Memoize callback
const handleAddToCart = useCallback((id: string) => {
addToCart(id);
}, []);
return (
<div>
{filteredProducts.map(product => (
<ProductCard key={product.id} product={product} onAdd={handleAddToCart} />
))}
</div>
);
}Lazy Loading & Code Splitting:
import { lazy, Suspense } from 'react';
// ✅ Route-based code splitting
const Dashboard = lazy(() => import('./pages/Dashboard'));
const Profile = lazy(() => import('./pages/Profile'));
const Settings = lazy(() => import('./pages/Settings'));
function App() {
return (
<Suspense fallback={<div>Loading...</div>}>
<Routes>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/profile" element={<Profile />} />
<Route path="/settings" element={<Settings />} />
</Routes>
</Suspense>
);
}
// ✅ Component-based lazy loading
const HeavyChart = lazy(() => import('./components/HeavyChart'));
function Dashboard() {
return (
<div>
<h1>Dashboard</h1>
<Suspense fallback={<Skeleton />}>
<HeavyChart data={data} />
</Suspense>
</div>
);
}Step 3: Optimize bundle size
Webpack Bundle Analyzer:
npm install --save-dev webpack-bundle-analyzer
# package.json
{
"scripts": {
"analyze": "webpack-bundle-analyzer build/stats.json"
}
}Tree Shaking (remove unused code):
// ❌ Bad: import entire library
import _ from 'lodash';
// ✅ Good: import only what you need
import debounce from 'lodash/debounce';Dynamic Imports:
// ✅ Load only when needed
button.addEventListener('click', async () => {
const { default: Chart } = await import('chart.js');
new Chart(ctx, config);
});Step 4: Optimize images
Next.js Image component:
import Image from 'next/image';
function ProductImage() {
return (
<Image
src="/product.jpg"
alt="Product"
width={500}
height={500}
priority // for the LCP image
placeholder="blur" // blur placeholder
sizes="(max-width: 768px) 100vw, 50vw"
/>
);
}Use WebP format:
<picture>
<source srcset="image.webp" type="image/webp">
<source srcset="image.jpg" type="image/jpeg">
<img src="image.jpg" alt="Fallback">
</picture>Step 5: Optimize database queries
Fix the N+1 query problem:
// ❌ Bad: N+1 queries
const posts = await db.post.findMany();
for (const post of posts) {
const author = await db.user.findUnique({ where: { id: post.authorId } });
// 101 queries (1 + 100)
}
// ✅ Good: JOIN or include
const posts = await db.post.findMany({
include: {
author: true
}
});
// 1 queryAdd indexes:
-- Identify slow queries
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';
-- Add index
CREATE INDEX idx_users_email ON users(email);
-- Composite index
CREATE INDEX idx_orders_user_date ON orders(user_id, created_at);Caching (Redis):
async function getUserProfile(userId: string) {
// 1. Check cache
const cached = await redis.get(`user:${userId}`);
if (cached) {
return JSON.parse(cached);
}
// 2. Query DB
const user = await db.user.findUnique({ where: { id: userId } });
// 3. Store in cache (1 hour)
await redis.setex(`user:${userId}`, 3600, JSON.stringify(user));
return user;
}Output format
Performance optimization checklist
## Frontend
- [ ] Prevent unnecessary re-renders with React.memo
- [ ] Use useMemo/useCallback appropriately
- [ ] Lazy loading & Code splitting
- [ ] Optimize images (WebP, lazy loading)
- [ ] Analyze and reduce bundle size
## Backend
- [ ] Remove N+1 queries
- [ ] Add database indexes
- [ ] Redis caching
- [ ] Compress API responses (gzip)
- [ ] Use a CDN
## Measurement
- [ ] Lighthouse score 90+
- [ ] LCP < 2.5s
- [ ] FID < 100ms
- [ ] CLS < 0.1Constraints
Required rules (MUST)
1. Measure first: profile, don't guess 2. Incremental improvements: optimize one thing at a time 3. Performance monitoring: track continuously
Prohibited items (MUST NOT)
1. Premature optimization: don't optimize when there is no bottleneck 2. Sacrificing readability: don't make code complex for performance
Best practices
1. 80/20 rule: 80% improvement with 20% effort 2. User-centered: focus on improving real user experience 3. Automation: performance regression tests in CI
References
Metadata
Version
- Current version: 1.0.0
- Last updated: 2025-01-01
- Compatible platforms: Claude, ChatGPT, Gemini
Related skills
- database-schema-design
- ui-components
Tags
#performance #optimization #React #caching #lazy-loading #web-vitals #code-quality
Examples
Example 1: Basic usage
<!-- Add example content here -->
Example 2: Advanced usage
<!-- Add advanced example content here -->
{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-03-10T08:19:39.097Z",
"slug": "supercent-io-performance-optimization",
"source_url": "https://github.com/supercent-io/skills-template/tree/main/.agent-skills/performance-optimization/",
"source_ref": "main",
"model": "claude",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "a9d6bb06720eab66d941dcad323735aed2a8325f074cb05b37363447361a0529",
"tree_hash": "7824f1a481941efc21c3fb2174ce0f4ccca127eef5ceca563a0b0dc3577e26ca"
},
"skill": {
"name": "performance-optimization",
"description": "Optimize application performance for speed, efficiency, and scalability. Use when improving page load times, reducing bundle size, optimizing database queries, or fixing performance bottlenecks. Handles React optimization, lazy loading, caching, code splitting, and profiling.",
"summary": "Optimize application performance for speed, efficiency, and scalability. Use when improving page load times, reducing bundle size, optimizing database queries, or fixing performance bottlenecks.",
"icon": "📈",
"version": "1.0.0",
"author": "supercent-io",
"license": "MIT",
"tags": [
"performance",
"optimization",
"React",
"lazy-loading",
"caching",
"web-vitals"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": []
},
"security_audit": {
"risk_level": "safe",
"is_blocked": false,
"safe_to_publish": true,
"summary": "This is a benign documentation skill for performance optimization. The static scanner flagged code examples in markdown documentation (React.lazy(), npm commands, example URLs) which are all legitimate educational content. No actual security risks present.",
"risk_factor_evidence": [],
"critical_findings": [],
"high_findings": [],
"medium_findings": [
{
"title": "Code Examples in Documentation",
"description": "Dynamic import() expressions shown as code examples for React lazy loading",
"locations": [
{
"file": "SKILL.md",
"line_start": 93,
"line_end": 93
},
{
"file": "SKILL.md",
"line_start": 94,
"line_end": 94
},
{
"file": "SKILL.md",
"line_start": 95,
"line_end": 95
},
{
"file": "SKILL.md",
"line_start": 110,
"line_end": 110
},
{
"file": "SKILL.md",
"line_start": 151,
"line_end": 151
}
],
"verdict": "FALSE_POSITIVE",
"confidence": 0.95,
"confidence_reasoning": "These are code examples in markdown documentation demonstrating React lazy loading pattern - a standard performance optimization technique, not dangerous code execution."
},
{
"title": "Shell Command Examples",
"description": "Shell commands shown as documentation examples",
"locations": [
{
"file": "SKILL.md",
"line_start": 25,
"line_end": 32
},
{
"file": "SKILL.md",
"line_start": 32,
"line_end": 35
},
{
"file": "SKILL.md",
"line_start": 35,
"line_end": 48
},
{
"file": "SKILL.md",
"line_start": 48,
"line_end": 53
},
{
"file": "SKILL.md",
"line_start": 53,
"line_end": 63
},
{
"file": "SKILL.md",
"line_start": 63,
"line_end": 66
},
{
"file": "SKILL.md",
"line_start": 66,
"line_end": 86
},
{
"file": "SKILL.md",
"line_start": 86,
"line_end": 89
},
{
"file": "SKILL.md",
"line_start": 122,
"line_end": 127
},
{
"file": "SKILL.md",
"line_start": 127,
"line_end": 136
},
{
"file": "SKILL.md",
"line_start": 136,
"line_end": 139
},
{
"file": "SKILL.md",
"line_start": 139,
"line_end": 145
},
{
"file": "SKILL.md",
"line_start": 145,
"line_end": 148
},
{
"file": "SKILL.md",
"line_start": 148,
"line_end": 154
},
{
"file": "SKILL.md",
"line_start": 154,
"line_end": 159
},
{
"file": "SKILL.md",
"line_start": 159,
"line_end": 175
},
{
"file": "SKILL.md",
"line_start": 175,
"line_end": 178
},
{
"file": "SKILL.md",
"line_start": 178,
"line_end": 184
},
{
"file": "SKILL.md",
"line_start": 184,
"line_end": 189
},
{
"file": "SKILL.md",
"line_start": 189,
"line_end": 204
},
{
"file": "SKILL.md",
"line_start": 204,
"line_end": 207
},
{
"file": "SKILL.md",
"line_start": 207,
"line_end": 216
},
{
"file": "SKILL.md",
"line_start": 216,
"line_end": 219
},
{
"file": "SKILL.md",
"line_start": 219,
"line_end": 222
},
{
"file": "SKILL.md",
"line_start": 222,
"line_end": 231
},
{
"file": "SKILL.md",
"line_start": 231,
"line_end": 235
},
{
"file": "SKILL.md",
"line_start": 235,
"line_end": 241
},
{
"file": "SKILL.md",
"line_start": 241,
"line_end": 261
}
],
"verdict": "FALSE_POSITIVE",
"confidence": 0.95,
"confidence_reasoning": "These are bash command examples in markdown code blocks showing npm install, lighthouse, webpack commands - legitimate documentation examples for performance measurement tools."
}
],
"low_findings": [
{
"title": "Reference URLs in Documentation",
"description": "Hardcoded URLs in documentation",
"locations": [
{
"file": "SKILL.md",
"line_start": 28,
"line_end": 28
},
{
"file": "SKILL.md",
"line_start": 31,
"line_end": 31
},
{
"file": "SKILL.md",
"line_start": 284,
"line_end": 284
},
{
"file": "SKILL.md",
"line_start": 285,
"line_end": 285
},
{
"file": "SKILL.md",
"line_start": 286,
"line_end": 286
}
],
"verdict": "FALSE_POSITIVE",
"confidence": 0.9,
"confidence_reasoning": "URLs are example domains (example.com) and official documentation links (web.dev, react.dev, GitHub) - legitimate reference URLs for performance optimization resources."
},
{
"title": "Internal Path References",
"description": "Relative path references to other skill files",
"locations": [
{
"file": "SKILL.md",
"line_start": 296,
"line_end": 296
},
{
"file": "SKILL.md",
"line_start": 297,
"line_end": 297
}
],
"verdict": "FALSE_POSITIVE",
"confidence": 0.9,
"confidence_reasoning": "Path references (../database-schema-design/) are internal documentation links to related skills - not a filesystem security risk."
}
],
"dangerous_patterns": [],
"files_scanned": 2,
"total_lines": 324,
"audit_model": "claude",
"audited_at": "2026-03-10T08:19:39.097Z",
"risk_factors": []
},
"content": {
"user_title": "Optimize Application Performance",
"value_statement": "This skill helps developers improve application speed and efficiency through proven optimization techniques including React performance, lazy loading, caching, and database query optimization.",
"seo_keywords": [
"performance optimization",
"React optimization",
"lazy loading",
"code splitting",
"web vitals",
"Lighthouse score",
"caching strategies",
"bundle size optimization",
"Claude",
"Codex",
"Claude Code"
],
"actual_capabilities": [
"Measure application performance using Lighthouse and web vitals",
"Optimize React components using React.memo, useMemo, and useCallback",
"Implement lazy loading and code splitting for faster initial loads",
"Reduce bundle size using webpack analysis and tree shaking",
"Optimize database queries to eliminate N+1 problems and add indexes",
"Implement caching strategies with Redis for improved response times"
],
"limitations": [
"Does not modify code directly - provides guidance and recommendations",
"Requires developer to implement suggested optimizations",
"Performance gains depend on existing codebase architecture",
"Some optimizations may require backend access and configuration"
],
"use_cases": [
{
"title": "Frontend Performance Audit",
"description": "Analyze and improve frontend performance metrics including Lighthouse scores, Core Web Vitals, and bundle size.",
"target_user": "Frontend developers working on web applications"
},
{
"title": "React Application Optimization",
"description": "Optimize React applications to prevent unnecessary re-renders and improve rendering performance.",
"target_user": "React developers building interactive web applications"
},
{
"title": "Database Query Performance",
"description": "Identify and fix database performance issues including N+1 queries, missing indexes, and caching strategies.",
"target_user": "Full-stack developers working with databases"
}
],
"prompt_templates": [
{
"title": "Basic Performance Check",
"prompt": "My web application is running slowly. Help me measure performance and identify bottlenecks using Lighthouse and web vitals.",
"scenario": "Developer wants to understand current performance baseline"
},
{
"title": "React Performance Review",
"prompt": "My React application has slow interactions. Help me optimize components using React.memo, useMemo, and useCallback to prevent unnecessary re-renders.",
"scenario": "Developer notices delayed user interactions in React app"
},
{
"title": "Bundle Size Analysis",
"prompt": "Help me analyze and reduce my application bundle size. Show me how to use webpack-bundle-analyzer and implement code splitting.",
"scenario": "Developer wants to reduce initial load time"
},
{
"title": "Database Optimization",
"prompt": "My database queries are slow. Help me identify N+1 query problems, add appropriate indexes, and implement Redis caching.",
"scenario": "Developer experiencing database performance issues"
}
],
"output_examples": [
{
"input": "How can I improve my React application performance?",
"output": "Here is a performance optimization checklist:\n\n## Frontend\n- Prevent unnecessary re-renders with React.memo\n- Use useMemo/useCallback appropriately\n- Lazy loading & Code splitting\n- Optimize images (WebP, lazy loading)\n- Analyze and reduce bundle size\n\n## Backend\n- Remove N+1 queries\n- Add database indexes\n- Redis caching\n- Compress API responses (gzip)\n- Use a CDN\n\n## Measurement\n- Lighthouse score 90+\n- LCP < 2.5s\n- FID < 100ms\n- CLS < 0.1"
},
{
"input": "What are the best practices for React performance?",
"output": "Key React performance practices include:\n\n1. **Prevent re-renders**: Use React.memo for expensive components, useMemo for computed values, useCallback for callbacks\n\n2. **Code splitting**: Use React.lazy() and Suspense to load components only when needed\n\n3. **Virtualization**: For long lists, use libraries like react-window to render only visible items\n\n4. **Image optimization**: Use Next.js Image component or responsive images with WebP format"
}
],
"best_practices": [
"Measure first before optimizing - use profiling tools to identify actual bottlenecks rather than guessing",
"Focus on incremental improvements - optimize one thing at a time and measure the impact",
"Set up continuous performance monitoring - track Lighthouse scores and Core Web Vitals in CI/CD"
],
"anti_patterns": [
"Premature optimization - do not optimize code that is not a proven bottleneck",
"Over-memoization - excessive use of useMemo/useCallback can hurt performance",
"Ignoring user experience - optimize for real user-perceived performance, not just metrics"
],
"faq": [
{
"question": "What is the 80/20 rule in performance optimization?",
"answer": "The 80/20 rule means that 80% of performance improvements come from 20% of optimizations. Focus on the biggest bottlenecks first for maximum impact."
},
{
"question": "What are Core Web Vitals?",
"answer": "Core Web Vitals are Google-defined metrics: Largest Contentful Paint (LCP), First Input Delay (FID), and Cumulative Layout Shift (CLS). They measure user experience performance."
},
{
"question": "What is the N+1 query problem?",
"answer": "The N+1 problem occurs when fetching a list of items then making a separate database query for each item. Fix it using JOINs or include/eager loading."
},
{
"question": "When should I use React.memo?",
"answer": "Use React.memo for components that render often with the same props. It prevents re-renders when props have not changed. Avoid overusing it on simple components."
},
{
"question": "What is code splitting?",
"answer": "Code splitting divides your application into smaller chunks that load on demand. Use it with React.lazy() to reduce initial bundle size and improve load time."
},
{
"question": "How does Redis caching work?",
"answer": "Redis caching stores frequently accessed data in memory. Check the cache first, return cached data if found, otherwise query the database and store the result in cache."
}
]
},
"file_structure": [
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 309
},
{
"name": "SKILL.toon",
"type": "file",
"path": "SKILL.toon",
"lines": 15
}
]
}
N:performance-optimization
D:Optimize application performance for speed, efficiency, and scalability. Use when improving page ...
G:performance optimization React lazy-loading caching
U[4]:
**Slow page loads**: low Lighthouse score
**Slow rendering**: delayed user interactions
**Large bundle size**: increased download time
**Slow queries**: database bottlenecks
S[5]{n,action}:
1,Measure performance
2,Optimize React
3,Optimize bundle size
4,Optimize images
5,Optimize database queries
Related skills
FAQ
How does it measure performance?
It uses Lighthouse (CLI and CI) and the web-vitals library to capture CLS, FID, FCP, LCP, and TTFB.
What React optimizations does it apply?
React.memo, useMemo, useCallback, plus route- and component-based lazy loading with Suspense.