Most people get mediocre AI output because they write mediocre prompts. The model is capable — the constraint is how you communicate with it. This guide gives you a practical framework that works across Claude, ChatGPT, and Gemini.
The Seven Elements of an Effective Prompt
Not every prompt needs all seven. But knowing which elements to include — and when — is what separates people who get consistently great outputs from people who say “AI doesn’t work.”
- Role/Persona — Who should the AI be?
- Task — What exactly do you want?
- Context — What does the AI need to know?
- Format — How should the output be structured?
- Constraints — What should it avoid or stay within?
- Examples — What does good output look like?
- Evaluation — How should it check its own work?
Element 1: Role/Persona
Giving the AI a role activates relevant training data and sets expectations:
Generic: “Write a product description for a coffee maker.”
With role: “You are an e-commerce copywriter with experience in premium kitchen appliances. Write a product description for a coffee maker.”
Good role prompts:
- Specific expertise: “You are a senior Python developer with 10+ years in data pipelines”
- Relevant perspective: “Respond as a skeptical CFO evaluating this proposal”
- Context match: “Act as a sympathetic but honest writing coach”
Element 2: Task
Be specific about what you want. Vague tasks produce vague outputs.
Vague: “Help me with my email.”
Specific: “Rewrite this email to be more direct. The current version buries the ask in paragraph 3. Move it to the first two sentences without losing politeness.”
Task framing patterns that work:
- “Rewrite [X] to [goal], maintaining [constraint]”
- “Analyze [X] and identify [specific aspect]”
- “Generate [N] [format] about [topic] that [quality criterion]”
- “Convert [input format] to [output format]“
Element 3: Context
What the AI doesn’t know, it will fill in with assumptions. Give it the relevant background:
Without context: “Write a blog post about our new feature.”
With context: “Write a blog post about our new AI scheduling feature.
Context:
- Our product: a project management tool for remote teams
- The feature: auto-schedules tasks based on team members’ availability
- Our audience: engineering managers and CTOs
- Our blog voice: technical, practical, no marketing fluff
- Current top posts are 1,000-1,500 words with code examples”
The more unusual your situation, the more context matters.
Element 4: Format
Tell the AI how to structure the output:
Format specifications that help:
- Length: “Under 150 words” or “800-1000 words”
- Structure: “Use H2 headings every 200 words”
- Style: “Bullet points for the main points, paragraph for the introduction”
- Sections: “Include: summary, problem, solution, next steps”
- Avoidances: “No bullet lists” or “No numbered lists”
Example: “Write a project brief. Format:
- Title (bold)
- One-sentence objective
- Background (2-3 sentences)
- Goals (3 bullet points max)
- Timeline (table)
- Risks (2-3 points) Do not exceed 400 words total.”
Element 5: Constraints
Constraints prevent common failure modes:
Word count: “Under 100 words” — prevents bloat Tone: “Professional but not stiff” — sets register Audience: “Assume the reader has no technical background” Avoid: “Don’t use corporate jargon” or “Don’t use hedging language” Include: “Always end with a specific recommendation”
Constraint example: “Write 5 tweet variations about this blog post.
Constraints:
- Under 280 characters each
- No generic phrases like ‘excited to share’ or ‘thrilled to announce’
- Must include a specific data point or claim from the article
- End with a question or provocative statement to drive replies
- No emojis”
Element 6: Examples (Few-Shot Prompting)
Showing the AI one or two examples of what you want dramatically improves output quality. This is called “few-shot prompting”:
Write 3 email subject lines for this newsletter issue about productivity.
Good examples of my subject line style:
- "The meeting habit that's wasting your Tuesday"
- "What 400 hours of time tracking taught me"
- "Your second hour is your most productive (use it differently)"
My newsletter: [describe]
This issue is about: [topic]
Now write 3 new subject lines in that style.
The examples train the AI on your style more effectively than describing it.
Element 7: Evaluation Criteria
Ask the AI to review its own output:
After writing the proposal:
1. Does it start with the client's problem, not our company's background?
2. Is the timeline realistic (10-12 weeks for this scope)?
3. Are all the client's stated concerns addressed?
4. Is it under 1,000 words?
If any criterion isn't met, revise before giving me the output.
Self-review prompts catch 20-30% of issues before you even see the output.
Putting It Together: Full Prompt Examples
Example 1: Writing Assistance
You are a technical writer with experience in developer documentation.
Task: Rewrite this API documentation section for better clarity.
Original: [paste text]
Context: Our API users are junior developers who may not know REST conventions.
Format: Keep the same sections but rewrite each one. Add a simple code example after each explanation.
Constraints:
- No jargon without definition
- Every endpoint example should be complete and runnable
- Max 500 words for the whole section
After writing, check: is every example actually runnable without modification?
Example 2: Analysis
You are a product manager reviewing user feedback.
Task: Analyze these 50 customer reviews and identify patterns.
Input: [paste reviews]
Context: We just shipped a redesign of our checkout flow.
Format:
- Top 3 positive themes (with example quotes)
- Top 3 negative themes (with example quotes)
- 3 specific suggestions for the next iteration
- Confidence level for each finding (high/medium/low based on how many reviews mention it)
Constraints: Only cite themes that appear in 5+ reviews. Don't invent patterns.
The Iteration Pattern
Don’t expect perfection on the first attempt. The best prompt engineers iterate:
- First response: “Good, but [specific problem]”
- Fix: “Rewrite the [specific section] to [specific improvement]”
- Continue until you have what you need
Each iteration teaches the AI what you want without rewriting the whole prompt.
Common Mistakes
Too vague: “Help me with this” — what should it do?
No constraints: Leads to outputs that are too long, wrong tone, or missing key elements.
Context overload: Pasting 10,000 words when 200 would do. Focus the context on what’s actually relevant.
Accepting first output: Most first outputs are 70-80% of what you need. Iterate.
Wrong format for the task: Bullet points for a persuasive argument. Paragraphs for a structured list. Match format to purpose.