think&test
Home / Lesson BONUS
Think & Test · Lesson BONUS

Prompts, agents, and iterative loops

Build habits that improve every lesson: write specific prompts, split work between agents when it helps, and use repeatable checks to know when a task is finished.

What you’re learning

A strong prompt makes the goal, useful context, constraints, and output format clear. Agents can divide independent work, but they need a shared goal and a way to combine and verify their results. A Ralph-style loop repeats a task against explicit completion criteria; it can also repeat mistakes if those criteria are weak.

Work through it

  1. Use a simple prompt frame. State the goal, provide the relevant context, list constraints, and describe the desired output. Add a success check. Include only details that help the task.
  2. Improve by iteration. Ask for a first answer, identify what missed the mark, then adjust one part of the prompt. Compare outputs rather than relying on “make it better.”
  3. Try a two-agent workflow. Give one agent a clear research or drafting subtask and another a review task with a checklist. Have a coordinator combine the results and verify claims against the source material.
  4. Understand Ralph-style loops. The Ralph Wiggum technique repeatedly feeds a bounded coding task back into an agent until it meets a completion condition or a maximum iteration limit. Use it only for small, reviewable tasks with automated checks and a clear stop condition.

Example command / prompt

Goal: Explain [topic] to [audience].
Context: [relevant facts or source material]
Constraints: [must include / must avoid]
Output: [format and length]
Success check: [how I will verify it]
Keep this in mind. Long-running agent loops can consume time and API usage, and may compound a bad assumption. Set a small iteration limit, use a disposable branch or folder, and review every change before using the result.
Try thisAsk one model for a concise explanation, then give a second model a checklist to review it. Compare the review with your own. Note any unsupported claims.

Official references