Most people treat prompts like search keywords. Professional prompt engineers treat them like structured specification documents. The difference in output quality is enormous.
Element 1: Role
The Role defines who the AI should embody. It has two layers: persona sets the domain and expertise level; skills refine specific capabilities.
Weak vs Strong Example
- Weak: "Explain this code.
- Strong: "You are a senior security-focused code reviewer. Audit this code and identify risks."
Element 2: Requirements
Requirements define what "good" looks like. It has three dimensions:
- Content requirements: what topics to include and what to exclude
- Format requirements: output structure (bullets, JSON, prose)
- Quality requirements: reading level, tone, audience sophistication
Element 3: Task
The Task is the core instruction. Use precise verbs: analyze, critique, generate, rewrite, debug, summarize, classify, extract, plan, evaluate.
Element 4: Examples
Examples are the most underused element, and often the highest-leverage addition. They work in three ways:
- Successful examples: show the expected format and style
- Failure examples: explicitly name error patterns to avoid
- Format templates: provide a precise output structure
Few-Shot Prompting
This technique is called few-shot prompting. Research shows it produces more consistent outputs than bare instructions, especially for tasks with strict formatting requirements.
Element 5: Constraints
Constraints define boundaries the model must respect. They serve three purposes:
- Hard rules (red lines): non-negotiable constraints like word count or no medical advice
- Preferences: soft guidance for when the model has agency, like prefer active voice
- Risk avoidance: safeguards against problematic outputs like don't speculate beyond what's provided
Element 6: Process
The Process defines the sequence of steps the model should follow before producing the final output. It's the most powerful element for handling complex tasks.
With vs Without Process
Without process: "Is this business idea viable?" — produces opinion without logic.
- With process Step 1: Identify the target customer and their core problem
- Step 2: Assess whether the problem is mainstream or niche
- Step 3: Evaluate whether the solution is better than existing alternatives
- Step 4: Identify the top three risks
- Step 5: Provide a judgment with reasoning based on the above analysis
Full Example: Using All 6 Elements
- Role: "You are a content strategist writing for busy professionals.
- Requirements: 400 words, H2 section headings, direct tone, each section needs one real case study.
- Task: Explain why most people fail to build habits and the three most effective strategies.
- Examples: [paste a sample paragraph showing the expected style]
- Constraints: Do not reference Atomic Habits; no motivational language; flag unverified claims.
- Process: 1) One sentence stating the problem 2) One paragraph explaining the difficulty 3) Three H2 strategies 4) One-sentence summary.
When to Use Each Element
- Simple tasks (translation, typos): Task alone is enough
- Medium tasks (descriptions, concept explanation): Role + Task + Requirements
- Complex tasks (strategic analysis, long docs): All six elements
- Production systems (real features in a product): All six elements, with special attention to Constraints and Process