Keep your coding agent up to date with the latest web best practices
Release v0.0.162
github-actions[bot]4f228b506548
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex a9c5cb2..0f5f6e3 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -8,7 +8,7 @@"name": "modern-web-guidance","source": "./","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.161"+ "version": "0.0.162"}]}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 2c26d87..6a8bb6e 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "modern-web-guidance","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.161",+ "version": "0.0.162","author": {"name": "Google Chrome"}diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.jsonindex 2c26d87..6a8bb6e 100644--- a/.cursor-plugin/plugin.json+++ b/.cursor-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "modern-web-guidance","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.161",+ "version": "0.0.162","author": {"name": "Google Chrome"}diff --git a/.github/img/boxes.svg b/.github/img/boxes.svgnew file mode 100644index 0000000..3d536d9--- /dev/null+++ b/.github/img/boxes.svg@@ -0,0 +1,8 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0Z"/>+ <path d="m3 17 3 1.8 3-1.8M6 21v-5.8"/>+ <path d="M12.97 2.92A2 2 0 0 0 12 4.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71V4.63a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0Z"/>+ <path d="m13 7 3 1.8 3-1.8M16 11V5.2"/>+ <path d="M2.97 2.92A2 2 0 0 0 2 4.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71V4.63a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0Z"/>+ <path d="m3 7 3 1.8 3-1.8M6 11V5.2"/>+</svg>diff --git a/.github/img/cpu.svg b/.github/img/cpu.svgnew file mode 100644index 0000000..db7b155--- /dev/null+++ b/.github/img/cpu.svg@@ -0,0 +1,12 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>+ <rect x="9" y="9" width="6" height="6"></rect>+ <line x1="9" y1="1" x2="9" y2="4"></line>+ <line x1="15" y1="1" x2="15" y2="4"></line>+ <line x1="9" y1="20" x2="9" y2="23"></line>+ <line x1="15" y1="20" x2="15" y2="23"></line>+ <line x1="20" y1="9" x2="23" y2="9"></line>+ <line x1="20" y1="15" x2="23" y2="15"></line>+ <line x1="1" y1="9" x2="4" y2="9"></line>+ <line x1="1" y1="15" x2="4" y2="15"></line>+</svg>diff --git a/.github/img/file-text.svg b/.github/img/file-text.svgnew file mode 100644index 0000000..37e173c--- /dev/null+++ b/.github/img/file-text.svg@@ -0,0 +1,7 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/>+ <path d="M14 2v4a2 2 0 0 0 2 2h4"/>+ <path d="M10 9H8"/>+ <path d="M16 13H8"/>+ <path d="M16 17H8"/>+</svg>diff --git a/.github/img/globe.svg b/.github/img/globe.svgnew file mode 100644index 0000000..dea8fbb--- /dev/null+++ b/.github/img/globe.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="12" cy="12" r="10"></circle>+ <line x1="2" y1="12" x2="22" y2="12"></line>+ <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>+</svg>diff --git a/.github/img/lightbulb.svg b/.github/img/lightbulb.svgnew file mode 100644index 0000000..a92d775--- /dev/null+++ b/.github/img/lightbulb.svg@@ -0,0 +1,5 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A7 7 0 0 0 5 8c0 1.3.5 2.6 1.5 3.5.7.8 1.3 1.5 1.5 2.5"></path>+ <line x1="9" y1="18" x2="15" y2="18"></line>+ <line x1="10" y1="22" x2="14" y2="22"></line>+</svg>diff --git a/.github/img/lock.svg b/.github/img/lock.svgnew file mode 100644index 0000000..ac4c948--- /dev/null+++ b/.github/img/lock.svg@@ -0,0 +1,4 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <rect width="18" height="11" x="3" y="11" rx="2" ry="2"/>+ <path d="M7 11V7a5 5 0 0 1 10 0v4"/>+</svg>diff --git a/.github/img/package.svg b/.github/img/package.svgnew file mode 100644index 0000000..9fb62cf--- /dev/null+++ b/.github/img/package.svg@@ -0,0 +1,6 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <line x1="16.5" y1="9.4" x2="7.5" y2="4.21"></line>+ <polygon points="12 22.08 12 12 3 6.91 3 16.97 12 22.08"></polygon>+ <polygon points="12 22.08 21 16.97 21 6.91 12 12 12 22.08"></polygon>+ <polygon points="12 12 21 6.91 12 1.8 3 6.91 12 12"></polygon>+</svg>diff --git a/.github/img/refresh-cw.svg b/.github/img/refresh-cw.svgnew file mode 100644index 0000000..5045412--- /dev/null+++ b/.github/img/refresh-cw.svg@@ -0,0 +1,6 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/>+ <path d="M3 3v5h5"/>+ <path d="M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"/>+ <path d="M16 16h5v5"/>+</svg>diff --git a/.github/img/shield-check.svg b/.github/img/shield-check.svgnew file mode 100644index 0000000..e39e598--- /dev/null+++ b/.github/img/shield-check.svg@@ -0,0 +1,4 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>+ <polyline points="9 11 11 13 15 9"></polyline>+</svg>diff --git a/.github/img/terminal.svg b/.github/img/terminal.svgnew file mode 100644index 0000000..e1a04fb--- /dev/null+++ b/.github/img/terminal.svg@@ -0,0 +1,4 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <polyline points="4 17 10 11 4 5"></polyline>+ <line x1="12" y1="19" x2="20" y2="19"></line>+</svg>diff --git a/.github/img/users.svg b/.github/img/users.svgnew file mode 100644index 0000000..f92faed--- /dev/null+++ b/.github/img/users.svg@@ -0,0 +1,6 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/>+ <circle cx="9" cy="7" r="4"/>+ <path d="M22 21v-2a4 4 0 0 0-3-3.87"/>+ <path d="M16 3.13a4 4 0 0 1 0 7.75"/>+</svg>diff --git a/.github/img/zap.svg b/.github/img/zap.svgnew file mode 100644index 0000000..5766068--- /dev/null+++ b/.github/img/zap.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#4285F4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon>+</svg>diff --git a/README.md b/README.mdindex 55c7ce5..681e738 100644--- a/README.md+++ b/README.md@@ -1,152 +1,142 @@+<p align="center">+ <img src="assets/modern-web-guidance.svg" alt="Modern Web Guidance Logo" width="150" />+</p>+# Modern Web GuidanceInject web platform expertise, best practices, and modern API patterns directly into your AI coding agents.-modern-web-guidance is an agent skill (aka [SKILL.md](http://SKILL.md)) that helps your coding agent build better web apps. It uses modern, high-performance, accessible, and secure APIs rather than legacy, outdated workarounds. This project is supported by the Google Chrome team, the Microsoft Edge team, and the web development community.--<!-- <LIKE A DEMO VIDEO LOOP OR SOMETHING?> -->--## Why?+**Modern Web Guidance** is an agent skill (aka `SKILL.md`) with a CLI that helps AI agents build better web applications using modern, high-performance, accessible, and secure APIs instead of legacy workarounds.-AI coding agents often default to older patterns/libraries because their training data contains vast amounts of legacy code. This often leads them to generate unnecessary, bloated JavaScript for common tasks that are now native in the web platform.+*Supported by the Google Chrome team, the Microsoft Edge team, and the web development community.*-### Bridging the "High-Recall, Low-Coverage" Knowledge Gap--Every developer knows about the **knowledge cutoff**βbut for coding agents, the real issue is **knowledge representation**. Even for web platform features released over the last 10 years, even current frontier models lack the density and coverage of high-quality, modern implementation patterns. The models have *high recall* (they know an API exists) but *low coverage* of actual production best practices.--**This repository bridges that gap.** We don't waste your agent's context on general knowledge it already has. Instead, we inject targeted, high-density, expert-curated guidance specifically focused on:+<!-- <LIKE A DEMO VIDEO LOOP OR SOMETHING?> -->-1. Advanced browser APIs models consistently misuse or fail to structure.-2. High-performance, accessible, and secure patterns that eliminate legacy bloat.-3. Responsible cross-browser fallback strategies that models are incapable of inventing on-the-fly.+## <img src=".github/img/terminal.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Quickstart-## What+```shell+npx modern-web-guidance@latest install+```-Our content is evergrowing, we cover the bleeding edge of the web platform as well as the past several years of new features handling fallback strategies. The skill is designed **not to waste your tokens** on stuff models already know.+This command runs an interactive wizard to place the SKILL.md appropriately. See [Alternative Installation Methods](#alternative-installation-methods) below.-### Core disciplines+#### Try it out (without installing)-Here's a tiny sampling of the **128 use-case-centric guides**:+```shell+# Search for relevant guides+npx modern-web-guidance@latest search "animate a dialog modal backdrop"-* **User Experience**: Smooth and modern visual states: View Transitions, CSS `scrollbar-color` styling, high-contrast adaptation, entry/exit transition animations, parallax scrolling.-* **CSS layout:** container queries (both size and style queries), modern color spaces (`oklch`, `color-mix`) and `subgrid`, text-wrap tuning (`balance`, `pretty`), subgrid, and typography line height trimming (`text-box`)-* **Performance**: instant page preloading, Interaction to Next Paint (INP) diagnostics, and background task scheduling using `scheduler.yield`.-* **Forms**: auto-sizing input fields (`field-sizing: content`), precise validation with `:user-invalid`, and accent color synchronization.-* **Native UI Components**: Direct control over dialogs, CSS Anchor Positioning for tooltips, same-document and cross-document View Transitions, and the Popover API.-* **Accessibility & Security**: accessible error announcements, keyboard focus management.-* **Built-in AI**: Leveraging local, on-device client models (native Language Detection, Summarization, and Translation APIs).+# Retrieve a guide by ID+npx modern-web-guidance@latest retrieve "animate-to-from-top-layer"+```-#### Full Skill Coverage (v0.0.161)+## <img src=".github/img/lightbulb.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Why?++Coding agents often default to older patterns because LLM training data contains vast amounts of legacy code. This often leads them to generate bloated JavaScript for tasks that now have native, high-performance web platform solutions.++Even if a model knows an API exists, it often lacks the density of real-world, modern implementation patterns required for production-ready code.++**Modern Web Guidance bridges this gap.** Our skill's CLI returns targeted, expert-curated guidelines directly into your agent's context window, focusing on:+* **Modern Browser APIs**: Helping models correctly structure APIs they frequently misuse.+* **Performance & Accessibility**: Eliminating legacy bloat with clean, native patterns.+* **Responsible Fallbacks**: Guiding models to use sensible, lightweight fallbacks instead of heavy polyfills or legacy libraries.++## <img src=".github/img/package.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> What's Included?++We cover the past several years of the web platform's new features, all the way up to the cutting edge. The guides are **designed to be token-efficient**; we run evals enabling us to prune lowest-common-denominator content that models already know.++### Core Disciplines++<table width="100%" style="border-collapse: collapse; border: none;">+ <tr style="border: none;">+ <td width="33%" valign="top" style="border: none; padding: 6px;">+ <h4>π¨ User Experience</h4>+ <p style="font-size: 0.9em; line-height: 1.4;">Smooth visual states (View Transitions, entry/exit animations, parallax scroll, CSS <code>scrollbar-color</code>).</p>+ </td>+ <td width="33%" valign="top" style="border: none; padding: 6px;">+ <h4>π CSS Layout</h4>+ <p style="font-size: 0.9em; line-height: 1.4;">Modern layout systems (container queries, <code>subgrid</code>, modern color spaces like <code>oklch</code>, text-wrap tuning, and line-height trimming).</p>+ </td>+ <td width="33%" valign="top" style="border: none; padding: 6px;">+ <h4>β‘ Performance</h4>+ <p style="font-size: 0.9em; line-height: 1.4;">Speed optimizations (instant preloading, Interaction to Next Paint (INP) diagnostics, and scheduling tasks via <code>scheduler.yield</code>).</p>+ </td>+ </tr>+ <tr style="border: none;">+ <td width="33%" valign="top" style="border: none; padding: 6px;">+ <h4>π Forms & UI</h4>+ <p style="font-size: 0.9em; line-height: 1.4;">Native components (Anchor Positioning for tooltips, Popover API, dialogs, <code>:user-invalid</code> validation, and auto-sizing fields).</p>+ </td>+ <td width="33%" valign="top" style="border: none; padding: 6px;">+ <h4>βΏ Accessibility</h4>+ <p style="font-size: 0.9em; line-height: 1.4;">Hardened patterns (accessible error announcements, keyboard focus management).</p>+ </td>+ <td width="33%" valign="top" style="border: none; padding: 6px;">+ <h4>π€ Built-in AI</h4>+ <p style="font-size: 0.9em; line-height: 1.4;">Local client models (native translation, summarization, and language detection APIs).</p>+ </td>+ </tr>+</table>++#### The full list<details>-<summary>Includes expert guidance across <strong>102 modern web features</strong></summary>--- [::backdrop](https://web-platform-dx.github.io/web-features-explorer/features/backdrop/)-- [:autofill](https://web-platform-dx.github.io/web-features-explorer/features/autofill/)-- [:has()](https://web-platform-dx.github.io/web-features-explorer/features/has/)-- [:not()](https://web-platform-dx.github.io/web-features-explorer/features/not/)-- [:user-valid and :user-invalid](https://web-platform-dx.github.io/web-features-explorer/features/user-pseudos/)-- [@function](https://web-platform-dx.github.io/web-features-explorer/features/function/)-- [@starting-style](https://web-platform-dx.github.io/web-features-explorer/features/starting-style/)-- [<details>](https://web-platform-dx.github.io/web-features-explorer/features/details/)-- [<dialog closedby>](https://web-platform-dx.github.io/web-features-explorer/features/dialog-closedby/)-- [<dialog>](https://web-platform-dx.github.io/web-features-explorer/features/dialog/)-- [<link rel="expect">](https://web-platform-dx.github.io/web-features-explorer/features/link-rel-expect/)-- [<link rel="preload">](https://web-platform-dx.github.io/web-features-explorer/features/link-rel-preload/)-- [AbortController and AbortSignal](https://web-platform-dx.github.io/web-features-explorer/features/aborting/)-- [accent-color](https://web-platform-dx.github.io/web-features-explorer/features/accent-color/)-- [Active view transition](https://web-platform-dx.github.io/web-features-explorer/features/active-view-transition/)-- [Anchor position container queries](https://web-platform-dx.github.io/web-features-explorer/features/container-anchor-position-queries/)-- [Anchor positioning](https://web-platform-dx.github.io/web-features-explorer/features/anchor-positioning/)-- [blocking="render"](https://web-platform-dx.github.io/web-features-explorer/features/blocking-render/)-- [calc-size()](https://web-platform-dx.github.io/web-features-explorer/features/calc-size/)-- [color-scheme](https://web-platform-dx.github.io/web-features-explorer/features/color-scheme/)-- [Container queries](https://web-platform-dx.github.io/web-features-explorer/features/container-queries/)-- [Container scroll-state queries](https://web-platform-dx.github.io/web-features-explorer/features/container-scroll-state-queries/)-- [Container style queries](https://web-platform-dx.github.io/web-features-explorer/features/container-style-queries/)-- [content-visibility](https://web-platform-dx.github.io/web-features-explorer/features/content-visibility/)-- [Cross-document view transitions](https://web-platform-dx.github.io/web-features-explorer/features/cross-document-view-transitions/)-- [Custom highlights](https://web-platform-dx.github.io/web-features-explorer/features/highlight/)-- [Customizable <select>](https://web-platform-dx.github.io/web-features-explorer/features/customizable-select/)-- [Email, telephone, and URL <input> types](https://web-platform-dx.github.io/web-features-explorer/features/input-email-tel-url/)-- [enterkeyhint](https://web-platform-dx.github.io/web-features-explorer/features/enterkeyhint/)-- [Event timing](https://web-platform-dx.github.io/web-features-explorer/features/event-timing/)-- [Federated credential management](https://web-platform-dx.github.io/web-features-explorer/features/fedcm/)-- [Fetch](https://web-platform-dx.github.io/web-features-explorer/features/fetch/)-- [Fetch priority](https://web-platform-dx.github.io/web-features-explorer/features/fetch-priority/)-- [fetchLater](https://web-platform-dx.github.io/web-features-explorer/features/fetchlater/)-- [field-sizing](https://web-platform-dx.github.io/web-features-explorer/features/field-sizing/)-- [font-size-adjust](https://web-platform-dx.github.io/web-features-explorer/features/font-size-adjust/)-- [Form-associated WebMCP attributes](https://web-platform-dx.github.io/web-features-explorer/features/declarative-webmcp/)-- [hidden="until-found"](https://web-platform-dx.github.io/web-features-explorer/features/hidden-until-found/)-- [HTML in canvas](https://web-platform-dx.github.io/web-features-explorer/features/canvas-html/)-- [image-set()](https://web-platform-dx.github.io/web-features-explorer/features/image-set/)-- [Individual transform properties](https://web-platform-dx.github.io/web-features-explorer/features/individual-transforms/)-- [inert](https://web-platform-dx.github.io/web-features-explorer/features/inert/)-- [inputmode](https://web-platform-dx.github.io/web-features-explorer/features/inputmode/)-- [Interest invokers](https://web-platform-dx.github.io/web-features-explorer/features/interest-invokers/)-- [interpolate-size](https://web-platform-dx.github.io/web-features-explorer/features/interpolate-size/)-- [Intersection observer](https://web-platform-dx.github.io/web-features-explorer/features/intersection-observer/)-- [Intl.DurationFormat](https://web-platform-dx.github.io/web-features-explorer/features/intl-duration-format/)-- [Invoker commands](https://web-platform-dx.github.io/web-features-explorer/features/invoker-commands/)-- [Language detector](https://web-platform-dx.github.io/web-features-explorer/features/languagedetector/)-- [LanguageModel](https://web-platform-dx.github.io/web-features-explorer/features/languagemodel/)-- [light-dark()](https://web-platform-dx.github.io/web-features-explorer/features/light-dark/)-- [linear() easing](https://web-platform-dx.github.io/web-features-explorer/features/linear-easing/)-- [Long animation frames](https://web-platform-dx.github.io/web-features-explorer/features/long-animation-frames/)-- [Masks](https://web-platform-dx.github.io/web-features-explorer/features/masks/)-- [moveBefore()](https://web-platform-dx.github.io/web-features-explorer/features/move-before/)-- [MutationObserver](https://web-platform-dx.github.io/web-features-explorer/features/mutationobserver/)-- [Mutually exclusive <details> elements](https://web-platform-dx.github.io/web-features-explorer/features/details-name/)-- [Navigation API](https://web-platform-dx.github.io/web-features-explorer/features/navigation/)-- [navigator.modelContext](https://web-platform-dx.github.io/web-features-explorer/features/navigator-modelcontext/)-- [overflow-clip-margin](https://web-platform-dx.github.io/web-features-explorer/features/overflow-clip-margin/)-- [overflow: clip](https://web-platform-dx.github.io/web-features-explorer/features/overflow-clip/)-- [overlay](https://web-platform-dx.github.io/web-features-explorer/features/overlay/)-- [overscroll-behavior](https://web-platform-dx.github.io/web-features-explorer/features/overscroll-behavior/)-- [Page visibility](https://web-platform-dx.github.io/web-features-explorer/features/page-visibility/)-- [Page visibility state](https://web-platform-dx.github.io/web-features-explorer/features/page-visibility-state/)-- [Partitioned cookies](https://web-platform-dx.github.io/web-features-explorer/features/partitioned-cookies/)-- [Permissions policy](https://web-platform-dx.github.io/web-features-explorer/features/permissions-policy/)-- [Popover](https://web-platform-dx.github.io/web-features-explorer/features/popover/)-- [popover="hint"](https://web-platform-dx.github.io/web-features-explorer/features/popover-hint/)-- [prefers-color-scheme media query](https://web-platform-dx.github.io/web-features-explorer/features/prefers-color-scheme/)-- [prefers-contrast media query](https://web-platform-dx.github.io/web-features-explorer/features/prefers-contrast/)-- [prefers-reduced-motion media query](https://web-platform-dx.github.io/web-features-explorer/features/prefers-reduced-motion/)-- [Registered custom properties](https://web-platform-dx.github.io/web-features-explorer/features/registered-custom-properties/)-- [Resize observer](https://web-platform-dx.github.io/web-features-explorer/features/resize-observer/)-- [Scheduler API](https://web-platform-dx.github.io/web-features-explorer/features/scheduler/)-- [Scroll snap](https://web-platform-dx.github.io/web-features-explorer/features/scroll-snap/)-- [Scroll snap events](https://web-platform-dx.github.io/web-features-explorer/features/scroll-snap-events/)-- [Scroll-driven animations](https://web-platform-dx.github.io/web-features-explorer/features/scroll-driven-animations/)-- [scroll-initial-target](https://web-platform-dx.github.io/web-features-explorer/features/scroll-initial-target/)-- [scrollbar-color](https://web-platform-dx.github.io/web-features-explorer/features/scrollbar-color/)-- [scrollbar-width](https://web-platform-dx.github.io/web-features-explorer/features/scrollbar-width/)-- [scrollend](https://web-platform-dx.github.io/web-features-explorer/features/scrollend/)-- [scrollIntoView()](https://web-platform-dx.github.io/web-features-explorer/features/scroll-into-view/)-- [sibling-count() and sibling-index()](https://web-platform-dx.github.io/web-features-explorer/features/sibling-count/)-- [sin(), cos(), tan(), asin(), acos(), atan(), and atan2() (CSS)](https://web-platform-dx.github.io/web-features-explorer/features/trig-functions/)-- [Speculation rules](https://web-platform-dx.github.io/web-features-explorer/features/speculation-rules/)-- [Summarizer](https://web-platform-dx.github.io/web-features-explorer/features/summarizer/)-- [SVG](https://web-platform-dx.github.io/web-features-explorer/features/svg/)-- [Temporal](https://web-platform-dx.github.io/web-features-explorer/features/temporal/)-- [text-box](https://web-platform-dx.github.io/web-features-explorer/features/text-box/)-- [text-wrap](https://web-platform-dx.github.io/web-features-explorer/features/text-wrap/)-- [text-wrap: balance](https://web-platform-dx.github.io/web-features-explorer/features/text-wrap-balance/)-- [text-wrap: pretty](https://web-platform-dx.github.io/web-features-explorer/features/text-wrap-pretty/)-- [Top-level await](https://web-platform-dx.github.io/web-features-explorer/features/top-level-await/)-- [transition-behavior](https://web-platform-dx.github.io/web-features-explorer/features/transition-behavior/)-- [Translator](https://web-platform-dx.github.io/web-features-explorer/features/translator/)-- [User agent client hints](https://web-platform-dx.github.io/web-features-explorer/features/ua-client-hints/)-- [View transitions](https://web-platform-dx.github.io/web-features-explorer/features/view-transitions/)-- [view-transition-class](https://web-platform-dx.github.io/web-features-explorer/features/view-transition-class/)-- [Web animations](https://web-platform-dx.github.io/web-features-explorer/features/web-animations/)-- [Web authentication](https://web-platform-dx.github.io/web-features-explorer/features/webauthn/)-- [Web authentication signal methods](https://web-platform-dx.github.io/web-features-explorer/features/webauthn-signals/)+<summary><strong>102 modern web features</strong></summary>++### CSS & Layout (51 features)++| | | |+| :--- | :--- | :--- |+| [::backdrop](https://web-platform-dx.github.io/web-features-explorer/features/backdrop/) | [Custom highlights](https://web-platform-dx.github.io/web-features-explorer/features/highlight/) | [Scroll snap events](https://web-platform-dx.github.io/web-features-explorer/features/scroll-snap-events/) |+| [:has()](https://web-platform-dx.github.io/web-features-explorer/features/has/) | [field-sizing](https://web-platform-dx.github.io/web-features-explorer/features/field-sizing/) | [Scroll-driven animations](https://web-platform-dx.github.io/web-features-explorer/features/scroll-driven-animations/) |+| [:not()](https://web-platform-dx.github.io/web-features-explorer/features/not/) | [font-size-adjust](https://web-platform-dx.github.io/web-features-explorer/features/font-size-adjust/) | [scroll-initial-target](https://web-platform-dx.github.io/web-features-explorer/features/scroll-initial-target/) |+| [:user-valid and :user-invalid](https://web-platform-dx.github.io/web-features-explorer/features/user-pseudos/) | [image-set()](https://web-platform-dx.github.io/web-features-explorer/features/image-set/) | [scrollbar-color](https://web-platform-dx.github.io/web-features-explorer/features/scrollbar-color/) |+| [@function](https://web-platform-dx.github.io/web-features-explorer/features/function/) | [Individual transform properties](https://web-platform-dx.github.io/web-features-explorer/features/individual-transforms/) | [scrollbar-width](https://web-platform-dx.github.io/web-features-explorer/features/scrollbar-width/) |+| [@starting-style](https://web-platform-dx.github.io/web-features-explorer/features/starting-style/) | [interpolate-size](https://web-platform-dx.github.io/web-features-explorer/features/interpolate-size/) | [scrollend](https://web-platform-dx.github.io/web-features-explorer/features/scrollend/) |+| [accent-color](https://web-platform-dx.github.io/web-features-explorer/features/accent-color/) | [light-dark()](https://web-platform-dx.github.io/web-features-explorer/features/light-dark/) | [scrollIntoView()](https://web-platform-dx.github.io/web-features-explorer/features/scroll-into-view/) |+| [Active view transition](https://web-platform-dx.github.io/web-features-explorer/features/active-view-transition/) | [linear() easing](https://web-platform-dx.github.io/web-features-explorer/features/linear-easing/) | [sibling-count() and sibling-index()](https://web-platform-dx.github.io/web-features-explorer/features/sibling-count/) |+| [Anchor position container queries](https://web-platform-dx.github.io/web-features-explorer/features/container-anchor-position-queries/) | [Masks](https://web-platform-dx.github.io/web-features-explorer/features/masks/) | [sin(), cos(), tan(), asin(), acos(), atan(), and atan2() (CSS)](https://web-platform-dx.github.io/web-features-explorer/features/trig-functions/) |+| [Anchor positioning](https://web-platform-dx.github.io/web-features-explorer/features/anchor-positioning/) | [overflow-clip-margin](https://web-platform-dx.github.io/web-features-explorer/features/overflow-clip-margin/) | [text-box](https://web-platform-dx.github.io/web-features-explorer/features/text-box/) |+| [calc-size()](https://web-platform-dx.github.io/web-features-explorer/features/calc-size/) | [overflow: clip](https://web-platform-dx.github.io/web-features-explorer/features/overflow-clip/) | [text-wrap](https://web-platform-dx.github.io/web-features-explorer/features/text-wrap/) |+| [color-scheme](https://web-platform-dx.github.io/web-features-explorer/features/color-scheme/) | [overlay](https://web-platform-dx.github.io/web-features-explorer/features/overlay/) | [text-wrap: balance](https://web-platform-dx.github.io/web-features-explorer/features/text-wrap-balance/) |+| [Container queries](https://web-platform-dx.github.io/web-features-explorer/features/container-queries/) | [overscroll-behavior](https://web-platform-dx.github.io/web-features-explorer/features/overscroll-behavior/) | [text-wrap: pretty](https://web-platform-dx.github.io/web-features-explorer/features/text-wrap-pretty/) |+| [Container scroll-state queries](https://web-platform-dx.github.io/web-features-explorer/features/container-scroll-state-queries/) | [prefers-color-scheme media query](https://web-platform-dx.github.io/web-features-explorer/features/prefers-color-scheme/) | [transition-behavior](https://web-platform-dx.github.io/web-features-explorer/features/transition-behavior/) |+| [Container style queries](https://web-platform-dx.github.io/web-features-explorer/features/container-style-queries/) | [prefers-contrast media query](https://web-platform-dx.github.io/web-features-explorer/features/prefers-contrast/) | [View transitions](https://web-platform-dx.github.io/web-features-explorer/features/view-transitions/) |+| [content-visibility](https://web-platform-dx.github.io/web-features-explorer/features/content-visibility/) | [prefers-reduced-motion media query](https://web-platform-dx.github.io/web-features-explorer/features/prefers-reduced-motion/) | [view-transition-class](https://web-platform-dx.github.io/web-features-explorer/features/view-transition-class/) |+| [Cross-document view transitions](https://web-platform-dx.github.io/web-features-explorer/features/cross-document-view-transitions/) | [Scroll snap](https://web-platform-dx.github.io/web-features-explorer/features/scroll-snap/) | [Web animations](https://web-platform-dx.github.io/web-features-explorer/features/web-animations/) |++### HTML & DOM (20 features)++| | | |+| :--- | :--- | :--- |+| [:autofill](https://web-platform-dx.github.io/web-features-explorer/features/autofill/) | [Customizable <select>](https://web-platform-dx.github.io/web-features-explorer/features/customizable-select/) | [Invoker commands](https://web-platform-dx.github.io/web-features-explorer/features/invoker-commands/) |+| [<details>](https://web-platform-dx.github.io/web-features-explorer/features/details/) | [Email, telephone, and URL <input> types](https://web-platform-dx.github.io/web-features-explorer/features/input-email-tel-url/) | [moveBefore()](https://web-platform-dx.github.io/web-features-explorer/features/move-before/) |+| [<dialog closedby>](https://web-platform-dx.github.io/web-features-explorer/features/dialog-closedby/) | [Fetch priority](https://web-platform-dx.github.io/web-features-explorer/features/fetch-priority/) | [MutationObserver](https://web-platform-dx.github.io/web-features-explorer/features/mutationobserver/) |+| [<dialog>](https://web-platform-dx.github.io/web-features-explorer/features/dialog/) | [hidden="until-found"](https://web-platform-dx.github.io/web-features-explorer/features/hidden-until-found/) | [Mutually exclusive <details> elements](https://web-platform-dx.github.io/web-features-explorer/features/details-name/) |+| [<link rel="expect">](https://web-platform-dx.github.io/web-features-explorer/features/link-rel-expect/) | [HTML in canvas](https://web-platform-dx.github.io/web-features-explorer/features/canvas-html/) | [Popover](https://web-platform-dx.github.io/web-features-explorer/features/popover/) |+| [<link rel="preload">](https://web-platform-dx.github.io/web-features-explorer/features/link-rel-preload/) | [inert](https://web-platform-dx.github.io/web-features-explorer/features/inert/) | [popover="hint"](https://web-platform-dx.github.io/web-features-explorer/features/popover-hint/) |+| [blocking="render"](https://web-platform-dx.github.io/web-features-explorer/features/blocking-render/) | [Interest invokers](https://web-platform-dx.github.io/web-features-explorer/features/interest-invokers/) | |++### JavaScript & APIs (31 features)++| | | |+| :--- | :--- | :--- |+| [AbortController and AbortSignal](https://web-platform-dx.github.io/web-features-explorer/features/aborting/) | [LanguageModel](https://web-platform-dx.github.io/web-features-explorer/features/languagemodel/) | [Speculation rules](https://web-platform-dx.github.io/web-features-explorer/features/speculation-rules/) |+| [enterkeyhint](https://web-platform-dx.github.io/web-features-explorer/features/enterkeyhint/) | [Long animation frames](https://web-platform-dx.github.io/web-features-explorer/features/long-animation-frames/) | [Summarizer](https://web-platform-dx.github.io/web-features-explorer/features/summarizer/) |+| [Event timing](https://web-platform-dx.github.io/web-features-explorer/features/event-timing/) | [Navigation API](https://web-platform-dx.github.io/web-features-explorer/features/navigation/) | [SVG](https://web-platform-dx.github.io/web-features-explorer/features/svg/) |+| [Federated credential management](https://web-platform-dx.github.io/web-features-explorer/features/fedcm/) | [navigator.modelContext](https://web-platform-dx.github.io/web-features-explorer/features/navigator-modelcontext/) | [Temporal](https://web-platform-dx.github.io/web-features-explorer/features/temporal/) |+| [Fetch](https://web-platform-dx.github.io/web-features-explorer/features/fetch/) | [Page visibility](https://web-platform-dx.github.io/web-features-explorer/features/page-visibility/) | [Top-level await](https://web-platform-dx.github.io/web-features-explorer/features/top-level-await/) |+| [fetchLater](https://web-platform-dx.github.io/web-features-explorer/features/fetchlater/) | [Page visibility state](https://web-platform-dx.github.io/web-features-explorer/features/page-visibility-state/) | [Translator](https://web-platform-dx.github.io/web-features-explorer/features/translator/) |+| [Form-associated WebMCP attributes](https://web-platform-dx.github.io/web-features-explorer/features/declarative-webmcp/) | [Partitioned cookies](https://web-platform-dx.github.io/web-features-explorer/features/partitioned-cookies/) | [User agent client hints](https://web-platform-dx.github.io/web-features-explorer/features/ua-client-hints/) |+| [inputmode](https://web-platform-dx.github.io/web-features-explorer/features/inputmode/) | [Permissions policy](https://web-platform-dx.github.io/web-features-explorer/features/permissions-policy/) | [Web authentication](https://web-platform-dx.github.io/web-features-explorer/features/webauthn/) |+| [Intersection observer](https://web-platform-dx.github.io/web-features-explorer/features/intersection-observer/) | [Registered custom properties](https://web-platform-dx.github.io/web-features-explorer/features/registered-custom-properties/) | [Web authentication signal methods](https://web-platform-dx.github.io/web-features-explorer/features/webauthn-signals/) |+| [Intl.DurationFormat](https://web-platform-dx.github.io/web-features-explorer/features/intl-duration-format/) | [Resize observer](https://web-platform-dx.github.io/web-features-explorer/features/resize-observer/) | |+| [Language detector](https://web-platform-dx.github.io/web-features-explorer/features/languagedetector/) | [Scheduler API](https://web-platform-dx.github.io/web-features-explorer/features/scheduler/) | |+</details><details>-<summary>Covers <strong>128 real-world developer use cases</strong> with production-ready code patterns</summary>+<summary><strong>128 real-world developer use cases</strong></summary><h3>accessibility</h3>@@ -198,7 +188,7 @@ Here's a tiny sampling of the **128 use-case-centric guides**:- **[defer-work-until-scroll-ends](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/defer-work-until-scroll-ends.md)**: Defer expensive operations like DOM updates, data fetching, analytics tracking, or layout recalculation until after scrolling completes to maintain smooth scroll performance.- **[deprioritize-background-fetches](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/deprioritize-background-fetches.md)**: Deprioritize background data fetches made with the Fetch API to prevent network contention with user-initiated requests.- **[detect-initial-visibility-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/detect-initial-visibility-state.md)**: Reliably determine whether a page was initially loaded in the background, even in cases where the script is loaded asynchronously after the user foregrounded the page.-- **[efficient-background-processing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/efficient-background-processing.md)**: Conserve system resources and battery life by pausing background JavaScript execution (such as `<canvas>` animations, WebGL rendering, or high-frequency WebSocket data polling) when the component is off-screen and then resume them just-in-time when they scroll back into view.+- **[efficient-background-processing](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/efficient-background-processing.md)**: Conserve system resources and battery life by pausing background JavaScript execution (such as `<canvas>` animations, WebGL rendering, or high-frequency WebSocket data polling) when the component is off-screen and then resume them just-in-time when they scroll back into view.- **[faster-spa-view-transitions](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/faster-spa-view-transitions.md)**: Enable faster transitions back to previously visited views in a Single-Page Application (SPA) by preserving their structural DOM state instead of destroying and rebuilding them on every navigation.- **[full-session-analytics](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/full-session-analytics.md)**: Reliably track analytics, errors, and telemetry data across the user's entire page visit, and defer sending of the data until the user leaves the page.- **[identify-heavy-scripts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/performance/identify-heavy-scripts.md)**: Identify the scripts most responsible for long animation frames@@ -260,7 +250,7 @@ Here's a tiny sampling of the **128 use-case-centric guides**:- **[light-dismiss-a-dialog](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/light-dismiss-a-dialog.md)**: Create a modal dialog that can be closed via light dismiss (i.e. clicking or tapping outside of the dialog)- **[manage-recurring-intervals](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/manage-recurring-intervals.md)**: Calculate recurring intervals for subscription billings or payroll cycles, automatically adjusting for edge cases such as month-end transitions (e.g., adding one month to January 31st) to ensure accurate period calculations.- **[model-partial-time-concepts](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/model-partial-time-concepts.md)**: Model date and time concepts that inherently lack a standard component (such as a specific year, day, or date) without using arbitrary placeholder values that introduce calculation errors.-- **[move-dom-element-without-losing-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/move-dom-element-without-losing-state.md)**: Move or reparent a DOM element without losing important element state, such as interactivity states (:focus/:active), <iframe> loading state, animation/transition state, etc+- **[move-dom-element-without-losing-state](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/move-dom-element-without-losing-state.md)**: Move or reparent a DOM element without losing important element state, such as interactivity states (:focus/:active), <iframe> loading state, animation/transition state, etc- **[navigation-drawer](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/navigation-drawer.md)**: Create a navigation drawer component that, when triggered from a menu button, slides in from the side overlayed on top of existing page content, and slides out when dismissed (by swiping away, tapping outside, or pressing escape).- **[overflow-clipping-control](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/overflow-clipping-control.md)**: Adjust the visible clipping boundary of an element to align with the content edge, padding edge, or border edgeβor a specified offset from any of theseβoffering finer-grained control over how content is clipped.- **[parallax-scroll-effects](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/user-experience/parallax-scroll-effects.md)**: Create scroll-based effects (such as parallax) where foreground and background layers move at different rates, creating a sense of depth as the user scrolls.@@ -304,145 +294,147 @@ Here's a tiny sampling of the **128 use-case-centric guides**:- **[agentic-javascript-tools](https://github.com/GoogleChrome/modern-web-guidance/blob/main/skills/modern-web-guidance/guides/webmcp/agentic-javascript-tools.md)**: Programmatically register client-side JavaScript functions as tools for AI agents using the WebMCP Imperative API.</details>-### The modern web platform that you can *use,* safely+### Safe Adoption of Modern Features-* **Responsible Fallbacks**: We don't recommend heavy polyfills that bloat your bundle or block the main thread. Instead, we suggest what an **in-tune senior front-end developer would appreciate**:- 1. Prioritizing lightweight, case-specific custom implementations (\<50 lines of code).- 2. Conditional loading of performant polyfills *only* when native support is absent. And avoiding both risky CDNs and heavy polyfills.- 3. Using bulletproof prototype-level feature detection rather than naive environment checks.-* **Gotchas & Quirk Mitigation**: Tricky API boundaries and platform quirks (e.g., the 64KB payload quota for `fetchLater()`, macOS specific scrollbar gutters, and WebKit flickering bugs) are fully documented.-* **Baseline-Aware Decisions**: Dynamic compatibility data from the Baseline project ensures agents make micro-architectural decisions on-the-flyβapplying progressive enhancement conditionally, not blindly.+* **Progressive Enhancement & Nuanced Fallbacks**: We distinguish between purely additive enhancements (like speculative preloading) which are safe to let older browsers silently ignore, and critical behaviors (like dialog controls or network beacons) where we write highly considered, low-overhead fallbacks.+* **Responsible Fallbacks**: We prioritize lightweight, case-specific custom fallbacks (<50 LOC) or conditionally-loaded polyfills instead of heavy third-party bundles.+* **Gotchas & Quirks**: We document hidden platform limitations, such as the 64KB payload quota for `fetchLater()` or macOS-specific scrollbar behaviors.+* **Baseline-Aware Integration**: We leverage real-time compatibility data from the **Baseline** project so agents can dynamically adapt to current browser support and any browser support preferences.-## How+## <img src=".github/img/cpu.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> How It Works-### How Coding Agents use our skill+0. **Activation**: The coding agent activates the `modern-web-guidance` skill because of a relevant task. The agent is instructed to use the `modern-web` CLI for web platform queries.+2. **Local Semantic Search**: The agent runs `modern-web search "<query>"`. The tool matches the query to the best guide using an offline, CPU-efficient TensorFlow.js model (no network calls, no API keys).+3. **Guide Fetch**: The agent retrieves the guide via `modern-web retrieve <guide-id>`, inserting targeted code patterns, gotchas, and fallbacks directly into its context window.-* **Bootstrapped Awareness**: When loaded, the agent receives a system prompt instruction: *"To use modern web platform APIs, query the `modern-web` tool."*-* **Semantic Vector Discovery**: The agent executes `modern-web search "<query>"` in your terminal. The tool uses an optimized `MiniLM-L6-v2` TensorFlow.js model running **entirely offline** on your CPU (thx `MiniLM`! No network calls, latency, or API keys required) to calculate the **cosine distance** between the query and our pre-computed guide embeddings.-* **Precision Retrieval**: The agent executes `modern-web retrieve <guide-id>` to fetch the exact, clean Markdown guidelines it discovered.-* **State-of-the-Art Generation**: The guide's precise code snippets, DO/DO NOT rules, and responsible cross-browser fallbacks are injected directly into the agent's context window, enabling it to generate clean, modern code instantly.+> [!TIP]+> Note: We use `npx` to ensure the content doesn't go stale, but the CLI works offline, completely private and local.+> The NPM package is self-contained, with no extra dependencies to ensure both low-latency and supply-chain security.-Token-efficient, targeted, and private guidance injected right into the context window. Yeah, buddy.+## <img src=".github/img/package.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Alternative Installation Methods-## Get started+<details>+<summary><b>Vercel Skills CLI</b> (aka <code>npx skills</code>)</summary>```shell-npx modern-web-guidance@latest install+npx skills add GoogleChrome/modern-web-guidance```+</details>-This will run a quick interactive wizard to install the modern-web-guidance-skill to your preferences, and for your configured agents.--### Not ready to install? All good. Search our guides manually+<details>+<summary><b>GitHub CLI</b></summary>```shell-# Search for relevant guides-npx modern-web-guidance@latest search "animate a dialog modal backdrop"-# Retrieve a guide by ID-npx modern-web-guidance@latest retrieve "animate-to-from-top-layer"+gh skill install GoogleChrome/modern-web-guidance```+</details>-### Alternative installation methods--#### Vercel `skills` CLI: `npx skills add GoogleChrome/modern-web-guidance`--#### Google Antigravity: `agy plugin install https://github.com/GoogleChrome/modern-web-guidance`+<details>+<summary><b>Google Antigravity</b></summary>-#### GitHub CLI: `gh skill install GoogleChrome/modern-web-guidance`+```shell+agy plugin install https://github.com/GoogleChrome/modern-web-guidance+```+</details>-#### GitHub Copilot CLI:+<details>+<summary><b>GitHub Copilot CLI</b></summary>```shell/plugin marketplace add GoogleChrome/modern-web-guidance/plugin install modern-web-guidance@googlechrome```+</details>-#### Claude Code plugin--We don't recommend this method, but it will work.+<details>+<summary><b>Claude Code Plugin</b></summary>```shell/plugin marketplace add GoogleChrome/modern-web-guidance/plugin install modern-web-guidance@googlechrome-/plugin # Select GoogleChrome marketplace, hit enter, enable AutoUpdate+/plugin # Select GoogleChrome marketplace, press enter, enable AutoUpdate/reload-plugins```+</details>-## Updating+## <img src=".github/img/refresh-cw.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Updating-If you installed the skill using `npx modern-web-guidance@latest install`, then you can update with this command:--```sh-# Update all installed skills-npx modern-web-guidance@latest update-```+If you installed the skill using `npx modern-web-guidance@latest install`, you can update with: `npx modern-web-guidance@latest update`.Otherwise, consult your agent's documentation for updating plugins and skills.-## Evals to prove this works well ;)--Every piece of guidance in this pack isn't just a tutorialβit is **empirically proven and continuously calibrated** to guarantee AI agents write better code. We test every guide using an automated quality-assurance harness to ensure correct agent behavior.+## <img src=".github/img/shield-check.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Evals to prove this works well ;)-### Validation Pipeline+We developed a robust eval harness to ensure that the content is **empirically proven and continuously calibrated** to guarantee AI agents write better code. We run automated evaluations using a closed-loop validation pipeline:```- [ SME-Authored Guidance ]+ [ Expert-authored guidance and demo ]ββΌ- [ Gemini CLI Generator ] ββ> Playwright Grader (.spec.ts) & Calibrated Negative Demo (.html)+ [ Generated assets ] ββ> Playwright Grader (.spec.ts) & Negative Demo (.html)ββΌ- [ Calibration Loop ] βββββββ> Runs Grader on Gold-Standard Demo (Must Pass 100%)+ [ Calibration loop ] βββββββ> Runs Grader on Gold-Standard Demo (Must Pass 100%)β Runs Grader on Negative Demo (Must Fail 100%)βΌ- [ E2E Agent Evals ] ββββββββ> Runs coding agents in Guided vs. Unguided modes- Compares accuracy pre/post guide injection to prove impact+ [ E2E agent evals ] ββββββββ> Runs coding agents in Guided vs. Unguided modes+ Compares accuracy w/ and w/o guide injection to prove impact```-### 1. Real-World, Outcome-Based Assertions--For each guide, we develop a Playwright script (`.spec.ts`) that asserts the guide's implementation details were followed, such as:+0. **Simulated Developer Tasks**: We define realistic, intent-based developer prompts (in `tasks/task.md`) that mimic real-world requests (e.g., "make my images load faster"). These prompts avoid naming specific APIs or features, testing whether the agent can successfully discover and implement the correct modern patterns solely by reading the guide.+1. **Outcome-Based Assertions**: We write browser automation scripts that verify the guide was followed correctly: exact runtime behaviors, computed styles, and accessibility states.+2. **Self-Healing Calibration**: Graders are calibrated against both a reference implementation (100% pass target) and a control page (0% pass target). The agent automatically refines tests on failure.+3. **E2E Testing**: We measure coding agent performance on real tasks with and without guidance. The _opportunity_ (100% - unguided pass rate) and _uplift_ (guided - unguided pass rate) are key. If there's little opportunity, then models already do a great job and our guidance isn't providing much value. Based on the results, we revise guides to maximize the uplift, optimizing their effectiveness.-* Verifying accessibility tags and computed styles (e.g., `@media (prefers-contrast: more)` overrides).-* Asserting exact functional layouts and performance behaviors as interpreted by the browser.+### Recent eval results-### 2. Self-Healing Playwright Calibration+| Suite | Agent + Model | Tasks | Unguided β Guided (Uplift) |+| :--- | :--- | :---: | :---: |+| Nightly (May 17) | β codex_cli (gpt-5.5) | 75 | 37% β 65% (**+28%**) |+| Nightly (May 17) | β± claude_code (opus-4-7) | 75 | 54% β 85% (**+31%**) |+| Nightly (May 16) | β codex_cli (gpt-5.5) | 75 | 49% β 82% (**+33%**) |+| Nightly (May 16) | β± claude_code (opus-4-7) | 75 | 51% β 86% (**+35%**) |+| Nightly (May 15) | β codex_cli (gpt-5.5) | 74 | 52% β 81% (**+29%**) |+| Nightly (May 15) | β± claude_code (opus-4-7) | 74 | 53% β 82% (**+29%**) |+| Nightly (May 14) | β codex_cli (gpt-5.5) | 68 | 54% β 86% (**+32%**) |+| Nightly (May 14) | β± claude_code (opus-4-7) | 68 | 54% β 91% (**+37%**) |+| Nightly (Apr 30) | β± claude_code (opus-4-6) | 66 | 44% β 81% (**+37%**) |+| Nightly (Apr 28) | β± claude_code (opus-4-6) | 66 | 41% β 77% (**+36%**) |-To ensure our test suites aren't nonsense, the pipeline runs a continuous, closed-loop calibration:-* **Golden Master vs. Anti-Pattern**: We run our per-usecase Playwright scripts against both a perfect reference implementation (`demo.html`, expects 100% pass) and a deliberately flawed implementation (`negative-demo.html`, expects 0% pass).-* **Autonomous Refinement**: If calibration fails, the generator automatically retries with detailed failure context until the grader achieves 100% calibration.+## <img src=".github/img/boxes.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Available Skill Packs-Last, we validate that the calibrated graders aren't taking shortcuts and honor the sanctity of the intent.+You can customize which skill packs are installed using the `--choose` flag:-### 3. E2E Agent Evals for Every Guide--Finally, we run end-to-end evaluations on real base applications:+```shell+npx modern-web-guidance@latest install --choose+```-* **Unguided (Control)**: The agent addresses a coding task using only its default training data.-* **Guided (Experiment)**: The agent addresses the exact same task, but with access to this skill pack.+* **`modern-web-guidance`** (~234 tokens): Comprehensive guidance on modern browser APIs, layouts, and performance.+* **`chrome-extensions`** (~181 tokens): Guidance on Manifest V3, background workers, extension APIs, and Chrome Web Store publishing.-We grade both outputs and only release guides that demonstrate a massive, quantifiable improvement in code quality (e.g., improving success rates from **20% up to 90%**).+## <img src=".github/img/lock.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Telemetry & Privacy-# Available Skills+Google collects anonymous usage statistics (such as search queries, guide retrievals, and installation) to improve the reliability, relevance, and performance of the tool. You can inspect what is collected in [modern-web.ts](https://github.com/GoogleChrome/modern-web-guidance-src/blob/main/serving/bin/modern-web.ts).-If you want to customize the skill packs installed and the scope at which they are installed, you can run install with `--choose`.+> [!TIP]+> **To Opt-Out:**, set the `DISABLE_TELEMETRY=1` env variable in your shell profile (e.g., `.bashrc` or `.zshrc`):+> ```bash+> export DISABLE_TELEMETRY=1+> ```-* **`modern-web-guidance`**: (234 tokens) Everything mentioned above-* **`chrome-extensions`**: (181 tokens) Manifest V3 development, background service workers, content scripts, and extension APIs. Manage Chrome Web Store metadata, permissions justifications, privacy policies, and publishing readiness.+Google handles this data in accordance with the [Google Privacy Policy](https://policies.google.com/privacy).-```sh-# Choose which skills you want-npx modern-web-guidance@latest install --choose-```+## <img src=".github/img/users.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Contributors-## Usage Statistics & Opt-Out+Active contributors are what keep this project moving forward. Thanks to everyone who has contributed!-Google collects anonymous usage statistics (such as search queries, guide retrievals, and installation) to improve the reliability, relevance, and performance of the Modern Web Guidance tool. See [modern-web.ts](https://github.com/GoogleChrome/modern-web-guidance-src/blob/main/serving/bin/modern-web.ts) to see exactly what data is collected.+<a href="https://github.com/GoogleChrome/modern-web-guidance/graphs/contributors">+ <img src="https://contrib.rocks/image?repo=GoogleChrome/modern-web-guidance" />+</a>-Data collection is enabled by default. You can opt-out completely at any time (suppressing all local console telemetry warnings, search/retrieve metric dispatches, and installation telemetry) by setting the `DISABLE_TELEMETRY=1` environment variable in your shell profile (e.g., `.bashrc` or `.zshrc`):+(We build the project in the [modern-web-guidance-src](https://github.com/GoogleChrome/modern-web-guidance-src) repo.)-```bash-export DISABLE_TELEMETRY=1-```+## <img src=".github/img/file-text.svg" width="24" height="24" style="vertical-align: middle; margin-right: 4px;"> Attribution-Google handles this data in accordance with the [Google Privacy Policy](https://policies.google.com/privacy).+Portions of the documentation in this project are derived from [MDN Web Docs](https://developer.mozilla.org/) by Mozilla Contributors, and [W3C](https://www.w3.org/) specifications.diff --git a/assets/modern-web-guidance.svg b/assets/modern-web-guidance.svgnew file mode 100644index 0000000..bc833f4--- /dev/null+++ b/assets/modern-web-guidance.svg@@ -0,0 +1,14 @@+<svg width="48" height="48" viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg">+<path d="M94.4908 270C81.9373 270 72.0185 266.357 64.7343 259.07C57.6052 251.783 54.0406 242.015 54.0406 229.767V203.87C54.0406 198.134 52.4908 193.793 49.3911 190.847C47.6208 188.983 42.651 187.679 37.9582 186.936C33.5944 186.244 30 182.614 30 178.196L30 169.801C30 165.382 33.5932 161.755 37.9622 161.097C42.6538 160.391 47.6213 159.153 49.3911 157.382C52.4908 154.281 54.0406 149.863 54.0406 144.126V118.233C54.0406 105.984 57.6052 96.217 64.7343 88.9302C72.0185 81.6434 81.9373 78 94.4908 78C98.638 78 102 81.362 102 85.5092V95.5133C102 98.6334 99.4707 101.163 96.3506 101.163C91.2362 101.163 86.9742 103.023 83.5646 106.744C80.155 110.31 78.4502 115.116 78.4502 121.163V144.359C78.4502 151.956 77.1328 158.002 74.4982 162.498C72.3229 166.306 68.8954 169.16 64.2156 171.059C63.0171 171.546 62.1771 172.677 62.1771 173.97C62.1771 175.291 63.0524 176.437 64.2839 176.914C68.9288 178.712 72.3335 181.573 74.4982 185.498C77.1328 189.839 78.4502 195.886 78.4502 203.638V226.837C78.4502 232.884 80.155 237.69 83.5646 241.256C86.9742 244.977 91.2362 246.837 96.3506 246.837C99.4707 246.837 102 249.367 102 252.487V262.491C102 266.638 98.638 270 94.4908 270Z" fill="#4285F4"/>+<path d="M205.509 270C218.063 270 227.982 266.357 235.266 259.07C242.395 251.783 245.959 242.015 245.959 229.767V203.87C245.959 198.134 247.509 193.793 250.609 190.847C252.379 188.983 257.349 187.679 262.042 186.936C266.406 186.244 270 182.614 270 178.196L270 169.801C270 165.382 266.407 161.755 262.038 161.097C257.346 160.391 252.379 159.153 250.609 157.382C247.509 154.281 245.959 149.863 245.959 144.126V118.233C245.959 105.984 242.395 96.217 235.266 88.9302C227.982 81.6434 218.063 78 205.509 78C201.362 78 198 81.362 198 85.5092V95.5133C198 98.6334 200.529 101.163 203.649 101.163C208.764 101.163 213.026 103.023 216.435 106.744C219.845 110.31 221.55 115.116 221.55 121.163V144.359C221.55 151.956 222.867 158.002 225.502 162.498C227.677 166.306 231.105 169.16 235.784 171.059C236.983 171.546 237.823 172.677 237.823 173.97C237.823 175.291 236.948 176.437 235.716 176.914C231.071 178.712 227.667 181.573 225.502 185.498C222.867 189.839 221.55 195.886 221.55 203.638V226.837C221.55 232.884 219.845 237.69 216.435 241.256C213.026 244.977 208.764 246.837 203.649 246.837C200.529 246.837 198 249.367 198 252.487V262.491C198 266.638 201.362 270 205.509 270Z" fill="#4285F4"/>+<rect x="102" y="270" width="96" height="24" rx="8" fill="#4285F4"/>+<path d="M150 6C169.882 6 186 22.1177 186 42C186 46.208 185.275 50.2464 183.948 54H190C194.418 54 198 57.5817 198 62V70C198 74.4183 194.418 78 190 78H110C105.582 78 102 74.4183 102 70V62C102 57.5817 105.582 54 110 54H116.052C114.725 50.2464 114 46.208 114 42C114 22.1177 130.118 6 150 6ZM150 30C143.373 30 138 35.3726 138 42C138 48.6274 143.373 54 150 54C156.627 54 162 48.6274 162 42C162 35.3726 156.627 30 150 30Z" fill="#4285F4"/>+<path d="M146.322 128.816C147.022 124.803 152.782 124.803 153.482 128.816L157.712 153.076C157.828 153.742 158.558 154.103 159.158 153.792L171.548 147.36C174.698 145.725 178.084 149.11 176.449 152.26L170.017 164.646C169.705 165.246 170.067 165.976 170.733 166.092L194.989 170.323C199.002 171.023 199.002 176.784 194.989 177.484L170.733 181.713C170.067 181.829 169.705 182.559 170.017 183.159L176.449 195.547C178.083 198.697 174.698 202.082 171.548 200.447L159.158 194.014C158.558 193.703 157.828 194.064 157.712 194.73L153.482 218.991C152.782 223.004 147.022 223.004 146.322 218.991L142.09 194.733C141.974 194.067 141.244 193.706 140.644 194.017L128.261 200.447C125.111 202.082 121.726 198.697 123.361 195.547L129.79 183.16C130.102 182.56 129.741 181.83 129.075 181.714L104.815 177.484C100.801 176.784 100.801 171.023 104.815 170.323L129.075 166.091C129.741 165.975 130.102 165.245 129.79 164.646L123.361 152.26C121.725 149.11 125.111 145.725 128.261 147.36L140.644 153.789C141.244 154.1 141.974 153.739 142.09 153.073L146.322 128.816Z" fill="#FBBC04"/>+<path d="M146.322 128.816C147.022 124.803 152.782 124.803 153.482 128.816L157.712 153.076C157.828 153.742 158.558 154.103 159.158 153.792L171.548 147.36C174.698 145.725 178.084 149.11 176.449 152.26L170.017 164.646C169.705 165.246 170.067 165.976 170.733 166.092L194.989 170.323C199.002 171.023 199.002 176.784 194.989 177.484L170.733 181.713C170.067 181.829 169.705 182.559 170.017 183.159L176.449 195.547C178.083 198.697 174.698 202.082 171.548 200.447L159.158 194.014C158.558 193.703 157.828 194.064 157.712 194.73L153.482 218.991C152.782 223.004 147.022 223.004 146.322 218.991L142.09 194.733C141.974 194.067 141.244 193.706 140.644 194.017L128.261 200.447C125.111 202.082 121.726 198.697 123.361 195.547L129.79 183.16C130.102 182.56 129.741 181.83 129.075 181.714L104.815 177.484C100.801 176.784 100.801 171.023 104.815 170.323L129.075 166.091C129.741 165.975 130.102 165.245 129.79 164.646L123.361 152.26C121.725 149.11 125.111 145.725 128.261 147.36L140.644 153.789C141.244 154.1 141.974 153.739 142.09 153.073L146.322 128.816Z" fill="url(#paint0_linear_97_4458)"/>+<defs>+<linearGradient id="paint0_linear_97_4458" x1="158.942" y1="148.664" x2="130.37" y2="186.761" gradientUnits="userSpaceOnUse">+<stop stop-color="#FBBC04"/>+<stop offset="1" stop-color="#E37400"/>+</linearGradient>+</defs>+</svg>diff --git a/gemini-extension.json b/gemini-extension.jsonindex 2c26d87..6a8bb6e 100644--- a/gemini-extension.json+++ b/gemini-extension.json@@ -1,7 +1,7 @@{"name": "modern-web-guidance","description": "Keep your coding agent up to date with the latest web best practices",- "version": "0.0.161",+ "version": "0.0.162","author": {"name": "Google Chrome"}diff --git a/package.json b/package.jsonindex bbf8520..7443572 100644--- a/package.json+++ b/package.json@@ -3,7 +3,7 @@"displayName": "Modern Web Guidance","description": "Keep your agent up to date on the latest web best practices.","license": "Apache-2.0",- "version": "0.0.161",+ "version": "0.0.162","publisher": "GoogleChrome","engines": {"vscode": "^1.90.0",