> ## Documentation Index
> Fetch the complete documentation index at: https://docs.basemode.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Standards

> Protocols that inject when you edit a matching file rather than when you type a keyword, how to see what is loaded, and how to prove one will fire before you rely on it.

A standard is a protocol that fires on a file rather than on a prompt. Where a domain matches what you typed, a standard matches what you are about to edit, and it injects on mutating operations rather than on every turn.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base standards list
base standards get midas-security
```

`base std` is the short alias.

## Where they come from

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base standards sync
base standards sync --source docs/protocols.md
```

**Why it works.** Standards are authored in a `protocols.md` source and synced into `standards.toml` plus the graph. That is deliberately different from rules, which you add one at a time from the command line: a standard is usually a document that already exists, and the sync is what turns it into something that fires.

**The gotcha.** There is no `base standards add`. If you want a new standard, write it into the protocols source and sync. Reaching for `add` and finding nothing is the most common first stumble here.

## Proving one will fire

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base standards test src/auth.rs
base standards test src/auth.rs --content "adding a login handler"
```

**Why it works.** This is a dry run of the matcher against a real file. It prints the scores and what would inject, and it writes nothing and sends nothing.

`--content` simulates the payload of an actual edit, which matters because a standard can match on what you are writing as well as on which file you are writing it to.

**The gotcha.** Test before you rely on one. A standard that does not fire is indistinguishable from a standard that fired and had nothing to say, and this command is the only thing that separates them.

## Seeing what is loaded

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base standards list
```

Every standard with its trigger and annotation counts. A standard with zero triggers will never fire, which is worth noticing before you spend an afternoon wondering why.

`base standards get <id>` shows one in full.

## Where standards fit

| Mechanism     | Fires on                                     | Configured in                             |
| ------------- | -------------------------------------------- | ----------------------------------------- |
| Domain rules  | Prompt keywords, file keywords, active paths | `domains.toml`, content in the graph      |
| Standards     | A file being edited, on mutating operations  | `standards.toml`, from a protocols source |
| Star commands | A `*word` you type                           | `commands.toml`                           |

Three mechanisms, three different moments. Standards are the one that reaches you while you are changing something rather than while you are asking about it.

## Next

<CardGroup cols={2}>
  <Card title="Rules and domains" icon="filter" href="/guides/rules-and-domains">
    The keyword-triggered half of the same idea.
  </Card>

  <Card title="Context reference" icon="sliders" href="/reference/context">
    Every `base standards` verb and flag.
  </Card>
</CardGroup>
