---
name: modern-web-predeploy-checklist
description: >-
  Use before publishing any web page or site change (landing pages, websites,
  product UI): a slim pre-deploy check for speed, security headers,
  accessibility and layout, based on Chrome's Modern Web Guidance. Run it on the
  noindex draft.
---
# Modern web pre-deploy checklist

Reference: GoogleChrome/modern-web-guidance-src (CLI: `npx modern-web-guidance@latest search|retrieve <topic>`). Main guides:
- guides/performance/performance/guide.md
- guides/security/security/guide.md
- guides/accessibility/accessibility/guide.md
- guides/html/html/guide.md
- guides/css/css/guide.md
- guides/performance/optimize-image-priority/guide.md
- guides/visual-design/color/guide.md

## Before
- Run Lighthouse mobile on the live pages you'll touch, and save the JSON with the before scores.
- Take full-page screenshots of those pages at 390 and 1440.

## Checklist (on the noindex draft)
1. **Images:** use WebP or AVIF at the size actually shown. Flag any image over about 200 KB and any tiny icon served large.
2. **Load order:** the LCP image gets fetchpriority="high" and is never lazy. Everything below the fold gets loading="lazy" decoding="async". Images inside a closed dialog or pop-up load only when it opens.
3. **Image sizes:** every img, and every picture source with a different aspect, has width and height, so CLS is 0.
4. **Contrast:** text contrast is at least 4.5:1, including small counts and labels.
5. **Charset:** `<meta charset>` comes first in `<head>`.
6. **Safe DOM:** use textContent or createElement instead of innerHTML for messages and any user or form text.
7. **Security headers** (for example a Netlify `_headers` file):
   - X-Content-Type-Options nosniff
   - Referrer-Policy strict-origin-when-cross-origin
   - Permissions-Policy
   - X-Frame-Options DENY plus CSP frame-ancestors 'none'
   - Content-Security-Policy-Report-Only that allows only what the page uses
   Then load every page, open the pop-ups and submit the forms with the request faked, and confirm there are 0 CSP violations.
8. **Indexing:** the draft is noindex (meta tag and X-Robots-Tag), and prod is not.
9. **Layout:** there's no sideways scroll at 390 or 1440, and the screenshots match the before shots except for intended changes.
10. **Working parts:** all links and downloads return 200, analytics fires, and forms work.
11. **Downloads:** on pages that offer a file for download, the shown content matches the downloadable file.
12. **After scores:** rerun Lighthouse on the same pages and report the before and after numbers you actually saw.

## After prod
Record the rollback deploy id first. Deploy only with the owner's OK (or a standing OK) and after the team's QA pass, unless the owner skips it. Then repeat checks 8-10 and 12 on the live site.

## Optional one-off
`npx modern-web-guidance@latest legacy-scan .` lists outdated patterns. Use it for review, not as a gate.
