Google Modern Web Guidance: Fix AI-Written Frontend Code
Modern Web Guidance 1.0 helps AI coding agents write faster, accessible frontend code. See the 10 fixes, legacy-scan workflow, and when to ask for help.
Modern Web Guidance 1.0 is Google Chrome's free set of skills that teaches AI coding agents to use current HTML, CSS and browser features instead of old JavaScript workarounds. It adds a legacy scan for existing code and, in Chrome's own evals, lifted guided agents from about 52% to 91% of checks. It does not rewrite your site alone: you still need review, testing and fixes.
Your AI-built site probably looks finished. The homepage loads, the menu opens, and the form submits. Modern Web Guidance exists because that surface can hide real problems: a modal that traps keyboard users, a form that flags empty fields too early, a video that shifts the layout, or a login flow with weak security defaults.
This guide explains what Google changed on 10 November 2026, what the fixes mean in plain language, and how to use the tool safely on a live site. It is written for the person who has to decide, not just for the person who writes the code.
What Modern Web Guidance is, and is not
Modern Web Guidance is a set of agent skills. A skill here means expert-written guidance that a coding agent reads before it writes HTML, CSS and JavaScript. The agent still writes the code. The guidance steers it toward the browser feature that fits the job.

It guides the code. It does not approve the code.
It is not a framework, a page builder or a new AI model. It does not replace design, content or SEO work. It also does not guarantee a faster site. It improves the odds that new and modernised code follows current best practice.
Version 1.0 added three things that matter for existing sites. First, a modernisation workflow that scans HTML, CSS, JavaScript, TypeScript, framework components and package.json for selected legacy patterns. Second, an expanded guide database aimed at hundreds of verified gaps in AI knowledge. Third, deeper expert review, including accessibility review of user-facing guides.
The project is now cross-browser. Firefox and Edge are contributing alongside Chrome, building on shared Baseline compatibility work. That matters because a fix that works only in one browser is not a fix for a real audience.
For a full web development service scope, the question is not whether the agent used a modern feature. The question is whether visitors can complete the task on a real phone, with a keyboard, on a slow connection, without confusion.
Why AI agents write old frontend code
AI models learn from large amounts of existing code. Much of that code is old. When you ask an agent for a modal, a tooltip, a carousel or a form, it often reaches for the JavaScript workaround that was common five years ago.
The browser has since added native features for many of those jobs. A native <dialog> element handles focus, layering and back-button behaviour. The popover attribute handles light-dismiss menus and tooltips. CSS Scroll Snap handles swipe layouts. CSS light-dark() handles theme colours.
Custom JavaScript can still work. It usually adds more code, more states to test, and more ways to break keyboard and screen-reader use. Native features are handled by the browser, so they tend to be lighter and more accessible by default.
Chrome tests this gap with an eval suite. Each guide defines expectations that must be true if best practice was followed. The same prompt is given to a guided agent and an unguided agent, and the output is checked against those expectations. On average, unguided agents pass about 50% of checks and guided agents about 90%. The published chart shows 52% against 91% as of 9 November 2026. Those are Chrome's own evals, not an independent benchmark.
The 10 fixes, grouped by business risk
Chrome published the 10 recurring mistakes on 11 November 2026. The list is technical. The grouping below orders it by what costs enquiries, trust or security first.

Forms and layout shift first. Security fixes need a review gate, not a quick batch.
Forms that punish users before they type
This is the highest-risk group for most business sites. AI agents often re-implement validation with custom JavaScript that flags untouched required fields as soon as a visitor tabs past them. They also rely on placeholder text for format hints, such as MM/YY, which disappears when typing starts.
Chrome's fix is to use CSS :user-invalid, keep aria-invalid in sync with the visible error, and show a persistent hint above the input, linked with aria-describedby. Hints placed below the input can be hidden by mobile keyboards and autofill popups at the exact moment the visitor needs them.
Check your enquiry and checkout forms first. A form that feels accusatory loses leads before any other fix matters.
Layout shift and visual flicker
Cumulative Layout Shift (CLS) measures visual stability. AI agents usually add width and height to images, but miss video elements, font swaps and mobile toolbar changes.
Chrome lists concrete misses: video elements without size default to 300 by 150 pixels and shift layout once metadata loads, hero sections sized with static vh units jump as mobile browser toolbars expand and retract, and old anti-flicker snippets for A/B tests hide content with opacity: 0 and long timeouts.
The fixes are specific: set size or aspect-ratio and object-fit on media, use dynamic viewport units such as dvh or svh, add font-size-adjust so text does not reflow when web fonts swap in, and avoid legacy anti-flicker code that delays Largest Contentful Paint (LCP).
Accessibility: focus, motion and keyboard use
Accessibility here means whether a person can use the site with a keyboard, a screen reader, or reduced-motion settings.
Common failures include focus that does not move into a newly opened view, focus that is not returned to the trigger when the view closes, manual JavaScript tab traps, and custom modals using aria-modal="true" instead of a modal <dialog> or inert. Toolbars and grids often expose every item as a separate tab stop instead of using one tab stop with roving tabindex.
Reduced-motion failures are subtler. Agents often remember prefers-reduced-motion for basic transitions but forget it for smooth scrolling, view transitions or scroll-driven animations. A blanket reset that wipes out all transitions can also remove state cues that users need.
The test is simple: tab through the site without a mouse. Focus should move into new views, return when they close, and always stay visible with enough contrast.
Dialogs, popovers and touch gestures
AI agents often build custom position: fixed overlays with manual click-outside handlers, entry and exit animations coordinated with requestAnimationFrame() and setTimeout() fallbacks, and body scroll locks using overflow: hidden on <html>.
Chrome's fix is to use the platform: popover for menus and tooltips, <dialog> for modals, and pure CSS with @starting-style and transition-behavior for entry and exit animations. A modal <dialog> also gives native back-button close on Android.
For touch, agents often write custom pointermove or touchmove logic for swipe-to-dismiss or swipe-to-reveal. CSS Scroll Snap and scroll-driven animations let the browser run gesture physics off the main thread, which usually feels smoother. Agents also miss overscroll-behavior-x: none on tab-swipe interfaces, which can trigger an accidental browser back or forward navigation.
Dark mode that flashes and drifts
Dark mode fails in small, visible ways. The most common miss is a missing <meta name="color-scheme" content="light dark"> tag, so dark-mode visitors see a white flash while stylesheets load. Agents also style dark themes without setting color-scheme, leaving scrollbars and form controls stuck in light mode.
Chrome recommends the light-dark() function for theme-adaptive colour tokens, a system-default option alongside light and dark, and a storage event listener so other open tabs stay in sync when the theme changes.
Runtime responsiveness and main-thread work
Interaction to Next Paint (INP) measures how quickly a page responds to taps, clicks and keyboard input. Agents usually follow classic load-time advice, but struggle with main-thread responsiveness.
Chrome lists custom setTimeout() queues instead of scheduler.postTask() or scheduler.yield(), dense grids without content-visibility: auto and contain-intrinsic-size, and inactive views hidden with display: none instead of content-visibility: hidden paired with inert. The second approach destroys cached rendering state, so switching back triggers full layout and paint.
For a long service list, dashboard or catalogue, this group decides whether the page feels fast after it loads, not just during load.
Security: sanitisation, CSP and passkeys
Security is where AI agents fail most quietly. Chrome found that models rarely add a Content Security Policy (CSP) or cross-origin isolation header unless explicitly prompted. Even when prompted, unguided models still fail more than half of security checks.
For DOM cross-site scripting (XSS), agents write hand-rolled DOMParser allowlist sanitisers instead of using native setHTML() when supported, with a vetted library such as DOMPurify only as a fallback. They also register permissive Trusted Types policies that pass input through unchanged, which undermines the protection.
For passkeys, agents hand-roll Base64URL helpers instead of using parseCreationOptionsFromJSON(), parseRequestOptionsFromJSON() and credential.toJSON(). They skip capability checks, miss credential cleanup when the server reports an unknown credential, and use outdated options for streamlined sign-in.
Do not let an agent "improve security" without a review step. A loose CSP or a permissive Trusted Types policy can look like progress while weakening protection.
Install and legacy-scan workflow
Use this workflow for a new build and for an existing site. Do not let the agent edit a live site on the first run.

Approve one pattern or folder at a time, and keep checkout and login out of the first batches.
Step 1: Install the skills. From the project folder, run:
npx modern-web-guidance@latest install If an earlier version is already installed, run npx modern-web-guidance@latest update. Plugin routes also exist for Claude Code, Codex, Cursor, Copilot, Antigravity, WebStorm, Kimi Code, Grok Build and other skills-compatible agents.
Step 2: Scan before you change anything. Run:
npx modern-web-guidance legacy-scan . --json The scan uses static analysis on a limited set of patterns. It covers roughly 20% of the guide corpus in this release, the subset where legacy code can be spotted deterministically. A clean report does not mean the code is fully modern. Treat it as a candidate list, not a pass certificate.
Step 3: Ask for a plan, not edits. Use a prompt such as: "Modernise this repository using Modern Web Guidance. Scan frontend files for legacy patterns, verify the findings, and propose a modernisation plan before making any code edits."
Step 4: Approve in small batches. Approve one folder or one pattern at a time. Commit after each batch so a regression is easy to find and revert. Keep checkout, login, payment, analytics and ad code out of the first batches.
Step 5: Verify in the browser, not just in the diff. Chrome recommends pairing Modern Web Guidance with Chrome DevTools for agents. Guidance tells the agent what to write. Runtime tools check whether it actually works, how long tasks block the main thread, and whether animations respect reduced-motion settings.
Step 6: Measure before and after. Record LCP, INP and CLS for the same pages, on the same device class, before and after the change. Lab scores help diagnosis. Field data in Search Console shows what real visitors experienced. If your site is an AI-built website not ranking, fix rendering and indexing first, because a modern modal will not help if Google cannot see the page.
There is no --fix flag, by design. Chrome's own documentation says modernisations often turn into cross-layer refactors, with behaviour and browser-support risk that needs agent verification and a test run.
Fix-order scorecard: what to do first
Use this table when time is limited. Score 1 point for each Yes. This is a decision aid, not a quote.

Score the site, then start with the highest-risk group rather than the easiest commit.
| # | Check | Yes = 1 |
|---|---|---|
| 1 | Enquiry or checkout form flags errors too early, hides hints, or breaks with autofill | |
| 2 | Hero, video or banner shifts layout on load | |
| 3 | Modal, menu or popup cannot be used fully with a keyboard | |
| 4 | Page feels slow after load, especially on a mid-range phone | |
| 5 | No CSP, or login and payment code was AI-generated without a security review | |
| 6 | Dark mode flashes white, or the theme toggle cannot return to system default |
4 to 6 points: fix in the next release. Start with forms and layout shift.
2 to 3 points: fix in planned batches. Do not bundle them with a redesign.
0 to 1 point: keep the guidance installed for new work. Re-check after the next major feature.
If you are choosing between a targeted fix and a full rebuild, the website redesign or CSS fix decision guide uses the same logic: fix when the problem is isolated, rebuild when faults stack across templates.
What Modern Web Guidance does not fix
Modern Web Guidance covers the web platform: HTML, CSS, JavaScript, browser compatibility and Baseline data. It does not cover your backend, database, API design, pricing, copy or business logic.
It does not fix thin content, duplicate titles, missing sitemaps or broken redirects. Those are search and content problems. It does not fix a confusing offer, a weak call to action, or a form that asks for too much. Those are conversion problems.
It also does not decide browser support for you. Baseline tells you which features work across major browsers. You still need to decide what to support for your audience and what fallback to provide. A feature that is Baseline in general may still be wrong for a checkout that must work on an older device in a specific market.
For discovery work beyond frontend code, SEO, AEO and GEO services cover crawlability, answer structure, and how AI systems describe your business. Keep those checks separate from frontend modernisation, so one project does not hide the other's failures.
An illustrative example
This is an illustrative scenario, not a verified client result.
A small service business has an AI-built marketing site. The homepage looks clean. On a phone, the enquiry form flags the phone field as invalid before the visitor types anything. The hero video has no size, so the headline jumps down once the video loads. The mobile menu opens, but keyboard focus stays behind it, so a keyboard user cannot reach the menu items.
The team installs Modern Web Guidance, runs legacy-scan, and asks the agent for a plan. The plan is approved in three batches: forms first, media sizes and viewport units second, dialog and focus third. Each batch is tested on a staging copy on two real phones, with keyboard-only navigation and reduced-motion on.
The result is not "AI fixed the site." The result is a short, testable list of changes with before and after checks. That is the honest value of the tool.
A note on evidence
No first-hand JUHENZA scan run is claimed here, and no client site is shown. The tool behaviour, commands, coverage and eval numbers come from Chrome's Modern Web Guidance 1.0 post and the Top 10 post, both linked below. The example is illustrative.
If you want proof for a specific site, ask for five artifacts: the scan output, the list of findings accepted and rejected with reasons, the plan, the before and after metrics, and the keyboard test result. A claim that "the agent modernised it" without those five is not evidence.
Common mistakes, limitations and when to involve a specialist
Common mistakes:
- Letting the agent edit live code without a plan or staging copy
- Treating a clean legacy scan as proof the site is modern
- Replacing a working custom component with a native feature without testing its edge cases
- Adding a CSP without testing checkout, analytics and third-party scripts
- Measuring only in a desktop browser's device view, not on a real phone
Limitations: the legacy scan covers only a subset of patterns it can detect with high confidence. It will miss some legacy code. The eval numbers are Chrome's own, so they show direction, not an independent audit. Guidance evolves, and a pattern that is modern today may be superseded later. WordPress and builder sites are partial cases: the scan can help with custom themes and code you control, but it cannot modernise third-party plugin code you do not maintain.
When to involve a specialist: bring one in when the site handles payments, health data or account access; when the agent proposes changes to authentication, CSP, Trusted Types or passkeys; when a fix touches checkout, login or a form that feeds your CRM; when you need to support older browsers or specific devices and cannot test them yourself; or when the same fault keeps returning after a fix.
FAQ
What is Modern Web Guidance?
Modern Web Guidance is a free set of skills from Google Chrome that teaches AI coding agents to use current HTML, CSS and browser features. It includes guides, browser compatibility data, and a modernisation workflow for existing code. It is not a new AI model or a website builder.
Is Modern Web Guidance free?
Yes. It is open source under the Apache 2.0 licence. You still pay for your AI coding tool, hosting and any developer time. Free here means no licence fee for the guidance itself, not zero cost to implement and test changes.
Which AI coding agents support Modern Web Guidance?
Chrome lists plugin routes for Claude Code, Codex, Cursor, Copilot, Antigravity, WebStorm, Kimi Code and Grok Build, plus a CLI installer for other skills-compatible agents. Check the official docs for the current list, because agent support changes quickly.
Can Modern Web Guidance improve an existing website?
Yes, for frontend code you control. Version 1.0 adds a legacy scan that finds selected legacy patterns in HTML, CSS, JavaScript, TypeScript, components and package.json. The agent should verify findings and propose a plan before editing. Always test on staging first.
Does the legacy scan find every outdated pattern?
No. It covers only patterns it can detect with high confidence, about 20% of the guide corpus in this release. A clean scan does not mean the site is fully modern. Manual review, keyboard testing and Core Web Vitals measurement are still needed.
Does Modern Web Guidance work with WordPress?
It can help with custom themes, custom plugins and frontend code you control. It cannot automatically modernise third-party plugin code you do not maintain. Test changes on staging, because a theme or builder update can interact with the fix.
Will Modern Web Guidance improve my Google rankings?
Not directly. It can improve speed, stability, accessibility and usability, which support rankings and conversions. Rankings also depend on content depth, crawlability, links and competition. Do not promise a ranking gain from a frontend fix alone.
Should I let an AI agent modernise my whole site at once?
No. Approve in small batches, one folder or one pattern at a time. Keep checkout, login, payment, analytics and ad code out of early batches. Commit after each batch, test on real devices, and keep a rollback path.
Where this fits and what to do next
This post sits under the web development service and alongside the AI-built site and redesign guides. It answers the code-quality question that comes after "does Google see my site?" and before "should I rebuild it?"
Modern Web Guidance does not make AI-written code automatically good. It makes good practice easier for the agent to reach, and easier for you to verify. Install it, scan, ask for a plan, approve in small batches, and measure on real devices.
If your site needs that review, discuss your project and send the site URL, the pages that matter most, and the faults you have already seen.