ALL INTELLIGENCE
Hacker News AIT2·Tools

Chrome and Browser Giants Launch Modern Web Skills for Coding Agents

Original title: Show HN: Get your coding agent off ~2019 JavaScript, onto modern web primitives
62AI Score

Google Chrome, Microsoft Edge, Mozilla Firefox and MDN have jointly released Modern Web Guidance, a skill set that embeds web platform best practices and browser compatibility data directly into coding agents to steer them away from legacy JavaScript patterns. It ships with an npx install wizard and a legacy-scan detector trained on 30k GitHub repos to flag outdated patterns for modernization.

Full Report

Contents6 sections

Modern Web Guidance

Modern Web Guidance is a set of skills that embed web platform expertise, best practices, and browser compatibility data directly into your coding agents. It helps to steer your coding agents away from legacy patterns, and instead toward solutions that harness the power and capabilities of the modern web platform.

Stewarded by the Google Chrome, Microsoft Edge, Mozilla Firefox, and MDN teams, alongside the web development community.

Documentation · Eval Dashboard · Source Code · Report an Issue

<img src="https://github.com/GoogleChrome/modern-web-guidance/raw/main/.github/img/terminal.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Quickstart

SHELL
npx modern-web-guidance@latest install

This command runs an interactive wizard to install Modern Web Guidance. See Alternative Installation Methods below.

Try it out (without installing)

SHELL
# Search for relevant guides
npx modern-web-guidance@latest search "animate a dialog modal backdrop"

# Retrieve a guide by ID
npx modern-web-guidance@latest retrieve "animate-to-from-top-layer"

# Scan a codebase for legacy patterns to modernize
npx modern-web-guidance@latest legacy-scan .

<img src="https://github.com/GoogleChrome/modern-web-guidance/raw/main/.github/img/lightbulb.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Why?

Coding agents often default to older patterns because LLM training data contains vast amounts of legacy code. This often leads them to generate bloated JavaScript for tasks that now have native, high-performance web platform solutions.

Even if a model knows an API exists, it often lacks the density of real-world, modern implementation patterns required for production-ready code.

Modern Web Guidance bridges this gap. Our skill's CLI returns targeted, expert-curated guidelines directly into your agent's context window, focusing on:

  • Modern Browser APIs: Helping models correctly structure APIs they frequently misuse.
  • Performance & Accessibility: Preferring platform-level APIs that can be optimized by the browser and include built-in accessibility affordances.
  • Responsible Fallbacks: Guiding models to use sensible, lightweight fallbacks instead of heavy polyfills or legacy libraries.

<img src="https://github.com/GoogleChrome/modern-web-guidance/raw/main/.github/img/package.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> What's Included?

We cover the past several years of the web platform's new features, all the way up to the cutting edge. The guides are designed to be token-efficient; we run evals enabling us to prune lowest-common-denominator content that models already know.

Core Disciplines

<table width="100%" style="border-collapse: collapse; border: none;"> <tr style="border: none;"> <td width="33%" valign="top" style="border: none; padding: 6px;"> <h4>🎨 User Experience</h4> <p style="font-size: 0.9em; line-height: 1.4;">Smooth visual states (View Transitions, entry/exit animations, parallax scroll, CSS <code>scrollbar-color</code>).</p> </td> <td width="33%" valign="top" style="border: none; padding: 6px;"> <h4>📐 CSS Layout</h4> <p style="font-size: 0.9em; line-height: 1.4;">Modern layout systems (container queries, <code>subgrid</code>, modern color spaces like <code>oklch</code>, text-wrap tuning, and line-height trimming).</p> </td> <td width="33%" valign="top" style="border: none; padding: 6px;"> <h4>⚡ Performance</h4> <p style="font-size: 0.9em; line-height: 1.4;">Speed optimizations (instant preloading, Interaction to Next Paint (INP) diagnostics, and scheduling tasks via <code>scheduler.yield</code>).</p> </td> </tr> <tr style="border: none;"> <td width="33%" valign="top" style="border: none; padding: 6px;"> <h4>📝 Forms & UI</h4> <p style="font-size: 0.9em; line-height: 1.4;">Native components (Anchor Positioning for tooltips, Popover API, dialogs, <code>:user-invalid</code> validation, and auto-sizing fields).</p> </td> <td width="33%" valign="top" style="border: none; padding: 6px;"> <h4>♿ Accessibility</h4> <p style="font-size: 0.9em; line-height: 1.4;">Important considerations (screen reader and keyboard operability, content navigation and discoverability).</p> </td> <td width="33%" valign="top" style="border: none; padding: 6px;"> <h4>🤖 Built-in AI</h4> <p style="font-size: 0.9em; line-height: 1.4;">Local client models (native translation, summarization, and language detection APIs).</p> </td> </tr> </table>

View an example: the navigation-drawer guide.

The full list

<details> <summary><strong>250 modern web features</strong></summary>

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)


作者发帖说明(HN):

Browsers natively handle a lot of what used to take 50 lines of JS (or a dependency): CSS.highlights for text range highlighting without s everywhere, <dialog> and showModal() give you backdrops and ideal focus management, field-sizing to auto-grow textareas as the user types.. (Something yesterday's ftrain post touched on [0])

Models know about some of these by name, but consistently won't default to using the platform-native solution and instead prefer the incumbent +JS based pattern. We started an effort in Chrome to supplement coding agents with this key domain knowledge and we're shipping our 1.0 today, in collaboration with Firefox, MDN, and Edge.

200+ guides (~1.7MB) of curated, hand-crafted implementation best-practices from web experts, updated as the web evolves. (Open source, obv, so.. we'll welcome your bikeshedding ;) Readable versions here: [1]

I've spent the last 9 months obsessing over how to ship this as an agent skill + (Agentic RAG) CLI without blowing up your context window. (Or cedeing activation mechanics to MCP dynamic tool search). The skill description is minmaxed for activating on relevant frontend tasks. The RAG work I'm pretty proud of… originally a 500mb native stack down to a ~7MB pure-JS package, ~10ms search on your CPU.

We just introduced a deterministic 'legacy-scan' (trained on 30k github repos) to identify old 'n dusted patterns that your agent can modernize. (92% avg precision on held-out repos.)

People make a lot of claims abou...