0Pricing
AI Agents · Lesson

Agentic Patterns: Plan-Execute-Verify

First make a plan, then execute step by step, then verify against acceptance criteria — beats one-shot.

Why Plan First?

One-shot code generation works for tiny tasks ("write a fizzbuzz"). For real software changes, the agent should:

  1. Plan — decompose the task into steps
  2. Execute — implement each step
  3. Verify — test, lint, run
  4. Iterate — fix until verified

Step 1: Plan

Ask the model to produce a structured plan:

PLAN_PROMPT = '''
You are a senior engineer. Given this task, produce a JSON plan:
{steps: [{description, files_to_touch: [str], test_commands: [str]}], risks: [str]}

Task: {user_task}
'''

All lessons in this course

  1. Agentic Patterns: Plan-Execute-Verify
  2. Tool Surfaces for Coding (Read, Edit, Bash)
  3. Iterative Self-Correction Loops
  4. SWE-Agent and OpenDevin Architectures
← Back to AI Agents