Quick Answer
Prompt engineering is the practice of designing clear inputs that make AI models produce specific, high quality outputs. Five core techniques work across all major models: role prompting, few-shot examples, chain of thought reasoning, format specification, and constraints. It is structured communication, not tricks, giving AI enough context to answer reliably.
What Is Prompt Engineering?
The five prompt engineering techniques that work on any AI are role prompting, few-shot examples, chain of thought, format specification, and constraint setting (arXiv; OpenAI). Prompt engineering is not a technical skill reserved for developers. It is the practice of communicating clearly and precisely with AI systems to get reliably useful output.
Think of it this way: when you give a colleague a task, you do not just say "write something about marketing." You say who it is for, what format you need, what length, what tone, and what the goal is. Prompt engineering applies the same principle to AI. The model is not thinking; it is pattern-matching your input to produce an output. The quality of your input determines the quality of the output.
The 5 techniques below work across ChatGPT, Claude, and Gemini. They are all available for free in the PromptCraft Asia library with ready-to-use templates.
Technique 1: Role Prompting
What it is: Opening your prompt by assigning the AI a specific role, expertise level, and relevant experience before giving the task.
Formula: You are a [ROLE] with [X] years of experience in [FIELD/DOMAIN].
Why it works: Role prompting activates relevant patterns in the model's training. An AI told it is a "senior copywriter with 12 years of direct response experience" will weight different vocabulary, sentence structures, and persuasion techniques than an AI given no role context. The role narrows the possibility space from "all possible responses" to "responses appropriate to this expert."
Without role prompting: "Write a subject line for a promotional email."
With role prompting: "You are a direct response copywriter with 10 years of experience writing email campaigns for B2C e-commerce brands. Write 5 subject line options for a promotional email offering 25% off [PRODUCT] to existing customers. Focus on curiosity and urgency, not discounts."
The second prompt reliably produces more specific, higher-performing output.
Technique 2: Few-Shot Examples
What it is: Providing 2-3 examples of the output you want before making your actual request. The AI learns the pattern from the examples and applies it.
Formula: "Here are 2 examples of [OUTPUT_TYPE] I want: [EXAMPLE_1], [EXAMPLE_2]. Now write [N] more in the same style for [TOPIC]."
Why it works: Examples communicate tone, style, length, and structure more precisely than any description. Instead of trying to articulate "witty but not sarcastic, punchy, under 10 words," you just show two examples that embody it. The AI pattern-matches to your examples rather than to a generic average.
Example in use:
"Here are 2 newsletter subject lines I like: 'The 8-minute meeting that changed everything' and '3 things I stopped doing after Singapore'. Write 5 more in this style for a newsletter about [TOPIC]."
Few-shot prompting is especially powerful for: subject lines, social captions, taglines, code comments, and any task where style consistency matters. For a deeper look at zero-shot vs few-shot prompting and when each one wins, see our dedicated comparison guide.
Technique 3: Chain of Thought
What it is: Instructing the AI to reason through a problem step by step before producing its final answer.
Trigger phrases: "Think step by step before giving your answer." / "Show your reasoning." / "Work through this systematically."
Why it works: For complex tasks, forcing the AI to produce intermediate reasoning before its conclusion significantly improves output accuracy. Without chain of thought, the model jumps to a likely-looking answer. With it, the model builds toward a conclusion, catching errors in its own reasoning as it goes.
Best for: Math and calculations, logical analysis, strategy recommendations, diagnosing a problem, evaluating trade-offs, and any task where the right answer depends on a sequence of reasoning steps.
Example: "A company's revenue grew from $800K to $1.2M over 3 years. Think step by step: calculate the total growth, then the CAGR, then tell me whether this rate is above or below the typical SaaS industry benchmark of 25% annual growth."
Technique 4: Format Specification
What it is: Explicitly stating the structure and format of the output you want.
Common formats to specify: Numbered list, bullet points, table, JSON, markdown with headers, plain prose, Q&A pairs, SWOT matrix, before/after comparison, step-by-step instructions.
Why it works: Without a format specification, the AI chooses a format based on what looks appropriate to it. This leads to inconsistent output that requires reformatting. Specifying the format upfront eliminates the reformatting step entirely.
Weak prompt: "Summarize this article."
Strong prompt: "Summarize this article in the following format: (1) One-sentence headline, (2) 3 key points as bullet points, (3) One thing I should do with this information. Article: [ARTICLE]"
You can also specify what NOT to use: "Output as a table. No introductory paragraph. No bullet points."
Technique 5: Constraint Setting
What it is: Adding explicit guardrails that tell the AI what to avoid, what limits to stay within, and what assumptions to reject.
Common constraints:
- Length: "Under 100 words." / "Exactly 3 paragraphs."
- Vocabulary: "Avoid jargon." / "Write for a 10-year-old."
- Tone: "No exclamation marks." / "Do not use 'excited' or 'thrilled'."
- Structure: "Do not use bullet points." / "No numbered lists."
- Content: "Do not mention competitors." / "Avoid mentioning price."
Why it works: Constraints shape the possibility space. Without constraints, the AI optimizes for the average acceptable output. With constraints, it is forced to find the best output within your specific requirements. Counterintuitively, adding constraints often produces more creative output because the AI has to work harder to meet all conditions simultaneously.
Adding even 2-3 constraints to any prompt consistently improves output quality.
What Are the Model-Specific Tips for 2026?
- Claude: Responds exceptionally well to XML tags for organizing complex instructions. Use
<task>,<context>,<format>, and<constraints>tags to structure multi-part prompts. Claude also handles very long context windows, so you can include full documents for analysis. - ChatGPT: The Role + Step-by-step structure is the most reliable formula. Use custom instructions to save your role and tone preferences so you do not repeat them every session. Projects with system instructions help maintain consistency across a series of related tasks.
- Gemini: Benefits from structured inputs with clear section labels. Gemini's integration with Google Workspace means it works well with prompts that reference specific documents, calendar context, or Google products. Use clear headers when providing multi-part instructions.
How Do You Apply These Techniques with Ready-Made Prompts?
All 5 techniques above are built into the prompts in the PromptCraft Asia library. Every prompt is engineered using these principles, tagged by model, and available with fill-in-the-blank variables. Browse by category or search for your use case. No signup required.
Start with the full prompt writing guide for a deeper dive into each technique, or go directly to the library to find prompts for your specific task.