audit-performance
Skill9 starsChanged 42 days agoMITView on GitHub
Audit and fix runtime performance (Core Web Vitals, load priority). Use when "slow page", "LCP/INP/CLS", "fetchpriority", "long tasks", or "bfcache". JS payload → audit-bundle-size. Instant nav → enhance-web-instant-nav. Load limits → test-load.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- dzhng/jevgreptheir own version, first seen Nov 7, 2026
- dzhng/skillstheir own version, first seen Nov 4, 2026
- Buddhilive/buddhi-clitheir own version, first seen Nov 1, 2026
- dzhng/yaptheir own version, first seen Oct 15, 2026
- krixon/skillstheir own version, first seen Oct 11, 2026
- ben-manes/caffeinetheir own version, first seen Oct 8, 2026
Used with
Projects with it also use marketing-pages, close-spec and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dzhngSkillmarketing-pages
Best-practice rulebook for a marketing site's pages, organized by page class — campaign landers, product pages, programmatic SEO trees, editorial. Use when writing or updating a landing/marketing page, wiring a campaign lander to an attribution identifier, changing site-wide nav/footer links, touching sitemap/robots/agent-readable surfaces, or auditing a public site's indexing, reachability, and conversion setup.
Also in 4 projects that use this
dzhngSkillclose-spec
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
Also in 4 projects that use this
transitive-bullshitSkillcompare-screenshots
Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Also in 4 projects that use this
LucasMatuszewskiSkillaudit-agents
Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.
Also in 4 projects that use this
antonio-orionusSkillfind-state-machines
Report every implicit state machine in a project, with its states, transitions and flaws.
Also in 3 projects that use this
rhnfzlSkillexplore-unknowns
Walk the user through mapping the unknowns of a task before, during, and after they build it, and hand them a four-quadrant map (settled ground, open decisions, taste, and landmines) they keep. Reach for this eagerly whenever a request is ambiguous or underspecified, the codebase or domain is unfamiliar, the user will "know it when they see it", a reference implementation must be understood before porting, a build-queue or architecture-changing task is about to start, a mid-build deviation needs capturing, or a finished change needs buy-in or verified understanding before merge. Trigger even when the skill is not named: "do a blindspot pass", "find my unknown unknowns", "interview me about this change", "brainstorm the approach for a task I am about to build", "help me scope this", "what am I missing here", "plan this before I build", "I know nothing about X in this codebase". When a territory profile is present it reads memory and the graph first and feeds the map into the build pipeline; without one it degrades to a plain general map. Not for trivial or mechanical tasks with clear acceptance criteria, single-fact lookups, pure debugging of a known symptom, or pure code review, those have their own tools. Do not use it to run the build itself; the map is the deliverable and implementation remains a separate task, whether it has not started or is already underway.
Also in 4 projects that use this
- +6 more from dzhng
Other versions8 projects use a version of this.
Word for word · 1
- kensaurus/skills★ 9100% same
Edited · 0
None found.
Wrote their own version · 7
- ben-manes/caffeine★ 18ksame name
- dzhng/jevgrep★ 3.2ksame name
- dzhng/skills★ 1.5ksame name
- dzhng/yap★ 112same name
- jasonmichaelbell78-creator/sonash-v0★ 2same name
- Buddhilive/buddhi-cli★ 1same name
- krixon/skills★ 1same 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 repository165 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/approved-plan-execution.mdcCursor rule
- .cursor/rules/skill-workflows.mdcCursor rule
- .cursor/rules/verification-before-completion.mdcCursor rule
- llms.txtllms.txt
- audit-accessibilitySkill
- audit-agent-speedSkill
- audit-analyticsSkill
- audit-auth-flowsSkill
- audit-backend-architectureSkill
- audit-bundle-sizeSkill
- audit-cicdSkill
- audit-codemod-safetySkill
- audit-code-qualitySkill
- audit-code-reviewSkill
- audit-db-schemaSkill
- audit-doctrineSkill
- audit-env-paritySkill
- audit-fe-apiSkill
- audit-gate-logicSkill
- audit-i18nSkill
- audit-infra-costSkill
- audit-langfuse-llmSkill
- audit-llm-securitySkill
- audit-monetization-iapSkill
- audit-payment-systemSkill
- audit-realworldSkill
- audit-registry-listingSkill
- audit-resilienceSkill
- audit-responsiveSkill
- audit-securitySkill
- audit-skill-conflictsSkill
- audit-ui-statesSkill
- audit-uiux-design-systemSkill
- audit-ux-journeysSkill
- audit-uxSkill
- backend-db-performanceSkill
- backend-error-handlingSkill
- backend-observabilitySkill
- backend-patternsSkill
- backend-realtimeSkill
- burndown-fullSkill
- complete-everythingSkill
- data-pipelineSkill
- data-visualizationSkill
- debug-errorSkill
- debug-fe-be-integrationSkill
- debug-sentry-monitorSkill
- deploy-npmSkill
- deploy-verifySkill
- design-apiSkill
- design-canvasSkill
- design-emailSkill
- design-frontendSkill
- design-generative-artSkill
- design-mobile-firstSkill
- design-motionSkill
- design-prdSkill
- design-systemSkill
- design-themeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Before optimizing, measure.
- Distinctive: line 42
If Sentry performance monitoring is enabled, fetch real production metrics:
- Distinctive: line 66
Check for performance-related issues:
- Distinctive: line 314
Check official framework docs via Context7:
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Performance Audit Skill
Degree of freedom: MIXED — what to optimize [HIGH freedom];
measure-first Sentry/vitals and EXPLAIN [LOW freedom — run exactly].
Audit-and-fix exception. Measure, then optimize. JS payload →
audit-bundle-size. Instant navigations →enhance-web-instant-nav. Breaking point →test-load. Timeouts/retries →audit-resilience. When fixing: change only the measured bottleneck and re-measure it; log other slow paths you notice as follow-ups, not fixes. Edit the existing file in place rather than rewriting it. Add a perf test only where the repo already keeps them or the task asks; scratch measurements stay out of the repo.
How to reason
- Observe — quote LCP/INP/CLS, p95, or
EXPLAIN/ N+1 loop (file:line) - Interpret — is the user waiting on bytes, a query, or main-thread work?
- Classify — vital-miss / N+1 / missing-index / bundle / image / re-render
- Severity — poor LCP/INP or p95 >> target on a live path = Critical
Worked example
Observe: Sentry p95
/users= 2.3s; handlerfindAllthen per-userOrder.findByUserId(app/api/users/route.ts:31). Interpret: N+1; TTFB/LCP suffer on that page. Classify: N+1. Severity: Critical (p95 far over 200ms). Finding:/users| N+1 | eager-load orders | then re-measure
Step 0: Gather Performance Data [LOW freedom — run exactly]
Before optimizing, measure. Collect data from multiple sources.
Production Data (Sentry)
If Sentry performance monitoring is enabled, fetch real production metrics:
sentry:search_events
{
"organizationSlug": "<ORG_SLUG>",
"projectSlug": "<PROJECT_SLUG>",
"regionUrl": "<REGION_URL>",
"query": "slowest transactions by p95 duration in last 7 days",
"limit": 20
}sentry:search_events
{
"organizationSlug": "<ORG_SLUG>",
"projectSlug": "<PROJECT_SLUG>",
"regionUrl": "<REGION_URL>",
"query": "web vitals LCP INP CLS performance scores in last 7 days",
"limit": 20
}Check for performance-related issues:
sentry:search_issues
{
"organizationSlug": "<ORG_SLUG>",
"projectSlugOrId": "<PROJECT_SLUG>",
"regionUrl": "<REGION_URL>",
"query": "performance issues slow queries N+1 in last 30 days",
"limit": 20
}Research Current Benchmarks
Fetch current performance targets:
firecrawl:firecrawl_search
{
"query": "web vitals thresholds good score <current year>",
"limit": 3,
"sources": [{ "type": "web" }]
}Field Data (source of truth) [LOW freedom — run exactly]
Lab (Lighthouse) is for diagnosis; field decides pass/fail.
- CrUX / PageSpeed Insights field tab for the origin and top 5 URLs by traffic — record p75 LCP / INP / CLS (mobile first).
web-vitals/attributionin the app (not the base build): it names the LCP element, the INP interaction target, and the CLS-shifting node.- Lighthouse CI with a
budget.json(seereferences/loading-priority-2026.md§Budgets). Fail the PR on regression, not on absolute score.
Record all three in the report's "Production Metrics" block before touching code.
Verification protocol [LOW freedom — run exactly]
# Field (source of truth): CrUX / PSI field tab → p75 LCP, INP, CLS
# Lab, repeatable, budgeted:
npx @lhci/cli autorun --config=lighthouserc.json
# Early Hints present?
curl -sv https://example.com/ 2>&1 | grep -E "< HTTP/.* 103"
# Speculation: DevTools → Application → Speculative loads
# bfcache: DevTools → Application → Back/forward cache → Test
# LCP element: web-vitals/attribution → onLCP(({attribution}) => attribution.element)Performance Targets
Core Web Vitals
| Metric | Good | Needs Work | Poor |
| LCP (Largest Contentful Paint) | <2.5s | 2.5-4s | >4s |
| INP (Interaction to Next Paint) | <200ms | 200-500ms | >500ms |
| CLS (Cumulative Layout Shift) | <0.1 | 0.1-0.25 | >0.25 |
Other Key Metrics
- TTFB: <800ms field p75 (Google threshold); aim <200ms at the edge
- FCP: <1.8s
- Long tasks: none >50ms on the critical interaction path (INP driver)
- LCP resource load delay: <100ms (gap between TTFB and the LCP image request starting — usually "image not discoverable / not preloaded")
- bfcache: eligible on every content page (DevTools → Application → Back/forward cache)
Frontend Performance Audit [HIGH freedom]
Bundle Size Analysis
npm run build -- --analyze # framework-specific
npx source-map-explorer 'dist/**/*.js'Checklist:
- Total bundle <200KB gzipped
- No single chunk >100KB gzipped
- Tree shaking working (no unused exports in bundle)
- Heavy libraries lazy-loaded (charts, editors, maps)
- No moment.js (use date-fns or dayjs)
- No lodash full import (use lodash-es or specific imports)
Code Splitting
- Route-based splitting (each page loads its own chunk)
- Component-level splitting for heavy components (
lazy()/dynamic()) - Below-fold content deferred
Image Optimization
- WebP/AVIF format used (not PNG/JPEG for photos)
- Images sized appropriately (not serving 4K to mobile)
loading="lazy"on below-fold images- Responsive
srcSetfor different screen sizes - Image CDN used (Cloudinary, imgix, Vercel Image Optimization)
Loading Priority & Speculation [HIGH freedom on which to apply, LOW freedom on the LCP rules]
Deep syntax: references/loading-priority-2026.md. Instant-nav implementation → enhance-web-instant-nav.
LCP element (find it first with web-vitals/attribution or DevTools → Performance → LCP)
- LCP image is not
loading="lazy"— lazy on the LCP image is an automatic Critical finding - LCP image has
fetchpriority="high"(Next.js:<Image priority />, which also injects the preload) - LCP image is discoverable from HTML — not a CSS
background-image, not injected by client JS, not behind a hydration boundary <link rel="preload" as="image" imagesrcset imagesizes>when the LCP image is responsive and not already preloaded by the framework- Non-critical images:
loading="lazy" decoding="async";<picture>AVIF → WebP → JPEG fallback
Fonts
font-display: swap(oroptionalfor non-brand text); fallback metrics set (size-adjust,ascent-override) so swap causes no CLS —next/fontdoes this automatically, verify it's actually used- Preload only the above-fold weight(s); subset to used unicode ranges; self-host
Early Hints (103)
- Origin/CDN sends
103 Early Hintswithpreconnectfor the image/font CDN andpreloadfor the LCP image + critical CSS. Verify:curl -sv https://site/ 2>&1 | grep -i "< HTTP/.* 103" - Node:
res.writeEarlyHints({ link: [...] }); otherwise configure at the CDN
Speculation Rules (next-navigation speed)
<script type="speculationrules">present withprefetchdocument rules atmoderateeagerness for in-site linksprerenderonly for high-probability next pages (pagination, "next article", product detail); eagernessmoderate/conservative- Excluded from speculation: logout, cart/checkout, auth, anything with side effects on GET, URLs with
?unlessexpects_no_vary_searchis set - Server ignores side-effects when
Sec-Purpose: prefetch;prerenderis present; analytics/ads guarded bydocument.prerendering+prerenderingchange - Full implementation →
enhance-web-instant-nav
bfcache
- No
unloadlisteners (usepagehide); noCache-Control: no-storeon HTML; no open WebSocket / IndexedDB transaction atpagehide - Verified green in DevTools → Application → Back/forward cache → "Test back/forward cache"
Render strategy (Next.js 16 / React 19)
- Server Components by default;
'use client'only at interactive leaves - Slow data wrapped in
<Suspense>so the shell streams; static shell + dynamic holes (cacheComponents/'use cache') instead of blocking the whole route - React Compiler enabled (
reactCompiler: true) before any manualmemo/useMemo/useCallback— manual memo only where Profiler proves the Compiler missed it
INP (responsiveness)
- No task >50ms on tap/click/keypress paths; break work with
scheduler.yield()(fallbacksetTimeout(0)) orstartTransition - No synchronous layout reads (
offsetHeight,getBoundingClientRect) inside input handlers content-visibility: auto+contain-intrinsic-sizeon long off-screen sections- Third-party scripts:
async/defer, Next<Script strategy="lazyOnload">(or"worker"via Partytown where safe), consent-gated, facades for embeds (lite-youtube, static map image → iframe on click)
CLS
- Every
<img>,<video>,<iframe>, ad slot haswidth/heightoraspect-ratio - Late-arriving UI (banners, toasts, cookie bars) reserves space or overlays — never pushes content
React Performance (if applicable)
- React Compiler on; manual memo only with Profiler evidence (see Loading Priority & Speculation)
- No unnecessary re-renders (React DevTools Profiler)
- Long lists virtualized (react-window, @tanstack/react-virtual)
- No inline object/array creation in JSX props
- Context providers scoped narrowly (not wrapping entire app for local state)
CSS Performance
- No layout thrashing (reads before writes)
- Animations use
transform/opacity(GPU-accelerated) - No
@importchains (bundled instead) - Critical CSS inlined for above-fold content
- Fonts subset and preloaded (
<link rel="preload">)
Backend Performance Audit [HIGH freedom]
Database Queries
N+1 Detection:
// BAD: N+1
const users = await User.findAll();
for (const user of users) {
const orders = await Order.findByUserId(user.id);
}
// GOOD: eager loading
const users = await User.findAll({ include: [Order] });Checklist:
- N+1 queries eliminated (eager loading, joins, batch loading)
- Indexes on frequently queried columns (WHERE, JOIN, ORDER BY)
- SELECT only needed columns (no
SELECT *) - Pagination on all list endpoints
- Connection pooling configured
- Slow query logging enabled
Index verification: [LOW freedom — run exactly]
EXPLAIN ANALYZE SELECT * FROM orders WHERE user_id = '123';API Response Optimization
- Response compression enabled (gzip/brotli)
- Appropriate cache headers (
Cache-Control,ETag) - No over-fetching (return only what the client needs)
- Pagination for list endpoints
- Response time <200ms for p95
Caching Strategy
| Layer | Tool | TTL | Use For |
| Browser | Cache-Control headers | Varies | Static assets, API responses |
| CDN | Vercel/CloudFront/Cloudflare | 1h-1d | Static pages, images |
| API | Redis/Memcached | 5m-1h | Expensive queries, computed data |
| ORM | Query cache | 1m-5m | Repeated identical queries |
Network Optimization
- CDN for static assets
- HTTP/2 or HTTP/3 enabled
- Preconnect to critical origins (
<link rel="preconnect">) - DNS prefetch for third-party domains
- API calls batched where possible (GraphQL, DataLoader)
Research-Driven Optimization [HIGH freedom]
For specific performance bottlenecks, research current solutions:
firecrawl:firecrawl_search
{
"query": "<framework> <specific bottleneck> performance optimization <current year>",
"limit": 5,
"sources": [{ "type": "web" }]
}Then deep-read the best result:
firecrawl:firecrawl_scrape
{
"url": "<best-result-url>",
"formats": ["markdown"],
"onlyMainContent": true
}Check official framework docs via Context7:
context7:resolve-library-id
{
"libraryName": "<framework>",
"query": "performance optimization"
}Quick Wins (Highest Impact, Lowest Effort)
| Issue | Solution | Impact |
| LCP image lazy / not prioritized | fetchpriority="high" + preload; remove loading="lazy" from LCP | High (−300 to −800 ms LCP) |
| Fast first page, slow second | Speculation Rules prefetch (moderate) | High (next-nav TTFB ≈ 0) |
| Manual memo everywhere | Enable React Compiler | High (INP; delete redundant memo) |
| Large bundle | Code split routes, lazy load heavy libs | High |
| Slow images | WebP + lazy load + responsive | High |
| No caching | Add Cache-Control headers | High |
| N+1 queries | Eager load / batch | High |
| Missing indexes | Add database indexes | High |
| Unoptimized fonts | Subset + preload + font-display:swap | Medium |
| No compression | Enable gzip/brotli | Medium |
| Expensive re-renders | React Compiler first; manual memo only with Profiler evidence | Medium |
| Layout shifts | Set explicit width/height on images/embeds | Medium |
Self-critique before applying fixes [LOW freedom — do not skip]
- Evidenced — a measured vital, p95, or
EXPLAIN, not "this looks slow" - Reproducible — same path still exceeds the target table
- Severity justified — Critical = poor vital or live-path p95
- Right owner — JS payload →
audit-bundle-size; breaking point →test-load; timeouts →audit-resilience - No-false-safety — no
memo/useMemowithout a measured re-render; measure again after the fix - LCP named — prove which element is LCP before recommending image fixes (no attribution data = guess, not audit)
Output: Performance Audit Report
## Performance Audit: [Project Name]
### Production Metrics (from Sentry)
- LCP: [value] — [good/needs work/poor]
- INP: [value] — [good/needs work/poor]
- CLS: [value] — [good/needs work/poor]
- Slowest transactions: [list with p95 times]
### Critical Issues (fix immediately)
| # | Area | Issue | Impact | Fix |
|---|------|-------|--------|-----|
| 1 | DB | N+1 on /users endpoint | p95 = 2.3s | Eager load orders relation |
### Optimizations (prioritized)
| # | Area | Issue | Impact | Effort | Fix |
|---|------|-------|--------|--------|-----|
| 1 | FE | Bundle 450KB gzipped | High | Low | Code split routes |
### Already Optimized
- [list of performance areas that are well-implemented]
### Monitoring Recommendations
- [what to add to track performance over time]
### Research Sources
- [URL] — [what optimization pattern it provided]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.

