Tier 2
Patterns
The patterns that hold up when many agents run for months: delegation, isolation, orchestration, routing, memory, loops, and shipping without breaking things.
Agents
- Anatomy of an agentWhat a specialist agent is on disk: a definition, a package with a CLI, a registry row, state it doesn't own, and one clear scope.
- Write the spec before the codeA short spec for a new agent, PRDs whose user stories become the test contract, and an intent gate that checks the build matches the ask.
- Sub-agents and delegationWhen to delegate, foreground vs background, what the prompt must carry, timeouts that actually kill, and naming the model tier on every lane.
- Worktree isolation: the hard lessonWhy parallel agents need their own git worktrees, the incidents that proved it, and the machine-enforced fix that replaced a prose rule.
- Orchestration: delegate down, verify upOne agent talks to the human, specialists do the work, and nothing reaches the human until it has been checked.
- Model routing: the right model for the workRoute by work type and blast radius, not habit. Model tiers, effort as a second dial, and when to add an off-plan model.
- Agent memory you ownThree layers of memory in plain files, the read, write, synthesize habit, and when to graduate to a database.
Loops and schedules
- Schedules as a heartbeatScheduled jobs are the system's pulse. Built-in options first, then cron vs launchd, staggered timing, and output that only speaks when something changed.
- The loops doctrineEvery future obligation becomes a machine loop with an off switch: cron, watcher, session loop or a dated one-shot.
- Watchers: condition until it firesA watcher checks one condition on a cadence, pings once when it is true, then stops. Expiry is mandatory. Here's how to build one.
Shipping
- Root cause first, never bandaidsDiagnose, fix the process, backfill, add a regression guard, then patch the symptom. In that order, with three real incidents.
- Ship to prod: review the product, not the diffPR, gates, merge, deploy, smoke test prod, then tell the human what to click. Plus the gate that decides when 'done' is actually true.
- The one-shot pipelineScaffold, lock intent, brief with ground truth, build in isolation, verify against stories, ship, log. Which steps machines enforce and which are still prose.
- The self-healing loopA scout reads the system's own failures and ranks fixes, a human approves, and isolated agents ship them with a failing test first.