/framework:performance-guidelinesfrom framework
Provides frontend and application performance guidelines including budgets, bundle size targets, rendering optimization, caching strategies, and profiling techniques. Useful when optimizing performance or building performance-sensitive UI.
Ships in framework. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Performance is a feature. Slow is broken.
| Operation Type | Target | Maximum |
|---|---|---|
| Simple Query | < 50ms | 100ms |
| Complex Query | < 200ms | 500ms |
| Search | < 300ms | 1s |
| File Upload | < 1s/MB | 2s/MB |
| Batch Operation | < 5s | 10s |
| Real-time Updates | < 100ms | 200ms |
| Query Type | Target | Action if Exceeded |
|---|---|---|
| Indexed SELECT | < 10ms | Add index |
| Complex JOIN | < 50ms | Optimize query |
| Full Table Scan | < 100ms | Add index/partition |
| Write Operation | < 20ms | Check locks |
| Transaction | < 100ms | Break down |
// Maximum bundle sizes
const budgets = {
javascript: {
initial: 200, // KB (gzipped)
lazy: 300, // KB (gzipped)
},
css: {
initial: 50, // KB (gzipped)
lazy: 100, // KB (gzipped)
},
images: {
hero: 200, // KB
thumbnail: 20, // KB
icon: 5, // KB
},
total: {
initial: 500, // KB (all assets)
full: 2000, // KB (entire app)
}
};
// Performance monitoring setup
const perfObserver = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
// Log to analytics
analytics.track('performance', {
metric: entry.name,
value: entry.value,
page: window.location.pathname
});
}
});
// Observe all performance metrics
perfObserver.observe({
entryTypes: ['navigation', 'resource', 'paint', 'measure']
});
# Caching hierarchy
1. Browser Cache → 0ms
2. CDN Edge Cache → 10-50ms
3. Redis/Memcached → 1-5ms
4. Application Cache → 0.1ms
5. Database Cache → 5-10ms
6. Database Query → 10-100ms
-- Before optimization
SELECT * FROM orders o
JOIN users u ON o.user_id = u.id
WHERE u.country = 'US';
-- After optimization
SELECT o.id, o.total, u.name
FROM orders o
JOIN users u ON o.user_id = u.id
WHERE u.country = 'US'
AND o.created_at > NOW() - INTERVAL '30 days'
LIMIT 100;
-- With proper indexes
CREATE INDEX idx_users_country ON users(country);
CREATE INDEX idx_orders_user_created ON orders(user_id, created_at DESC);
// Performance test scenarios
const scenarios = {
baseline: {
users: 100,
duration: '5m',
rampUp: '30s'
},
stress: {
users: 1000,
duration: '15m',
rampUp: '2m'
},
spike: {
users: 5000,
duration: '10m',
rampUp: '10s'
},
endurance: {
users: 500,
duration: '2h',
rampUp: '5m'
}
};
| Metric | Excellent | Good | Needs Work | Unacceptable |
|---|---|---|---|---|
| Page Load | < 1s | < 2s | < 3s | > 3s |
| API Response | < 100ms | < 300ms | < 1s | > 1s |
| Database Query | < 10ms | < 50ms | < 200ms | > 200ms |
| CPU Usage | < 40% | < 60% | < 80% | > 80% |
| Memory Usage | < 50% | < 70% | < 85% | > 85% |
| Error Rate | < 0.1% | < 1% | < 5% | > 5% |
// Real User Monitoring (RUM)
- Google Analytics / GA4
- New Relic Browser
- Datadog RUM
- Sentry Performance
// Synthetic Monitoring
- Lighthouse CI
- WebPageTest
- GTmetrix
- SpeedCurve
# APM Tools
- New Relic APM
- Datadog APM
- AppDynamics
- Elastic APM
# Custom Metrics
- Prometheus + Grafana
- StatsD
- CloudWatch (AWS)
- Application Insights (Azure)
# Performance gates in pipeline
performance-check:
stage: test
script:
- lighthouse ci --budget=./budget.json
- bundlesize --max-size 200KB
- npm run test:performance
rules:
fail_on:
- lcp > 2500
- fid > 100
- cls > 0.1
- bundle_size > budget
# Frontend
✅ Enable compression (gzip/brotli)
✅ Add Cache-Control headers
✅ Optimize images (WebP, lazy load)
✅ Minify CSS/JS
✅ Remove unused dependencies
# Backend
✅ Add database indexes
✅ Enable query caching
✅ Implement pagination
✅ Use connection pooling
✅ Add Redis caching
# Infrastructure
✅ Enable CDN
✅ Configure auto-scaling
✅ Optimize container size
✅ Use HTTP/2
✅ Enable keep-alive
// ❌ DON'T DO THIS
- Synchronous API calls in loops
- Unbounded queries (SELECT * without LIMIT)
- Large DOM manipulations
- Inline styles/scripts
- Blocking resources in <head>
- Memory leaks (event listeners, timers)
- N+1 database queries
- Premature optimization
// ✅ DO THIS INSTEAD
- Batch API calls
- Paginate large datasets
- Virtual DOM / React
- External stylesheets
- Async/defer scripts
- Cleanup in useEffect/componentWillUnmount
- Eager loading with includes
- Measure first, optimize second
Every millisecond counts.
Performance is not a one-time task—it's a continuous process.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lagowski/claudeautopm --plugin framework3 skills in this plugin
/ui-development-standardsUI development standards: component structure, accessibility, responsive design and styling. Use when building or changing user interface components./ui-framework-rulesMandatory behaviors for UI framework work: reuse existing components, follow the design system, test components. Use when working with a UI framework such as React, Vue or Angular.Other plugins' skills for the same job