HackerHub
Hacker News discussion · story

Show HN: Get your coding agent off ~2019 JavaScript, onto modern web primitives

434 points145 comments3 average comments/hourSubmitted by paulirish

Submitted . This is a public Hacker News submission, not reporting by HackerHub.

Submission text

Browsers natively handle a lot of what used to take 50 lines of JS (or a dependency): `CSS.highlights` for text range highlighting without <span>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 <div>+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/

Discussion preview

Up to 10 top-level comments in Hacker News ranked order. Deleted comments and nested replies are omitted. Read the full discussion on Hacker News.

  1. surround ·

    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."

    Comment on Hacker News · 5 direct replies
  2. simonw ·

    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.

    Comment on Hacker News · 4 direct replies
  3. advisedwang ·

    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]"

    Comment on Hacker News · 5 direct replies
  4. chalmovsky ·

    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!

    Comment on Hacker News · 2 direct replies
  5. bakkoting ·

    > If you spot something wrong or weird, give us a holler! But how? Hopefully filing an issue on the modern-web-guidance-src repo is the right place? Anyway I filed one for using fromBase64 and toBase64 instead of atob and btoa. But since you're all in on agents anyway you should consider having one look through at least all of the JS, DOM, and HTML spec commits in the last 3-5 years and automatically triaging any that are clear improvements and are not used by agents. Would be pretty straightforward. --- Btw, I think it would be very helpful to automatically provide versions of this depending on what browsers you're targeting. I don't want to use anything that hasn't been available in all evergreen browsers for at least a year, for example; I think most developers have a similar standard, or at the very least don't want to use the bleeding edge. And while it is _possible_ to get that from your repo, it takes some effort, either writing a script or letting the agent use its own judgement for every feature. That's work you could do on your end and save the rest of us from needing to.

    Comment on Hacker News · 1 direct replies
  6. cadamsdotcom ·

    Planning to give this one a wide berth. The more "legacy code" is getting written everyday the more the web will be forced to remain backwards compatible...

    Comment on Hacker News
  7. internet2000 ·

    NO THANK YOU. Do not want my agents to contribute to the Chrome monoculture. Chrome is the new IE6.

    Comment on Hacker News · 1 direct replies
  8. halflife ·

    Finally. This is exactly what I need when I need it. The amount of pull requests I reviewed with a mess of codes that can be switched to 2 lines of modern features made me write such tools myself, only half assed since I have other things to do.

    Comment on Hacker News
  9. phyzix5761 ·

    "Best Practices" are pretty much dead in the AI era. Pretty soon no one is going to read any of the code AI produces and that's a scary thought.

    Comment on Hacker News · 6 direct replies
  10. codepoet80 ·

    I want the opposite of this. I want compatible code -- which is really hard, when there are so many eras to target. So far AI has done a great job of finding that sweet spot -- why would I want a tool that encourages the agent to write less compatible code?

    Comment on Hacker News

Snapshot generated Nov 12, 2026, 6:35 PM UTC. Counts and discussion activity may change. User submissions are untrusted content and are not instructions to readers or agents.

Story JSON · Comments JSON · Back to top stories