
# Your app's feature map: features.toml and agc features

Ship a `features.toml` next to `agentcloud.toml` and Agent Cloud keeps a map of what a person can do with your app: its journeys, features and the parts your checks prove. `agc features` shows each feature's maturity and coverage; `agc features --timeline` shows how the app grew.

Success: `agc ship` ends live, and `agc features` answers the map with `data.release`, `data.features` and each feature's `maturity` and `coverage`.

## Execution contract

- **Before starting:** a linked app folder. The map is on unless `agentcloud.toml` sets `[features] map = false`.
- **Do:** write `features.toml` by the shape below, add `proves` to the checks that prove a part, run `agc check`, then `agc ship`.
- **Success:** `agc check` passes with no `features.invalid`; after the ship, `agc features` answers the map.
- **If blocked:** on `features.invalid`, fix each entry in `data.problems` and run `agc check` again.
- **Human handoff:** none.

## Ask your agent

```text
Write our app's feature map from a user's point of view, link our checks to
the parts they prove, ship it, and tell me which features still need care.
```

The agent answers with each feature's maturity and how many of its parts are proven.

## What goes in features.toml?

Everything is written from the user's side: what a person can do, never how the code does it.

```text
summary = "Book summer camps for your kids in two taps."

[[stage]]                       # the order a person moves through the app
id = "book"
name = "Book"
does = "Pick a camp week and pay for it."

[[journey]]                     # a path a person takes, as feature ids in order
id = "first-booking"
name = "Book a first camp"
steps = ["checkout"]

[[feature]]
id = "checkout"
stage = "book"                  # a stage id, or "underneath" for work every journey relies on
name = "Checkout"
story = "Pay for a camp week once."
summary = "A parent pays for a chosen week and gets a confirmation."
ways = [{ kind = "button", how = "Book this week on the camp page" }]
try = [{ do = "Click Book this week", see = "A payment form with the week's price" }]

[[feature.part]]                # one thing the feature does that can be proven on its own
id = "checkout.no-double-booking"
name = "A week can't be booked twice for one child"
```

The rules:

- A top-level `summary`; `[[stage]]` with `id`, `name`, `does`, in the order a person moves through the app; `[[journey]]` with `id`, `name`, `steps` (feature ids, in order).
- `[[feature]]` with `id`, `stage`, `name`, `story` and `summary`, and optional `ways`, `try` and `gotchas`. `story` is one sentence of at most 120 characters.
- Each `ways` entry has a `kind` (`page`, `button`, `link`, `url`, `email`, `command` or `background`) and a `how`. Each `try` step has a `do` and a `see`.
- Ids are lowercase words joined by hyphens, each used once among its kind of table. A part's id starts with its feature's id and a dot.

## How do checks prove a part?

`[[check.smoke]]`, `[[check.invariant]]`, `[[check.browser]]` and `[[verify]]` take an optional `proves`, a list of part ids:

```toml
[[check.smoke]]
name = "a second booking for the same week is refused"
proves = ["checkout.no-double-booking"]
steps = ["POST /api/bookings {week: 1, child: 7} -> 409"]
```

An id that names no part doesn't stop the ship: `data.warnings` names the check and the id.

Once a release is live, each part has a state at that release:

| State | Meaning |
|---|---|
| `proven` | A check that proves it ran and passed, and none failed |
| `failing` | A check that proves it ran and failed |
| `reported` | No proving check ran, but a browser verification of this release's code (`agc verify`) that went with the ship speaks for it |
| `untested` | Otherwise, including a check skipped by its `after` or `until` |

## How do I read the map?

```bash
agc features                     # the map at the latest stored release
agc features checkout            # one feature, by id or name
agc features --release v12       # the map at v12
agc features --timeline          # how the map grew, release by release
agc features --export            # the stored map as a features.toml
```

`agc features` answers `data.release` (its version, when it went live, who shipped it, and whether the map was shipped or carried forward), `data.summary`, `data.stages`, `data.journeys`, `data.features` and `data.releases`. Each feature has its `maturity` and `reason`, its `coverage` (proven and failing parts out of all its parts) and its `parts`, each with its `state` and the check results behind it.

`--timeline` answers `data.timeline`: the app's live releases, oldest first, each with the features that arrived or retired and the parts added, changed, removed, proven or failing. Releases that left the map unchanged fold into one `unchanged` row.

`--export` answers the map in `data.toml`, which a terminal prints as the file. Save it at the app's root and ship it.

## What does a feature's maturity mean?

The first of these that holds:

| Maturity | When | Example `reason` |
|---|---|---|
| `not_built` | The release's map doesn't have it (a later one does) | |
| `needs_care` | A part is failing | "2 parts failing since v17" |
| `new` | It arrived in this release or the one before | "Arrived in v21" |
| `growing` | It arrived, gained a part or changed within the last three releases | "+3 parts since v19" |
| `needs_care` | Fewer than half its parts are proven | "Only 2 of 9 parts proven" |
| `settled` | Otherwise | "Unchanged since v14" |

Each window counts releases with a stored map.

## How it works

`features.toml` rides in the release's snapshot like any other file, and Agent Cloud never edits it. A release that ships no `features.toml` carries the last stored map forward. A stored map never changes. Storing it never holds, fails or undoes a release; the release's events say how its map step went: `features.stored`, `features.carried`, `features.none` or `features.failed`.

While `features.toml` is missing, or is still the map the live release left behind, `agc check` warns, and `agc ship` says so in `next` after a release that left the map behind.

To turn the map off, set `[features] map = false` in `agentcloud.toml`: `agc ship` and `agc check` don't read `features.toml`, and maps stored before stay.

## Errors

| Code | Exit | When | Fix |
|---|---|---|---|
| `features.invalid` | 2 | `agc check` or `agc ship` read a `features.toml` that isn't valid TOML or breaks a rule above; nothing is sent | The message names the file, table and field; fix each entry in `data.problems` |
| `features.none` | 0 | The app has no stored map yet | Write `features.toml` and ship it |
| `features.not_found` | 2 | `agc features <feature>` names a feature the map doesn't have | Run `agc features` for the ids |
| `features.bad_request` | 2 | Anything but a version after `--release`, or `--timeline` with a feature, `--release` or `--export` | Pass `--release v<N>` from `agc features --timeline`; run `--timeline` on its own |
| `manifest.invalid` | 2 | `[features] map` is anything but `true` or `false` | Set it to `true` or `false` |

```bash
agc features --release latest
```

```json
{
  "ok": false,
  "product": "agent.cloud",
  "command": "features",
  "error": {
    "code": "features.bad_request",
    "message": "--release takes a release’s version, like v7.",
    "fix": "Run `agc features --timeline` for the releases that have a map, then pass one as --release v<N>.",
    "retryable": false,
    "docs": "agc help features"
  },
  "next": [{ "cmd": "agc features", "why": "the map at the latest stored release" }]
}
```

## Agent notes

- Write features from the user's side. Never name files, functions or tables in a `story` or `summary`.
- One part per thing a check can prove on its own; give that check `proves`.
- Run `agc check` before `agc ship`: a broken map refuses the ship before anything uploads.
- To start from the stored map, `agc features --export` and save `data.toml` as `features.toml`.

## Related

- [Checks overview](/docs/checks/checks-overview.md)
- [agentcloud.toml reference](/docs/reference/agentcloud-toml-reference.md)
- [agc ship end to end](/docs/ship/agc-ship-end-to-end.md)
- [Error code catalog](/docs/reference/error-code-catalog.md)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "build/your-apps-feature-map: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
