# Choose what to build

> Decides which part of an agent's work goes in its prompt, a script, a function, a widget or another agent.

Most agents need only a prompt and a few operations. Two tests decide the rest:

- **Is there a step the agent must not be able to skip?** If nothing has to wait for an answer or be blocked until a condition holds, it's prompt text and operations. If something does, that stretch, and only that stretch, becomes a [script](https://docs.mindset.ai/docs/scripts).
- **A script orchestrates. A function iterates.** "For each row, call something" is a [function](https://docs.mindset.ai/docs/functions). "Do A, wait for a person, then B or C" is a script.

Your coding agent reads the `choosing-what-to-build` topic before any build it hasn't done before. It holds the full set of worked comparisons.

## Ask your coding agent

```
Read choosing-what-to-build, then tell me what you'd build for the invoice exceptions agent and what you'd leave in its prompt, before you build anything.
```

Skill: [mindset-build-agent](https://docs.mindset.ai/skills/mindset-build-agent/SKILL.md)

## Common choices

| The request                                                    | Build                                                                                   | Not                                                        |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| Answer questions about the returns policy and look up an order | A prompt and one read operation                                                         | A script, or a function wrapping the read                  |
| Book a demo only after the visitor's company size is known     | A script whose first phase holds no calendar tool                                       | "Ask about size first" in the prompt                       |
| Rank six accounts by health score                              | A function that reads each account and sorts                                            | The agent calling the read six times and sorting itself    |
| Show open orders by country as a bar chart                     | The agent's built-in chart, from a function's counts                                    | A custom chart widget                                      |
| Use the same booking confirmation card in two agents           | One widget, given to both agents                                                        | A widget per agent                                         |
| Approve a booking over £400 by the manager, by link            | A script that prices the stay, then asks the manager                                    | The rule in the prompt, or the model working out the total |
| Keep contract text out of the general assistant's reach        | A legal agent holding the contract operation, which the general assistant hands work to | A rule in the general assistant's prompt                   |
| Post yesterday's order count to Slack every night              | A schedule on an agent that holds the read and the Slack post                           | A script, which has no current date                        |

> **Tip:** A rule that must hold every time belongs in a script, a function or the system that performs the action. Policy rules in the prompt are instructions to the model, and Mindset doesn't enforce them.

## Done when

Your coding agent can say, for each part of the agent's work, where it goes and why.
