Prompt Templates

What Is Prompt Engineering?

Prompt engineering is the art and science of communicating effectively with AI models. A well-crafted prompt can dramatically improve AI output — transforming vague, generic responses into precise, structured, and immediately usable content. Whether you use ChatGPT, Claude, Gemini, or any other LLM, mastering prompt design will significantly boost your productivity.

In 2026, as AI model capabilities continue to advance, prompt engineering has evolved from a nice-to-have skill into a core competency. Developers use it to generate production-quality code, marketers use it to craft compelling copy, and researchers use it to analyze complex data — prompt templates are becoming an essential toolkit for every knowledge worker.

This page provides 20+ battle-tested prompt templates across four categories: coding, writing, data analysis, and translation. Each template is copy-ready with a single click. We also cover advanced techniques like Chain-of-Thought and few-shot learning to take you from beginner to expert.

Prompt Structure Frameworks

Great prompts follow a consistent structure. Here are two of the most popular frameworks:

RICE Framework

Role — Tell the AI who it is: "You are a senior backend engineer"

Instructions — What to do: "Review the following code for security vulnerabilities"

Context — Background info: tech stack, business scenario, constraints

Examples — Provide samples of expected output to guide the AI

CRISPE Framework

Capacity — The role and capabilities the AI should assume

Request — The specific task you need completed

Insight — Additional expertise or background you provide

Statement — Output format and style requirements

Personality — The tone and voice of the AI response

Experiment — Ask for multiple approaches or variations

Key Elements Cheat Sheet: Regardless of framework, great prompts include five elements — Role (who you are), Instructions (what to do), Context (background info), Examples (expected output), and Constraints (format/length/tone). Missing any one can lead to suboptimal results.

Prompt Template Library

The following templates have been tested and refined for optimal results. Click the Copy button in the top-right corner of any template to copy it.

Coding Prompt Templates

Code Review
You are a senior software engineer with 10+ years of experience in [language/framework]. Review the following code, focusing on: 1. Security vulnerabilities (injection, XSS, auth bypass, etc.) 2. Performance issues (N+1 queries, memory leaks, unnecessary computation) 3. Code readability and maintainability 4. Adherence to [language] best practices and design patterns For each issue found, output in this format: - Severity: High / Medium / Low - Location: filename and line number - Issue: Brief description - Fix: Specific code change with example Code: ``` [paste your code here] ```
Bug Fixing
You are an expert debugger. I have a bug that needs diagnosis and fixing. Environment: - Language/Framework: [e.g., Python 3.12 / Django 5.0] - Runtime: [e.g., Ubuntu 22.04, Docker] - Key dependencies: [list versions] Problem: [Describe expected vs actual behavior in detail] Error message / stack trace: ``` [paste error output] ``` Relevant code: ``` [paste related code] ``` Please analyze step by step: 1. Root cause analysis 2. Fix (provide complete corrected code) 3. How to prevent similar bugs in the future 4. Suggested test cases to add
Code Refactoring
You are a software architect focused on code quality. Refactor the following code. Refactoring goals: - [ ] Improve readability - [ ] Reduce duplication (DRY principle) - [ ] Improve error handling - [ ] Optimize performance - [ ] Enhance testability Constraints: - Keep the public API unchanged - Maintain backward compatibility - Follow [language] community conventions Code: ``` [paste your code here] ``` Output: 1. Complete refactored code 2. Explanation of each change and why it was made 3. Before/after complexity comparison
Unit Test Generation
You are a test engineer. Write comprehensive unit tests for the following code. Test framework: [e.g., pytest / Jest / JUnit] Coverage target: > 90% Tests must include: 1. Happy path scenarios 2. Edge cases (null, empty, min/max values, empty arrays) 3. Error / exception handling 4. Necessary mocks and stubs Code: ``` [paste your code here] ``` Output format: - Add a comment before each test explaining its intent - Use AAA pattern (Arrange-Act-Assert) - Name tests: should_[expected]_when_[condition]
API Design
You are an API architect, expert in RESTful and GraphQL design. Design an API for the following business requirements: Business description: [describe the scenario and requirements] Target users: [internal services / external developers / mobile apps] Tech stack: [e.g., Go + PostgreSQL] Output: 1. Endpoint list (method, path, description) 2. Request/response JSON Schema examples 3. Authentication and authorization approach 4. Pagination, filtering, and sorting strategy 5. Error code definitions 6. Versioning strategy

Writing Prompt Templates

Blog Post
You are a professional content creator specializing in [domain]. Write a blog post about [topic]. Requirements: - Target audience: [beginner / intermediate / advanced] - Word count: [1500-2500 words] - Tone: [professional but accessible / casual and witty / academic] - Include SEO-friendly headings and subheadings (H2/H3) - Support each point with specific examples or data - End with a call-to-action (CTA) Structure: 1. Engaging hook (pain point + promise) 2. Core content (3-5 key points, each with examples) 3. Actionable advice (steps readers can take immediately) 4. Summary and CTA
Email Drafter
You are a business communication expert. Help me write a [type] email. Email type: [cold outreach / follow-up / apology / partnership proposal / project update] Recipient: [job title and relationship] Core objective: [what action you want the recipient to take] Context: [provide relevant background] Requirements: - Subject line: concise, compelling, under 60 characters - Body: under 200 words - Tone: [formal / semi-formal / friendly] - End with a clear next step - Provide 2 versions to choose from
Technical Documentation
You are a technical documentation engineer. Write docs for [product/feature/API]. Doc type: [quickstart / API reference / architecture overview / changelog] Target reader: [developers / DevOps / product managers] Include: 1. Overview (one sentence: what it is and what problem it solves) 2. Prerequisites and environment requirements 3. Installation/setup steps (with code examples) 4. Core usage (with runnable code snippets) 5. FAQ and troubleshooting guide 6. Reference links Format: Use Markdown. Tag code blocks with language. Display key parameters in tables.
Social Media Post
You are a social media marketing expert. Create posts for the following content. Platform: [Twitter/X / LinkedIn / Instagram / TikTok] Topic: [describe the content/product/event to promote] Goal: [brand awareness / traffic / conversions] Target audience: [describe demographics and interests] Deliver: 1. 3 post variations from different angles 2. Suggested image/visual description for each 3. 5-8 relevant hashtags 4. Best posting time recommendation Constraints: - Stay within platform character limits - Match brand voice and tone - Include engagement hooks (question / poll / CTA)
Product Description
You are an e-commerce copywriting expert. Write a compelling description. Product name: [name] Category: [category] Key features: [list 3-5 core selling points] Target customer: [describe the typical buyer persona] Competitive advantage: [how it differs from competitors] Output: 1. One-line tagline/slogan 2. Short description (under 50 words) 3. Full description (~300 words): pain point > solution > features > social proof > CTA 4. 5 bullet points (each ≤ 15 words)

Analysis Prompt Templates

Data Analysis
You are a data analyst skilled in statistics and data visualization. Analyze the following dataset/data. Data description: [source, fields, time range] Analysis goal: [find trends / detect anomalies / forecast / attribution] Provide: 1. Data overview (key stats: mean, median, std dev, etc.) 2. Core findings (3-5 insights, ranked by importance) 3. Visualization recommendations (chart types and dimensions) 4. Outlier analysis and possible causes 5. Actionable recommendations (data-driven decision advice) Data: ``` [paste data or describe structure] ```
Summarization
You are an information distillation expert. Provide a structured summary. Content type: [paper / report / meeting notes / article / transcript] Target reader: [executives / technical team / general audience] Output: 1. One-sentence summary (max 30 words) 2. Key points (3-5 bullet points) 3. Key data and citations (if any) 4. Main conclusions and recommendations 5. Action items relevant to me (if applicable) Requirements: - Stay objective — do not add personal opinions - Cite sources when identifiable - Distinguish facts from author opinions Source material: [paste content here]
Comparison / Evaluation
You are a neutral industry analyst. Perform a comprehensive comparison. Options: [Option A] vs [Option B] vs [Option C] Use case: [describe the scenario and requirements] Decision maker: [describe role and priorities] Compare across these dimensions: 1. Core features and capabilities 2. Pricing and cost (short-term + long-term TCO) 3. Ease of use and learning curve 4. Community ecosystem and support 5. Scalability and future roadmap 6. Risks and limitations Output format: - Comparison table (features x options matrix) - Detailed analysis per dimension - Scenario-based recommendations - Migration cost assessment (if applicable)
Research Assistant
You are an academic research assistant skilled in literature review and synthesis. Research topic: [specific research question] Field: [computer science / economics / medicine, etc.] Depth: [introductory overview / deep analysis / frontier tracking] Provide: 1. Topic overview and definitions 2. Historical development and key milestones 3. Current mainstream theories / methods / schools of thought 4. Latest research developments (2024-2026) 5. Open questions and future directions 6. Recommended reading list (5-10 key papers/resources) Note: Clearly label what you are confident about vs. what is speculative or general inference. Flag uncertain information explicitly.
Competitive Analysis
You are a market research analyst. Conduct a competitive analysis. My product: [name and brief description] Competitors: [list 3-5 competitors] Target market: [describe target users and market] Analyze: 1. Each competitor's positioning and target audience 2. Feature comparison matrix (core features x competitors) 3. Pricing strategy comparison 4. Strengths and weaknesses (SWOT) 5. Market share and growth trends (if available) 6. Differentiation opportunities for my product 7. Recommended market entry / competitive strategy

Translation & Localization Prompt Templates

Contextual Translation
You are a professional translator fluent in [source language] and [target language] with deep expertise in [domain]. Translate the following from [source language] to [target language]. Translation principles: 1. Stay faithful to the original meaning, but use natural target-language expressions 2. Preserve technical terms (add original in parentheses on first occurrence) 3. Adapt sentence structure to target-language conventions 4. Maintain the tone and formality level of the original Context: - Text type: [blog / legal document / marketing copy / technical manual] - Target reader: [describe] - Brand voice: [describe] Source text: [paste source text here] Also provide: 1. The translation 2. Notes on cultural differences or translation challenges
Technical Translation
You are a technical translation expert specializing in [technical domain]. Translate the following technical content, strictly following these rules: 1. Keep industry-standard terminology consistent (reference [standard, e.g., Microsoft LIP]) 2. Do NOT translate code, commands, filenames, or API names 3. Keep variable names and placeholders as-is 4. Follow the target platform's localization conventions for UI strings 5. Expand technical abbreviations on first occurrence Output format: - Paragraph-by-paragraph parallel translation - Glossary (source term > translated term) Source text: [paste technical document here]
Localization (Cultural Adaptation)
You are a localization expert deeply familiar with [target market] culture and consumer psychology. Adapt the following content for localization (not just translation, but cultural adaptation). Source content: [paste original] Source market: [e.g., United States] Target market: [e.g., Japan / Brazil / Middle East] Handle: 1. Cultural references and metaphors > replace with target-culture equivalents 2. Number formats (dates, currency, units) > convert to local formats 3. Color and image meanings > flag potential cultural taboos 4. Humor and wordplay > create equivalent effects in target language 5. Legal and compliance > note relevant local regulation differences Output: 1. Fully localized content 2. Change log (original > localized version > reason for change)

Advanced Prompt Techniques

1. Chain-of-Thought (CoT) Prompting

Asking the AI to "think step by step" significantly improves accuracy on complex reasoning tasks. This technique is especially effective for math problems, logical reasoning, and multi-step decision-making.

A farm has 35 chickens and 12 cows. How many legs are there in total? Think step by step: - Step 1: Determine the number of legs per animal type - Step 2: Calculate each separately - Step 3: Sum the totals Give the final answer.

2. Few-Shot Learning

Provide 2-3 input/output examples to help the AI understand your expected format and style. This is often more effective than verbose written instructions.

Classify the following product reviews as "positive", "negative", or "neutral". Example 1: Review: "These headphones have amazing sound quality and are super comfortable!" Classification: positive Example 2: Review: "Terrible build quality. Broke after two days." Classification: negative Example 3: Review: "It's okay, nothing special." Classification: neutral Now classify this review: Review: "[paste review here]" Classification:

3. System Prompts vs User Prompts

System prompts set the AI's role, capabilities, and behavioral rules — typically configured once at the start of a conversation. User prompts contain the specific instructions for each turn. Place invariant rules in the system prompt and variable tasks in the user prompt to maintain consistency across a conversation.

# System Prompt Example You are a professional Python development consultant. Follow these rules: 1. Use Python 3.12+ syntax in all code examples 2. Always include type annotations 3. Prefer standard library over third-party packages (unless necessary) 4. Add brief comments to every code block 5. If there are multiple solutions, present the most Pythonic approach first # User Prompt How do I implement a thread-safe singleton pattern?

4. Temperature & Top-p Settings Guide

These two parameters control the randomness and creativity of AI output:

  • Temperature: Range 0-2. Low (0-0.3) = deterministic, ideal for code generation and data analysis. Medium (0.4-0.7) = balanced, good for general writing. High (0.8-1.5) = creative, great for brainstorming and creative writing.
  • Top-p (nucleus sampling): Range 0-1. Similar effect to temperature but different mechanism. Top-p = 0.1 means sampling only from the top 10% most probable tokens. Generally, adjust only one of these parameters at a time.
  • Recommended settings: Code generation = temp 0.1-0.2; Technical writing = temp 0.3-0.5; Marketing copy = temp 0.7-0.9; Creative brainstorming = temp 1.0-1.3.

Common Prompt Mistakes

Avoiding these common prompt design mistakes will immediately improve your AI output quality:

1. Vague Instructions

Bad: "Write me something" — Good: "Write a 150-word value proposition for my SaaS landing page targeting startup CTOs in a professional but approachable tone." Specific context and constraints are the foundation of effective prompts.

2. Cramming Too Many Tasks

Bad: "Write code, tests, docs, and do a code review" — Good: Break complex tasks into separate prompts, each focused on a single objective. This lets the AI deliver higher quality on each individual task.

3. Ignoring Output Format

Without specifying the output format, the AI will choose its own — and the result often won't match your expectations. Be explicit: Markdown table, JSON, numbered list, code block, etc. Format constraints make output more predictable and usable.

4. Not Providing Examples

No amount of written description is as clear as one concrete input/output example. Especially for classification and format conversion tasks, 2-3 few-shot examples can boost accuracy by 20-40%.

5. Skipping Role Assignment

"You are a senior frontend engineer" vs "You are a product manager" will produce completely different answers to the same question. Role assignment helps the AI select the right knowledge domain and response style.

6. Not Iterating

Great prompts are rarely written correctly on the first try. Treat prompt engineering as an iterative process: write an initial version > review output > analyze issues > refine the prompt > repeat. Save effective prompt templates for reuse.

Prompt Editor

Edit or paste your prompt template below, then copy it with one click. You can also pick a template from the library above as a starting point.

FAQ

Do I need to know how to code to learn prompt engineering?
No. Prompt engineering is fundamentally about clear logical thinking and communication skills, not coding. That said, understanding basic programming concepts (variables, conditionals, loops) can help you build more structured prompts, especially when calling AI models via APIs.
The same prompt gives different results on different models. What should I do?
This is normal. Different models have different training data, architectures, and instruction-following behaviors. Tips: (1) Maintain separate optimized prompt versions for your primary models; (2) Use structured frameworks like RICE/CRISPE from this page — structured formats transfer better across models; (3) Test with low temperature (0.1-0.3) to isolate randomness.
Are longer prompts always better?
Not necessarily. Overly long prompts can: (1) dilute key instructions, causing the AI to miss important requirements; (2) increase token consumption and API costs; (3) approach context window limits. Best practice: keep prompts concise but complete — include all necessary information while removing redundancy.
How do I evaluate prompt effectiveness?
Evaluate across four dimensions: (1) Accuracy — Is the output correct? (2) Relevance — Does it answer your question? (3) Format compliance — Does the output match your specified format? (4) Consistency — Do multiple runs produce similar results? For critical use cases, run the same prompt 3-5 times and pick the best output.
Can I use these templates directly with ChatGPT and Claude?
Yes. All templates on this page have been tested on ChatGPT (GPT-4o) and Claude (3.5 Sonnet). Simply replace the [bracketed] placeholders with your specific content. The templates also work with Gemini, Llama, and other LLMs, though minor tweaks based on each model's characteristics are recommended.