Your agent writes 2026 syntax with 2015 habits

Ask a coding agent for a modal. Eight times out of ten you get an absolutely positioned div, a hand-rolled Tab key focus trap, and one line of JavaScript that sets overflow on the body. A <dialog> element with showModal() and ::backdrop would do the whole job, and focus management, Escape handling and the top layer come from the browser.

The model is not being stupid. Frontend code written between 2015 and 2021 dominates its training corpus, and the forty-line div version appears on the public web two orders of magnitude more often than the correct dialog version. Sampling follows frequency. Output follows old habits. The harder you push for code right now, the more likely it is to fall back on the version it has seen most.

What hit Trending today is a spec cheat sheet, not a model

Number two on GitHub Trending for 2026-11-13 is GoogleChrome/modern-web-guidance-src, with 1,875 stars in a day and 4,100 total. It is not a framework and not a model. It is a set of skills for coding agents: 250 modern web features and 203 guides organised around real development tasks, maintained jointly by the Chrome, Edge, Firefox and MDN teams.

The distribution tells you what they think is broken. CSS and layout account for 140 features, HTML and DOM for 36, JavaScript and APIs for 74. Guides live under categories such as accessibility, css, forms, performance, security, wasm and webmcp, written as Markdown at paths like skills/modern-web-guidance/guides/ui-components/navigation-drawer.md.

Why retrieval injection instead of fine-tuning

The web platform ships weekly. Model weights ship monthly at best. Baking new knowledge into weights is permanently half a step behind, and stuffing 203 guides into the context window blows the token bill before it helps, while diluting attention until the model uses whichever part is easiest.

So the interface only has two verbs. search handles recall, retrieve fetches a single guide by ID. The README describes the goal as returning targeted, expert-curated guidelines directly into the agent context window. The guides themselves were pruned during evaluation to strip the lowest common denominator content the model already knows, leaving implementation density that reads like production code.

That distinction matters. Knowing that content-visibility exists is not the same as knowing to pair content-visibility: auto with contain-intrinsic-size on a list container so the scrollbar does not jump. Models have the first. They routinely get the second wrong.

Origin Trial and volatile: leaving the experimental bet to a human

This is the design most worth stealing. Guides come in three tiers. Stable features are retrievable immediately. Origin Trial features, meaning experimental APIs behind a registration token, and volatile features, meaning anything that shipped in a single engine within the last three months, can still be found by search, but retrieve refuses to serve them unless the developer flips a switch.

npx modern-web-guidance@latest set-allow-origin-trials
npx modern-web-guidance@latest set-allow-volatile-features

The two commands write allowOriginTrials and allowVolatileFeatures into .mwgrc at the project root, or into ~/.mwgrc, and the project file can be committed so the whole team shares it. Defaulting to off is itself an opinion: an agent should behave conservatively unless a person decides otherwise. Shipping an experimental API should never be a model's aesthetic choice.

The small details are solid too. fetchLater() has a 64KB payload quota. Scrollbar behaviour on macOS differs from everywhere else. Both are written down as traps. Degradation guidance prefers scenario-specific code under fifty lines or a conditionally loaded polyfill over pulling in a heavy package. API documentation does not tell you any of that.

The other direction: the web exposing itself to agents

Two categories in the guide index deserve separate attention. built-in-ai covers models shipped in the browser: Summarizer, Translator, LanguageModel, language detection. security covers Passkeys, client-side encryption, digital signatures, Trusted Types and local network access. Then webmcp points the other way, exposing page capabilities to agents through declarative form attributes or imperative JavaScript tools.

Taken together, the Chrome team is building a two-way interface. Agents consume the web platform, and pages advertise their capabilities to agents. For anyone running a tool site that is a new distribution surface: your tool does not have to wait for a human to open the page, it can be called first. Early days, but a clearer direction than shipping another chat box.

Getting started: three commands and one legacy scan

npx modern-web-guidance@latest install
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 .

install runs an interactive wizard that wires the skill into your agent. search returns IDs and summaries, retrieve returns the body, which keeps recall cheap and injection precise. legacy-scan sweeps the whole repository for patterns you have stopped needing.

In practice: a diff-only legacy check

A whole-repository sweep is useless in CI, because historic debt paints every build red. Here is the same idea restricted to the current change, standard library only, no network:

import subprocess, sys
from pathlib import Path

RULES = [
    ("document.write", "prefer DOM APIs or a template element"),
    ("$(", "querySelector / querySelectorAll"),
    ("addEventListener('scroll'", "scroll-driven animations or IntersectionObserver"),
    (".innerHTML =", "setHTMLUnsafe or explicit DOM nodes"),
    ("offsetHeight", "content-visibility or a ResizeObserver"),
]
EXTS = {".js", ".ts", ".jsx", ".tsx", ".html", ".css", ".vue", ".svelte"}

def targets(argv):
    if argv:
        files = []
        for raw in argv:
            p = Path(raw)
            files += [f for f in p.rglob("*") if f.suffix in EXTS] if p.is_dir() else [p]
        return sorted(set(files))
    out = subprocess.run(["git", "diff", "--name-only", "--diff-filter=ACMR", "origin/main...HEAD"],
                         capture_output=True, text=True).stdout
    return [Path(x) for x in out.split(chr(10)) if Path(x).suffix in EXTS]

hits, per_file = 0, {}
for f in targets(sys.argv[1:]):
    for no, line in enumerate(f.read_text(encoding="utf-8", errors="replace").split(chr(10)), 1):
        for snip, fix in RULES:
            if snip in line:
                hits += 1
                per_file[str(f)] = per_file.get(str(f), 0) + 1
                print("%s:%d  %s -> %s" % (f, no, snip, fix))
print("legacy_hits=%d files=%d" % (hits, len(per_file)))
for name, n in sorted(per_file.items(), key=lambda kv: -kv[1])[:3]:
    print("  top  %-40s %d" % (name, n))
sys.exit(1 if hits else 0)

Pointed at this site's own src/js directory:

$ python legacy_diff.py src/js
...
legacy_hits=216 files=23
  top  src/js/altimeter.js                       48
  top  src/js/id-tools.js                        24
  top  src/js/base-tools.js                      20

216 hits across 23 files. Then I read the details: nine out of ten are .innerHTML =, which is how my own templates render, not a legacy problem. Rules generate false positives. Judgement needs context.

Which is exactly why Google shipped retrieval rather than a rule set. Rules match patterns. Whether a pattern can be replaced by a modern API depends on what the code is doing and which browsers it must support. Mechanical rules cannot answer that. An agent holding an accurate spec can.

How to get value out of it

  • Install it: npx modern-web-guidance@latest install. One interactive pass, less rework on every frontend generation afterwards.
  • Commit .mwgrc to the repository. Experimental features stay off unless a PR says why it needs them.
  • Stop hand-writing modern CSS instructions in prompts. Let retrieval fetch them. Hand-written checklists rot, retrieval does not.
  • In CI, check the diff only. A full sweep means you disable the job by week three.
  • Run legacy-scan once on your own project. Any rule that fires on more than thirty percent of files is noise, delete it.

What this repository really offers is not the list of 250 features but a stance: knowledge expires, so do not bake it into weights; experimental features carry risk, so keep them off and let a human decide. Copy those two ideas into your own agent workflow and you will get more out of them than memorising APIs.

Further reading

フィードバック

このサイトはフロントエンドのみでバックエンドやアカウントはなく、フィードバックはGitHub Issues・ディスカッション・メールで受け付けています。

issueやメールに貼り付けていただくと問題特定が早まります。入力内容は含まれません

その他:既存の報告を見る · メールでのフィードバック(GitHubアカウント不要):278975598@qq.com