# One glossary for your product terms, checked by FACET in every pull request

> Define your product's key words once in a FACET glossary, let the check warn when a record misspells a term and fail when a term gets a second meaning, and read the definitions in FACET Atlas.

Source: https://facet-framework.com/en/guides/one-glossary-your-checks-enforce/  
Last updated: 2026-11-26T23:28:23+01:00

A customer complains that the discount code `SPRING5` was refused although "the order was over 25 euros". Support looks at the order total, which includes shipping, and agrees. The developer says the minimum is checked against the subtotal, before discount and shipping. The help article says "order value". Three words for amounts that are not the same, and each person reads the other two as their own.

FACET keeps a short, checkable description of each feature, called a record, next to your code and tells you when code and description drift apart. By the end of this guide the shop's money words are defined once, in one glossary file next to the records. `npx facet lint` warns in every pull request when a record spells a defined term differently, and fails when the same term gets a second meaning. FACET Atlas, the browser app for reading FACET records, shows each term with its definition and the records that use it.

The commands below use the example shop from [“One answer instead of three”](https://facet-framework.com/en/guides/write-down-what-a-feature-does/). In your own project, start with the two or three words that cause the most misunderstandings.

## Define each word once

The glossary lives next to the records, in `docs/facets/glossary.yaml`. Save this there:

```yaml
schema_version: "0.1"
categories:
  - id: money
    title: Money
    purpose: Amounts the shop computes on a cart or an order.
terms:
  - term: Subtotal
    category: money
    definition: |
      The sum of all line items in the cart, before any discount and before shipping.
      The minimum order value of a discount code is checked against it.
  - term: Total
    category: money
    definition: |
      What the customer pays: the Subtotal minus the discount, plus shipping.
```

- **`term`** is the exact word as records should write it. Matching is case-sensitive and whole-word: `Subtotal` and `subtotal` are different words to FACET.
- **`definition`** says what the word means and how it differs from its neighbours. What the shop does with the amount belongs in the records.
- **`categories`** group terms, and each term names at most one category. They are optional; a short glossary works without them.

## Let the check find spellings that miss the term

```sh
npx facet lint
```

![Terminal output of npx facet lint: a warning says subtotal in contract.scenarios minimum-order-value is not a defined glossary term, did you mean Subtotal; another warning lists two test files no record names, invoice.test.ts and refund.test.ts; 0 errors, 2 warnings.](https://facet-framework.com/guides/one-glossary-your-checks-enforce/lint-near-miss-light.png)

*The record writes the term in lower case, so it does not link to its definition.*

The existing discount-code record says `When the cart subtotal is below that value`. That is almost the term, but not exactly, so nothing links it to the definition. FACET reads `intent.summary` and every scenario statement of every record and reports each word that is a different case or a small typo away from a defined term.

Open `docs/facets/features/checkout/discounts/redeem-code.yaml` and change the line in the scenario `minimum-order-value` to:

```text
When the cart Subtotal is below that value
```

Run the check again:

```sh
npx facet lint
```

The summary now ends with `0 error(s), 1 warning(s) (unclaimed-tests 1)`: the glossary warning is gone, and only the note about unclaimed test files from “One answer instead of three” remains.

## Keep one meaning per word

A month later someone adds "Subtotal" again at the end of the glossary, meaning the amount with shipping:

```yaml
terms:
  # Subtotal and Total from step 1 stay here
  - term: Subtotal
    category: money
    definition: |
      The order value including shipping.
```

```sh
npx facet lint
```

![Terminal output of npx facet lint: an error says term Subtotal is defined more than once, merge the definitions into one entry or give the second term a name of its own; summary 1 error, 1 warning.](https://facet-framework.com/guides/one-glossary-your-checks-enforce/lint-duplicate-light.png)

*A second definition of the same term is an error.*

This one is an error, and the command exits with status 1, so the pull request that adds it fails. Remove the second entry. If the team really needs a word for the amount with shipping, give it its own name, as `Total` already does.

## Read the glossary in Atlas

Atlas, the FACET reader, starts from the npm package. In the shop's folder, run:

```sh
npx facet-framework ui
```

The first run asks `Download and start? [y/N]` before it downloads Atlas; answer `y`. Later runs start without asking.

Atlas opens in the browser. Click **Glossary**:

![FACET Atlas, Glossary tab: 2 domain terms, a filter for the category Money, and the terms Subtotal with its definition and 1 record, and Total with its definition and 0 records.](https://facet-framework.com/guides/one-glossary-your-checks-enforce/atlas-glossary-light.png)

*Each term with its definition and the number of records that use it.*

Support, product and new colleagues read the same definitions here without opening YAML. `Subtotal` shows `1 record`: the discount-code record that uses the exact spelling since step 2.

## Commit the glossary so every pull request checks it

```sh
git add docs/facets/glossary.yaml docs/facets/features/checkout/discounts/redeem-code.yaml
git commit -m "Define Subtotal and Total in the glossary"
```

The workflow from [“One answer instead of three”](https://facet-framework.com/en/guides/write-down-what-a-feature-does/) runs `facet lint` on every pull request. A spelling that misses a term shows up there as a warning; a term defined twice, or a term naming a category that does not exist, fails the run.

> **What this does not do**
>
> FACET does not find synonyms: "order value" or "basket total" in a record are not reported, because they are not
> spelled like a defined term. In this release only single-word terms are checked for near misses; a term with a space,
> such as "Store credit", is defined and shown, but "store credit" in a record is not reported. Knowledge answers are
> not checked, and help articles or code comments outside the records are not read at all.

## If the check says something else

- **`"…" in contract.scenarios … is not a defined glossary term — did you mean "…"?` for an ordinary word:** a common word like "total" in normal prose now looks like a misspelled term. Either write the term as defined wherever you mean it, or define only words that are terms of art in your product.
- **`term "…" is defined more than once`:** two entries share the same `term`. Merge them, or give the second one its own name.
- **`term "…" names category "…", which the glossary does not declare`:** the category id is misspelled or was deleted. The message lists the declared categories; correct the term or declare the category.
- **No glossary warnings at all, although a record misspells a term:** check that the file is called `docs/facets/glossary.yaml`. Without the file, no glossary check runs.

For more on teams that need the same words for the same things, read the [page for distributed teams](https://facet-framework.com/en/solutions/distributed-teams/).

### Sources

- [FACET Core on GitHub](https://github.com/facet-framework/core)
- [FACET Atlas on GitHub](https://github.com/facet-framework/atlas)
