Ask an AI coding agent for a dialog, a scroll effect or a page transition and it will happily write you the 2019 version — hand-rolled divs, scroll listeners, jQuery-era DOM code — because that is what most of its training data looks like. modern-web-guidance is the Chrome team's fix: an expert-maintained library of modern patterns that your agent can search locally before it writes a line. We ran all three of its commands for real on November 23, 2026 (release v1.0.2, Node v24.22.1), then pointed its legacy scanner at this very website. Every result below is what the tool actually printed — including the real bug it found in our own chat assistant, and the five problems it cannot see.
modern-web-guidance (GoogleChrome/modern-web-guidance on GitHub) is an Agent Skill plus a small CLI, led by the Google Chrome team and co-maintained with people from Edge, Firefox and MDN. It packages 269 modern web features and 206 real-world expert guides — organised into 17 categories from accessibility, CSS and forms to performance, PWAs and WebMCP — into a knowledge base that lives on your machine. Your coding agent (or you, from the terminal) searches it locally, pulls the full text of the relevant guide, and writes today's pattern instead of yesterday's. The code is Apache-2.0; the guide content is CC BY 4.0. It is completely free and needs no API key: search and retrieve are local semantic search over the bundled guides, with no cloud model involved.
The guides are not API references. Each one follows a fixed production-grade structure — scenario, step-by-step implementation, complete working code, then a "Constraints & Accessibility" checklist with MANDATORY and DO NOT items. The example guide in the project's README (animate-to-from-top-layer, 253 lines, which we read in full) warns, for instance, that overlay must be in the transition list and that allow-discrete must never be written into the transition shorthand — exactly the kind of pitfall that official reference docs mention quietly, if at all, and that an agent guessing from training data will get wrong.
Attribution: guide content referenced in this tutorial is from the modern-web-guidance project (GoogleChrome/modern-web-guidance) and its contributors, used under the CC BY 4.0 licence; the project's code is Apache-2.0. This tutorial is based on our own hands-on test — the commands, timings and findings are ours, from our machine and our website.
There are two ways in. The full install wires the skill into your coding agent with an interactive wizard:
npx modern-web-guidance@latest install # wizard: pick Claude Code / Codex / Cursor / …
But nothing in this tutorial needed it. All three commands run straight from npx with no installation at all, which is the route we used for every test below:
npx -y modern-web-guidance@latest search "view transitions" npx -y modern-web-guidance@latest retrieve "cross-document-transitions" npx -y modern-web-guidance@latest legacy-scan ./your-site --json
The only requirement is Node.js ≥ 22. For reference, cloning the repository itself (git clone --depth 1 https://github.com/GoogleChrome/modern-web-guidance) took 3.8 seconds on our machine, and the release repo ships the full guide library under skills/ if you would rather read the guides as plain Markdown files — they are ordinary documents, not a black box.
search, retrieve and legacy-scan for real, against the live package and against this website's actual source code; the outputs in section 3 are quoted from those runs. We did not run the interactive install wizard — there is no agent host on this machine to register the skill with, and the three commands are the part that works standalone. Where section 4 goes beyond the tool's output (a manual audit of our own code against the guides), it is labelled as ours, not the tool's.We searched for the capability our own site most obviously lacks:
npx -y modern-web-guidance@latest search "view transitions"
It took about 6.9 seconds including the first-time npx package download, exited cleanly, and returned a JSON array of 10 results (each an id plus a description). The hit quality was high: the first three were cross-document-transitions (transitions across page navigations), same-document-transitions (morphing elements inside an SPA) and consistent-cross-document-transitions (keeping page state stable before a transition runs), followed by narrower pieces — scoped-component, group-element, directional-navigation, faster-spa — and the general motion guide.
The documented query rules matter more than the command itself, because most people will search wrong the first time: use 2–5 English words, make it action-oriented, describe one capability per query, and translate your business need into a UI primitive first — "confirm before deleting" becomes confirmation modal dialog, not "delete button popup react". Judge hits by their descriptions; if a search comes back empty or off-target, retry once with synonyms before falling back to list. This little discipline is, frankly, half the value of the tool: it forces the question to be asked in the vocabulary the modern platform actually uses.
We retrieved the first hit:
npx -y modern-web-guidance@latest retrieve "cross-document-transitions"
About 1.2 seconds, exit code 0, and the complete guide printed straight to stdout — 4,602 bytes of it. This is the real thing, ready to paste into a project: step 1 adds one rule to your shared global CSS, wrapped in a reduced-motion media query exactly as the guide insists:
@media (prefers-reduced-motion: no-preference) {
@view-transition { navigation: auto; }
}
Step 2 customises the slide-in/slide-out with ::view-transition-old(root) and ::view-transition-new(root); step 3 adds directional transitions using transition types and the pagereveal event. Practical details worth knowing: you can retrieve several guides at once with comma-separated ids, and if the combined output exceeds about 9.5 KB the tool writes it to a temporary file instead of flooding stdout.
legacy-scan walks a codebase and flags old patterns that have a modern replacement. It accepts a whole directory, so we pointed it at the entire CluoPrints site rather than a sample page:
npx -y modern-web-guidance@latest legacy-scan ~/cluoprints-site --json
About 8.1 seconds, exit code 0, a 24,808-byte JSON report with 41 findings across 4 rules. Every finding carries the file, the line, the offending code, and the rule's keepWhen/dropWhen criteria so a human can reject false positives. Here is what it found in our own code:
| Rule | Count | What it found on cluoprints.com |
|---|---|---|
ime-safe-enter-submit | 1 | A real bug. assistant.js line 142: our chat assistant's input sends the message on any Enter keydown, without checking event.isComposing or keyCode 229. Anyone typing with a Chinese or Japanese IME presses Enter to confirm a character — and would fire off a half-typed message instead. We checked the source by hand: it is a genuine bug, not a false positive, and for a bilingual Quebec business with Chinese-speaking visitors it is the single most valuable line in this report. |
dark-mode | 2 | single-color-icon-maker.html and its French version, line 134 in both: a @media (prefers-color-scheme: dark) block overrides colours without declaring color-scheme: light dark or using light-dark(), so form controls and scrollbars can render in the wrong scheme. |
js/structured-clone | 2 | decision-simulator.html line 273 and decision-simulator-fr.html line 263: preset data deep-copied with JSON.parse(JSON.stringify(...)), where the modern structuredClone() is faster, safer and one line long. |
js/replace-children-innerhtml | 36 | Across 23 of our tool pages (English and French) plus designer.js: elements emptied with el.innerHTML = "" where replaceChildren() is the modern call. We spot-checked (e.g. business-card-generator.html line 124) and the pattern matches are real — but this one is low-severity code hygiene, and any spot that builds HTML by string assignment must be judged individually against the keepWhen/dropWhen criteria, not batch-replaced. |
One expectation to set before you run it on your own site: the project's own SKILL.md is upfront that legacy-scan only covers the subset of guides with deterministic rules — roughly 20% of the library. It is a targeted sweep, not a full audit. Section 4 shows exactly what that means in practice.
Because the tool only finds old patterns that are present in the code, we also audited this site by hand against the guides. The two passes overlapped on nothing — zero findings in common — and that is the most instructive result in this whole test. The scanner swept 40+ pages and found 41 things across them; our manual pass read only 6 core files and found 5 different problems, every one of them invisible to the scanner:
<dialog>. assistant.js (lines 108–113) builds the panel with document.createElement("div") and an innerHTML blob: no focus management, no Esc-to-close, no inert background, no top-layer rendering — just z-index and hope. The library has a whole matching set (dialog, light-dismiss-a-dialog, prevent-page-scroll-under-modal-dialog, animate-to-from-top-layer) that would give us all of that natively. A scanner cannot flag a dialog that was never written.index.html carries 14 images; only 5 have a loading attribute, almost none declare width/height, and the hero product image has no fetchpriority="high". The browser cannot reserve the layout space, so the page jumps as images load — a textbook CLS problem, with a textbook fix (real dimensions or aspect-ratio, lazy below the fold, fetch priority on the hero).motion.js line 159 hooks window.addEventListener('scroll', …) with rAF throttling. The modern pattern is pure CSS scroll-driven animation — animation-timeline: scroll() — zero JavaScript, zero main-thread cost. The guides cover it in scroll-entry-exit-effects and parallax-scroll-effects.view-transition and you get no hits — on a plain multi-page static site, where the one CSS rule from section 3 would give every page navigation a smooth cross-fade. Fittingly, the guide we needed was search's very first hit: the question-and-answer mode covers exactly the blind spot of the scanning mode.style.css animations ignore reduced-motion. There is not a single prefers-reduced-motion in our main stylesheet (the motion layer handles it in CSS once and in JS, but the plain-CSS animation line was missed). Nearly every animation guide in the library lists reduced-motion handling as MANDATORY.For balance, the manual pass also confirmed what is already clean here: no jQuery, no XMLHttpRequest, no document.write, no inline onclick, no mixed http:// content, no table layouts, viewport meta everywhere, and scroll-reveal already on IntersectionObserver. The honest summary: legacy-scan and a human audit are complements, not substitutes. The scanner is wide and shallow — it reads every file but only recognises about a fifth of the rulebook. A human (or a well-prompted agent with the guides retrieved) is narrow and deep. Run the scan first for the cheap wins, then audit the core files by hand — and use search as the bridge between the two.
No. There is no key, no account and nothing to buy. search and retrieve run as local semantic search over the guide library bundled with the package — no cloud model is called, which is also why a search takes seconds (mostly the first-time npx download) and retrieve comes back in about a second. The licence is Apache-2.0 for the code and CC BY 4.0 for the guide content, so using it in commercial work — including writing tutorials like this one, with attribution — is explicitly allowed.
Scanning old code is exactly what legacy-scan is for, and it takes a whole directory, not just a file: we ran it against this entire production website (40+ pages) in about 8 seconds. Two caveats, both confirmed in our test. First, it only applies the roughly 20% of guides that have deterministic rules, so treat the report as a first sweep, not an audit. Second, every finding comes with keepWhen/dropWhen criteria — plan on a human pass to reject false positives and judge the borderline cases before you change anything, then re-scan to verify the fixes.
Anything that is missing rather than present. It pattern-matches old code that exists in your files; it cannot tell you that you never used native <dialog>, view transitions, image dimensions or reduced-motion fallbacks — all five of our manually-audited findings on this site were of that kind, and the scanner missed all five. It also cannot judge architecture, content or design quality. The intended workflow pairs the modes: scan for the mechanical wins, then use search/retrieve (or read the guides directly) to audit the important files for the modern features that should be there and are not.
No. The install wizard registers the skill with agent hosts such as Claude Code, Codex or Cursor, and that is the audience the project is aimed at — but search, retrieve and legacy-scan are plain CLI commands that run under npx with nothing else installed beyond Node ≥ 22. Every result in this tutorial was produced that way, with no agent involved. If you do use an agent, the skill format means the agent runs the same searches itself before writing front-end code.
Short, single-capability, action-oriented ones: 2–5 English words, phrased as UI primitives. "animate a dialog modal backdrop", "light dismiss dialog" and "view transitions" are the shape that works; a sentence about your whole feature, or a query with a framework name in it, is the shape that fails. If the results are empty or off-target, retry once with synonyms, then fall back to list and browse the catalogue. Judging by description text, one capability at a time, is the workflow the tool is built around.
This tutorial exists because we run these checks on our own site first: the scanner's 41 findings and our own audit list above are now our fix list. That is the same habit we bring to client work. Our website services build bilingual (English/French) sites for small businesses from C$699 — hand-checked code, modern patterns, and a free preview before you pay. Already have a site? Start with our free tools, or ask us for a modernisation pass: we will scan it, show you the findings, and fix what actually matters.
We can put your design on T-shirts, hoodies, mugs, posters and more — printed to order in Quebec, no minimums, with a free preview before you pay.
Contact us for a free quote