跪拜 Guibai
← All articles
Artificial Intelligence · Open Source

Chrome's Modern Web Guidance Shoves Curated Best Practices Into AI Coding Agents

By 冬奇Lab ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Most AI coding agents generate stale, over-engineered frontend code; this Skill gives teams a way to push current browser APIs and safety practices into agent context without modifying the model. The built-in evaluation pipeline sets a precedent for measuring whether a Skill actually improves output, which is rare in the agent-plugin ecosystem.

Summary

AI-generated frontend code tends to look dated because training data has far more old patterns than new ones. Modern Web Guidance attacks that at the context level: a Skill that feeds agents curated guides on web platform features, best practices, and compatibility data. It works through a two-step retrieval: an offline `search` using a zero-dependency embedding model plus BM25 to match natural-language queries to the most relevant guide, then a `retrieve` step that pulls the full guide into the agent's context. The package is self-contained with no network or API key needed, and uses `npx` so content stays fresh.

The project ships with a closed-loop evaluation pipeline. Experts write guides, then the repo auto-generates tasks, golden solutions, and Playwright scoring scripts. Scoring scripts must pass 100% on the golden solution and fail 100% on the unmodified base app to be accepted. Agents then run tasks with and without guidance to measure uplift. Official results from November 8 show improvement of +36 points for antigravity_cli (58% to 94%), +31 for claude_code (57% to 88%), and +28 for codex_cli (54% to 82%). Those numbers are the project's own evals, not a third-party benchmark, and cover 250 web features and 203 scenarios across 18 categories.

Takeaways
— Modern Web Guidance is maintained by Chrome, Edge, Firefox, and MDN teams, per the README.
— The project covers 250 modern web features (140 CSS/layout, 36 HTML/DOM, 74 JavaScript/API) and 203 real-world scenarios.
— Two-step retrieval uses an offline, zero-dependency embedding model plus BM25 for search, then retrieves the guide by ID.
— CLI subcommands include `search`, `retrieve`, and `legacy-scan .` to scan a project for outdated patterns.
— New-feature adoption uses progressive enhancement, lightweight fallbacks under 50 lines, Baseline data, and gating for Origin Trials and unstable features.
— Gating requires developer consent via `.mwgrc` or `~/.mwgrc`, with commands `set-allow-origin-trials` and `set-allow-volatile-features`.
— Evaluation pipeline requires scoring scripts to pass 100% on golden solutions and fail 100% on unmodified base apps.
— Official uplift numbers: antigravity_cli +36 points (58%→94%), claude_code +31 (57%→88%), codex_cli +28 (54%→82%).
— Telemetry is enabled by default, collecting anonymous install counts, agent names, retrieved guide IDs, and search queries; disable with `DISABLE_TELEMETRY=1`.
— Install commands exist for Vercel Skills CLI, GitHub CLI, OpenAI Codex, Claude Code, GitHub Copilot CLI, Google Antigravity, Grok Build CLI, and Kimi Code.
Conclusions

The evaluation pipeline is the most valuable part: it treats a Skill like a testable artifact, with pass/fail gates on golden solutions and base apps, which makes the claim "this Skill helps" falsifiable rather than marketing.

Gating unstable features behind explicit developer consent is a pragmatic compromise between giving agents the newest APIs and protecting against compatibility breakage; it puts the risk decision back on the developer.

The +27 to +36 point uplift numbers are only valid for the project's own tasks and scoring scripts; real-world business code may not see the same improvement, especially for scenarios outside the 203 covered.

Shipping a 250-feature guide set as a self-contained offline npm package shows a deliberate choice for supply-chain security and low latency, trading off the ability to fetch live docs for reproducibility.

Concepts & terms
Skill
In AI coding agents like Claude Code, a Skill is a bundled instruction set with tools and context that the agent activates for relevant tasks, letting developers inject domain-specific guidance without retraining the model.
Baseline
A browser compatibility baseline that marks a web feature as available across major browsers once all support it for a defined period; used here to let agents adjust to real-world support levels.
Origin Trial
A mechanism that lets developers try a new web platform feature in production for a limited time before it's fully standardized; access is usually gated by token. Modern Web Guidance gates such guides behind explicit consent.
Progressive enhancement
A web development strategy that starts with a functional baseline and adds enhanced capabilities when the browser supports them; old browsers ignore what they don't understand, so risky features degrade gracefully.
BM25
A ranking function used in information retrieval to score documents by term frequency and document length, commonly used in full-text search; here it helps match queries to relevant guides without a network call.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗