Skip to main content

BlogWeb2 min read

Modern Web Guidance: What Coding Agents Can Learn From the Browser

Modern Web Guidance gives coding agents advice on browser APIs, compatibility, and fallbacks. A modal dialog shows how to use it in practice.

Ask a coding agent to build a dialog and it may produce a JavaScript component that blocks the background, manages focus, and handles Escape. Browsers already provide built-in behavior for many of these tasks. The agent still needs to know which features exist and whether they work in the browsers your project supports.

Modern Web Guidance gives coding agents targeted instructions. The teams behind Chrome, Edge, Firefox, and MDN steward the project alongside the web community. The modern-web-guidance-src repository contains the source code and tools for authoring and evaluating the guidance. Developers install the published modern-web-guidance package. Source repository · Published skills

How agents get the guidance

The CLI can search for a task and retrieve a relevant guide by ID. That gives the agent targeted advice on APIs, browser compatibility, and fallbacks. The project covers topics such as CSS layout, forms, performance, and accessibility. Its legacy-scan command can also look for older patterns in an existing codebase. Treat each match as a starting point for review. Your target browsers or component library may still justify the existing approach. README and CLI examples

A practical example: the modal dialog

For a confirmation dialog, an agent can check whether the native HTML <dialog> element meets the requirements. Calling showModal() opens it as a modal and makes the rest of the document temporarily inert. Animating the backdrop has its own requirements, which a dedicated guide covers. During review, check that the dialog has a meaningful label, that initial focus lands in the right place, and that keyboard navigation works. HTML specification for dialogs · Modern Web Guidance quickstart

How to try it in a project

The project requires Node.js 22 or later. The first command searches for relevant guides. The second retrieves the guide named in the quickstart. Both work without installing the skill in your agent. The npx command runs a package from the registry. For a shared team workflow, you can pin a version you have reviewed. Installation and usage

npx modern-web-guidance@latest search "animate a dialog modal backdrop"
npx modern-web-guidance@latest retrieve "animate-to-from-top-layer"

Start with one component and give the agent your browser support requirements. Ask it to compare the existing approach with the native option. Review whether the proposal simplifies integration and preserves the behavior you need in each target browser. For a dialog, test with a keyboard and a screen reader. A well-tested dialog component may still be the right choice for your application.

If you would like to explore where native browser features could simplify your frontend, get in touch with BIT62.

Modern Web Guidance for Coding Agents | BIT62 | BIT62