How to Write Better Prompts
for ChatGPT & Claude
Once you understand the five components of a good prompt (Role, Context, Task, Output Format, Constraints), the next step is learning how to apply them strategically. This guide covers seven practical techniques that will immediately improve the quality of your AI responses — each illustrated with a real before/after example.
Technique 1: Lead with the Role
Opening your prompt with a role assignment does two things: it sets the model's perspective, and it signals the level of expertise you expect. The AI will calibrate its vocabulary, depth, and assumptions accordingly.
Before:
What are the best practices for database indexing?
After:
Act as a senior database engineer with extensive experience optimizing PostgreSQL for high-traffic applications.
What are the 5 most impactful database indexing best practices for a production application with 10 million+ rows in the main tables? Focus on practices that are commonly overlooked by mid-level developers.
The role prompt produces a response calibrated to expert-level knowledge, skips the basics, and focuses on the non-obvious practices — which is exactly what the question was really asking for.
Technique 2: Give Concrete Context
Vague context produces vague responses. The AI cannot infer your specific situation, constraints, or audience. The more precisely you describe your context, the more tailored and useful the output.
Poor context keywords: "my project", "my audience", "my company"
Good context keywords: specific numbers, technologies, roles, and constraints.
Before:
Write an onboarding email for new users.
After:
Act as a SaaS copywriter specializing in onboarding sequences.
Context: Our product is a project management tool targeting small engineering teams (3–15 people). Users have just signed up for a free trial. Our tone is professional but friendly — we want to feel approachable, not corporate.
Task: Write a welcome email for new users that will be sent immediately after signup.
Output Format: Subject line, preheader text, and full email body (under 200 words).
Constraints: Focus on one clear CTA — getting them to create their first project. No feature lists or pricing mentions.
Technique 3: Specify Exactly What You Want (Not What You Don't)
AI models respond better to positive instructions than negative ones. Instead of "don't include X," try "focus only on Y." This is not a hard rule — sometimes negative constraints are necessary — but when possible, frame instructions positively.
Less effective:
Explain blockchain. Don't make it too technical. Don't use jargon. Don't assume I know anything about finance.
More effective:
Explain blockchain to someone who understands how a shared Google Doc works, but has no background in finance or cryptography. Use everyday analogies. Keep it under 200 words.
Technique 4: Define the Output Format in Detail
One of the most underused prompt techniques is precise output formatting. If you need the AI to produce something in a specific structure — JSON, a table, a numbered list, Markdown headers — describe it exactly. You can even provide a template.
Before:
Give me a comparison of React, Vue, and Angular.
After:
Act as a senior frontend architect.
Compare React, Vue, and Angular for a team choosing a framework for a new enterprise web application.
Output Format: A Markdown table with the following columns: Framework | Learning Curve | Ecosystem Size | Best For | Major Weakness. After the table, provide a 2-sentence recommendation for an enterprise team with mixed experience levels.
Technique 5: Use Anchoring to Set the Quality Bar
Anchoring means telling the AI the standard you expect the output to match. Referencing a known style, publication, person, or quality level shifts the model's output register significantly.
Write in the style of Paul Graham's essays — conversational but precise, with short paragraphs and no filler sentences.
Write this error message in the style of Stripe's API documentation — friendly, direct, and with a suggested next action.
Explain this concept at the level of a Y Combinator application — assume the reader is smart but has no domain knowledge.
Technique 6: Break Complex Tasks Into Steps
When a task has multiple independent sub-parts, prompting for everything at once often produces mediocre results across the board. Instead, chain prompts together — complete one step well, then use that output as context for the next.
Instead of:
Analyze my startup idea, write a pitch, create a landing page, and suggest a pricing model.
Do this:
- Prompt 1: "Analyze this startup idea critically. Identify the top 3 strengths and 3 weaknesses based on the current market..."
- Prompt 2: "Based on the analysis above, write a 60-second investor pitch..."
- Prompt 3: "Using the pitch from the previous step, write landing page copy..."
Each prompt builds on the output of the last, and you can steer the output of each stage before moving to the next.
Technique 7: Ask for Alternative Versions
When the first response isn't quite right, don't just ask again or settle. Ask for alternatives — multiple versions at different tones, lengths, or angles — and choose the best element from each.
Generate 3 different versions of this email subject line:
- Version A: Professional and formal
- Version B: Casual and conversational
- Version C: Bold and curiosity-driven
Base them on this email content: [paste your email]
This technique works especially well for creative tasks: naming, taglines, introductions, code implementations, and explanation styles.
Putting It All Together
Here is a fully formed prompt using all seven techniques:
Act as a senior product manager at a B2B SaaS company. [Role]
Context: We are preparing a quarterly product update email for 2,000 customers. Our product is a sales analytics platform. Customers are sales leaders and ops teams at mid-market companies. [Context]
Task: Write the product update email announcing three new features: (1) AI-powered forecast accuracy scores, (2) Salesforce sync improvements (2x faster), and (3) a new mobile dashboard. [Task]
Output Format:
- Subject line (A/B test: two options)
- Preheader text (under 90 chars)
- Email body with a short intro, one paragraph per feature, and a closing CTA
- Length: 280–350 words [Output Format]
Constraints:
- Tone: confident and professional, not hype-y
- Lead with customer benefit, not feature name
- CTA: "See what's new in your dashboard" (no links needed)
- Avoid words like "exciting", "thrilled", "delighted" [Constraints]
Style anchor: Think of how Notion writes product release notes — clear, functional, confident. [Anchoring]
Next Steps
These seven techniques cover the vast majority of real-world prompting needs. When you're ready to tackle more complex tasks — multi-step reasoning, structured data extraction, consistent persona maintenance — read our next guide: Advanced Prompt Techniques: Chain-of-Thought, Few-Shot & More.