--- name: project-guides description: Best practices for authoring and reviewing guidance. Use this skill any time you're writing or reviewing `guide.md`, `expectations.md`, or `demo.html` files. --- # Stage 2: Authoring guidance for a use case (Needs guidance) This is the second of three stages in creating guidance: 1. Stage 1: Identifying use cases for a feature 2. Stage 2: Authoring guidance for a use case (you are here) 3. Stage 3: Evaluating guidance for a use case > **Governance & Review**: See [`GOVERNANCE.md`](../../../GOVERNANCE.md) and [`docs/ATLS.md`](../../../docs/ATLS.md) for authoring permissions (Peers fast-track to Stage 2; every guide requires Peer/ATL authorship and category Content ATL approval before merging). ## What a real-world coding agent sees 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 reference or eval infrastructure: | File/Directory | Purpose | Seen by real-world agents? | |---|---|---| | `guide.md` | Guidance for implementing the use case | ✅ Yes — this is the only file | | `demo.html` | Canonical standalone reference implementation used for Stage 2 validation and review | ❌ No | | `expectations.md` | Verification criteria used to generate target evaluation tasks | ❌ No | | `targets//patches/*-solution.patch` | Multi-agent golden diffs against clean base apps used to calibrate the grader | ❌ No | | `targets//patches/zero-passrate.patch` | Calibration baseline diff (empty on almost every guide, i.e., the untouched starting app) used to verify grader checks fail when requirements are not implemented | ❌ No | | `targets//grader.ts` | Playwright grader run against the eval agent's output | ❌ No | | `targets//task.md` | Simulated developer prompt fed to the eval agent by the harness | ❌ No | **Implication for Stage 2 authoring (`guide.md`, `demo.html`, & `expectations.md`):** Stage 2 ends at `guide.md`, `demo.html`, and `expectations.md` (self-validated with the [`project-guide-validation`](../project-guide-validation/SKILL.md) skill). `task.md`, the solution patches, and `grader.ts` are generated downstream in Stage 3 by `gd dev` (see [`src/harness/README.md`](../../../src/harness/README.md)); people can hand-edit them, and agents only when a person asks. Never change `guide.md` just to fit a grader; if a grader needs something the guide doesn't require, fix the grader (see [project-evals](../project-evals/SKILL.md)). **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 `expectations.md`, any target patch, or any external link to understand how to implement the use case. **MANDATORY RULES FOR WRITING `guide.md`:** ### 1. YAML Frontmatter Schema `guide.md` must start with this YAML frontmatter structure (added in **Stage 1**): ```yaml --- name: slugified-use-case-name description: (e.g., "Create dynamic color systems using modern color syntax") web-feature-ids: - webstatus-feature-id --- ``` * **web-features**: Must be a list of accurate IDs found via webstatus.dev. Include ALL features referenced in the guide body, not just the primary one (validation enforces this for macros). If an ID is missing, inform the USER. * **Pending Features (`tmp-` prefix)**: If a feature ID is pending upstream in `@web-platform-dx/web-features` (e.g. an open issue), use `tmp-` (e.g. `tmp-scroll-axis-lock`) in `guide.md` AND register it in `features/pending-web-features.json` along with its upstream issue link. Optionally add `group` (a web-features group ID like `scrolling`, or an array of them) so ATL triage routes it to that group's owner in `.github/atls.json` (then run `node src/ci/generate-feature-to-groups.ts`), and `compat_features` (a `@mdn/browser-compat-data` key or array of keys, e.g. `["css.properties.scroll-axis-lock"]`) so CI can detect when the feature graduates upstream even if `web-features` chooses a different final ID than ``. On the GitHub `new-feature` issue itself, annotate the predicted final ID **without** the `tmp-` prefix (``); the sync and triage scripts automatically strip `tmp-` when matching guides to issues. When the feature ID is officially released upstream in `web-features`, validator checks will automatically fail in CI to prompt updating the frontmatter to the official ID. * **draft** (optional): Withholds the guide from all distribution without deleting it. Omit to publish. Must be one of: * `stub`: placeholder with outline/author notes; skips the H1 and Baseline checks. * `wip`: being written. * `blocked`: held back by the platform/spec situation. Requires `draft-reason` (one line, link the deciding issue/PR). ### 2. Tone and Formatting * **Formatting Directives:** Use strict imperative directives (`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 (`MANDATORY` is emphasis, not a required tag on every graded step). Coding agents respond best to rigid constraints when they are selectively applied. * **Focus & Token Economy (Teach Only the Course-Correction Delta):** Keep the guidance focused on the specific use case and short. No fluff or conversational text. Cut reference-style syntax enumeration and textbook explanations of Baseline Widely Available features that coding agents already know (e.g., how `