一键导入
project-guides
// Best practices for authoring guidance. Use this skill any time you're writing or reviewing `guide.md` files.
// Best practices for authoring guidance. Use this skill any time you're writing or reviewing `guide.md` files.
| name | project-guides |
| description | Best practices for authoring guidance. Use this skill any time you're writing or reviewing `guide.md` files. |
This is the second of three stages in creating guidance:
When a developer asks an AI coding assistant to implement something, the assistant retrieves the relevant guide.md via a RAG (vector search) system. guide.md is the only project file a real-world coding agent ever sees. Everything else in a use case directory is eval infrastructure:
| File | Purpose | Seen by real-world agents? |
|---|---|---|
guide.md | Guidance for implementing the use case | ✅ Yes — this is the only file |
demo.html | Reference implementation used to calibrate the grader | ❌ No |
negative-demo.html | Incorrect implementation used to verify the grader catches failures | ❌ No |
expectations.md | Source used to generate grader.ts | ❌ No |
grader.ts | Playwright tests run against the eval agent's output | ❌ No |
tasks/task.md | Simulated developer prompts and base application name fed to the eval agent by the harness | ❌ No |
Implication for demo.html: Because real agents never see demo.html, it does not need to be a polished, production-ready example. It just needs to be a correct, minimal implementation that the grader can pass against. Do not over-engineer it.
Implication for guide.md: Because guide.md is the agent's only source of truth, it must be entirely self-contained. Do not rely on agents reading demo.html, expectations.md, or any external link to understand how to implement the use case.
MANDATORY RULES FOR WRITING guide.md:
guide.md must start with this YAML frontmatter structure (added in Stage 1):
---
name: slugified-use-case-name
description: <do thing> <with feature> (e.g., "Create dynamic color systems using modern color syntax")
web-feature-ids:
- webstatus-feature-id
---
MANDATORY:, DO, DO NOT) only when emphasis is strictly needed (e.g., for critical constraints, security, or common pitfalls). Do not overuse them for every single instruction. Coding agents respond best to rigid constraints when they are selectively applied.[link text](url)). All required knowledge to use the feature MUST be fully synthesized into the markdown body. Agents must not be slowed down or require additional resources to implement the guidance.<!-- Always use the required attribute -->).import/export) in JavaScript code examples; avoid CommonJS (require).2rem or 50ms) as example-only in comments to avoid them being mistaken for strict technical constraints.MANDATORY if they are truly required for the feature to function. Optional steps (e.g., adding scroll snap, adding an event listener for progressive enhancement) must be labeled as optional. Incorrect use of MANDATORY causes agents to implement unnecessary complexity.demo.html or any other file — agents won't have access to them. Everything the agent needs to implement the use case must be in guide.md.{{ FEATURE_FALLBACKS("feature-id") }} (preferred) or {{ BASELINE_STATUS("feature-id") }}. Do not place either at the top of the document.
FEATURE_FALLBACKS even when no features/<feature-id>.md exists yet — it gracefully degrades to just the baseline status, and any shared fallback content added later flows in automatically without a guide-side edit.BASELINE_STATUS directly only when you need the BCD-key second argument: {{ BASELINE_STATUS("feature-id", "bcd.key") }}. This is useful when a critical sub-feature's status differs from the overall feature status.CSS.supports(), if ('feature' in window)) and graceful degradation techniques.HTMLElement.prototype (e.g., 'onbeforematch' in HTMLElement.prototype) over window or document, as it is more reliable.| Macro | What it emits |
|---|---|
{{ BASELINE_STATUS("feature-id"[, "bcd.key"]) }} | "Baseline since YYYY-MM-DD" or "limited availability". |
{{ INCLUDE("path[#section]") }} | Whole markdown file (frontmatter + leading # H1 stripped) or one section (its heading dropped). Bare paths resolve from repo root; .//../ resolve relative to the calling file. |
{{ FEATURE("feature-id", "section") }} | Sugar for INCLUDE("features/<feature-id>.md#<section>"). |
{{ FEATURE_FALLBACKS("feature-id") }} | ### Fallbacks & browser support for <Feature name> + BASELINE_STATUS + the #fallbacks section. If #fallbacks is empty, emits only BASELINE_STATUS (no heading). |
{{ FEATURE_ISSUES("feature-id") }} | ### Issues to be aware of when using <Feature name> + the #issues section. Returns "" if #issues is empty/missing. |
MacroError (build fails loudly). Missing referenced content (file or section) → silent "", so guides can reference content that doesn't exist yet.### Fallback strategies → fallback-strategies), or an explicit {#id} suffix on the heading.features/When the same feature-level content (intro, fallback patterns, a11y, gotchas) applies to multiple guides, extract it into features/<feature-id>.md and pull it in with the macros above. Rule of thumb: extract if two or more guides cover the same web-feature-id and repeat the same advice. Standard section names: ## Fallbacks (used by FEATURE_FALLBACKS), ## Issues (used by FEATURE_ISSUES); add others as needed and pull them with FEATURE. Verify your include resolved by inspecting the build output (serving/build/guides/<category>/<id>.md) — silent misses won't fail the build.
expectations.md and demo.htmlexpectations.md: Write a natural language, bulleted list of assertions that must be true if an agent implements the guide.md correctly. (e.g., "The input element is styled with a red border only AFTER a blur event").demo.html: The demo.html file should be a clean example of a correct implementation of the use case. If possible, it should be self-contained with inline scripts and styles.Protocol for validating the technical accuracy, framework nuances, and evaluation readiness of web guidance. Use this skill when assigned to validate or review a guide, demo, or expectations file.
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. Trigger immediately for: - UI/Layout: Modals, dialogs, popovers, Glassmorphism/backdrop-filters, anchor positioning, container queries, `:has()`, `:user-valid`. - Scroll/Motion: View Transitions, Scroll-driven animations, scroll parallax/reveals. - Performance: CWV (LCP, INP), content-visibility, Fetch Priority, image optimization. - System/APIs: Local filesystem access, WebUSB, WebSockets sync, WebAssembly widgets. - Frameworks: Adapting layout/styles in React, Vue, Angular. - General Frontend: Forms, autofill, advanced inputs, custom scrollbars, modern component states, etc. DO NOT trigger for: - Backend: Database SQL, ORMs, Express API routes. - Pipelines: CI/CD deployment, Docker, Actions. - Generic: Local scripts (Python/Go tools), ESLint, Git.
Best practices for creating use cases for a given feature. This is the first step in creating a new guide. Use this skill any time you're writing or reviewing a use case under the guides/ directory.
Build and publish Chrome Extensions using Manifest V3 best practices. Use this skill whenever the user asks to create, modify, debug, or understand Chrome browser extensions, add-ons, or anything involving the Chrome Extensions API. Trigger on mentions of: 'Chrome extension', 'browser extension', 'manifest.json', 'content script', 'service worker' (in browser context), 'popup' (in browser extension context), 'side panel', 'chrome.* API', 'declarativeNetRequest', 'omnibox', 'context menu' (in extension context), or any request to build functionality that integrates with the Chrome browser UI. Also trigger for publishing to the Chrome Web Store: 'publish extension', preparing an extension for publishing, responding to a review rejection, writing permission justifications, or drafting a privacy policy.
Compiling C and C++ for the modern web using WebAssembly. Use this skill when you need to port C++ code, build C++ libraries with Emscripten, or set up high-performance C++ components in the browser.
A skill for implementing passkey in web applications. You MUST use this skill whenever a user asks about passkey registartion, passkey authentication or passkey management. It defines the required database schema, API usage, and security best practices.