Modern Web Guidance Skill · Development

Modern Web Guidance Skill for AI Coding Agents (Unofficial Offline Edition)

An unofficial Modern Web Guidance skill that helps AI agents write modern HTML, CSS and JS offline, with an optional CLI lookup and telemetry turned off.

  • HTML & CSS
  • Accessibility
  • Core Web Vitals
  • Works Offline

About This Skill

Modern Web Guidance steers coding agents toward native web platform features (dialog, popover, container queries, :has(), view transitions, :user-invalid, fetchpriority) instead of legacy patterns and heavy libraries. This edition is based on the modern-web-guidance skill and guides by the Google Chrome team (GoogleChrome/modern-web-guidance-src, CC BY 4.0). It adds an offline checklist drawn from the upstream guides, a precise trigger, telemetry disclosure with an opt-out, pinned CLI versions, and a verification step. It is an unofficial edition, not affiliated with Google.

What we changed from the original

Based on modern-web-guidance by Google Chrome team (GoogleChrome) (CC-BY-4.0 (skill and guide text); Apache-2.0 (code, not included)). Unofficial edition; the original and its license notice are credited in the download.

AreaOriginalOur edition
TriggerMarked itself MANDATORY to run first for every HTML, CSS and client-side JS task, with a long keyword list.Lists the phrases users actually say plus a When NOT to use section (typo and copy edits, renames, backend, build config, native apps), and applies only to the browser-side part of mixed tasks.
Offline coreGave no guidance without running the npx CLI, so it did nothing offline or in sandboxes without network.Adds references/offline-core.md, a paraphrased checklist from the upstream guides (HTML, overlays, CSS architecture, layout, forms, accessibility, dark mode, motion, performance, sanitizer, framework adaptation); the CLI becomes an optional deeper lookup.
Privacy and telemetryRan npx without mentioning that the CLI sends usage telemetry to Google by default.Asks before the first network or npx call, discloses what is collected (query text, guide ids, agent name, OS), and recommends DISABLE_TELEMETRY=1 on every command.
Version pinningAlways ran modern-web-guidance@latest, so behavior could change between runs.Gets the published version with npm view, has the user approve it, and pins that exact version for the session.
Output formatRequired a self-promoting '### Modern Web Guidance' section, with verbatim quotes, at the end of every answer that used it.Drops the required section. A guide id is cited only when that guide was actually read and used, and nothing is said when it did not apply.
VerificationAsked the agent to cross-check code against the retrieved guide, with no runtime checks.Adds a checklist with pass conditions: Baseline status lookup, feature detection and fallbacks, keyboard pass, console errors, reduced motion, dark mode and performance audit, and lists any checks that could not be run.
BoundariesTold the agent to request network approval proactively and gave no other stop points.Adds stop points before npx use, before adding dependencies or polyfills, before large legacy-scan edits, and before writing a browser-support policy into AGENTS.md or CLAUDE.md.
Example and installShowed query examples but no complete task, and gave only CLI-based install instructions.Adds a full worked example (light-dismiss confirmation dialog with fallback, plus how to check it), a guide-id index, and copy-folder install paths for Antigravity, Claude Code and Codex.

Quick Start

  1. 1Download the skill (1 credit) and unzip the modern-web-guidance folder.
  2. 2Copy the folder into your skills directory: Antigravity ~/.gemini/config/skills/ (or .agents/skills/ in a project), Claude Code ~/.claude/skills/, Codex ~/.agents/skills/.
  3. 3Ask your agent for a front-end change, e.g. "add a delete confirmation dialog that closes when I click outside". The offline checklist is used automatically.
  4. 4Optional: if you want the full upstream guides, approve the CLI when the agent asks. It suggests DISABLE_TELEMETRY=1 and a version pin you choose.

Core Capabilities

Native-first UI patterns

Uses <dialog> with showModal(), popover, invoker commands and anchor positioning instead of hand-rolled modals, focus traps and z-index fixes.

Modern CSS layout

A decision path for flexbox, grid, subgrid and container queries, plus :has(), @layer, @scope, logical properties and light-dark() theming.

Forms that validate politely

Native constraints, :user-invalid styling, correct autocomplete and inputmode tokens, and accessible error messages linked with aria-describedby.

Core Web Vitals rules

LCP image priority, lazy loading below the fold, image dimensions against CLS, and scheduler.yield() to break up long tasks for INP.

Ask-first CLI and telemetry opt-out

Works offline by default. The optional npm CLI runs only after you approve it, with DISABLE_TELEMETRY=1 and a pinned version.

Baseline-aware verification

Checks each newer feature's Baseline status, adds feature detection and fallbacks, then runs keyboard, console, reduced-motion and dark-mode checks.

Usage Examples

Input

Add a delete-confirmation popup to the settings page. It should close if I click outside it.

Output

The agent writes a <dialog closedby="any"> opened with showModal(), a visible Cancel button, a <form method="dialog"> to return the choice, and a feature-detected backdrop-click fallback for browsers without closedby. It then confirms that Esc, a backdrop click and the Delete button behave correctly and that focus returns to the trigger.

Input

Our product page has a bad LCP and the layout jumps while images load. Fix it.

Output

The agent marks the hero <img> with fetchpriority="high" and removes loading="lazy" from it, adds loading="lazy" and width/height to below-the-fold images, adds sizes to every srcset, defers non-critical scripts, and reports before/after results if Lighthouse is available.

Input

Show password-field errors only after the user has typed something, not on page load.

Output

The agent uses required, minlength and pattern, styles errors with :user-invalid instead of :invalid, shows text errors linked through aria-describedby only while the field is invalid, validates on blur or submit, and focuses the first invalid field when a submit fails.

SKILL.md

---
name: modern-web-guidance
description: Write browser-side HTML, CSS and client-side JavaScript with modern, standards-based web platform features (native dialog/popover, container queries, :has(), view transitions, :user-invalid validation, lazy loading, fetchpriority, light-dark(), scheduler.yield) instead of legacy patterns or extra libraries, using an offline checklist drawn from the Google Chrome team's Modern Web Guidance guides, with the optional modern-web-guidance CLI for deeper lookups. Use when the user asks to build or change a web UI component, layout, animation, form, dark mode, overlay, accessibility fix, Core Web Vitals (LCP, INP, CLS) fix, HTML sanitization, or to "modernize" or "audit for legacy patterns" in front-end code. Do NOT use for typo or copy edits, renames, backend code (SQL, ORMs, API routes), build/CI/Docker config, lint or test setup, native mobile apps, or non-web languages. Asks before any network or npx call and discloses CLI telemetry. Unofficial Antigravity Skills edition.
---

# Modern Web Guidance (unofficial edition)

Coding agents often reach for old patterns (div-based modals, JS validation on every keystroke, media queries for everything, heavy polyfills) because training data is full of them. This skill steers you toward native platform features, with fallbacks only where browser support requires them.

It works in two tiers:

1. **Offline core (always):** `references/offline-core.md` — a paraphrased checklist from the upstream guides. No network needed.
2. **CLI lookup (optional, ask first):** the `modern-web-guidance` npm CLI searches and retrieves the full upstream guides. It needs network access and sends usage telemetry to Google by default. See `references/cli-lookup.md`.

| Read | When |
| --- | --- |
| `references/offline-core.md` | Every task this skill covers. Read the sections that match the task. |
| `references/baseline-and-verification.md` | Choosing whether a feature needs a fallback; checking your result 

Frequently Asked Questions

FAQ

Is this the official Modern Web Guidance skill?
No. It is an unofficial edition by Antigravity Skills, based on the modern-web-guidance skill and guides by the Google Chrome team (GoogleChrome/modern-web-guidance-src), licensed CC BY 4.0. It is not affiliated with or endorsed by Google. For the official version, see developer.chrome.com/docs/modern-web-guidance.
What did you change from the original?
The original requires an npx CLI lookup before any HTML, CSS or JS task and adds a fixed section to every answer. This edition adds an offline checklist drawn from the upstream guides, a narrower trigger that skips trivial and backend work, an ask-first rule for the CLI with telemetry disclosed and switched off, a pinned version instead of @latest, a verification checklist, and a full worked example.
Does it send data anywhere?
Not by itself. The offline checklist is plain Markdown. The optional upstream CLI downloads from npm and, by default, sends usage telemetry to Google (search query text, guide ids, agent name, OS). The skill asks you before the first CLI call and recommends DISABLE_TELEMETRY=1.
Do I need Node.js or network access?
No, not for the core checklist. Node.js, npm and network access are only needed if you approve the optional CLI for deeper guide lookups or a legacy-pattern scan.
Will it add fallbacks or polyfills to my project?
By default it treats Baseline Widely available features as safe and adds the guide's fallback or feature detection for newer ones. If you state a browser-support policy, it follows that. It asks before adding any new dependency or polyfill package.

Discussion

Discussion

0 comments
U

Trigger Phrases

Use these phrases to activate this skill in your AI coding assistant:

add a modal dialog that closes when I click outsidemake this card grid responsiveadd dark mode to the siteshow form errors only after the user typesanimate between pages with view transitionsfix our LCP and layout shiftmodernize our CSS and remove legacy patternssanitize this user HTML before inserting it