Practical techniques โข 7 min read
Great prompts have four things: context (who/what), task (specific action), format (how to output), and examples (when possible). Iterate 2-3 times to refine.
Tell the AI who it is and what it's dealing with.
You are a senior technical writer for a SaaS company.
The audience is engineers evaluating our API.
State exactly what you want.
Write a 300-word intro for our webhooks documentation.
Specify structure, length, tone.
Use H2/H3 headings. Include one code example.
Tone: friendly but technical. Avoid marketing language.
Show what good looks like.
Example intro style:
"Webhooks let you..." (calm, direct, no hype)
Add "Think step by step" or "First, list your considerations, then answer." Improves reasoning on complex tasks by 20-40%.
Show 2-3 input/output pairs before the real question.
Q: What's the capital of France?
A: Paris
Q: What's the capital of Japan?
A: Tokyo
Q: What's the capital of Ghana?
A:
Assigning an expert role improves quality: "As a nutritionist..." or "As a database administrator..."
Use triple backticks, XML tags, or dashes to separate input from instructions:
Summarize the following text in one sentence:
<text>
[your content here]
</text>
Put "must" and "must not" at the top, not buried at the end. Models read prompts sequentially and give more weight to early instructions.
Role: You are a [role].
Task: Write [content type] about [topic].
Audience: [description].
Length: [word count].
Tone: [tone].
Must include: [3 key points].
Must avoid: [what to skip].
Write a [language] function that:
- Input: [signature]
- Output: [signature]
- Constraints: [performance/style]
- Handle edge cases: [list]
Include type hints and docstring. Skip comments in code.
Analyze this data: [data]
Steps:
1. Identify key patterns
2. Explain each pattern's likely cause
3. Suggest one actionable insight
Format: Markdown with H3 headers per section.
Related: ChatGPT vs Claude ยท Claude API Guide ยท AI Glossary