Writing instructions for agents
Apply writing-for-the-reader. Here, the reader is an agent choosing and performing
behavior from finite context.
Contract
- State the task and trigger. Make the required behavior and the conditions for using it discoverable in the description and opening lines.
- Specify observable conduct. Describe the action to take, the relevant inputs, and the result or stopping condition.
- Keep only behavior-changing context. Include a pipeline fact when the agent must act differently because of it. Express that difference as direct conduct.
- Order by execution. Put prerequisites before actions, actions before verification, and exceptions beside the step they alter.
- Use progressive disclosure. Keep the governing path compact and point to references for detail that is needed only sometimes.
- Preserve signal strength. Use ordinary declarative language. Let ordering and specificity carry priority.
Maintenance tests
- Contribution: compare behavior with and without the instruction. Keep it when behavior changes usefully.
- Environment: prefer a query or tool over prose that can become stale.
- Duplication: give each instruction one canonical home and use a pointer elsewhere.
- Generalization: state the underlying behavior rather than the session that revealed it.
- Control boundary: compare the reader's inputs, action, validation, and output with each context sentence. Keep sentences that change at least one field.
Instructions describe what the next agent does now. The review record carries instruction history.