
Prompt engineering is the practice of designing and refining inputs to AI models to get the best possible outputs. A well-crafted prompt can mean the difference between a generic answer and an insightful one.
Prompt engineering is the practice of designing and refining inputs to AI models to get the best possible outputs. A well-crafted prompt can mean the difference between a generic answer and an insightful one.
| Weak Prompt | Strong Prompt |
|---|---|
| "Write about dogs" | "Write a 500-word article comparing Golden Retrievers and Labradors for first-time dog owners, focusing on exercise needs and temperament" |
| "Make it better" | "Rewrite this paragraph to be more concise. Cut the word count by 40% while keeping all key information. Use active voice." |
Bad: "Write a blog post about solar energy"
Good: "Write a blog post for homeowners in Arizona considering
solar panels. The reader is concerned about upfront costs and
maintenance. Address these concerns, explain the 30% federal tax
credit, and include typical payback periods. Tone: informative but
accessible. Target length: 1,200 words."
"Analyze this customer feedback and output as JSON:
{
"sentiment": "positive/negative/neutral",
"key_issues": ["issue1", "issue2"],
"urgency": "low/medium/high",
"recommended_action": "string"
}"
"You are an experienced cardiologist reviewing a patient's lab
results. Explain these results to a 45-year-old patient who is
anxious but wants to understand their health. Avoid jargon.
Compare values to normal ranges."
"Solve this step by step:
A store has a 30% off sale. An item costs $84 after the discount.
What was the original price?
Step 1: If the price after 30% off is $84, that means...
Step 2: 70% of the original price = $84
Step 3: 1% of the original price = $84 / 70 = $1.20
Step 4: 100% of the original price = $1.20 × 100 = $120
Answer: $120
Provide examples before asking:
Convert temperatures:
Water boils at 212°F → 100°C
Room temperature is 72°F → 22.2°C
Body temperature is 98.6°F → 37°C
What is 0°F in Celsius?
Tell the model what NOT to do:
"Write a product description for a standing desk.
Do NOT mention:
- Price (pricing is on the product page)
- Brand names of competitors
- Shipping details
- Use the word 'ergonomic' more than once
- Write more than 100 words"
For applications, set persistent behavior:
SYSTEM: You are a customer support agent for TechCo.
RULES:
- Always identify yourself as "Support Agent"
- Never apologize ("I understand your frustration" instead of "I'm sorry")
- If you don't know something, say "I'll escalate this to our senior team"
- Always end with a specific next step
- Keep responses under 3 paragraphs
Write a [type: blog post/email/social post] about [topic].
Target audience: [description]
Tone: [professional/conversational/enthusiastic]
Length: [word count]
Key points to include:
- [point 1]
- [point 2]
- [point 3]
Structure:
1. Hook
2. Problem/Context
3. Solution
4. Examples
5. Call to action
Analyze the following [text/data] and provide:
1. Summary (2-3 sentences)
2. Key findings (bullet points)
3. Actionable recommendations (numbered)
4. Confidence level (high/medium/low)
Here is the content:
[PASTE CONTENT]
Language: [Python/JavaScript/etc.]
Task: [describe function/module]
Constraints:
- Must handle edge cases: [list]
- Follow [style guide]
- Include type hints
- Maximum complexity: O(n)
- No external libraries except [allowed]
Example input/output:
Input: [example]
Output: [expected]
| Mistake | Problem | Fix |
|---|---|---|
| Being vague | Generic output | Add specific constraints |
| Overloading | Model misses key points | Prioritize, use structure |
| No negative instructions | Gets wrong tone | Explicitly state what to avoid |
| Assuming knowledge | Missing context | State everything explicitly |
| One-shot expectation | Poor first result | Iterate: generate → review → refine |
Prompt engineering is a learnable skill. The best prompts are:
Invest time in your prompts — the quality of your output depends on the quality of your input.
No approved comments are visible yet. New community replies may wait for moderation.