How to use
Pick the framework that fits your task, fill in the fields, and your prompt builds live in the preview. Blank fields are silently omitted. Copy and paste directly into any AI.
Download the full guide.
The foundation of every good prompt. Context + Task + Format = Quality Output. Get this right before reaching for anything else.
Task: Refactor this code to use list comprehensions…
Format: Return only the code block with comments.
- Always provide relevant context first
- Be specific about the task — vague in, vague out
- Define output format explicitly
Provide 2–5 input/output examples to pattern-match the model's behavior. Faster than writing detailed instructions for consistent formatting.
Input: "I hated every minute" → Output: Negative
Input: "It was okay, nothing special" → Output:
- Use 2–5 examples for best results
- Keep examples diverse but consistent in structure
- Include edge cases if your task has them
Force the model to show its reasoning before answering. Dramatically improves accuracy on multi-step logic, math, and analytical tasks.
"A train travels 120 km in 2 hours. How long to travel 300 km?"
Magic phrases: "Let's think step by step" · "Explain your reasoning" · "Break this down"
- "Let's think step by step" is a reliable trigger
- Ask for intermediate reasoning, not just the answer
- Verify each reasoning step in the output
Assign a specific expert persona to shape tone, vocabulary, and depth. "Act as a senior X with Y years of Z" outperforms generic requests.
"You are a skeptical editor reviewing this article for logical gaps."
- Be specific about expertise level and years
- State the audience — expert role + lay audience = clear explanations
- Add behavioral constraints ("be concise", "no jargon")
Reasoning + Acting. Interleave thought and action for tool-augmented workflows. The backbone of agentic AI systems.
Action: search_weather[location=London]
Observation: 15°C, rainy
Thought: Now I can make a recommendation.
Final Answer: Bring an umbrella, it's raining in London.
- Use for tool-augmented / function-calling workflows
- Structure strictly as Thought → Action → Observation
- Useful for API integration and multi-step retrieval
Force specific output formats for reliable downstream parsing. Provide the exact schema — don't describe it, show it.
{
"summary": "…",
"key_points": ["…", "…"],
"sentiment": "positive | negative | neutral"
}
- Provide the exact schema, not a description of it
- Use "No prose, only JSON" for strict formatting
- Validate output structure programmatically
Define what NOT to do as clearly as what TO do. Negative constraints narrow the output space and prevent common failure modes.
— Do not use technical jargon
— Maximum 3 sentences per section
— Never mention competitor brands
— If unsure, say "I don't know" rather than guessing
— Respond only within the scope of [topic]
- Use negative constraints sparingly but precisely
- Set word/character limits to prevent over-generation
- Define what counts as out-of-scope
Generate multiple independent answers and take the majority vote. Reduces variance on critical decisions where a single run may be unreliable.
Or: run the same prompt 3–5× at temperature > 0 and compare outputs manually.
- Use higher temperature (0.7–1.0) to ensure diversity between runs
- Ask the model to evaluate its own options
- Best justified on high-stakes, low-frequency decisions
Control randomness and creativity through sampling parameters. The right temperature is determined by the task, not the vibe.
| Parameter | Low value | High value |
|---|---|---|
| Temperature | Deterministic (0.0–0.3) | Creative (0.7–1.0) |
| Top P | Narrow focus (0.1) | Diverse (0.9) |
| Max Tokens | Short answers | Long-form content |
- Temp 0 for code/facts; 0.7–0.9 for creative writing
- Adjust Top P instead of Temperature for finer control
- Set max tokens to prevent runaway generations
Use clear delimiters to separate instructions from content. Prevents prompt injection and makes long, multi-part inputs unambiguous.
"""
[Your text here]
"""
Or use XML tags:
<article>…</article>
<question>…</question>
- Triple quotes for long text blocks
- XML tags for complex multi-part inputs
- Markdown code blocks for code snippets
Explore multiple reasoning paths simultaneously and backtrack when dead ends are reached. Simulates deliberate planning rather than linear generation.
- Best for complex planning and creative problem-solving
- Simulates multi-agent deliberation in a single prompt
- Allows exploration, evaluation, and backtracking
Set global behavior rules that persist across the entire conversation. The right place to define persona, safety boundaries, and response defaults.
1. Explain the code before writing it
2. Include error handling
3. Add type hints
4. Never use deprecated functions
User: Write a function to fetch user data…
- Use for persistent behavioral instructions
- Define scope, persona, and safety limits here
- Keep system prompts focused — longer ≠ better