optimizing-performance skill
Analyzes and optimizes application performance across frontend, backend, and database layers to diagnose slowness and improve load times.
- GitHub stars
- 1,423
- Files
- 1
- Last commit
- Oct 6, 2026
- License
- MIT
- Allowed tools
- —
What does the optimizing-performance skill do?
optimizing-performance analyzes and optimizes application performance across frontend, backend, and database layers to diagnose slowness and improve load times.
Summary generated from the skill's SKILL.md.
About the optimizing-performance skill
Diagnosing application slowness and improving load times across the entire stack is what this skill enables. Developers use it when they need to profile code, reduce bundle sizes, or optimize database queries. It provides a structured workflow that moves from measuring baseline performance to identifying bottlenecks and applying targeted fixes.
An agent should load this skill when tasked with performance profiling or addressing latency issues rather than correctness-focused work. It utilizes specific profiling commands for Node.js, Python, and web performance via Lighthouse. The skill covers frontend improvements like memoization and code splitting, backend enhancements such as multi-layer caching and async processing, and database optimizations using EXPLAIN or JOINs to solve N+1 query problems. It helps users track progress against specific targets like Web Vitals and API latency metrics.
What an agent can do with it
- 1Profile Node.js application performanceRun profiling commands to generate logs and identify slow code in a Node.js environment.
- 2Reduce frontend bundle sizeOptimize JavaScript imports and implement code splitting to improve loading speeds.
- 3Fix slow database queriesResolve N+1 query problems by implementing single queries with JOINs or using pagination.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the optimizing-performance skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the optimizing-performance skill in Plugin
/plugin marketplace add CloudAI-X/claude-workflow-v2 /plugin install project-starter@claude-workflow
Install the optimizing-performance skill in Claude Code
~/.claude/skills/optimizing-performance/SKILL.md
$ npx degit CloudAI-X/claude-workflow-v2/skills/optimizing-performance ~/.claude/skills/optimizing-performanceInstall the optimizing-performance skill in Claude Code (project)
.claude/skills/optimizing-performance/SKILL.md
$ npx degit CloudAI-X/claude-workflow-v2/skills/optimizing-performance .claude/skills/optimizing-performanceInstall the optimizing-performance skill in Codex
~/.agents/skills/optimizing-performance/SKILL.md
$ npx degit CloudAI-X/claude-workflow-v2/skills/optimizing-performance ~/.agents/skills/optimizing-performanceInstall the optimizing-performance skill in Gemini CLI
~/.gemini/skills/optimizing-performance/SKILL.md
$ npx degit CloudAI-X/claude-workflow-v2/skills/optimizing-performance ~/.gemini/skills/optimizing-performanceInstall the optimizing-performance skill in Claude.ai
npx degit CloudAI-X/claude-workflow-v2/skills/optimizing-performance optimizing-performance && zip -r optimizing-performance.zip optimizing-performance # claude.ai → Customize → Skills → + → Create skill → Upload a skill → optimizing-performance.zip
SKILL.md
View on GitHubOptimizing Performance
When to Load
- Trigger: Diagnosing slowness, profiling, caching strategies, reducing load times, bundle size optimization
- Skip: Correctness-focused work where performance is not a concern
Performance Optimization Workflow
Copy this checklist and track progress:
Performance Optimization Progress:
- [ ] Step 1: Measure baseline performance
- [ ] Step 2: Identify bottlenecks
- [ ] Step 3: Apply targeted optimizations
- [ ] Step 4: Measure again and compare
- [ ] Step 5: Repeat if targets not met
Critical Rule: Never optimize without data. Always profile before and after changes.
Step 1: Measure Baseline
Profiling Commands
# Node.js profiling
node --prof app.js
node --prof-process isolate*.log > profile.txt
# Python profiling
python -m cProfile -o profile.stats app.py
python -m pstats profile.stats
# Web performance
lighthouse https://example.com --output=json
Step 2: Identify Bottlenecks
Common Bottleneck Categories
| Category | Symptoms | Tools |
|---|---|---|
| CPU | High CPU usage, slow computation | Profiler, flame graphs |
| Memory | High RAM, GC pauses, OOM | Heap snapshots, memory profiler |
| I/O | Slow disk/network, waiting | strace, network inspector |
| Database | Slow queries, lock contention | Query analyzer, EXPLAIN |
Step 3: Apply Optimizations
Frontend Optimizations
Bundle Size:
// ❌ Import entire library
import _ from "lodash";
// ✅ Import only needed functions
import debounce from "lodash/debounce";
// ✅ Use dynamic imports for code splitting
const HeavyComponent = lazy(() => import("./HeavyComponent"));
Rendering:
// ❌ Render on every parent update
function Child({ data }) {
return <ExpensiveComponent data={data} />;
}
// ✅ Memoize when props don't change
const Child = memo(function Child({ data }) {
return <ExpensiveComponent data={data} />;
});
// ✅ Use useMemo for expensive computations
const processed = useMemo(() => expensiveCalc(data), [data]);
Images:
<!-- ❌ Unoptimized -->
<img src="large-image.jpg" />
<!-- ✅ Optimized -->
<img
src="image.webp"
srcset="image-300.webp 300w, image-600.webp 600w"
sizes="(max-width: 600px) 300px, 600px"
width="600"
height="400"
alt="Description"
loading="lazy"
decoding="async"
/>
Backend Optimizations
Database Queries:
-- ❌ N+1 Query Problem
SELECT * FROM users;
-- Then for each user:
SELECT * FROM orders WHERE user_id = ?;
-- ✅ Single query with JOIN
SELECT u.id, u.name, o.id AS order_id, o.total
FROM users u
LEFT JOIN orders o ON u.id = o.user_id;
-- ✅ Or use pagination
SELECT id, name FROM users WHERE id > :last_id ORDER BY id LIMIT 100;
Caching Strategy:
// Multi-layer caching
const getUser = async (id) => {
// L1: In-memory cache (fastest)
let user = memoryCache.get(`user:${id}`);
if (user) return user;
// L2: Redis cache (fast)
user = await redis.get(`user:${id}`);
if (user) {
user = JSON.parse(user);
memoryCache.set(`user:${id}`, user, 60);
return user;
}
// L3: Database (slow)
user = await db.users.findById(id);
await redis.setex(`user:${id}`, 3600, JSON.stringify(user));
memoryCache.set(`user:${id}`, user, 60);
return user;
};
Async Processing:
// ❌ Blocking operation
app.post("/upload", async (req, res) => {
await processVideo(req.file); // Takes 5 minutes
res.send("Done");
});
// ✅ Queue for background processing
app.post("/upload", async (req, res) => {
const jobId = await queue.add("processVideo", { file: req.file });
res.status(202).send({ jobId, status: "processing" });
});
Algorithm Optimizations
// ❌ O(n²) - nested loops
function findDuplicates(arr) {
const duplicates = [];
for (let i = 0; i < arr.length; i++) {
for (let j = i + 1; j < arr.length; j++) {
if (arr[i] === arr[j]) duplicates.push(arr[i]);
}
}
return duplicates;
}
// ✅ O(n) - hash map
function findDuplicates(arr) {
const seen = new Set();
const duplicates = new Set();
for (const item of arr) {
if (seen.has(item)) duplicates.add(item);
seen.add(item);
}
return [...duplicates];
}
Step 4: Measure Again
After applying optimizations, re-run profiling and compare:
Comparison Checklist:
- [ ] Run same profiling tools as baseline
- [ ] Compare metrics before vs after
- [ ] Verify no regressions in other areas
- [ ] Document improvement percentages
Performance Targets
Web Vitals
| Metric | Good | Needs Work | Poor |
|---|---|---|---|
| LCP | < 2.5s | 2.5-4s | > 4s |
| INP | < 200ms | 200-500ms | > 500ms |
| CLS | < 0.1 | 0.1-0.25 | > 0.25 |
| TTFB | < 800ms | 800ms-1.8s | > 1.8s |
API Performance
| Metric | Target |
|---|---|
| P50 Latency | < 100ms |
| P95 Latency | < 500ms |
| P99 Latency | < 1s |
| Error Rate | < 0.1% |
Validation
After optimization, validate results:
Performance Validation:
- [ ] Metrics improved from baseline
- [ ] No functionality regressions
- [ ] No new errors introduced
- [ ] Changes are sustainable (not one-time fixes)
- [ ] Performance gains documented
If targets not met, return to Step 2 and identify remaining bottlenecks.
Files in this skill
1optimizing-performance skill questions
How do I install the optimizing-performance skill in Claude Code?
Run npx degit CloudAI-X/claude-workflow-v2/skills/optimizing-performance ~/.claude/skills/optimizing-performance. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the optimizing-performance skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
How can I profile a Node.js application?
You can use the command node --prof app.js and then process the resulting log with node --prof-process isolate*.log > profile.txt.
What are the target metrics for good Web Vitals?
For good performance, LCP should be under 2.5s, INP under 200ms, CLS under 0.1, and TTFB under 800ms.