← Back to blog
AiAbout 7 min read

The browser vendors wrote your agent a textbook, then deleted half of it

Published Nov 29, 2026
The browser vendors wrote your agent a textbook, then deleted half of it

Coding agents write old JavaScript. The cause is training data: a decade of Stack Overflow answers, jQuery tutorials and blog posts about polyfills. Ask for a modal and you get a div with a z-index fight. Ask for a scroll-linked animation and you get a scroll event handler with no throttling.

GoogleChrome/modern-web-guidance-src is the source repository for Google Chrome's attempt to fix that, and it has 11,704 stars. The project is stewarded by the Chrome, Edge, Firefox and MDN teams along with the web development community, which makes it the closest thing to an industry consensus document that this space has produced.

The product is a set of Agent Skills plus a CLI. The install:

npx modern-web-guidance@latest install

Node 22 or later. There is also a try-before-install path:

npx modern-web-guidance@latest search "animate a dialog modal backdrop"
npx modern-web-guidance@latest retrieve "animate-to-from-top-layer"
npx modern-web-guidance@latest legacy-scan .

That last command is the one I would run first on any codebase. It scans for legacy patterns and tells you what to modernize, which is a useful audit whether or not you ever install the skill.

The diagnosis is precise

The README states the problem better than most: coding agents default to older patterns because training data contains vast amounts of legacy code, and even when a model knows a modern API exists, it lacks the density of real-world implementation patterns needed for production-ready code.

That second clause is the important one. Models do not fail on dialog.showModal() because they have never heard of it. They fail because they have seen it three times and seen a custom modal component three thousand times, so the prior favors the component. Knowing an API exists and knowing how to structure a real implementation around it are different levels of knowledge, and the gap between them is where generated code becomes plausible-looking and wrong.

The fix is a smaller context window filled with better material: targeted, expert-curated guidance returned directly into the agent's context. A bigger model would help, but it is the expensive route.

The pruning is the method

Here is the part worth stealing.

The guides cover several years of web platform features. They are explicitly designed to be token-efficient, and the team runs evals to prune what they call lowest-common-denominator content that models already know.

Read that as a discipline: before shipping a guide, measure whether the model already handles the topic. If it does, delete the guide. Every paragraph cut is context the agent can spend on the actual task, and every paragraph kept is a claim that this is where models go wrong.

Most documentation projects work in the opposite direction. More coverage is treated as more value, and the result is a reference so large that nobody reads it, human or model. The eval dashboard is public, which is the only reason to take the claim seriously: you can look at what they measured.

There is a second-order benefit. Pruning by eval produces a document that is also good for humans, because it is a list of mistakes rather than a list of features. "Here is what models get wrong about View Transitions" is more useful to a junior developer than a full API reference, and it happens to be what an agent needs too.

What is actually inside

The disciplines are grouped by the kind of problem rather than by API family. User experience covers View Transitions, entry and exit animations, parallax scroll, and CSS scrollbar-color. CSS layout, performance, accessibility and responsible fallbacks get their own sections.

The fallback guidance is a small policy statement hiding in a docs site. Prefer platform-level APIs that the browser can optimize and that carry built-in accessibility affordances, and when a fallback is required, use a lightweight one instead of a heavy polyfill or a legacy library.

That is a direct rebuke of the polyfill economy. For fifteen years the answer to "does this work in browser X" was "ship 40 KB of JavaScript." For a growing share of features, the answer is now "it works, and the old polyfill is actively harmful because it overrides the native implementation with a slower one."

An agent trained on the polyfill era will keep adding the polyfill. That is precisely the kind of habit a short, opinionated guide can correct.

The fallback argument is the useful one

The section on responsible fallbacks deserves its own paragraph, because it is the part that changes generated code most.

For most of the web's history, the safe answer to a compatibility question was to ship a library. Want a date picker that works everywhere? Ship 80 KB. Want smooth scrolling, modal dialogs, sticky headers? Ship more. The cost was paid by users on slow connections and by every team that inherited a bundle nobody dared remove.

That trade has flipped for a meaningful set of features. A polyfill for a native API is no longer neutral; it often replaces a browser-optimized implementation with a slower JavaScript one, and it can break accessibility affordances the platform provides for free. The guidance's instruction is to prefer the platform and use a lightweight fallback where one is genuinely needed.

An agent trained on the polyfill era will do the opposite by default, because the training data is full of that advice. Correcting it requires an explicit, opinionated statement, which is what a guide is for.

The catch is that the guidance assumes a support matrix. If you still support a browser that lacks the feature, the guide's preferred approach may not apply to you, and following it blindly produces code that breaks for a slice of your users. Check the compatibility data against your own analytics before adopting a recommendation wholesale.

Four vendors in one repository

The governance detail deserves attention. Chrome, Edge, Firefox and MDN jointly stewarding guidance for coding agents is a quiet standardization move.

Browser vendors have never fully agreed on what "modern web" means. They agree on specs, and then disagree on implementation order, prefix requirements and which features are worth the polygon budget. A shared guidance corpus is a statement that, whatever the disagreements, the recommended patterns are common ground.

It also creates a small conflict of interest to watch. The guidance ships from Google's GitHub organization, installs through npm, and nudges agents toward platform features. Chrome benefits when developers use platform APIs instead of framework abstractions, because the platform is where Chrome's engineering investment compounds. The multi-vendor stewardship is what makes that acceptable rather than self-serving, and it is worth checking from time to time whether the other vendors are still at the table.

Limits worth naming

A guidance corpus cannot fix a model that has decided on an architecture. If an agent has already committed to a component library that ships its own modal, a guide about the native <dialog> element will not change the plan mid-task.

It also cannot cover everything. The guides focus on the platform surface where models demonstrably fail. For a topic where they do not fail, there is no guide, and you are back to hoping the training data was current.

And a skill competes for context with everything else in the window. On a long task with a large codebase, the guidance may be loaded and then pushed out by retrieved files. That is an argument for retrieve over install in long sessions: pull the one guide you need at the moment you need it.

For teams shipping web frontends with agents, the practical version is small. Run legacy-scan on the repo, read the report, and install the skill if the failures it names match what you keep seeing in review. The most valuable artifact here is the admission that teaching a model less, more precisely, beats teaching it everything. The feature list matters less than the pruning.

Turn ideas into images with ChatPicture

60 free credits every day. Generate, edit, and download — no prompt engineering degree required.

Related articles