If your AI coding agent keeps reaching for jQuery-era workarounds or npm packages to do things browsers have handled natively for years, the problem isn't the model's intelligence — it's the training data. LLMs were trained on enormous amounts of legacy JavaScript, so they reproduce it by default. Modern Web Guidance is a practical fix: a CLI that surfaces expert-curated guides covering 250+ modern web features and 203 real-world use cases, injecting that knowledge directly into your agent's context window.

The tool is stewarded by the Google Chrome, Edge, Firefox, and MDN teams, which gives the compatibility guidance real credibility. Installation takes one command — npx modern-web-guidance@latest install — and an interactive wizard handles the rest. You can also try it without installing: run a search (npx modern-web-guidance@latest search "animate a dialog modal backdrop"), retrieve a specific guide by ID, or run a legacy scan against an existing codebase to surface outdated patterns worth replacing.

Modern Web Guidance: Teach Your AI Coding Agent to Stop Writing 2019 JavaScript

The coverage is broad and genuinely useful. On the CSS side: container queries, subgrid, anchor positioning, scroll-driven animations, field-sizing for auto-growing textareas, and text-wrap: balance. On the HTML/DOM side: <dialog> with showModal() for focus-trapped modals with native backdrops, the Popover API, declarative shadow DOM, and lazy-loading. JavaScript coverage includes the Scheduler API (scheduler.yield for INP optimization), Intersection Observer, the Speculation Rules API for instant preloading, and even on-device AI APIs like the Translator and Summarizer.

The guides are designed to be token-efficient — the team runs evals to prune content models already know well, so you're not wasting context on basics. The focus is on three things models consistently get wrong: correct API structure for frequently misused interfaces, performance and accessibility wins that come free with platform-level APIs, and lightweight fallback strategies instead of heavy polyfills.

For builders, the most immediately actionable feature is the legacy scan. Point it at a codebase and it identifies patterns worth modernizing — a fast way to prioritize refactoring work or to audit what your agent has been generating. The source is open, the eval dashboard is public, and the project accepts issue reports, so the guidance set will evolve as the platform does.