blackbelttechnology/pi-agent-dashboard/performance-optimization
Claude Code and agent skill by blackbelttechnology/pi-agent-dashboard
- community
Checking that the SKILL.md file is still in the repository.
Measure-first performance work. Use on triggers like "it's slow", "profile this", "optimize perf", "fix the bottleneck", "improve load time / Core Web Vitals", or when a measured regression needs fixing. Enforces measure-before-optimize. Fills a perf gap not covered by existing project skills. Not a build/ship workflow.
Install
npx vskill@latest install blackbelttechnology/pi-agent-dashboard/performance-optimizationSKILL.md
The same SKILL.md was published earlier as blackbelttechnology/pi-agent-dashboard/performance-optimization.
Performance Optimization
Overview
Measure before optimizing. Performance work without measurement is guessing — and guessing leads to premature optimization that adds complexity without improving what matters. Profile first, identify the actual bottleneck, fix it, measure again. Optimize only what measurements prove matters.
When to Use
- Performance requirements exist in the spec (load time budgets, response time SLAs)
- Users or monitoring report slow behavior
- Core Web Vitals scores are below thresholds
- You suspect a change introduced a regression
- Building features that handle large datasets or high traffic
When NOT to use: Don't optimize before you have evidence of a problem. Premature optimization adds complexity that costs more than the performance it gains.
Core Web Vitals Targets
| Metric | Good | Needs Improvement | Poor | |
|---|---|---|---|---|
| LCP (Largest Contentful Paint) | ≤ 2.5s | ≤ 4.0s | > 4.0s | |
| INP (Interaction to Next Paint) | ≤ 200ms | ≤ 500ms | > 500ms | |
| CLS (Cumulative Layout Shift) | ≤ 0.1 | ≤ 0.25 | > 0.25 |
The Optimization Workflow
Step 1: Measure
Two complementary approaches — use both:
- Synthetic (Lighthouse, DevTools Performance tab): Controlled conditions, reproducible. Best for CI regression detection and isolating specific issues.
- RUM (web-vitals library, CrUX): Real user data in real conditions. Required to validate that a fix actually improved user experience.
Frontend:
Backend:
Where to Start Measuring
Use the symptom to decide what to measure first:
Step 2: Identify the Bottleneck
Common bottlenecks by category:
Frontend:
| Symptom | Likely Cause | Investigation | |
|---|---|---|---|
| Slow LCP | Large images, render-blocking resources, slow server | Check network waterfall, image sizes | |
| High CLS | Images without dimensions, late-loading content, font shifts | Check layout shift attribution | |
| Poor INP | Heavy JavaScript on main thread, large DOM updates | Check long tasks in Performance trace | |
| Slow initial load | Large bundle, many network requests | Check bundle size, code splitting |
Backend:
| Symptom | Likely Cause | Investigation | |
|---|---|---|---|
| Slow API responses | N+1 queries, missing indexes, unoptimized queries | Check database query log | |
| Memory growth | Leaked references, unbounded caches, large payloads | Heap snapshot analysis | |
| CPU spikes | Synchronous heavy computation, regex backtracking | CPU profiling | |
| High latency | Missing caching, redundant computation, network hops | Trace requests through the stack |
Step 3: Fix Common Anti-Patterns
N+1 Queries (Backend)
Unbounded Data Fetching
Missing Image Optimization (Frontend)
Unnecessary Re-renders (React)
Large Bundle Size
Missing Caching (Backend)
Performance Budget
Set budgets and enforce them:
Enforce in CI:
See Also
For detailed performance checklists, optimization commands, and anti-pattern reference, see references/performance-checklist.md.
Common Rationalizations
| Rationalization | Reality | |
|---|---|---|
| "We'll optimize later" | Performance debt compounds. Fix obvious anti-patterns now, defer micro-optimizations. | |
| "It's fast on my machine" | Your machine isn't the user's. Profile on representative hardware and networks. | |
| "This optimization is obvious" | If you didn't measure, you don't know. Profile first. | |
| "Users won't notice 100ms" | Research shows 100ms delays impact conversion rates. Users notice more than you think. | |
| "The framework handles performance" | Frameworks prevent some issues but can't fix N+1 queries or oversized bundles. |
Red Flags
- Optimization without profiling data to justify it
- N+1 query patterns in data fetching
- List endpoints without pagination
- Images without dimensions, lazy loading, or responsive sizes
- Bundle size growing without review
- No performance monitoring in production
React.memoanduseMemoeverywhere (overusing is as bad as underusing)
Verification
After any performance-related change:
- [ ] Before and after measurements exist (specific numbers)
- [ ] The specific bottleneck is identified and addressed
- [ ] Core Web Vitals are within "Good" thresholds
- [ ] Bundle size hasn't increased significantly
- [ ] No N+1 queries in new data fetching code
- [ ] Performance budget passes in CI (if configured)
- [ ] Existing tests still pass (optimization didn't break behavior)
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/eng-disciplines/.pi/skills/performance-optimization/SKILL.md
Popularity
- Repository stars
- 313
- Repository forks
- 47
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/blackbelttechnology/pi-agent-dashboard/performance-optimization)