16.2 Choosing the right piece
- Approved by
- Panaversity ·
In everyday life. A kitchen has a stove that came with the house and a knife you sharpened yourself. It has a recipe card and a delivery service for what you do not keep at home. It has an assistant cook for a side dish and a lock on the cabinet that holds the cleaning chemicals. Each does one kind of job. You would not write "do not open the chemicals cabinet" on a recipe card and call it locked.
What you will learn. How to decide what each new job for an agent needs. It may need what is already there, your own code, written instructions, a link to another system, a helper, or a rule that cannot be ignored.
Why it matters. Each piece does one kind of job and costs something different. Put a rule in the wrong piece, and it works only until the day the agent ignores it.
Which pieces can I choose from?
Six. No single standard defines this list, because it covers several standards and every product's own features.
| Piece | What it is | Use it for | Who can change it |
|---|---|---|---|
| Built-in tool | A tool the agent already has: read a file, search, run a command | Anything the agent can already do well | The product's maker |
| Custom tool | Code you write and test, which the agent runs | Calculations, checks, anything that must be exact every time | You, through a reviewed change |
| Skill | Instructions and files that load when the work matches (16.1) | A procedure with judgment in it: which steps, in what order, what to report | Whoever edits the skill |
| Connector | A server that gives the agent tools and data from another system, through the Model Context Protocol (MCP), an open standard | Systems the agent cannot reach on its own: an accounting system, a database, a shared drive | The connector's author |
| Subagent | A helper agent with its own context that reports back | A side task whose reading would crowd the main session | You |
| Hook or setting | A rule the product enforces before or after an action | Things that must never happen, whatever the instructions say | The person who controls the settings |
What is the difference between a skill and a hook?
A skill guides. A hook or setting enforces. A skill is words. An agent usually follows them, and sometimes does not. A hook is code the product runs at a fixed moment, such as before every file edit, and it can block the action. A permission setting does the same without code. So "never edit the AP export" belongs in a setting that denies edits to data/, not only in a skill's "Never" list. Chapter 23 teaches hooks in depth.
Where do calculations go?
Into tested code, never into a skill's words. This is the rule for every number from Chapter 13: an AI can reason about a problem, but deterministic code, which gives the same answer every time, enforces rules and arithmetic. A skill that says "add up the amounts" or "calculate the due date" asks the model to do the arithmetic itself. A skill that says "run the triage script and copy its totals" does not. So most good skills have a script beside them. The skill's job is to say when to run it and how to report what it printed. The number in that code is still a copy of a rule its owner decides (16.6).
What does each piece cost?
A built-in tool costs nothing extra. A skill costs its short description on every turn. A connector costs its tool names or descriptions on every turn, depending on the product, and a running process. A subagent costs a second context. Choose the cheapest piece that does the job reliably.
How do I choose?
Ask these questions in order, and stop at the first yes. If a job has parts, ask for each part. The Monday report's totals are tested code, and its steps are a skill.

Figure 16.4. Choosing the piece. Reading a long contract is side work, so it goes to a subagent, even though the agent could read it in the main session.
At work. Ana and the builder place six AP jobs, which means they choose a piece for each:
| Job | Piece | Why |
|---|---|---|
| Read the weekly invoice export | Built-in tool | The agent can already read a file |
| Compute due dates | Custom tool: src/due-date.ts | A number people act on, so tested code |
| Sort invoices into piles and report | Skill, which runs a script | A procedure with steps and a report shape, with the sorting in code |
| Look up a vendor in the accounting system | Connector | Another system. Chapter 17 builds it |
Never edit data/ | Setting | It must work even if instructions are ignored |
| Pause before scheduling a payment | Hook | An approval gate. Chapter 23 builds it |
The operating rule: use the cheapest piece that is reliable enough. Put judgment in a skill, numbers in tested code, other systems behind a connector, and every "never" that must hold in a hook or setting.
Practice it. Practice: choosing the right piece, on your own, ten minutes.
Building Skills and Plugins with Coding Agents
Question 1 / 8
0 answered
An agent must compute each invoice's due date the same way every time. Which piece?
- Owner
- Panaversity