# Your first story with the agent

This page follows one story from the line you type to the moment the agent hands the story over. You need an agent [connected](/docs/connect/) with a **Read & write** key, and a map whose active release holds stories with acceptance criteria.

On its own, the agent takes stories only from the active release; a story you name by its number it takes from anywhere. The first release of a map becomes active on its own; after that, you activate the next release on the board or ask your agent to. If a map has no active release, the board says "The agent gets no stories until a release is activated".

## What it looks like

```text
> take the next story from Slicemap

slicemap_next_story
  SM-12 "Class list with attendance", 3 criteria
slicemap_estimate_story
  40 min, 25 to 60, complexity 2, clarity 4
slicemap_update_story_status
  In Development
  ...writes the code, runs the tests...
slicemap_toggle_ac_done
  ✓ Coach marks who came to class
slicemap_toggle_ac_done
  ✓ Parent sees the kid's attendance history
slicemap_toggle_ac_done
  ✓ Coach sees who missed two classes in a row
slicemap_record_work
  35 min
slicemap_update_story_status
  Automated AI QA
```

Slicemap describes this order to the agent when it connects, and the agent follows it. Two rules are kept by the server whatever the agent does: the plan freezes when the story first goes into work, and a story can't move to a closed stage while a criterion is unticked.

The board updates on its own as the agent works, so you can watch it in another window.

## 1. The agent takes the story

If your workspace has more than one project, name it: "take the next story from Slicemap in the Acme project".

The agent calls `slicemap_next_story`. The map, not the agent, decides what is next: the first story of the active release that is not yet in a closed stage, going through the steps from left to right. The story comes with its acceptance criteria.

**On the map:** nothing changes yet. The agent now has the story's number, title, description and criteria.

A story counts as open until it reaches a closed stage. A story the agent handed over and that waits in Automated AI QA comes back as the next story until you move it to Production, so review handed-over stories before you ask for the next one. When every story of the active release is in a closed stage, the agent stops and lists the backlog for you to choose from. It takes a story from outside the queue only when you name it, for example "take SM-142".

## 2. It estimates the story

Before the first line of code, the agent calls `slicemap_estimate_story`. It estimates in minutes of its own work, not a human developer's days: the expected minutes with a range, how complex the work is (1 to 5), how clear the card is to it (1 to 5) and, below 5, one line on what the card is missing. Low clarity is a reason for the agent to ask you before it starts.

**On the map:** open the story. Its **Agent estimate** section shows the plan, the range, complexity and clarity, what is missing and the model that estimated. To see the estimate on cards, turn on **Estimate** under **Display** → **Fields**.

You can't edit the plan yourself. If you disagree, ask the agent to re-estimate. More in [Agent estimates in minutes](/docs/concepts/agent-estimates/).

## 3. It moves the story into work

The agent calls `slicemap_update_story_status` before it writes code. It picks the stage whose description says what is happening; with the default stages, that is **In Development**. From this moment the plan is frozen, so it can later be compared with the minutes the agent actually spent.

**On the map:** the card shows the new status, and on a Kanban tab it moves to that column. The card's last change line reads like "Alex's agent changed the status", with the name of the person whose key the agent uses.

## 4. It ticks the criteria as it checks them

The agent calls `slicemap_toggle_ac_done` once per criterion, when it has checked that the criterion holds.

**On the map:** the counter on the card goes 1/3, 2/3, 3/3 and turns green when every criterion is ticked. In the story, the ticks appear under **Acceptance criteria**, and the last change line says the agent checked a criterion.

## 5. It records the minutes it worked

Before handing the story over, the agent calls `slicemap_record_work` with the minutes of its own work in this pass, without the time it waited for your answers. If the story comes back from acceptance, the next pass is added on top.

**On the map:** the **Agent estimate** section shows the actual minutes next to the plan, and the calendar time from the first move into work.

## 6. It hands the story over

The agent calls `slicemap_update_story_status` again and moves the story on to acceptance or done. With the default stages, the stage after development is **Automated AI QA**, and the closed stage is **Production**.

If a criterion is still unticked, a move to a closed stage is refused:

```text
A story is done only when every acceptance criterion is verified. Still unticked: "Coach sees who missed two classes in a row".
```

**On the map:** the card shows the new stage.

## What next

- Review the handed-over story and move it to Production, then ask for the next story the same way. When every story of the release is in a closed stage, activate the next release on the board.
- [What to ask your agent](/docs/agent/what-to-ask/): ready-made requests for estimates, releases, criteria and stages.
- [Write acceptance criteria your agent can check](/docs/how-to/acceptance-criteria/).
