performance-budget
Skill1 starsChanged 6 months agoMITView on GitHub
Define and enforce performance budgets for web apps - bundle size, Core Web Vitals, render time, API latency. Use when the user asks to set perf budgets, review performance, investigate slowness, or set up performance gates in CI.
- Reads credentials
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- LeonxLJX/web-engineer-skillstheir own version, first seen Sep 3, 2026
- charanjit-singh/lovable-skillstheir own version, first seen May 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- charanjit-singh/lovable-skills★ 10same name
- LeonxLJX/web-engineer-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- accessibility-reviewSkill
- adr-authorSkill
- api-designSkill
- architecture-reviewSkill
- caching-strategySkill
- changelogSkill
- ci-cd-pipelineSkill
- codebase-explorationSkill
- code-reviewSkill
- code-style-guideSkill
- context-engineeringSkill
- conventional-commitsSkill
- cost-optimizationSkill
- database-migrationSkill
- data-privacy-reviewSkill
- debuggingSkill
- dependency-updateSkill
- deprecation-migrationSkill
- error-handlingSkill
- feature-flag-rolloutSkill
- filament-resource-designSkill
- flux-ui-patternsSkill
- git-workflowSkill
- i18n-reviewSkill
- idea-refineSkill
- incident-responseSkill
- incremental-implementationSkill
- inertia-patternsSkill
- laravel-ai-featuresSkill
- laravel-eloquent-performanceSkill
- laravel-queue-designSkill
- laravel-testingSkill
- livewire-component-designSkill
- llm-feature-designSkill
- observabilitySkill
- onboarding-docSkill
- pr-descriptionSkill
- primevue-patternsSkill
- refactoringSkill
- release-checklistSkill
- resilience-patternsSkill
- runbook-authorSkill
- security-auditSkill
- spec-writingSkill
- task-breakdownSkill
- tech-debt-triageSkill
- test-writingSkill
- threat-modelingSkill
- using-elyra-skillsSkill
- vue-component-patternsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 144
When something is slow:
- Distinctive: line 168
Add indexes for columns in WHERE / JOIN / ORDER BY
- Very specific: line 175
Avoid SELECT * when you need three columns
- Distinctive: line 177
Read replicas for read-heavy workloads
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Budget
A performance budget is a number you refuse to cross. Without it, "is this fast enough?" is opinion-driven and slowly loses every argument to features.
When to use
- "Set up performance budgets"
- "Is this app fast enough?"
- "Investigate why X is slow"
- "Add a perf gate to CI"
- "Review the bundle / render / latency of …"
Procedure
- Decide what you're budgeting (see categories below) — don't try to budget everything at once
- Measure the current state — you can only budget what you measure
- Set a target + a ceiling, not a single magic number
- Target: what you want
- Ceiling: what fails CI
- Enforce in CI so regressions can't sneak in
- Review monthly — budgets that never change are decoration
Budget categories
1. Bundle size
| Metric | Reasonable starting point |
| Initial JS (compressed, gzip/brotli) | ≤ 170 KB |
| Initial CSS (compressed) | ≤ 60 KB |
| Total transferred (initial load, compressed) | ≤ 500 KB |
| Largest single chunk | ≤ 250 KB |
| Image weight (above the fold) | ≤ 200 KB |
Adjust for your audience. A B2B internal tool on corporate desktops tolerates more than a public site for emerging markets on 3G.
2. Core Web Vitals (real-user)
| 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 |
Budget on the 75th percentile of real users, not your dev laptop.
3. Lab metrics (synthetic, Lighthouse-style)
| Metric | Target |
| Time to Interactive (TTI) | ≤ 3.5s on mid-tier mobile, 4G |
| First Contentful Paint (FCP) | ≤ 1.8s |
| Total Blocking Time (TBT) | ≤ 200ms |
| Lighthouse Performance | ≥ 90 |
4. API & backend
| Metric | Target |
| p50 endpoint latency | ≤ 100ms |
| p95 endpoint latency | ≤ 300ms |
| p99 endpoint latency | ≤ 1s |
| Error rate | ≤ 0.1% |
Percentiles, not averages. The average hides the users having a bad time.
5. Database
| Metric | Target |
| Queries per request (p95) | ≤ 10 |
| Slowest query per request | ≤ 50ms |
| N+1 queries detected | 0 |
Measuring
# Bundle size (most bundlers expose this)
# Vite: npx vite build --report
# Webpack: npx webpack --json | npx webpack-bundle-analyzer
# Next: ANALYZE=true npm run build
# Show gzipped sizes:
find dist -name '*.js' -exec sh -c 'gzip -c "$1" | wc -c | xargs -I{} echo "$1: {} bytes"' _ {} \;
# Lighthouse from CLI
npx lighthouse https://example.com --output=json --output-path=./lh.json \
--preset=desktop # or --form-factor=mobile
# Real user metrics
# - web-vitals npm package, sent to your analytics
# - Chrome UX Report (CrUX) for public sites
# - Vercel/Cloudflare/Netlify all expose CWV dashboards
# API latency
# - APM tool (Datadog, Sentry, New Relic, Honeycomb, …)
# - For quick local measurement:
ab -n 100 -c 10 https://example.com/api/users
hey -n 100 -c 10 https://example.com/api/usersEnforcing in CI
# .github/workflows/perf.yml — bundle size check
- name: Check bundle size
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}// package.json — size-limit config
{
"size-limit": [
{ "path": "dist/index.js", "limit": "170 KB" },
{ "path": "dist/index.css", "limit": "60 KB" }
]
}# Lighthouse CI
- name: Lighthouse CI
run: |
npm install -g @lhci/cli
lhci autorun --collect.url=https://staging.example.com \
--assert.preset=lighthouse:recommendedInvestigation playbook
When something is slow:
- Measure first — don't optimize on hunch
- Identify the layer: network, parse/compile, render, layout, paint, API, DB
- Use the right tool:
- Network slow → DevTools Network panel, response sizes, cache headers
- JS slow → DevTools Performance profile, look for long tasks
- Render slow → React/Vue DevTools profiler, count re-renders
- API slow → APM trace, span breakdown
- DB slow →
EXPLAIN ANALYZE, slow query log
- Fix the biggest item, re-measure — don't batch micro-optimizations
- Add a regression test or budget gate so it doesn't come back
Common wins by category
Frontend
- Code-split routes; lazy-load below-the-fold
- Preload critical fonts, eliminate FOIT
<img loading="lazy">, modern formats (AVIF/WebP), correct sizing- Server-side render or static-generate where you can
- Audit dependencies — one accidental
momentimport can be 70KB
Backend
- Eliminate N+1 (eager loading / batch fetches)
- Add indexes for columns in WHERE / JOIN / ORDER BY
- Cache hot reads (Redis, HTTP cache headers)
- Move expensive work to background jobs
- Compress responses (gzip / brotli)
Database
EXPLAIN ANALYZEthe slow query, look at scan vs index- Avoid
SELECT *when you need three columns - Connection pool sized appropriately
- Read replicas for read-heavy workloads
Output format
## Performance audit: <scope>
**Baseline measurements:**
- Bundle: <kb>
- LCP / INP / CLS (p75): … / … / …
- API p95: …
**Budget proposal:**
| Metric | Current | Target | Ceiling |
|---|---|---|---|
| … | … | … | … |
### Findings
- 🔴 **Critical:** <largest single regression vs target>
- 🟠 **Major:** …
- 🟡 **Minor:** …
### Recommended actions (ordered by impact)
1. …
2. …
### CI gates to add
- …Anti-patterns
- ❌ "Make it faster" without a target
- ❌ Measuring on your dev laptop and calling it a day
- ❌ Averaging out the p99 users
- ❌ Premature micro-optimization (loop unrolling) before profiling
- ❌ Budget gates that bypass with
--forceevery week — fix the cause - ❌ Optimizing the part of the request that's already fast
- ❌ Re-rendering the world to "fix" a 2ms task
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

