Deterministic
Things code should know
- Which agent to launch
- Which files must exist first
- Which tools are permitted
- The exact output address
- Whether the output exists
- How a verdict changes the route
Primitive 01 / Agent
An agent is not a personality wrapped around a prompt. It is a bounded unit of judgment with named inputs, a defined output, restricted tools, and an explicit stopping point.
probabilistic judgment inside a deterministic contract
Choose a highlighted region in the definition to see what it controls.
01 / Definition
A strong definition is deliberately split. Some parts guide a model’s interpretation; other parts give the orchestrator facts it can verify without asking the model.
Deterministic
Probabilistic
If a responsibility has one correct answer for a given input, move it out of the agent definition and into code.
02 / Contract test
These questions are portable. The answers change by language, framework, and role; the contract shape does not.
What expert is this, and which mental model guides its judgment?
Which artifacts, source files, and project context may it read?
What exact file or code change must exist when it finishes?
Which capabilities are necessary, and which would widen the blast radius?
Which reusable rules and schemas must be injected into this role?
What must it refuse, report, or hand back to another owner?
Which decisions, findings, assumptions, and outcomes must it record?
03 / Runtime topology
Isolation is useful when the work benefits from fresh context, narrower tools, independent judgment, or parallel execution. Interactive continuity is useful when the role must stay in conversation with you.
Main conversation
Bounded subagents
Do not inherit the builder’s framing when independent judgment matters.
Give a reviewer enough access to inspect, not enough to silently fix.
Launch orthogonal review lenses together and wait at one gate.
A failed specialist can be retried without replaying the entire workflow.
04 / Handoff
The next role receives the contract it needs, not the previous role’s transcript. That makes context construction deliberate and recovery possible.
001.01-dis-feature.md001.02-arc-feature.md001.04-eng-feature.md001.05-cr-feature.mdPassing the whole conversation feels convenient, but it makes hidden context part of the API and weakens reviewer independence.
05 / Failure modes
You are a world-class software expert.You turn an approved brief into a technical specification. You do not implement it.Expertise without ownership creates role bleed.
Review the code and report back.Write {SEQ+1}-cr-feature.md with one of three allowed verdicts.A response is not a durable done condition.
tools: [Read, Write, Edit, Shell, Agent]tools: [Read, Search, WriteReport]Tools should follow the output contract, not convenience.
06 / Portable template
Copy the shape first. Replace the example identity, skills, inputs, process, and evidence rules with your own language-specific decisions.
---
name: <role>
model: <model-class>
tools: [<minimum capabilities>]
skills: [<reusable policies>]
---
# <Role>
## Identity
You own <one kind of judgment>.
## Inputs
- <required upstream artifact>
- <approved project context>
## Process
1. <inspect>
2. <decide>
3. <record evidence>
## Output
Write <exact artifact address>.
## Cannot
- <neighbor role's responsibility>
- <unsafe or conflicting action>
## Handoff
Name assumptions, uncertainty, and
what the next role should verify.