Lurker News
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, `` 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 about what coding agents are good/bad at. We wanted receipts, so we invested heavily in eval infra [2] to help us hill-climb, but also to identify when knowledge is common enough we can prune our guides. (Ofc, some of the things we thought AI didn't know turned out to be wrong :) We run codex/claude/agy against 200 tasks without the skill and then with.. In total ~1,700 playwright/AST-based assertions. Agents go from 55% pass unguided to 92% guided.
Try it out:

    DISABLE_TELEMETRY=1 npx modern-web-guidance@latest install
    DISABLE_TELEMETRY=1 npx modern-web-guidance@latest search "animate dialog modal"
    DISABLE_TELEMETRY=1 npx modern-web-guidance@latest legacy-scan ./src
If you spot something wrong or weird, give us a holler!

Longer write-up on the 1.0: https://developer.chrome.com/blog/modern-web-guidance-v1
---
0: https://news.ycombinator.com/item?id=50416456
1: https://developer.chrome.com/docs/modern-web-guidance/guides
2: https://googlechrome.github.io/modern-web-guidance-src/

Comments (146) 60 threads

surround5 replies#
Here's a list of browser features the skills will tell your agent to use that are stable in Chrome but not supported by Firefox and Safari:

  CSS @function
  CSS calc-size()
  CSS interpolate-size
  CSS corner-shape
  CSS border-shape
  CSS flex-wrap: balance
  CSS text-fit
  CSS text-decoration-skip-spaces
  CSS scroll-axis-lock
  CSS scroll-target-group
  CSS :target-current
  CSS scroll-initial-target
  CSS container scroll-state queries
  scrollsnapchange event
  scrollsnapchanging event
  HTML focusgroup
  Element.startViewTransition()
  CSS view-transition-scope
  Interest Invokers (interestfor)
  LanguageModel (Prompt API)
  LanguageDetector
  Translator
  Summarizer API
  Window.fetchLater()
  Speculation Rules API
  Long Animation Frames API
  VisibilityStateEntry
  PerformanceSoftNavigation
  InteractionContentfulPaint
  Connection-Allowlist
  CSS url() integrity() modifier
  HTML meta name="text-scale"
  HTML template for
  HTML processing instructions
  PasswordCredential
  Promise-returning scroll methods
  Web App Origin Migration
  Local Network Access permissions
  Request.targetAddressSpace
  beforeinstallprompt event
To be fair, the skills also recommend ~11 features not supported by Chrome itself. And the project does seem concerned with compatibility: "Guiding models to use sensible, lightweight fallbacks."
philipwalton3 replies#
> Here's a list of browser features the skills will tell your agent to use that are stable in Chrome but not supported by both Firefox and Safari:

To be clear, the skills document how to use these features to solve common use cases, and then they give your agent a full browser support table for any APIs mentioned that are not Baseline Widely available -- and then your agent can decide whether to use them or not, based on your site's browser support requirements.
In most of these cases a cross-browser fallback is also documented.

surround1 reply#
The line between documenting and instructing is blurry in many cases. For example, these statements are meant to document best practices to the agent, but they sound like instructions:

"DO use fetchLater()..."
"Your own code MUST call fetchLater() directly..."
https://github.com/GoogleChrome/modern-web-guidance/blob/mai...
But yes, the skills do document compatibility and fallbacks well.

philipwalton6 replies#
Agreed the line can be blurry, but I want to stress that the goal of this project is NOT to push Chrome-only APIs on users.

The mental model we've been using on the team is:
If you hired an expert web development consultant to build X, what would they recommend as a best practice? When does it make sense to use the new API (because it provides real benefits) vs. when does it make sense to wait until it's available everywhere?
To use your `fetchLater()` example, this is a case where the `fetchLater()` API legitimately solves a very real problem for people trying to build accurate analytics or telemetry features, see: https://nicj.net/beaconing-in-practice/
And lots of companies actually are already using `fetchLater()` in production now because of its increased reliability.

Continue this thread — 6 replies

hatthew#
In my experience, it's difficult to suggest something to an LLM in a way that it doesn't interpret as a command, unless I explicitly list conditions (which it will take as law rather than guidance).
lelandfe1 reply#
The default behavior for this "web best practices" tool which steers people away from "legacy patterns" has agents using Limited Availability features with complex and nuanced[0] fallbacks?

This would be deeply surprising to me, and I am the target audience for this repo. I'd expect the default here to be Widely Available only with some opt-in for the courageous. I don't know that I'd even enable it.
[0] https://github.com/GoogleChrome/modern-web-guidance/blob/4dd...

magicalist1 reply#
> The default behavior for this "web best practices" tool which steers people away from "legacy patterns" has agents using Limited Availability features with complex and nuanced[0] fallbacks?

You have causality reversed here. If you need to detect if the page was loaded in the foreground or background, it is nuanced and (relatively) complex. Therefore it's good for your agent not to just assume document.visibilityState is all it needs to check, or you're going to be getting seemingly impossible log entries pretty quickly.

Continue this thread — 1 reply

hackingonempty1 reply#
How about details/summary?
philipwalton#
The details/summary features are covered in the accordion guide here: https://developer.chrome.com/docs/modern-web-guidance/guides...

If you scan to the bottom of the guide under the "Fallback strategies" section, you can see the recommendations for how to deal with the aspects of details/summary that aren't Baseline widely available (e.g. mutually exclusive details).

onion2k1 reply#
Here's a list of browser features the skills will tell your agent to use that are stable in Chrome but not supported by Firefox and Safari

That's fine though. Progressive enhancement, adding features to a site when they're available but still offering a working site when they're not, is how we should build web sites. That way they work for the user's device rather than the developer's opinion of what the web should do.
Working that way completely removes the decision about whether or not to use a feature because it doesn't work for some people, and moves it to a decision about whether or not it's worth adding for the users on browsers that can use it. In the past that was a real development effort cost, but today where AI writes the code the effort is much, much lower.
If you're using AI to make something but still using heuristics designed to save coding time then you really need to rethink your mental model of how to decide what gets built.
Websites created today should all use server-loaded content for the first render, small page sizes, a sub-1s loading time, progress enhancement for features, and WCAG 3.1 AAA accessibility (maybe.. at least AA though) because doing that isn't any more effort than not doing it.

embedding-shape3 replies#
> That's fine though. Progressive enhancement, adding features to a site when they're available but still offering a working site when they're not, is how we should build web sites.

Alright, that's fine and dandy. Is this the actual results of using this skill though that is being advertised here? Is it asking the agent to also make sure it's "Progressive enhancement" so the same stuff more or less works in Firefox and Safari?
If not, your whole point is kind of moot, as you have someone from Google trying to get people to write websites that'll look and/or work differently in Chrome compared to other browsers.

atopal#
Not only is it asking the agent, the guides themselves spell out how to make a fallback work in unsupported browsers. That's not just Firefox and Safari, if it's a Chrome only feature older versions of Chrome might not support it either. Here's an example: https://github.com/GoogleChrome/modern-web-guidance-src/blob...

Unless you have specified something different, by default the skill assumes you are targeting Baseline Widely Available, which means everything has to work in all major browsers from at least 2.5 years ago.

onion2k#
Progressive enhancement isn't new. It's a concept from the days of IE and Netscape, and it's how we should all have been building website for the past 3 decades.
kevin_nisbet#
I tried the skill as an experiment, and while it did give a suggestion that had poor support, it also suggested the library version as fallback (using Temporal). So if that's universally applied it might not be so unreasonable, but I don't do much frontend dev to know whether it's worth the risk or not.
Cthulhu_2 replies#
I've looked up a few on MDN and they're all listed as experimental, so while they may work in Chrome they're not web standards; I hope everyone prompts their agents to avoid experimental features. That said I'm disappointed this tool seems to recommend using them anyway.
tgv#
It's proposed by a Google team. That privacy data isn't going to fly to their data stores by itself. So of course they want to thwart Firefox and Safari.
atopal#
Unless you have specified something else, Modern Web Guidance assumes that you are targeting Baseline Widely Available, meaning all major browsers going back 2.5 years. Everything has to either be a progressive enhancement or have a fallback that works in those browsers. Otherwise you have to explicitly ask for that feature. This is a policy that was worked out with Microsoft Edge and Mozilla Firefox, who are also contributing to the skill.
Arubis#
The proportion of sites that I have to swap out of Firefox to use has gone from "every couple of weeks" to "multiple times weekly" lately, mostly among clearly AI-coauthored sites. I wonder if this is part of why.
simonw4 replies#
Distribution suggestion: in addition to the npm packages you have right now, set up GitHub Pages to publish a markdown index document of the skills at https://googlechrome.github.io/modern-web-guidance-src/skill... (currently a 404)

That index page should link to plain markdown versions of all of the documents, and should be designed for search with grep to find the right answers.
That way I don't have to install anything at all - provided my agent has the ability to make HTTP requests I can tell it "Look for tips on https://googlechrome.github.io/modern-web-guidance-src/skill..." and it will fetch the index, then navigate to the most relevant documents - no MCP or npm or installation required at all.

trvz#
What’s the point of modern Javascript without over complicating things?
paulirish#
Aye. I like the idea, Simon. The token cost of the index is high enough I wouldn't suggest the technique for regular use but.. agree that for occasional users it should suffice.

We'll make this happen. :)

jph001 reply#
If you rename that file to "llms.txt" it'll be a bit more discoverable.
kinlan#
yeah that's fair. the infrastructure we are on isn't the most flexible (we will soon move to a newer more custom platform but that's a little way a way)
kohukohunui#
It looks like the markdown has cross references that assume that the cli approach is used, it would be nice to separate the content from the tooling to access.
nico2 replies#
> That way I don't have to install anything at all

It feels that something like this would be the holy grail of agents. A small agent that has only the minimum necessary built in knowledge. The rest, it just retrieves on the fly when it needs (+ caching)
It’s like storing pointers/links instead of the contents

paulirish#
In reality that's pretty much what we got here. Very progressive disclosure centric. There's a 'install' command exists because the ecosystem doesn't have good cross-agent ergonomics for installing skills. (Which bums me out).

But yeah.. big corpus of valuable context × minimal agent footprint = happy place.

mtrovo#
If created properly, skills are already something like that. You have a front matter summary always available to the agent. The agent can request the full skill content on demand, which might contain additional linked documents with details about APIs and schemas being used, deeper documents about niche subtopics, scripts to help with subtasks, etc.
Havoc#
That was my first thought too…why are we distributing text via package managers
advisedwang5 replies#
Chrome already has too much power in the browser standards world. The last thing we need is everyone's LLMs to follow Chrome team's guidance on how to do web development. This road leads back to "To view this site, please view in [DOMINANT BROWSER]"
philipwalton4 replies#
Mozilla Firefox and Microsoft Edge are also contributors to this project, so this is a cross-browser initiative to help improve how agents build for the web.
troupo1 reply#
That's why it seems to skip the most egregious of Chrome-only APIs and focuses on areas where there's large cross-browser agreement.
philipwalton1 reply#
Cross-browser compatibility has been a guiding principle for this project from the start. See: https://youtu.be/bo3i0FzDUYo?si=EqIgY_Kh_r_hSgdE&t=686

Also Mozilla only joined in the last few weeks, so they haven't yet had a big influence on the project (though I expect they will going forward).

Continue this thread — 1 reply

phendrenad2#
They back it because they have no choice. We have no real independent browsers in 2026. And it's sad that the fact that we don't have independent browsers is being twisted into proof that Google doesn't have much power.
philwelch1 reply#
Edge is just a rebranded Chrome. “Cross browser” except it’s different skins of Chrome, what a joke.
jefftk1 reply#
Firefox is not a skin of Chrome; it has the only browser engine in common use that's not descended from KHTML.

Continue this thread — 1 reply

LordDragonfang1 reply#
Edge is Chrom[ium], so that's not very meaningful. It's good that Firefox is at the table, but that table has three seats for Chromium to only one for Firefox, and a de-facto 3/5 majority[1]. And without Safari at the table, you're missing the single most important mobile browser engine (all browsers on iOS, including Chrome).

[1] https://github.com/GoogleChrome/modern-web-guidance-src/blob...

philipwalton#
We would love to have Safari join the project, and we're currently in discussion with them about that. There are also two additional owners seats for independent experts (one of whom is currently filled by Lea Verou).

Continue this thread — 1 reply

Continue this thread — 3 more replies

chalmovsky1 reply#
Amazing! I'm just writing an article about how Alex Russell's quote about 'React being a legacy technology' got, unfortunately, totally ignored.

And now this just fell in my lap! Some of the arguments I wanted to make seem to be provide here. Didn't have a chance to take a proper look at it, but it looks very promising and nice!
Thank you!

Continue this thread — 1 reply

Load more comments