Design a Single-Loop Agent
0/5 steps0%

Step 1 of 5

Define the loop contract

Write down exactly what one turn of the loop does before coding it.

First time here? Paste the Context Pack first so the AI understands your project - open it from the header above.

Prompt Capsule
Design the core loop for a single-agent system and write it as a contract before implementation. Specify: (1) INPUT: system prompt + message history + tool registry. (2) TURN: send to model; the model returns either final text or one or more tool calls. (3) EXECUTE: run each tool call in order, capture result or error. (4) FOLD: append tool results as tool-role messages, preserving call order and IDs. (5) TERMINATE: stop on explicit finish, max N turns, or K consecutive tool failures. Produce this as a short design doc with a state diagram and the exact message shapes you will use.
Paste into EmergentFull Build: complete implementation prompt with explicit requirements

Quick is short. Full Build is recommended for most steps. Strict forces real logic when the AI keeps faking output.

Actual change check

Expected after this step

A one-page loop contract with message shapes and termination rules.

Should NOT happen

  • An existing feature broke
  • A button only logs to console
  • Data disappears after refresh
  • Errors fail silently with no visible state

This is what should exist before you continue. If reality does not match, do not move on.

Track what changed, failed, or needs follow-up. Notes export with the flow.

Made with Emergent