Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

modern-web-guidance

БесплатноБез исполняемых скриптовНе проверен

Apply Chrome's Modern Web Guidance to frontend code, then verify the built page in a real browser with agent-browser. Use when asked to build or modernize UI…

vercel-labsот vercel-labs★ 54 950 звёзд на GitHub

Об этом скилле

Modern Web Guidance

Modern Web Guidance is a set of guides from Chrome that describe how to build common UI with current web platform features, including Baseline compatibility data. Its CLI returns guidance and can statically scan source files for legacy patterns. It does not load or run the page, so it cannot tell you whether the result works.

Use Modern Web Guidance to decide what to write and agent-browser to check the built page in Chrome. Finish only after every rule you applied has a browser check with recorded evidence.

Get the guidance

Search for the task, then retrieve the guides that match. You do not need to install anything; npx runs the CLI directly.

npx modern-web-guidance@latest search "animate a dialog"
# [{"id":"animate-to-from-top-layer","description":"Animate elements such as dialogs, popovers, and tooltips as they're entering/exiting the top layer."}, ...]

npx modern-web-guidance@latest retrieve "dialog"
npx modern-web-guidance@latest retrieve "dialog,animate-to-from-top-layer"
npx modern-web-guidance@latest list

retrieve accepts one ID or several comma-separated IDs. When the text is larger than 9,500 bytes and standard output is not a file, the CLI saves it to a file in the system temporary directory and prints only its path, for example Output (12.1 KB, 220 lines) saved to .../mwg-guide-49624-1794420750850.md. Read that whole file before you write code. To choose the location, redirect the output to a file, which receives the full guide:

npx modern-web-guidance@latest retrieve "dialog" > dialog.md

To find existing code that a guide would replace, run the static scan on the source directory. It reads files only:

npx modern-web-guidance@latest legacy-scan ./src --json
npx modern-web-guidance@latest legacy-scan ./src --guide dialog

The scan has rules for only part of the guidance (33 guides in version 1.0.0), so a result with no findings does not mean the code already follows every guide.

Modern Web Guidance also ships its own agent skill (npx modern-web-guidance@latest install). Installing it is optional and interactive; this workflow only needs search and retrieve.

Write the code from the guidance instead of pasting guide text into the project. Cite the guide ID in the report so a reviewer can retrieve the same guide.

Workflow

  1. Retrieve. Search and retrieve the guides for the task. Write down each rule you intend to apply, with its guide ID.
  2. Baseline. If you are changing existing UI, run the matching browser check below before you edit, so you have a number or snapshot to compare against.
  3. Apply. Implement the guidance in the project's code.
  4. Verify. Serve the built page and run the matching check for every rule. A rule without a browser check stays unverified.
  5. Report. List each rule with its result and evidence, as described in the report section below.

Use the project's own dev or preview server. The examples use http://localhost:3000; replace it with the page you changed.

Layout shift

Use for guides that reserve space for images, embeds, fonts, or late content (for example performance).

agent-browser vitals http://localhost:3000/products
# url: http://localhost:3000/products
# ttfb: 1.4ms  fcp: 56ms  lcp: 56ms  cls: 0.23  inp: -
agent-browser vitals http://localhost:3000/products --json

vitals navigates to the URL, waits for the load event and then three more seconds for shifts to settle, and reports metrics for that load. Without a URL it reloads the current tab, so client-side state such as an open dialog is lost. In the JSON output, data.cls.score is the total and data.cls.entries lists each shift with its startTime in milliseconds and value. Match the largest entry's time to the code that runs then.

Pass when cls is at most 0.1 (the "good" Core Web Vitals threshold) and lower than the baseline. cls: 0 with an empty entries array means the load recorded no shifts. Run the check against the same URL before and after the change.

Reduced motion

Use for guides that animate UI and respect prefers-reduced-motion (for example motion, animate-to-from-top-layer, spinner).

agent-browser open http://localhost:3000/account
agent-browser set media reduced-motion
agent-browser eval "matchMedia('(prefers-reduced-motion: reduce)').matches"
# true
agent-browser eval "getComputedStyle(document.querySelector('dialog')).transitionDuration"
# "0.1s"
agent-browser set media
agent-browser eval "getComputedStyle(document.querySelector('dialog')).transitionDuration"
# "0.3s"

set media with no arguments sets both the color scheme and reduced motion back to no-preference. Read the same computed property under each preference; replace the selector and property with the element and the CSS the guide changes (transitionDuration, animationName, transform). Pass when the value

Полный SKILL.md на GitHub

Установить modern-web-guidance в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash(agent-browser:*)
Bash(npx modern-web-guidance@latest:*)

FAQ

Что делает скилл modern-web-guidance?

Apply Chrome's Modern Web Guidance to frontend code, then verify the built page in a real browser with agent-browser. Use when asked to build or modernize UI with web platform best practices, follow Modern Web Guidance or Baseline guidance, or check that a change fixed layout shift, respects reduced motion or the color scheme, or gives a dialog correct focus and inert behavior. Triggers include "use modern web guidance", "modern web best practices", "fix layout shift", "respect reduced motion", "add dark mode", "build an accessible dialog", and "verify this against the guide".

Как установить скилл modern-web-guidance?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл modern-web-guidance запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить modern-web-guidance с