Planning · Free preview

Decompose the Goal

Big task into small steps

Planning starts by decomposing one big goal into an ordered list of small, concrete subtasks the agent can execute one at a time.

Big task into small steps

Hand an agent the goal "ship the launch email" and watch it stall. There's no tool named ship_the_launch_email; the goal names an outcome, not an action. The agent either freezes, or — worse — hallucinates one giant step and reports "done" having sent nothing. A capable plan begins by dissolving that gap.

Decomposition is the move: turn one fuzzy goal into an ordered list of subtasks small enough that each maps to a single concrete action. "Ship the launch email" becomes draft the copy → add a call to action → proofread the draft → schedule the send. Each piece is verb-first and checkable — you can look at the result of "proofread the draft" and say whether it happened. That checkability is what makes a step doable; a vague subtask just defers the same stall to later.

Where do the subtasks come from? An LLM can propose them, but here the knowledge lives in a small rulebook — a map from known goals to their ordered steps — with a generic fallback (research → do the work → review) for goals it has never seen. A rulebook is deterministic and auditable: the same goal always expands the same way, which matters when a wrong plan costs a real send. The fallback is the humility clause — it keeps an unknown goal from crashing the planner.

The starter cheats: subtasks = [goal] echoes the whole goal back as one step, decomposing nothing. Look the goal up in the rulebook (use fallback when it's missing), then print each subtask on its own line numbered from 1.. Done means four numbered lines, not one.

A plan is just an ordered list of steps small enough to actually do — and big goals only become doable once you've broken them down.

In the full academy, you write and run this — live, graded:

// A goal, and a rulebook that maps known goals -> ordered subtasks.
const goal = "ship the launch email";

const rulebook = {
  "ship the launch email": [
    "draft the copy",
    "add a call to action",
    "proofread the draft",
    "schedule the send",
  ],
  "publish the blog post": [
    "write the headline",
    "write the body",
    "add images",
    "hit publish",
  ],
};

// A generic fallback for goals the rulebook has never seen.
const fallback = ["research the goal", "do the work", "review the result"];

// Decompose the goal into its ordered subtasks.
// TODO: look up the goal in the rulebook (or use the fallback),
//       then print each subtask on its own numbered line: "1. ...".
const subtasks = [goal]; // <- this just echoes the goal as one big step.

subtasks.forEach((task, i) => {
  console.log(`${i + 1}. ${task}`);
});

🔒 Live code execution, real agent runs, mastery tracking and verifiable credentials unlock with the full academy.

This is 1 of 50 lessons.

The full academy: write real code, watch real agents run, and earn verifiable credentials — across 8 tracks, in a 3D campus.

Unlock the full academy — $100 →

14-day refund · 🔒 Stripe-secured checkout · lifetime access

More free lessons: An LLM Is a Function  ·  The Agent Loop  ·  Define a Tool  ·  Give an Agent a Tool  ·  Durable State

← The Agent Marketplace