Modern web guidance skill

Search tool for modern web development best practices.

by GoogleChrome·Apache-2.0 license·★ 2,407 Stars on the repo·GitHub ↗

Use now

Files of Modern web guidance

GoogleChrome/main1 file shown
SKILL.md
Show the full text124 lines

Modern Web Guidance

A skill to search for specific web development use cases and retrieve their corresponding best practice guides.

When to use

Must use this skill:

  • At the start of implementing any web feature.
  • Before creating a new component, to check if a standardized pattern already exists.
  • To avoid implementing ad-hoc solutions or loading large dependencies unnecessarily.

Usage Instructions

Step 1. Search Use Cases

Search with an action-oriented query summarizing what you want to achieve using the search command. Run modern-web-guidance directly with npx.

npx -y modern-web-guidance@latest search "<query>" --skill-version 2026_09_04-7de96777

Example Output:

[
  {
    "id": "optimize-image-priority",
    "description": "Optimize the loading priority of Largest Contentful Paint (LCP) candidate images.",
    "category": "performance",
    "featuresUsed": [ "Fetch priority" ],
    "tokenCount": 985,
    "similarity": 0.7289
  },
  {
    "id": "defer-rendering-heavy-content",
    "description": "Reduce rendering times in content-heavy web pages by deferring rendering for offscreen content.",
    "category": "performance",
    "featuresUsed": [ "content-visibility", "hidden=\"until-found\"" ],
    "tokenCount": 1250,
    "similarity": 0.6961
  }
]

Note: If search results are vague, return no matches, or show low similarity scores, run the list command to browse all guides:

npx -y modern-web-guidance@latest list

Step 2. Retrieve Best Practices

Once you have a relevant id from the search results, call this script using the retrieve command to get the full guide. You can pass multiple IDs separated by commas.

npx -y modern-web-guidance@latest retrieve "<id>"

If the output is truncated, you must repeat the command but redirect to a file and read that file.

Example Output: The markdown content of the guide describing implementation steps...


Step 3. Verify Guidance Compliance

When generating or modifying code, cross-check the implementation against the retrieved guide before concluding:

  • Applicable Guidance & Fallbacks: Ensure the relevant modern patterns and necessary fallback strategies from the guide are correctly applied, without forcing unrequested features.
  • Task Fulfillment: Confirm that the implementation fully satisfies the user's request.

Using npx / pnpx

  • Prefer pnpx over npx if pnpm is available (note: pnpx does not use the -y flag).
  • When requesting tool permissions, allowlist npx -y modern-web-guidance@latest * specifically (or pnpx modern-web-guidance@latest *), never bare npx * or pnpx *.
  • IMPORTANT: on Windows, using npx may fail. Use npx.cmd ... instead.
  • Fetching and running modern-web-guidance requires outbound network access. If running in a sandboxed, permission-gated, or approval-based environment (e.g., Codex, Claude Code), proactively request approval/allowlisting for the command with network access BEFORE executing it the first time, avoiding sandbox network timeouts.
  • In sandboxed environments where ~/.npm is read-only or restricted, set NPM_CONFIG_CACHE=/tmp/npm-cache.
  • If the command hangs due to being offline, try running again in offline mode: npx --offline ….
  • The --skill-version flag is used to determine if this SKILL.md is out of date. If it is, a warning message is logged to stderr.

Guidelines

  • Always search first to find the most relevant guides.
  • These guides are usually framework-agnostic; adapt them correctly to your setup.
  • Do not hallucinate guides or ignore them; they represent the preferred local standard for the user's project.

Interpreting Browser Support & Fallbacks

  • Default Behavior: All guides assume Baseline Widely available features are safe to use without fallbacks. For features that are not Baseline widely available, you MUST follow the fallback recommendations in the guide, unless the user has specified a custom browser support policy.

  • Custom Policies: If the user has already defined explicit browser support requirements, use the browser compatibility data in the guide to determine if a fallback can be safely ignored.

    • For Baseline YYYY targets, a feature satisfies this target if its "Baseline since" date is <= YYYY.
    • Policy Examples:
      • "Do not implement feature fallbacks." (for exploratory prototypes of the cutting-edge web)
      • "Safari 17.4+" (for internal tools targeting macOS or Tauri-based desktop apps)
      • "Never recommend or implement polyfills; if a Baseline Newly Available feature is required for core functionality, provide a lightweight custom fallback or redesign the approach." (to minimize bundle size and avoid technical debt)
      • "Assume a modern execution environment where Baseline Newly Available features can be used natively, provided they are strictly feature-detected and degrade gracefully." (for progressive enhancement strategies)
  • Reactive Policy Discovery: Watch for environmental cues to suggest documenting a policy in CLAUDE.md or AGENTS.md. Suggest this if the developer:

    • Mentions building for a restricted runtime (e.g., Electron or Tauri).
    • Explicitly excludes specific targets (e.g., "we don't support Desktop Chrome").
    • Expresses hesitation about polyfill complexity, bundle size, or performance cost.
    • Questions if a feature is safe to use without fallbacks.

    No defined policy format. This is an example: **Browser Support:** Allow Newly Available features, but only adopt custom fallback code that adds <= 20 lines and does not require external dependencies.

1---
2name: modern-web-guidance
3description: |
4 Search tool for modern web development best practices. MANDATORY: Execute FIRST for all HTML/CSS and clientside JS tasks. Do NOT skip — web APIs evolve rapidly and training weights contain obsolete patterns.
5 
6 Trigger immediately for:
7 - UI/Layout: Modals, dialogs, popovers, Glassmorphism/backdrop-filters, anchor positioning, container queries, `:has()`, `:user-valid`.
8 - Scroll/Motion: View Transitions, Scroll-driven animations, scroll parallax/reveals.
9 - Performance: CWV (LCP, INP), content-visibility, Fetch Priority, image optimization.
10 - System/APIs: Local filesystem access, WebUSB, WebSockets sync, WebAssembly widgets.
11 - Frameworks: Adapting layout/styles in React, Vue, Angular.
12 - General Frontend: Forms, autofill, advanced inputs, custom scrollbars, modern component states, etc.
13 
14 DO NOT trigger for:
15 - Backend: Database SQL, ORMs, Express API routes.
16 - Pipelines: CI/CD deployment, Docker, Actions.
17 - Generic: Local scripts (Python/Go tools), ESLint, Git.
18---
19 
20# Modern Web Guidance
21 
22A skill to search for specific web development use cases and retrieve their corresponding best practice guides.
23 
24## When to use
25 
26Must use this skill:
27- At the **start** of implementing any web feature.
28- Before creating a new component, to check if a standardized pattern already exists.
29- To avoid implementing ad-hoc solutions or loading large dependencies unnecessarily.
30 
31## Usage Instructions
32 
33### Step 1. Search Use Cases
34 
35Search with an action-oriented query summarizing what you want to achieve using the `search` command. Run `modern-web-guidance` directly with `npx`.
36 
37```sh
38npx -y modern-web-guidance@latest search "<query>" --skill-version 2026_09_04-7de96777
39```
40 
41**Example Output**:
42```json
43[
44 {
45 "id": "optimize-image-priority",
46 "description": "Optimize the loading priority of Largest Contentful Paint (LCP) candidate images.",
47 "category": "performance",
48 "featuresUsed": [ "Fetch priority" ],
49 "tokenCount": 985,
50 "similarity": 0.7289
51 },
52 {
53 "id": "defer-rendering-heavy-content",
54 "description": "Reduce rendering times in content-heavy web pages by deferring rendering for offscreen content.",
55 "category": "performance",
56 "featuresUsed": [ "content-visibility", "hidden=\"until-found\"" ],
57 "tokenCount": 1250,
58 "similarity": 0.6961
59 }
60]
61```
62 
63> **Note**: If search results are vague, return no matches, or show low similarity scores, run the `list` command to browse all guides:
64> ```sh
65> npx -y modern-web-guidance@latest list
66> ```
67 
68---
69 
70### Step 2. Retrieve Best Practices
71 
72Once you have a relevant `id` from the search results, call this script using the `retrieve` command to get the full guide. You can pass multiple IDs separated by commas.
73 
74```sh
75npx -y modern-web-guidance@latest retrieve "<id>"
76```
77 
78If the output is truncated, you must repeat the command but redirect to a file and read that file.
79 
80**Example Output**:
81`The markdown content of the guide describing implementation steps...`
82 
83---
84 
85### Step 3. Verify Guidance Compliance
86 
87When generating or modifying code, cross-check the implementation against the retrieved guide before concluding:
88- **Applicable Guidance & Fallbacks**: Ensure the relevant modern patterns and necessary fallback strategies from the guide are correctly applied, without forcing unrequested features.
89- **Task Fulfillment**: Confirm that the implementation fully satisfies the user's request.
90 
91## Using npx / pnpx
92 
93- Prefer `pnpx` over `npx` if `pnpm` is available (note: `pnpx` does not use the `-y` flag).
94- When requesting tool permissions, allowlist `npx -y modern-web-guidance@latest *` specifically (or `pnpx modern-web-guidance@latest *`), never bare `npx *` or `pnpx *`.
95- IMPORTANT: on Windows, using `npx` may fail. Use `npx.cmd ...` instead.
96- Fetching and running `modern-web-guidance` requires outbound network access. If running in a sandboxed, permission-gated, or approval-based environment (e.g., Codex, Claude Code), **proactively request approval/allowlisting for the command with network access BEFORE executing it the first time**, avoiding sandbox network timeouts.
97- In sandboxed environments where `~/.npm` is read-only or restricted, set `NPM_CONFIG_CACHE=/tmp/npm-cache`.
98- If the command hangs due to being offline, try running again in offline mode: `npx --offline …`.
99- The `--skill-version` flag is used to determine if this SKILL.md is out of date. If it is, a warning message is logged to stderr.
100 
101## Guidelines
102 
103- Always search **first** to find the most relevant guides.
104- These guides are usually framework-agnostic; adapt them correctly to your setup.
105- Do not hallucinate guides or ignore them; they represent the preferred local standard for the user's project.
106 
107## Interpreting Browser Support & Fallbacks
108 
109* **Default Behavior**: All guides assume **Baseline Widely available** features are safe to use without fallbacks. For features that are not Baseline widely available, you **MUST** follow the fallback recommendations in the guide, unless the user has specified a custom browser support policy.
110* **Custom Policies**: If the user has already defined explicit browser support requirements, use the browser compatibility data in the guide to determine if a fallback can be safely ignored.
111 - For Baseline YYYY targets, a feature satisfies this target if its "Baseline since" date is <= YYYY.
112 - **Policy Examples**:
113 - _"Do not implement feature fallbacks."_ (for exploratory prototypes of the cutting-edge web)
114 - _"Safari 17.4+"_ (for internal tools targeting macOS or Tauri-based desktop apps)
115 - _"Never recommend or implement polyfills; if a Baseline Newly Available feature is required for core functionality, provide a lightweight custom fallback or redesign the approach."_ (to minimize bundle size and avoid technical debt)
116 - _"Assume a modern execution environment where Baseline Newly Available features can be used natively, provided they are strictly feature-detected and degrade gracefully."_ (for progressive enhancement strategies)
117* **Reactive Policy Discovery**: Watch for environmental cues to suggest documenting a policy in CLAUDE.md or AGENTS.md. Suggest this if the developer:
118 - Mentions building for a restricted runtime (e.g., Electron or Tauri).
119 - Explicitly excludes specific targets (e.g., "we don't support Desktop Chrome").
120 - Expresses hesitation about polyfill complexity, bundle size, or performance cost.
121 - Questions if a feature is safe to use without fallbacks.
122 
123 No defined policy format. This is an example: `**Browser Support:** Allow Newly Available features, but only adopt custom fallback code that adds <= 20 lines and does not require external dependencies.`
124 

Discussion

Alternatives

Animation vocabularyReverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.Design & UI · MITPlaywright BrowserHeadless, reproducible browser automation with Playwright for any project — screenshots of web pages or local dev servers (desktop/tablet/mobile, full page or one element, single page or every page/menu of an app in one batch), frontend audits (console errors, failed requests, broken images/links, responsive overflow, axe accessibility, LCP/CLS performance), before/after visual comparison, scripted E2E flows (log in, click, fill, page through, assert), and logged-in pages via saved sessions. Use this whenever the user wants to screenshot or visually check a site, find frontend bugs, see how a page looks on mobile, compare the UI before and after a CSS/code change, reproduce a bug from an issue or ticket and capture evidence images for it, verify a UI flow works, or run/write a browser test — even if they never say "Playwright" or "browser". If Claude in Chrome could also do the job, briefly ask which to use (with a recommendation) instead of silently picking.Coding · MITAct as an electron frontend developerGuide users in building a desktop application using Electron with a focus on frontend development best practices.Coding · CC0-1.0AI builderThis AI builder will create a fully functional website based on the provided details the website will be ready to publish or deployInfrastructure & ops · CC0-1.0