GoogleChrome/modern-web-guidance-src · 10.9k stars · Beginner · 10 min · 2026-11-25

Stop your coding agent writing legacy web code

Modern Web Guidance gives your coding agent a local search-and-retrieve CLI of expert web platform guides, so it reaches for native APIs instead of the legacy patterns in its training data.

TL;DR

Modern Web Guidance is a skill plus a CLI that puts targeted, expert-written web platform guidance into your coding agent's context. Run npx modern-web-guidance@latest install, and the agent searches and retrieves guides locally instead of defaulting to older patterns. The repo is the source for the published project, with the guides, the CLI and the eval harness.

Why this repo matters

Per the README, coding agents often default to older patterns because LLM training data contains vast amounts of legacy code, which leads to bloated JavaScript for tasks that now have native solutions. Even when a model knows an API exists, it may lack real-world modern implementation patterns. The project is stewarded by the Google Chrome, Microsoft Edge, Mozilla Firefox and MDN teams with the web community, has software under Apache 2.0 and guide content under CC-BY 4.0, and its README says the guides are token-efficient because content models already know is pruned using evals.

Best practices

  • Let the agent pull guides on demand. The README's "How It Works": the agent activates the skill, runs search "<query>", then retrieve <guide-id>.
  • Use it offline-friendly. The search runs locally with an offline, zero-dependency embedding model and BM25, with no search API calls or API keys.
  • Scan before you change. legacy-scan reports legacy idioms and maps each to a guide, with "Keep when" and "Drop when" criteria to verify findings; the README marks static results as provisional.
  • Set a Baseline target in .mwgrc. A project-level .mwgrc file configures opt-ins and can be committed to share across your team.
  • Keep experimental features gated. Guides on Origin Trial or volatile features stay searchable but retrieve refuses them until you opt in.
  • Check the telemetry setting. Usage telemetry is on by default; export DISABLE_TELEMETRY=1 opts out.

How-to

Where do I start?

1. Install the skill

How do I get my agent using it? Node.js 22 or later is required, then run the wizard:

npx modern-web-guidance@latest install

It is interactive. For specific packs, install --choose lets you pick from the repository; the README lists modern-web-guidance and chrome-extensions.

Next: Try a search

Try it

In a small project, run legacy-scan ., pick one finding, then run retrieve <guide-id> with the id it prints. Ask your agent to apply the guide to that one file and compare the diff with the scan output.

Pitfalls

  • Telemetry is on by default. The README says it collects installation counts, the calling agent name, guide retrieval IDs and agent-generated search queries, not raw prompts.
  • Scan results are provisional. The scan reports itself as static analysis; verify each finding against the Keep/Drop criteria. Its sample output notes only a share of the guidance corpus has deterministic rules.
  • Do not bypass gates. The gate message tells agents never to edit .mwgrc or read raw guide files to get around an opt-in.
  • Node 22 or later. The CLI checks the Node version at startup.

Next steps