--- name: performance-audit description: Performance audit — bundle size, image opt, lazy load, code split, caching, CWV. Deep-dive for /launch-check performance. disable-model-invocation: false argument-hint: "[project-path]" effort: medium --- Writing: read docs/skills/shared/writing-rule.md before you write a durable artifact. # /performance-audit — Bundle & Core Web Vitals Analysis Deep-dive performance analysis focused on what's measurable from the codebase without running Lighthouse. Checks bundle size, image optimization, lazy loading, code splitting, and caching configuration. Invoke when `/launch-check`'s performance row shows WARN or FAIL. ## Process ### Step 1: Bundle analysis - Check for build output (`dist/`, `build/`, `.next/`, `out/`) - If build exists: measure total JS + CSS size, identify the 5 largest files - Check for code splitting (dynamic imports, `React.lazy`, `next/dynamic`, route-based splitting) - Check for tree shaking configuration (ES modules, `sideEffects: false` in package.json) - Check if source maps are excluded from production build ### Step 2: Image optimization - Find all images in the project (src, public, static, assets directories) - Check formats: are images served as WebP/AVIF, or only PNG/JPEG? - Check for oversized images (> 500KB, > 2000px width) - Check for `next/image`, `@astrojs/image`, or similar optimization components - Check for `loading="lazy"` on below-the-fold images - Check for explicit `width` and `height` attributes (prevents layout shift) ### Step 3: Loading performance - Check for render-blocking resources (CSS in `` without `media`, sync `