maintenance-code-optimize-applisted
Install: claude install-skill skowalskidev/dotclaude
# Optimize App — performance & Lighthouse harness
Applies to any web app (Next.js assumed where specific). Run the audits yourself; report conclusions, not
raw JSON. The RULES are below; the exact commands + fix recipes live in two bundled references (read them
when the rule is in play):
- **How to measure** → `references/running-lighthouse.md` (prod build, debug Chrome, MCP perf trace,
deployed-URL CLI pinned to Node 24, tool-artifact detection).
- **The fixes** → `references/verified-fixes.md` (video re-encode, `next/image` + `<picture>` art direction,
media lazy-loading, a11y/agentic-browsing, CSP, the gotchas).
## Rule 0 — NEVER change colors
Simon has a standing instruction: **do not change the color palette, and do not "fix" `color-contrast`.**
It has been explicitly reverted before, twice. `color-contrast` scoring 0 is an accepted, deliberate state.
Never reapply contrast fixes, never touch the primary color, and don't re-raise it as a suggestion unless
Simon brings it up first.
## Rule 1 — Measure on a PRODUCTION build, never `next dev`
The single biggest source of false findings — a `next dev` Lighthouse run is worthless for performance
(real case: dev LCP 36,338 ms vs prod LCP 1,217 ms on the same code, ~30x). Always
`npm run build && npx next start -p 3100` and audit that. The dev-mode artifacts that mark a poisoned run,
and the exact commands, are in `references/running-lighthouse.md`.
**3100 is a placeholder, not a reservation.** Another session may alr