Course contents
Concept · 5 hands-on exercises

Develop the prompt

Turn an idea into a prompt an agent can finish: a goal, context, constraints and a definition of done, delivered in small steps you check one by one.

You've seen that the agent fills gaps with guesses. Prompting well is mostly about leaving fewer gaps. That doesn't mean writing essays. A good build prompt has four parts, fits on one screen, and asks for one step at a time.

Four parts of a build prompt

PartQuestion it answersExample: the specials board
GoalWhat should exist when you're done?A “This week's specials” section built from a data file
ContextWhat does the agent need to know?Specials change every Monday, and the owner isn't technical
ConstraintsWhat must it avoid?Plain JavaScript, no new packages, don't touch other sections
Done meansHow will you both check?Edit the data file, reload, see the change; works at 375px wide

Context is where beginners under-share. The agent can read your files, but it can't read your reasons. “Specials change every Monday and the owner isn't technical” tells it that updating must be easy, and that one sentence changes the whole design: a data file the owner can edit instead of HTML she'd have to touch.

Constraints and examples do the heavy lifting

For any request, an agent could build dozens of reasonable versions. Constraints rule out the ones you don't want before any code exists. The most useful ones for beginners are about scope and safety: “don't change other sections,” “no new packages,” “keep the current colors,” “keep the data file's format.” Each one prevents a whole category of surprise.

Examples beat adjectives. “Make the cards look nice” leaves the agent to guess. “Each card shows the name in bold, the price on the right, and small tags underneath, like this: Cardamom buns · $4.50 · vegetarian” doesn't. When you can't describe what you want, point at something that has it: a screenshot, a site you like (for inspiration, not copying), or another part of your own page.

Finally, use your project's own names. Say specials.json, “the hero section” or “the hours table”: the same words your files and the agent use. A vague reference such as “that thing at the top” costs a search and invites a wrong guess.

Fill the blanksExercise 1 of 5

Complete the end of a prompt so the agent plans before it builds.

Before writing any code, the files you'll change, then for my OK.

Let the agent interview you

For anything bigger than a small fix, flip the conversation. Describe the idea in two sentences and ask the agent to question you before it plans. It will raise things you hadn't considered: What should the page show in a week with no specials? Should sold-out items disappear or get a badge? Answer, then ask for the plan. Some tools build this in. Cursor's Plan Mode asks clarifying questions before it plans, and Kiro turns an idea into a spec (requirements, a design and a task list) before it writes code.

Small steps beat one giant prompt

Each action an agent takes usually goes right. But a whole feature can be dozens of actions, and small chances of a slip add up. Try the explorer: set how often each step succeeds and how many steps a task takes, and watch what happens to the whole run. Then switch on checking.

Explore: Why giant prompts go wrongExercise 2 of 5
1 step200 steps
95.0%per step
36%whole run of 20 steps
64runs that fail, per 100

Each agent action is a step. Checking after each step catches most slips before the next step builds on them.

Move the controls and watch what changes.

Quick checkExercise 3 of 5

With each step 95% reliable and no checking, about how often does a 20-step run finish without a single slip?

That's the argument for small, checked steps: build one section, check it; build the next part, check it. A step you check is a step whose slip you catch before anything else is built on top of it.

Spot the problemsExercise 4 of 5

This prompt will cause trouble. Click the lines that need rewriting.

prompt.txt0 of 3 found
Build itExercise 5 of 5

Build the prompt for the specials board. Switch on what helps; leave out what hurts.

What gets sent
Add a specials section to the site.
Check your understanding
Q1. Which line adds the most useful context to a build prompt?
Q2. Why ask for a plan before code on anything bigger than a small fix?
· Work through the 5 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.