Prompt Engineering Fundamentals: Write Prompts That Actually Work
Master the art of prompt engineering. Learn proven frameworks, patterns, and techniques to get consistently better results from any AI model.
Quick answer
Prompt engineering is the practice of writing structured instructions that get consistently better results from AI models. The CRAFT framework (Context, Role, Action, Format, Tone) is a reliable starting point for any important prompt. The key insight: specificity beats length — a precise 3-line prompt outperforms a vague paragraph.
Prompt Engineering Fundamentals: Write Prompts That Actually Work
Why Prompt Engineering Matters
The difference between a mediocre AI response and a brilliant one is almost always the prompt. Prompt engineering isn’t just about asking nicely — it’s a systematic approach to communicating with AI models.
The CRAFT Framework
Use this framework for every important prompt:
- Context — Set the scene. Who are you? What’s the situation?
- Role — Give the AI a persona. “You are a senior DevOps engineer…” (this ties directly into system prompts, which we cover separately)
- Action — Be specific about what you want done
- Format — Specify the output format (table, list, code, JSON)
- Tone — Set the communication style
Example Using CRAFT
Context: I'm launching a SaaS product for small business accounting.
Role: You are a growth marketing strategist with 10 years of experience.
Action: Create a 90-day go-to-market launch plan.
Format: Present as a week-by-week timeline with milestones and KPIs.
Tone: Strategic and actionable, no fluff.
Essential Patterns
Few-Shot Learning
Show the AI examples of what you want:
Convert these product descriptions to compelling one-liners:
Input: "A 500ml stainless steel water bottle with double-wall insulation"
Output: "Keep your drinks ice-cold for 24 hours with our bulletproof steel bottle."
Input: "A wireless bluetooth speaker with 20-hour battery life"
Output: "Your soundtrack, untethered. 20 hours of wireless audio bliss."
Input: "A mechanical keyboard with cherry MX switches and RGB lighting"
Output:
Chain of Thought
Force step-by-step reasoning:
Solve this problem step by step. Show your reasoning at each stage before giving the final answer.
A company's revenue grew 15% in Q1, declined 8% in Q2, grew 22% in Q3, and grew 5% in Q4. If they started the year at $1M monthly revenue, what was their revenue at the end of Q4?
Constraint Setting
Set clear boundaries:
Write a technical blog post about Kubernetes autoscaling.
Constraints:
- Target audience: mid-level developers
- Length: 800-1000 words
- Include at least 2 code examples
- Avoid jargon without explanation
- End with 3 actionable takeaways
Common Mistakes
- Being too vague — “Write something about AI” gives you generic content (we break down more of these in You’re Using AI Wrong)
- Not specifying format — You’ll get walls of text instead of structured output
- Ignoring iteration — The first response is a draft. Always refine.
- Overcomplicating — Sometimes a simple, clear prompt beats an elaborate one
Practice Exercise
Try this prompt on your favorite AI model and compare the results:
I'm a freelance web developer building a portfolio site. Help me write the "About Me" section.
About me:
- 5 years experience
- Specialize in React and Node.js
- Based in Melbourne, Australia
- Passionate about clean code and accessibility
Requirements:
- 150 words max
- Professional but approachable tone
- Include a subtle call-to-action
- First person perspective
Prompt engineering is a skill that compounds. Each conversation teaches you what works and what doesn’t. Start applying these patterns today.
Related Articles
- Mastering System Prompts — The most powerful application of prompt engineering
- Getting Started with Claude — Practice these techniques with Claude
- You’re Using AI Wrong: 5 Mistakes That Kill Your Productivity — The anti-patterns to avoid
Frequently asked questions
What is prompt engineering?
Do I need to learn prompt engineering in 2026?
What is the CRAFT framework for prompting?
What's the difference between a prompt and a system prompt?
Want to keep learning?
Explore our guided learning paths or try building something with AI right now.
More from Tutorials
Mastering System Prompts: The Hidden Key to Better AI Outputs
Mastering System Prompts: The Hidden Key to Better AI Outputs
System prompts are the most powerful and least understood part of working with AI. Learn how to craft system prompts that dramatically improve output quality.
AI Image Generation for Beginners: Free Tools That Actually Work
AI Image Generation for Beginners: Free Tools That Actually Work
Create stunning AI images for free. Hands-on comparison of Ideogram, Leonardo.ai, Bing Image Creator, and DALL-E with example prompts and honest assessments.
Build Your First AI Automation with n8n (No Code Required)
Build Your First AI Automation with n8n (No Code Required)
Step-by-step tutorial: build a working AI automation from scratch using n8n. Connect AI to email, documents, and databases without writing code.
Enjoyed this article?
Subscribe for more AI insights delivered to your inbox every week.