# FACET > FACET (Feature-Anchored Canonical Executable Truth) keeps one machine-readable YAML record per product feature next to the code. Source files point to their record with an `@facet:` comment, and `facet lint` checks both directions. Notes for AI agents that read this site and write FACET records. The record schema is the authority, not this page and not a summary from a search engine. Check every record you write against it, and run `facet lint` before you call it done. ## Sources - [Record schema (JSON Schema)](https://github.com/facet-framework/core/blob/main/schema/facet.schema.json): the fields that exist and the ones that are required - [Specification](https://github.com/facet-framework/core/blob/main/docs/framework/FACET.md) - [Authoring guide](https://github.com/facet-framework/core/blob/main/docs/AUTHORING.md): how to write a record - [Record schema, explained](https://facet-framework.com/en/docs/schema/) - [CLI reference](https://facet-framework.com/en/docs/cli/) - [Guides](https://facet-framework.com/en/guides/), with a runnable example in [facet-framework/examples](https://github.com/facet-framework/examples). Each guide is also Markdown beside its page: append `index.md` to its address, as in https://facet-framework.com/en/guides/write-down-what-a-feature-does/index.md - [This file with every English guide in full](https://facet-framework.com/llms-full.txt) ## A valid record ```yaml schema_version: "0.1" id: checkout/discounts/redeem-code lifecycle: active intent: summary: A customer enters a discount code in the cart and gets its discount, or a reason why not. contract: scenarios: - id: expired-code-is-refused statement: | Given the code SPRING5, whose last day is 2026-05-31 When a customer redeems it after 23:59:59 UTC on that day Then the shop refuses it with E2002 and the cart keeps its price - id: one-code-per-order statement: | Given a cart that already has a code When the customer enters a second code Then the shop refuses it with E2004 verification: unit_tests: - id: tests/discount.test.ts proves: [expired-code-is-refused, one-code-per-order] lineage: owner: team: checkout created_at: "2026-11-22" ``` ## Do - Start with `facet init` in the project root. Do not hand-build the folder layout. - Required fields: `schema_version`, `id`, `intent.summary`, `contract.scenarios` (each with `id` and `statement`), `lineage.owner`, `lineage.created_at`. - `id` has three kebab-case segments, `domain/capability/feature`. Take domain and capability from the project's `docs/facets/taxonomy.yaml` when one exists, or ask. - Name each scenario after what it promises (`expired-code-is-refused`). Write the statement as Given / When / Then text. - Set `lifecycle: active` only when the implementing code carries `@facet: `. Otherwise use `planned`. - List a scenario under `proves:` only if that test actually checks it. - Take owners, dates, error codes and test paths from the project. Leave an optional field out when nothing in the project supports it. ## Don't - Do not invent ids, owners, teams, tests or tickets. A plausible value that nobody can confirm is worse than a missing one. - Do not number ids (`SCEN-01`, `RULE-01`). Ids are stable names, not positions. - Do not use fields the schema does not have, such as `status` (it is `lifecycle`), `intent.owner` (it is `lineage.owner`), `contract.rules`, `verification.tests`, or separate `given` / `when` / `then` keys. - Do not put prose rules under `contract.business_rules`. It references decision tables in a model file. A rule written in words is a scenario. - Do not write a record from a description of FACET alone. Read the code the feature lives in, and anchor it.