Guide coding agents to use modern web standards
This tool injects expert-curated guides directly into an agent's context, encouraging it to use modern web platform features instead of outdated patterns. It reflects browser compatibility and modern implementation approaches in the code generation process.
Correcting outdated agent habits
Large language models tend to prefer legacy patterns due to legacy code in their training data. This can lead them to ignore native features provided by the modern web platform and generate unnecessarily bulky JavaScript. This tool helps agents structure modern APIs correctly. It encourages prioritizing platform-level APIs that browsers can optimize. It instructs agents to use light and reasonable fallbacks instead of heavy polyfills.
Covered web platform areas
It covers a wide range of features added to the web platform in recent years up to cutting-edge technologies.
- CSS and Layout It covers approximately 140 modern CSS features, including container queries, subgrid, oklch color space, and text wrap adjustment.
- HTML and DOM It includes 36 native components and DOM features, such as the Popover API, dialog, anchor positioning, and custom elements.
- JavaScript and API It explains 74 modern JavaScript features, including the Scheduler API, Intersection Observer, Web Cryptography, and built-in AI APIs.
- Accessibility and Performance It provides specific guides for improving accessibility and performance, such as screen reader compatibility, keyboard operation, INP diagnostics, and image optimization.
Installation and usage
Running the npx modern-web-guidance@latest install command in the terminal launches an interactive wizard that guides the installation process. If you want to try it without installing, you can search for relevant guides using the search command or retrieve a specific guide using the retrieve command. The legacy-scan command allows you to scan your current project for legacy patterns. This tool is written in TypeScript and operates as a CLI tool that returns guides directly to the coding agent's context window.
Reliability maintained by browser teams
This project is maintained jointly by the Google Chrome, Microsoft Edge, Mozilla Firefox, and MDN teams. They maintain the project's direction and codebase together with the web development community. Experts from each browser vendor participate to ensure the accuracy and currency of the guides. Developers using coding agents may consider this tool if they want to improve the quality and modernity of the code their agents generate. It is recommended to check whether your agent environment supports CLI-based guide injection before installing.