# Pack builders

A **pack** is a reusable implementation. It reads the meaning a project has authored and turns it into files: controllers, entities, DTOs, SDKs, config, docs. Packs never redefine meaning; they _represent_ it.

This section is for people who write packs. If you only want to use packs, read [Find and use packs](/docs/usage/packs). If you want to describe software, read [Authoring](/authoring).

```mermaid
flowchart LR
    A["Authored meaning<br/>(Runtime IR)"] --> S["Selection<br/>which subjects?"]
    S --> C["Bounded context<br/>only the paths a template reads"]
    C --> T["Templates<br/>Jinja · Handlebars · Liquid · Mustache"]
    T --> F["Planned files<br/>paths, symbols, dependencies"]
    F --> D["Diff you approve"]
```

## The mental model

1. **Selections** pick canonical subjects (every `schema`, every `operation` with an HTTP facet, every `property.enum`).
2. **Templates** are files on disk. Each one is bound to a selection and decides where its output goes (`output.name`, `output.path`, `output.symbol`).
3. **Context** is what a template can read. The engine never hands a template the whole model. It analyses the template, learns which context paths it reads, validates them against the vocabulary, and projects _only those paths_.
4. **Composition** lets packs `provide` and `need` capabilities (`schema.validation`, `schema.persistence`) that a project binds together.
5. **Actions** are explicit commands (format, install) the client runs after generation. The engine plans them; it never runs them.

Everything is deterministic and explainable. A generated file can always be traced back to the selection, template and context that produced it.

## Where to go next

| You want to                                | Read                                                                                                  |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| Make something work in ten minutes         | [Build your first pack](/pack-builders/first-pack)                                                    |
| Know every key of `dryv.pack.yaml`         | [Pack anatomy](/pack-builders/anatomy)                                                                |
| See which values a template can read       | [Context overview](/pack-builders/context/overview) and the [catalog](/pack-builders/context/catalog) |
| Understand `is`, `has_*`, `*_json` helpers | [Derived values](/pack-builders/context/derived)                                                      |
| Wire packs together                        | [Composition and bindings](/pack-builders/design/composition-and-bindings)                            |
| Run commands after generation              | [Actions and commands](/pack-builders/design/actions)                                                 |
| Prove and ship a pack                      | [Test and publish](/pack-builders/test-and-publish)                                                   |

## Discover context from the terminal

You never have to guess a path. The CLI asks the engine:

```bash
dryv context list                                         # every root and type
dryv context show "schema.fields[].value.is.boolean"     # what one path reads, with provenance
dryv context show "schema.fields[].value.generated.schema_validation" --json
```

> [!NOTE]
> `dryv context` needs a CLI that includes it (0.1.0 or newer built from this repository). If your shell says `unknown command 'context'`, you are running an older global install: see [CLI for pack builders](/pack-builders/cli).
