Skip to main content
That completes the loop — from start to finish. Step back and take in how the pieces connect. An AI coding agent is built around a compact, repeating cycle: try, test, fix, save. This cycle runs continuously until the agent reaches its goal. Two immutable foundations must be defined first in every project:
  • A clear goal that specifies what “done” looks like.
  • A scorekeeper that measures what “correct” means.
Only after those foundations should you add other components. Each additional part exists to solve a concrete problem; add it only when needed. Callouts for quick reference:
Start with the goal and the scorekeeper in every project. Get one small, saved win (a green state) early — it reduces risk and provides a reliable baseline for iteration.
Core components and their roles
  • Automations — repeat the loop’s work reliably and without drift.
  • Worktrees — create safe branches or disposable copies for experiments.
  • Skills — package reusable procedures, heuristics, or models.
  • Connectors and plugins — enable interaction with external tools, APIs, or services.
  • Sub-agents — delegate focused responsibilities or subtasks to specialized agents.
  • Memory — persist notes, context, checkpoints, and other state across sessions.
For clarity, here’s a compact reference table: Design order and practical rules
  1. Define the goal and the scorekeeper first. Without them, the loop cannot measure progress.
  2. Get one small win saved (green) quickly — this becomes your rollback/safety point.
  3. Add components in this sequence only as problems demand them: Automations → Worktrees → Skills → Connectors/Plugins → Sub-agents → Memory.
  4. Keep each addition minimal and justified by a measurable need.
Engineering habits that keep loops healthy
  • Make small, incremental changes and save often to ensure rollback points exist.
  • Inspect the actual outputs shipped by the loop — don’t rely only on the score flipping green.
  • Decide up front when the loop should stop, and define the criteria for human handoff.
Automate carefully. Over-automation without clear stop conditions can produce brittle behavior. Define explicit termination or escalation rules to ensure safe handoffs to humans.
A short, practical cycle example
Aim to make each iteration short and measurable. The loop’s objective is to steer itself toward the goal, not to remove humans from the picture entirely. Final thought The purpose of this framework is not to memorize a list of parts. It is to learn to think in loops: design compact cycles that detect, measure, and correct their behavior reliably. That shift — from manual steering to designing dependable cycles — is the key skill. Links and references

Watch Video