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:
- WHAT โ what to build. "A landing page." Not "something cool."
- WHO โ who it's for / your product. "Robo Sneakers โ self-tying shoes for kids."
- PARTS โ the sections you want. "A hero, 3 feature cards, a footer." You speak builder-language now!
- RULES โ the constraints. "One HTML file. CSS in a
<style>tag in the head.<script>at the end of the body." - 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!"
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:
- ๐ด Lazy: "That's wrong, redo it." โ The AI rebuilds EVERYTHING, and code you liked disappears.
- ๐ฏ Pro: "Change only the hero background to dark blue. Touch nothing else." โ One tiny, safe change.
The magic words are "change only...". They stop the AI from rewriting your whole file.
๐ ๏ธ Build it (the fun part)
- Do Task A and Task B below first โ the checker helps you make your prompt truly pro.
- Open your AI (Claude!) and paste in your improved prompt from Task B โ but for YOUR real product, with YOUR product name.
- Save the code the AI gives you as
practice/prompted.htmland open it in your browser. - 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?
- 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?
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.