core practice · coding
Define an agent-readable environment contract
Implement environmentContract(worktreeId) returning {bootstrap, readiness, workspace, capabilities}. bootstrap and readiness must each contain two runnable commands. workspace must include the supplied worktreeId and distinct port, database, and output identifiers derived from it. capabilities must explicitly list filesystem, network, and secrets as allow, deny, or scoped.
The mechanism
Treat the development environment as an API offered to the agent: bootstrap has declared inputs, readiness has observable outputs, and every writable or networked capability has a boundary. If a fresh session cannot establish readiness mechanically, the environment contract is incomplete.
Expected evidence
A reproducible bootstrap/readiness contract whose mutable resources are isolated per worktree.
Try this drill in the practice workspace →
Hints when you need them
- Readiness is an observable condition after bootstrap, not a second installation step.
- Derive every mutable resource name from the worktree identity so concurrent runs cannot collide.
Watch for these mistakes
- Assuming an undeclared global tool or manually prepared service exists
- Starting work before checking that dependencies and required services are ready
- Sharing mutable ports, databases, or build output across concurrent agent runs