# State the architecture you expect

Intent turns architectural decisions into rules Enola can show before an edit and verify after it.

> Web page: https://enola.tech/docs/intent
> All pages: https://enola.tech/llms.txt

## Choose where to declare intent

Repository intent lives in `enola-intent.yaml`. A cluster can declare the same schema beside its repository list and override a repository file wholesale. A Markdown decision page can opt in with an `enola_intent:` frontmatter block; Enola reads that block, not the page body.

A repository declaration can name the service, the seams it consumes and serves, its layer order outermost first, and the external dependencies it expects:

enola-intent.yaml:

```yaml
service:
  name: backend
  description: order and payment API
consumes:
  - {repo: payments, via: http}
serves:
  - {via: http, description: public REST API}
layers:
  - {name: handlers, paths: ["app/handlers/**"]}
  - {name: domain, paths: ["app/domain/**"]}
  - {name: storage, paths: ["app/storage/**"]}
dependencies:
  - {name: jwt, ecosystem: rubygems, purpose: "token verification", safety_path: true}
```

Layer paths are repository-relative exact paths or `prefix/**` subtrees. Run `enola constraints lint` to see how many measured modules each layer selects before enforcing it.

Components and rules are constraints: they live in `enola-intent.yaml` or `enola/constraints/*.yaml`, never on a page. See [Policy as Code](https://enola.tech/docs/constraints.md).

To have your coding agent propose a declaration, use the [enola-intent skill](https://enola.tech/docs/skill-intent.md). For a worked example, see [How to Enforce Architecture Rules for AI Coding Agents](https://enola.tech/blog/architecture-rules-ai-coding-agents).

## Find the rules for a change

| Question | Tool |
| --- | --- |
| Which declarations cover this target? | `governing_intent` |
| Which rules, exemptions, and guidance apply? | `constraints_for` |
| What would these paths or this patch affect? | `plan_check` or `enola plan` |

Check planned paths:

```shell
enola plan --paths internal/auth,internal/api
```

## Choose how each rule behaves

| Mode | Behavior |
| --- | --- |
| `ratchet` | Default. Existing debt can remain; new violations fail the check. |
| `advisory` | Reports evidence without failing the check. |
| `strict` | Any violation fails unless it is recorded in the suppression ledger. |

Exemptions name specific allowed violations and remain visible. Guidance gives advice before an edit; it is not a violation.

## Understand the evidence limits

Enola evaluates declarations against the graph it extracted. Unsupported syntax, dynamic behavior, generated code, or missing provider facts can leave relationships unseen. Receipts record extractor and provider provenance; coverage reports show unresolved boundaries.

> Enola checks declared intent against facts in the snapshot. Review the evidence and coverage before treating a missing relationship as proof that none exists.

## Use the canonical reference for authoring

For the declaration schema, page frontmatter, vocabularies and how intent findings are graded, read [INTENT.md](https://github.com/enola-labs/enola/blob/main/docs/INTENT.md). Components, the 21 rule forms, recipes, modes and exemptions are covered on [Policy as Code](https://enola.tech/docs/constraints.md) and in [CONSTRAINTS.md](https://github.com/enola-labs/enola/blob/main/docs/CONSTRAINTS.md). Provider contracts are in [PROVIDERS.md](https://github.com/enola-labs/enola/blob/main/docs/PROVIDERS.md).
