After months of using AI for professional work, I've developed a collection of prompt templates that consistently produce high-quality outputs. These aren't generic examples—they're battle-tested patterns refined through hundreds of iterations. Each template includes placeholders you can customize, along with explanations of why each element matters.
Code Generation Template
This template works for generating functions, classes, or entire modules. It ensures the code follows best practices and includes proper documentation.
You are an expert [LANGUAGE] developer with [X] years of experience in [DOMAIN]. Task: [DESCRIBE WHAT THE CODE SHOULD DO] Requirements: - Follow [FRAMEWORK/LIBRARY] conventions - Include comprehensive error handling - Add type hints/annotations - Write clear docstrings - Follow [STYLE_GUIDE] style guide - Include unit tests Context: [RELEVANT BACKGROUND INFORMATION] Output format: [CODE_ONLY / CODE_WITH_EXPLANATION] Please provide the implementation with comments explaining key decisions.
Technical Writing Template
For documentation, blog posts, or technical articles. This template ensures clarity, proper structure, and appropriate depth.
You are a technical writer specializing in [DOMAIN] for [AUDIENCE]. Write a [LENGTH] article about [TOPIC]. Structure: 1. Introduction: Hook and overview 2. Core concepts: Explain [KEY_CONCEPTS] 3. Practical examples: [NUMBER] real-world examples 4. Common pitfalls: What to avoid 5. Conclusion: Summary and next steps Tone: [PROFESSIONAL / CONVERSATIONAL / ACADEMIC] Technical level: [BEGINNER / INTERMEDIATE / ADVANCED] Include code examples where relevant. Use clear headings and bullet points for readability.
Data Analysis Template
For analyzing datasets, generating insights, or creating reports. This template ensures thorough analysis with actionable conclusions.
You are a data analyst with expertise in [DOMAIN]. Analyze the following data: [DESCRIBE_DATA_SOURCE] Focus areas: - [KEY_METRIC_1] - [KEY_METRIC_2] - [KEY_METRIC_3] Questions to answer: 1. [QUESTION_1] 2. [QUESTION_2] 3. [QUESTION_3] Output format: - Executive summary (2-3 sentences) - Key findings (bullet points) - Detailed analysis - Recommendations - Limitations and caveats Use specific numbers and percentages. Highlight trends and anomalies.
Creative Writing Template
For stories, marketing copy, or creative content. This template helps maintain consistent voice and style.
You are a [GENRE] writer known for [STYLE_DESCRIPTION]. Write [FORMAT: story/email/blog post] about [TOPIC]. Key elements: - Target audience: [AUDIENCE] - Tone: [VOICE_DESCRIPTION] - Length: [WORD_COUNT] - Key message: [CORE_MESSAGE] Style guidelines: - [STYLE_RULE_1] - [STYLE_RULE_2] - [STYLE_RULE_3] Avoid: [THINGS_TO_AVOID] Include: [ELEMENTS_TO_INCLUDE]
Problem-Solving Template
For complex problems requiring analysis and solution design. This template ensures thorough thinking and consideration of alternatives.
You are a [DOMAIN] expert consultant. Problem: [DESCRIBE_PROBLEM] Context: - Current situation: [CURRENT_STATE] - Constraints: [CONSTRAINTS] - Goals: [DESIRED_OUTCOME] - Stakeholders: [WHO_IS_INVOLVED] Analyze this problem step by step: 1. Break down the problem into components 2. Identify root causes 3. Generate 3-5 potential solutions 4. Evaluate each solution (pros/cons) 5. Recommend the best approach 6. Outline implementation steps 7. Identify risks and mitigation strategies Think through this systematically. Show your reasoning for each step.
Customization Tips
These templates are starting points. Customize them based on:
- Your specific domain: Add domain-specific terminology and constraints
- Output requirements: Adjust format, length, and structure
- Model capabilities: Some models handle certain tasks better than others
- Iteration needs: Start broad, then refine based on initial outputs
Save your customized templates. Over time, you'll build a library of prompts that work reliably for your specific use cases. The best prompts are often highly specific to your workflow and requirements.
Template Best Practices
- • Always specify role and expertise level
- • Include clear structure and format requirements
- • Provide context and constraints
- • Request step-by-step reasoning for complex tasks
- • Iterate and refine templates based on results