Lesson 16 ยท about 15 minutes

๐ŸŽฏ Prompt Like a Pro

In Lesson 10 you asked an AI to build a page. Now we level that up. A great prompt is like a work order for a builder โ€” and you're about to write ones so clear, the AI can't mess them up.

๐ŸŽฌ Watch first (90 seconds)

The AI can't read your mind

Imagine ordering a birthday cake by saying: "Make me a cool cake." You might get chocolate. You might get broccoli-flavored. The baker isn't bad โ€” your order was empty!

An AI is the same. It's a super-fast builder that does EXACTLY what you ask. Vague ask = random result. Clear ask = your dream page. A prompt is not a wish โ€” it's a work order.

The 5 ingredients of a pro prompt

Every pro prompt for a web page has these five ingredients. You know all the words already โ€” that's your superpower from lessons 1โ€“15:

  1. WHAT โ€” what to build. "A landing page." Not "something cool."
  2. WHO โ€” who it's for / your product. "Robo Sneakers โ€” self-tying shoes for kids."
  3. PARTS โ€” the sections you want. "A hero, 3 feature cards, a footer." You speak builder-language now!
  4. RULES โ€” the constraints. "One HTML file. CSS in a <style> tag in the head. <script> at the end of the body."
  5. BEHAVIOR โ€” what happens on clicks. "When I click the Buy button, a thank-you message appears."

Easy to remember: What, Who, Parts, Rules, Behavior. Count them on one hand โ€” five fingers, five ingredients. ๐Ÿ–๏ธ

Bad order vs pro order

Look at these two prompts side by side. Which builder gets to do a better job?

๐Ÿ˜ด The lazy order:

make me a cool website

๐ŸŽฏ The pro order (all 5 ingredients):

Build a landing page (WHAT)
for my product "Robo Sneakers" โ€” shoes for kids
that tie themselves (WHO).

Parts I want (PARTS):
- a hero with a big headline and a Buy button
- 3 feature cards side by side (flexbox)
- a footer with my name

Rules (RULES):
- ONE html file only
- CSS in a <style> tag in the head
- JavaScript in a <script> tag at the end of the body

Behavior (BEHAVIOR):
- when I click the Buy button, show the message
  "๐ŸŽ‰ Thanks for buying Robo Sneakers!"
๐Ÿ’ก The one idea of this lesson A prompt is a work order, not a wish. Give the AI all 5 ingredients โ€” What, Who, Parts, Rules, Behavior โ€” and it builds YOUR page instead of a random one. And here's the sneaky bonus: the RULES ingredient ("one HTML file, style tag in head, script at end") isn't for the AI's sake โ€” it's for YOURS. It forces the AI to write code in the exact shape you learned to read. No rules = mystery code you can't understand.

Pro trick: iterate in SMALL steps

The AI's first try is almost never perfect โ€” and that's fine! The pro move is asking for tiny changes, not do-overs:

The magic words are "change only...". They stop the AI from rewriting your whole file.

โš ๏ธ The AI's goldfish memory In the same chat, the AI remembers your page and your rules โ€” you can keep saying "now change only the footer." But open a new chat and POOF โ€” it forgot everything. It never saw your page. So: keep working in one chat, and if you must start a new one, paste your code in and give your work order again.

๐Ÿ› ๏ธ Build it (the fun part)

๐Ÿงช Your mission Write a real 5-ingredient work order for YOUR product, send it to your AI, and score the result: how many of your 5 ingredients did it deliver?
  1. Do Task A and Task B below first โ€” the checker helps you make your prompt truly pro.
  2. Open your AI (Claude!) and paste in your improved prompt from Task B โ€” but for YOUR real product, with YOUR product name.
  3. Save the code the AI gives you as practice/prompted.html and open it in your browser.
  4. Now score the AI out of 5. Check its work against your order, ingredient by ingredient: right WHAT? Your WHO (product name!) in the headline? All the PARTS you listed? Did it follow your RULES (one file? style in head? script at the end)? Does the BEHAVIOR work when you click?
  5. If it scored 4/5 or less, use the pro trick: ask for the missing piece with "change only..." โ€” in the SAME chat. Re-score. Can you get it to 5/5?

๐Ÿ•น๏ธ Try it right here โ€” the lesson checks your prompt!

Special mission today: the editors below hold English, not HTML. You're writing prompts! The preview box just shows your words as plain text โ€” ignore it. Press Check my code โœ” and the checker reads your prompt like a picky builder reading a work order.

๐ŸŽฎ Quiz time

No peeking at the notes above โ€” trying to remember is what makes it stick!

๐Ÿ“š Want more?

โญ Best thing to read next MDN: Your first website โ€” this is what pros build by hand. After your AI builds prompted.html, compare the two: does the AI's page have the same skeleton, sections, and style setup MDN uses? Spot the differences! And remember: you can paste any prompt into your AI teacher and ask "critique my prompt โ€” which of the 5 ingredients am I missing?" anytime.