Most people write prompts the same way they'd type a Google search — and get back shallow, hit-or-miss results. In this lesson, you'll learn the six building blocks of a well-structured prompt and see exactly what separates weak prompts from ones that reliably get great output.
The Anatomy of a Prompt
Every prompt — whether you realize it or not — has structural pieces. Understanding these pieces lets you build prompts deliberately, not by guesswork.
The 6 Building Blocks:
[ROLE] → Who is the AI playing? What expertise?
[CONTEXT] → What background does it need to know?
[TASK] → What exactly should it do?
[INPUT DATA] → The content to work on
[OUTPUT FORMAT] → How should the response look?
[CONSTRAINTS] → What to avoid or limit?Weak Prompt: "Summarize this article."
Well-Built Prompt:
You are a financial analyst writing for institutional investors.
Context: Q3 earnings report for a mid-cap tech company.
Task: Summarize key financial signals — revenue, margins, guidance.
Format: 3 bullet points max, each under 30 words.
Constraints: No filler phrases. Numbers and directional signals only.
Article: [INSERT TEXT]The well-built prompt is longer — but it produces dramatically more useful output every single time. Precision saves editing time later.
Detailed Analysis
The Role component sets who the AI is pretending to be. This shapes the vocabulary, depth, and style of the response. A "senior data engineer" will produce technically richer output than a generic "helpful assistant."
Context and Background is where most prompts fall short. Humans communicate with huge amounts of shared context — "you know that project we discussed." The AI has none of that unless you provide it. Be generous with background — the AI cannot assume anything.
Task vs. Instruction — "Task" is what you want done; "instruction" is how to do it. "Summarize" (task) vs. "Extract the 3 most important financial metrics and state each as a single sentence" (instruction). More specific instructions = more predictable output.
Input Data separation — Always clearly separate your source material from your instructions. Use XML tags, triple quotes, or clear headers. This prevents the AI from confusing data with instructions (it also protects against malicious content in data trying to hijack the AI — more on that in the Security lesson).
Output Format is massively underused. If you give the AI a template — even a partial one — it will follow it reliably. The AI mirrors whatever format you give it.
Constraints close the gap between "good enough" and "exactly right." They handle edge cases before they happen: "if the answer is unknown, say so explicitly" prevents the AI making things up. "No preamble" stops it from restating your question before answering.
Take-Home Points
- Every prompt has 6 building blocks — use all 6 for complex tasks
- Context is the most commonly missing piece — provide more than you think you need
- Separate your source data from your instructions using clear dividers
- Specify output format explicitly — show an example if possible
- Constraints are your edge-case handlers — write them before problems happen
Conclusion
The anatomy of a prompt is like the grammar of a sentence — it has required parts that work together. Just as a sentence has a subject and verb, a solid prompt has a role, context, task, data, format, and constraints. Mastering this structure transforms prompting from guesswork into a repeatable skill. Everything else in this course builds on this foundation.
Check what you picked up, graded instantly.
Pick up where you left off, on any device.
Finish the course and earn a shareable certificate.