skulldc

Modern Web Guidance feeds coding agents current web platform patterns instead of legacy code

An Apache-2.0 CLI from the Chrome, Edge, Firefox and MDN teams returns curated guides on modern browser APIs to coding agents and scans codebases for legacy patterns.

What the project is

GoogleChrome/modern-web-guidance-src is the source repository for Modern Web Guidance. It holds the code and documentation used to author, calibrate and evaluate the guides that ship in the separate GoogleChrome/modern-web-guidance repository. The README describes Modern Web Guidance as a set of skills that put web platform expertise, best practices and browser compatibility data directly into coding agents.

The project is stewarded by the Google Chrome, Microsoft Edge, Mozilla Firefox and MDN teams, together with the web development community. The repository is written in TypeScript, licensed under Apache-2.0 and was created on 2026-01-27. As a snapshot at the time of writing, it had 4011 stars, 1875 of them gained in the last day on GitHub trending, and 235 forks.

The problem it targets

The README states the motivation plainly: coding agents often default to older patterns because LLM training data contains vast amounts of legacy code. The result is often bloated JavaScript for tasks that now have native, high-performance web platform solutions. It adds that even when a model knows an API exists, it often lacks enough real-world modern implementation patterns to write production-ready code.

The tool’s answer is to return targeted, expert-curated guidelines into the agent’s context window. The README lists three focus areas:

  • Modern browser APIs, helping models structure APIs they frequently misuse.
  • Performance and accessibility, preferring platform-level APIs that the browser can optimize and that include built-in accessibility affordances.
  • Responsible fallbacks, steering models toward lightweight fallbacks instead of heavy polyfills or legacy libraries.

The guides are designed to be token-efficient. According to the README, the maintainers run evals and use them to prune lowest-common-denominator content that models already know. An eval dashboard is published alongside the source.

What the guides cover

The README groups the content into six disciplines:

  • User experience: View Transitions, entry and exit animations, parallax scroll and CSS scrollbar-color.
  • CSS layout: container queries, subgrid, modern color spaces such as oklch, text-wrap tuning and line-height trimming.
  • Performance: instant preloading, Interaction to Next Paint (INP) diagnostics and scheduling tasks with scheduler.yield.
  • Forms and UI: Anchor Positioning for tooltips, the Popover API, dialogs, :user-invalid validation and auto-sizing fields.
  • Accessibility: screen reader and keyboard operability, content navigation and discoverability.
  • Built-in AI: local client models for native translation, summarization and language detection APIs.

The full list counts 250 modern web features, 140 of them under CSS and layout, ranging from :has() and @scope to field-sizing, light-dark() and scroll-driven animations.

Trying it

A single command starts an interactive install wizard:

npx modern-web-guidance@latest install

The CLI can also be used without installing. It searches for relevant guides, retrieves a guide by its ID, and scans a codebase for legacy patterns worth modernizing:

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 .

The legacy-scan command is the most direct way to see what the guides would change in an existing project before wiring the skill into an agent. The README links an example guide for a navigation drawer, and points to CONTRIBUTING.md and GOVERNANCE.md for how the project is run.


Source: GoogleChrome/modern-web-guidance-src on GitHub