- 1. Overview and Mental Model
- 2. Foundations: What a Prompt Really Is
- 3. Taxonomy of Prompt Engineering Techniques
- 4. Prompt Engineering vs Context Engineering
- 5. Markdown Prompting: Why It's So Powerful
- 6. Core Prompting Patterns (with Copy-Paste Templates)
- 7. Context Engineering: RAG, Chunking, and Formatting
- 8. JSON Prompting and Structured Outputs (Text Models)
- 9. JSON Prompting for Image Generation
- 10. Context + JSON: Full-Stack Prompt and Context Engineering
- 11. Special Topics
- 12. Learning Path: From Beginner to Master
- 13. Key Research Papers and Resources for Deep Study
- References
Prompt engineering is the discipline of designing inputs to generative models (LLMs, vision models, etc.) so that they reliably produce the behaviors and outputs you want, without changing model weights.123 Context engineering is the complementary discipline of curating, structuring, and injecting external information (documents, tools, state) so that the model reasons over the right facts in the right format, especially in retrieval-augmented generation (RAG) and tool-using systems.456 Together, they form a full-stack interface layer between humans and foundation models: prompts tell the model "how" to think and act; context tells it "what" to think over.
This playbook is structured as a practical workbook: every major section includes copy-pasteable prompt templates and exercises you can run directly in any advanced LLM (ChatGPT, Claude, Gemini, etc.). It also points to current survey papers and research so you can go deep on theory and empirical results.231
Modern research treats a prompt as a program written in natural and semi-structured language that configures a frozen model to perform a task.32 A single prompt typically encodes several components:
- Instruction: What role or task the model should perform ("You are a security code reviewer").
- Constraints: Style, length, safety, formatting requirements ("Output valid JSON only").
- Examples: Few-shot demonstrations of input→output pairs to shape behavior.
- Context: Task-specific data (docs, tables, user profile, conversation history).
- Control signals: Delimiters, section headers, markers, and schemas that tell the model how to segment and interpret the text.12
A useful mental model is: Prompt = Instruction + Context + Control Structure + Examples + Output Schema.
Survey work emphasizes that prompt engineering lets you repurpose a pre-trained model for new tasks without retraining, by operating purely at the input level.23 Fine-tuning and parameter-efficient methods (LoRA, adapters, etc.) change the model weights; prompts change the activation path.
In practice:
- Use prompt engineering alone for most application logic, formatting, and interaction patterns.
- Use context engineering when you need domain knowledge, personalization, or grounding in proprietary data.
- Consider fine-tuning only when behavior must be extremely consistent over a narrow domain and cannot be achieved with prompts + context.
Recent surveys and The Prompt Report categorize dozens of techniques.312 This playbook groups the most practically useful ones into the following families:
| Family | Examples | Primary Use |
|---|---|---|
| Instruction-style prompting | Role prompting, system messages, style constraints | General behavior steering |
| Example-based prompting | Few-shot, many-shot, contrastive examples | Task adaptation, format learning |
| Reasoning prompts | Chain-of-thought, tree-of-thought, self-consistency, self-critique | Hard reasoning, math, coding |
| Decomposition prompts | ReAct, task decomposition, tool-calling patterns | Complex workflows, agents |
| Output-structure prompts | JSON schemas, XML, Markdown frames | API integration, post-processing |
| Safety/control prompts | Guardrails, refusal policies, red-teaming prompts | Safety, compliance |
| Optimization/meta-prompts | Prompt search, automatic prompt optimization | Systematic performance tuning |
The Prompt Report identifies over 50 text prompting techniques and 40 multimodal ones; this playbook focuses on those that are actionable for practitioners while pointing you to survey papers for exhaustive taxonomies.123
- Prompt engineering: Designing the instructions, roles, and structures that tell the model how to process inputs and format outputs.
- Context engineering: Designing what information the model sees for a specific task instance and how that information is presented (chunking, ordering, delimiters, schemas).564
Research on RAG shows that simply retrieving relevant documents is not enough; the way those documents are chunked, ordered, labeled, and delimited significantly affects accuracy and robustness.645 This leads to the idea that context engineering is as important as prompt wording.
A useful division:
-
Prompt
- Defines objectives (what is success?).
- Specifies reasoning style (step-by-step, skeptical, concise, etc.).
- Constrains outputs (JSON, Markdown, minimal prose).
- Encodes safety and policy.
-
Context
Together they form a prompted RAG pipeline: retrieval (context selection) + context formatting + instruction.
-
Emphasize prompt engineering when:
- The model already "knows" the domain (general knowledge, programming, generic writing).
- Your main problems are hallucinations of form (wrong style) rather than fact.
- You need to standardize outputs for downstream tools.
-
Emphasize context engineering when:
Base prompt (ChatGPT / Gemini system message style):
You are an expert technical writer. Given context documents and a user question, you will:
- Read and synthesize the context.
- Answer using only information supported by the context.
- Cite section titles from the context in parentheses.
If information is missing, explicitly say you cannot find it.Context variant A (bad context engineering):
- Huge raw PDF dump pasted without headings or segmentation, truncated mid-sentence.
Context variant B (good context engineering):
- 3–5 chunks: "Overview", "API Reference", "Rate Limits"; each chunk clearly delimited, with titles and bullet summaries.
Same prompt, different context; variant B yields much more accurate and stable answers because the model can locate and reason over relevant information more effectively.45
Exercise:
- Take any 10–20 page technical document.
- Run the same QA prompt twice: once with raw copy/paste, once with carefully chunked and titled sections.
- Compare factual accuracy and latency. Note which context engineering decisions helped.
Markdown provides a small set of structural primitives—headings, lists, code blocks, tables—that LLMs are highly sensitive to and trained on extensively. Empirical guidance and survey papers highlight that explicit structural cues and delimiters significantly improve reliability and reduce ambiguity.21
Benefits of Markdown prompting:
- Structure clarity: Headings separate roles, instructions, examples, and schemas.
- Parsing friendliness: Models can more easily emit structured sections and code blocks that downstream tools parse.
- Cognitive scaffolding: For the model, the structure hints at the intended "program flow" (e.g., instructions first, then examples, then tasks).
This is a reusable skeleton for complex tasks (ideal for custom GPTs / Gemini Gems):
# Role
You are an expert {{domain}} assistant.
Your primary goals are:
- Goal 1
- Goal 2
- Goal 3
# Capabilities
- You can explain concepts at multiple levels of depth.
- You can ask clarification questions when user requests are ambiguous.
- You can produce structured outputs in Markdown and JSON.
# Constraints
- Never fabricate citations or sources.
- If unsure, say "I don't know" and explain what information is missing.
- Keep answers concise unless the user explicitly requests depth.
# Style
- Use clear, direct language.
- Prefer bullet lists over long paragraphs when enumerating items.
- Include short code examples where relevant.
# Input Format
The user will provide:
- A natural language question.
- Optional context delimited by triple backticks.
Example:
```context
<user context here>
```
# Output Format
Always respond in this structure:
```markdown
## Direct Answer
<2–4 sentences>
## Reasoning
<step-by-step reasoning or analysis>
## Next Steps
<follow-up recommendations, links, or questions>
```
# Examples
## Example 1
**User:** Explain overfitting in machine learning.
**Assistant:**
## Direct Answer
Overfitting occurs when a model memorizes training data rather than learning general patterns...
## Reasoning
...
## Next Steps
...
# Task
Now, respond to the next user message using the above rules.You can specialize this skeleton for any domain (security code reviews, legal analysis, growth marketing audits, etc.).
Custom GPTs and Gemini Gems typically support a "system prompt" or "instructions" field that is always prepended to the conversation. Using structured Markdown here provides several advantages:
- Separable sections: Role, rules, tools, and output formats are clearly partitioned.
- Easy editing: You can tweak one section (e.g., "Style") without touching others.
- Meta-prompting: The prompt itself documents how the assistant behaves, which helps users discover capabilities.
Template: System Prompt for a Custom Security Code Reviewer GPT
# Role
You are a senior application security engineer and code reviewer.
# Primary Objectives
- Identify security vulnerabilities in code.
- Explain risks in practical language.
- Recommend concrete, minimal fixes.
# Scope
- Web applications (Node.js, React, Next.js, Express).
- APIs and microservices.
- Authentication, authorization, input validation, data protection.
# Analysis Workflow
1. Understand the architecture and threat model based on the provided code and description.
2. Identify potential vulnerabilities using OWASP Top 10 and common security frameworks.
3. For each issue, provide:
- A short title.
- Risk level: Low, Medium, High, Critical.
- Impact description.
- Code-level remediation steps.
# Input Format
User will provide one or more of:
- Code snippets.
- High-level architecture descriptions.
- Logs or error messages.
# Output Format
Always respond using this Markdown structure:
```markdown
## Summary
- Overall risk level: <Low/Medium/High/Critical>
- Key issues: <list>
## Findings
### 1. <Issue title>
- Risk: <level>
- Description: <what and why>
- Impact: <business/technical impact>
- Recommendation: <code or config changes>
### 2. ...
## Secure Implementation Example
```language
<secure code snippet>
```
## Checklist
- [ ] Input validation implemented
- [ ] Authentication enforced
- [ ] Authorization checks present
- [ ] Secrets not hard-coded
- [ ] Logging avoids sensitive data
```
# Style
- Use precise technical language.
- Assume the reader is a competent developer.
- Avoid fear-mongering; be factual and solution-oriented.
# Behavior
- If the user asks for something outside security, briefly answer then steer back to security considerations.This kind of Markdown prompt becomes both the spec and contract for your custom agent.
- Create three variants of the same system prompt:
- One monolithic paragraph.
- One with clear Markdown sections.
- One with sections + examples.
- Run 5–10 diverse test queries against each and compare:
- Consistency of output structure.
- Adherence to rules.
- Need for post-processing.
You will typically see major gains from structured Markdown, especially for long-running tools and workflows.
This section covers fundamental patterns that underlie most effective prompting techniques, with ready-to-use templates. Survey papers group many of these under broader categories like instruction prompting, few-shot learning, and chain-of-thought prompting.32
Concept: Explicitly define the assistant's role, the task, and non-negotiable constraints.
Template:
You are a {{role}}.
Task: {{clear description of what to do}}.
Constraints:
- {{Constraint 1}}
- {{Constraint 2}}
- {{Constraint 3}}
Now process the following input:
```input
{{user_input}}
```Example (Growth Experiment Designer):
You are a senior growth product manager.
Task: Design 3 high-impact growth experiments for a B2B SaaS that helps SMBs automate invoicing.
Constraints:
- Focus on experiments that can be run within 2 weeks.
- Each experiment should have a clear hypothesis, metric, and target segment.
- Use concise bullet points.
Now process the following input:
```input
Current metrics: 500 paying customers, 8% monthly churn, 14-day free trial with 20% free-to-paid conversion.
Key channels: LinkedIn outbound, content marketing.
```Exercise: Adapt this template to create a "Technical Architecture Reviewer" role for one of your own projects.
Few-shot prompting shows the model examples so it can infer the mapping from input to output format without explicit rules.23
Template:
You are learning from examples.
## Example 1
Input:
"Write a short, friendly reminder email to a client about an overdue invoice."
Output:
Subject: Gentle Reminder: Invoice Payment
Hi {{client_name}},
Just a friendly reminder about invoice {{invoice_number}}...
## Example 2
Input:
"Draft a concise internal Slack message announcing a successful feature release."
Output:
Hey team,
Quick update: we just rolled out...
## Task
Now generate an output for this new input, following the same style and level of detail:
Input:
"{{your_input_here}}"Tips:
- Keep examples short and very consistent in format.
- Include edge cases (e.g., negative sentiment, errors).
- Ensure examples do not contradict your constraints.
CoT prompts encourage the model to show intermediate reasoning steps for tasks like math, logic, and code debugging.32
Simple CoT Template:
You are a careful reasoner.
When solving a problem:
1. Restate the problem in your own words.
2. Think step by step.
3. Check your answer.
4. Then provide the final answer clearly.
Problem:
{{problem_here}}With Hidden Reasoning (for user-friendly outputs):
You are a careful reasoner.
First, think through the solution step by step in a hidden scratchpad that you do not show the user.
Then, provide only the final answer and a concise explanation for the user.
Problem:
{{problem_here}}Some models support native "structured reasoning" tools; the general idea is the same: explicitly request stepwise analysis before the final answer.12
Research shows that having the model critique and revise its own output can improve quality and robustness.12
Two-stage Template:
Stage 1: Draft
You are an expert {{domain}} assistant.
First, produce your best draft answer to the following question.
Question:
{{question_here}}
---
Stage 2: Critique and improve
Now, as a critical reviewer, analyze the previous draft.
Identify:
- Any factual errors or unsupported claims.
- Any unclear explanations.
- Any missing important considerations.
Then, write an improved answer that addresses those issues.
Provide your response in this structure:
1. Bullet list of critiques.
2. Revised answer.You can implement this as two separate model calls (draft → critique → final) inside an agent, or as one multi-turn conversation.
The ReAct pattern interleaves reasoning ("Thought") and acting ("Action") for tool-augmented agents.21
Skeleton:
You are an agent that can use tools.
At each step, you may:
- Think about what you need to do next.
- Choose one tool and call it.
- Observe the result.
Use this exact format:
Thought: <your internal reasoning>
Action: <tool_name>[<arguments>]
Observation: <tool output>
Repeat Thought → Action → Observation as needed, then finish with:
Final Answer: <your answer to the user>
User question:
{{question_here}}Many modern agent frameworks (LangChain, LlamaIndex, etc.) implement variations of this pattern; the prompt still matters for clarity and error reduction.12
RAG combines retrieval from external knowledge sources with generation from an LLM.65
The high-level pipeline:
- Encode query and documents.
- Retrieve top-k relevant chunks.
- Format retrieved chunks as context.
- Call LLM with instructions + context.
Recent work shows that context formatting choices (delimiters, ordering, key-value structure) can significantly change accuracy, even when semantic content is identical.4 For example, changing delimiters or the density of context can improve robustness to order variation and long-context utilization.4
Common chunking strategies:
- Fixed-size windows: e.g., 512–1024 tokens with overlap; simple but may break semantics.56
- Semantic / structure-aware chunking: split by headings, sections, paragraphs, or AST nodes; preserves logical units.5
- Graph / knowledge-based: retrieve related nodes in a knowledge graph to capture relationships across documents.5
For engineering docs, structure-aware and graph-aware chunking have been shown to improve grounding and technical accuracy versus naive fixed windows.5
General RAG QA Prompt with Structured Context:
You are a question-answering assistant grounded in the provided context.
Instructions:
- Use only the information in the context to answer.
- If the answer is not in the context, say "I cannot answer from the provided context".
- Cite the section titles from the context where you found the answer.
# Context
You will receive one or more context chunks.
Each chunk has this structure:
---
[CHUNK {{index}}]
Title: {{title}}
Source: {{file or URL}}
{{content}}
---
# Question
{{user_question}}
# Output Format
```markdown
## Answer
<your grounded answer>
## Evidence
- [CHUNK X] <why this chunk supports your answer>
- [CHUNK Y] ...
## Missing Information
<what additional info would be needed if the context is insufficient>
```This pattern works well in both single-shot use and as a base prompt inside a RAG microservice.
When context is large, you need to compress while preserving task-relevant information. Recent RAG guides and research suggest:
- Summarize irrelevant sections more aggressively; keep critical ones verbatim.65
- Use task-aware summarization prompts ("summarize for security review" vs generic summarization).
- Avoid mixing unrelated domains in the same context window.
Context Compression Prompt:
You are compressing documentation for a security code review assistant.
Goal: Reduce the following text to the minimum needed to:
- Understand authentication and authorization flows.
- Identify places where user input is accepted.
Output:
- A bullet list of endpoints and their auth requirements.
- A bullet list of input fields and validation rules.
Text:
```doc
{{doc_chunk}}
```Use such specialized compression prompts before feeding context into your main task prompt.
- Implement a simple RAG loop (in your language of choice) with:
- Fixed-size chunking.
- Heading-aware chunking.
- Use the same QA prompt and evaluate on 20 questions:
- Accuracy.
- Citation quality.
- Model verbosity.
- Experiment with different delimiter styles:
- Plain text.
- Markdown sections.
- Explicit
[CHUNK X]markers.
Compare results and document your findings.
JSON prompting asks the model to emit responses in strict JSON structures. This is crucial for building reliable pipelines, tools, and evaluation harnesses.21
Benefits:
- Machine-readable: Easy parsing in any programming language.
- Schema enforcement: You can validate outputs against JSON Schema.
- Deterministic interfaces: Prompts can evolve while the schema stays stable.
Surveys note that output-structure prompting (JSON/XML) is a major category of techniques for integrating LLMs into larger systems.312
You are an information extraction system.
Extract the required fields from the input text.
Respond with a single JSON object that matches this schema:
{
"company_name": string,
"industry": string,
"employee_count_range": "1-10" | "11-50" | "51-200" | "201-1000" | "1000+",
"funding_stage": "bootstrapped" | "pre-seed" | "seed" | "series-a" | "series-b" | "series-c+" | "public" | "unknown"
}
Rules:
- Do not include any keys other than those in the schema.
- Use all-lowercase for enum values.
- If a value is unknown, use "unknown".
Text:
```input
{{company_description}}
```Exercise: Wrap this in your favorite language, call the model on 50–100 LinkedIn "About" sections, and validate outputs with a JSON schema validator.
LLMs sometimes emit extra commentary or invalid JSON. Improve robustness with:
You are a JSON API.
Your entire response must be valid JSON.
Do not include any explanation, comments, or additional text.
Schema:
{
"query": string,
"intent": string,
"entities": [
{
"name": string,
"type": string
}
]
}
If you are unsure about a field, set its value to null.
User query:
"{{user_query}}"Also consider "strict_json": true or equivalent flags when supported by the API.
Complex agents often require nested structures and union types.
Example: Experiment Design Schema
You are an experiment design assistant.
Return experiments in this JSON format:
{
"experiments": [
{
"name": string,
"objective": string,
"hypothesis": string,
"segment": string,
"metric": string,
"variant_type": "copy" | "pricing" | "onboarding" | "feature" | "other",
"implementation_notes": string
}
]
}
Constraints:
- 3–5 experiments only.
- Use concise sentences.
- metric must be a single, primary KPI.
Context:
```product
{{product_description}}
```
Goal:
```goal
{{goal_description}}
```This explicit schema makes it easy to plug the results into experiment tracking tools or dashboards.
For image generation, JSON prompts provide a structured way to describe scenes: subjects, styles, palettes, compositions, and constraints.78910 Anecdotal and community studies show that JSON or style-guide-driven prompts can improve repeatability and control, especially in batch or programmatic generation.810117
Compared to natural language prompts:
- JSON encodes structure (subject vs background vs style) instead of mixing everything in prose.
- JSON is easier to manipulate algorithmically (e.g., vary color palette, keep composition fixed).
- JSON pairs well with validators to ensure inputs are well-formed.
A detailed blog experiment compared a JSON prompt to an equivalent textual prompt for a cybernetic creature; JSON achieved strong compositional control and framing.7
JSON prompt (simplified):7
{
"subject": "Cybernetic Creature",
"description": "Ferocious, furious, extraterrestrial creature with only the face displayed.",
"environment": {
"background": "Extraterrestrial surface with tremors radiating from the central position and purple lights giving an evil, menacing vibe."
},
"color_palette": ["black", "white", "purple"],
"face_features": {
"eyes": {
"size": "small",
"color": "golden",
"expression": "raging"
},
"horns": "yes"
},
"composition": {
"placement": "creature face only, at center",
"effects": ["tremors from center", "purple light rays"]
},
"style": "cybernetic, menacing",
"mood": "evil, furious, extraterrestrial"
}Equivalent text prompt:7
"Create a highly detailed image of a cybernetic creature's face that appears ferocious, furious, and extraterrestrial... Use a palette of black, white, and purple shades. Its eyes should be small, golden, and filled with visible rage."
The JSON approach excelled for repeatability and control, while natural language was more flexible and forgiving for one-off creative tasks.7
PromptJSON provides a JSON-based language for crafting image prompts with a defined schema (Image → Prompts → Attributes, AspectRatio, Style, Dimensions, etc.).8 It separates the main prompt text from artistic attributes like style, mood, and color scheme, enabling richer control and validation.8
JSON style-guide approaches for GPT-4o image models similarly define keys for subject, medium, lighting, color, and composition, ensuring consistent generations across prompts and projects.10
Generic Image Prompt Schema (inspired by PromptJSON + style guides):108
{
"version": "1.0",
"prompts": [
{
"prompt": "string, main description of the scene",
"attributes": {
"style": "string, e.g., cyberpunk, watercolor, photorealistic",
"mood": "string, e.g., melancholic, energetic, ominous",
"camera": "string, e.g., wide-angle, close-up, isometric",
"lighting": "string, e.g., golden hour, neon, studio soft light",
"colorScheme": "string, e.g., complementary purple-yellow",
"resolution": "string, e.g., 4k, poster, thumbnail",
"additional": "string, additional notes"
}
}
],
"aspectRatio": "16:9 | 9:16 | 1:1 | 4:5",
"dimensions": "optional explicit dimensions like 1920x1080",
"negativePrompts": ["optional list of things to avoid"]
}This can be adapted to any image API that accepts JSON inputs.
Template:
{
"version": "1.0",
"brand": {
"name": "YourAKShaw Inc.",
"primaryColors": ["#0FF1CE", "#05080F", "#FFFFFF"],
"secondaryColors": ["#FF007F", "#00FFC2"],
"typography": {
"headline": "Sleek, geometric sans-serif, all caps",
"body": "Clean, modern sans-serif, sentence case"
},
"texture": "Futuristic, cyberpunk, subtle glitches and scanlines"
},
"imageGuidelines": {
"subject": "Tech founders, neural interfaces, cityscapes, abstract data flows",
"style": "High-contrast, cinematic, neon accents on dark backgrounds",
"lighting": "Moody, directional, with neon rim lights",
"composition": "Strong leading lines towards central subject, generous negative space for text",
"avoid": ["cartoonish styles", "overly busy backgrounds", "pastel color schemes"]
}
}You can then programmatically merge this style guide with per-campaign prompts to enforce brand-consistent visuals.
- Define a JSON schema for "LinkedIn carousels" with fields for frame_type, headline, supporting_visual, and accent_color.
- Write a script that:
- Takes a content topic.
- Fills in the schema for 5–10 frames.
- Sends each JSON object to an image model.
- Compare outputs to equivalent natural language prompts; iterate on the schema.
Goal: A research agent that, given a startup's landing page, produces a JSON brief and Markdown summary.
Steps:
- Context engineering
- Scrape page, extract text.
- Chunk by sections (hero, features, pricing, testimonials).
- Prompt engineering (JSON extraction)
You are a SaaS product profiler.
From the provided landing page content, extract this JSON:
{
"product_name": string,
"tagline": string,
"target_audience": string,
"primary_job_to_be_done": string,
"core_features": [string],
"positioning": string,
"pricing_model": string
}
Use null for unknown fields.
Landing page content:
```landing
{{landing_text}}
```- Prompt engineering (Markdown narrative)
You are a startup analyst.
Using the JSON below, write a concise, founder-friendly summary in Markdown.
JSON:
```json
{{extracted_json}}
```
Output structure:
```markdown
## Product Snapshot
<1–2 sentences summary>
## Target Users
- <bullet list>
## Core Value Proposition
<short paragraph>
## Key Features
- <features>
## Go-To-Market Notes
<short paragraph>
```This demonstrates how prompt engineering (instructions + schemas) and context engineering (scraping, chunking) combine into a robust pipeline.
Survey papers emphasize that many prompting techniques are benchmarked empirically; performance varies by model, task, and dataset.312 In practice, treat prompting as an experimental process with:
- Metrics: accuracy, latency, cost, user satisfaction.
- A/B tests: compare prompt variants on held-out tasks.
- Logs: capture failure cases for iterative prompt refinement.
Meta-Prompt for Automated Prompt Search (Simplified):
You are a prompt optimizer.
Given a task description, current prompt, and examples of failures, propose 3 improved prompt variants.
Each variant must include:
- A short name.
- The full prompt text.
- A bullet list of hypotheses about why it might work better.
Task description:
{{task_description}}
Current prompt:
```prompt
{{current_prompt}}
```
Failure examples:
```failures
{{failure_examples}}
```You can then feed these variants into your evaluation harness.
The Prompt Report and related work cover safety-oriented prompting and red-teaming patterns.1 Basic guidance:
- Explicitly encode refusal rules (what the model must not do).
- Use negative examples (prompts that should lead to refusals).
- Consider layered defenses: system prompt, content filters, tool policies.
Example System Prompt Fragment:
# Safety and Compliance
You must refuse to:
- Provide instructions for illegal activities.
- Generate hate speech or harassment.
- Reveal sensitive personal data.
When refusing, briefly explain which rule would be violated.Prompt engineering extends beyond text to multimodal models that accept images, audio, and video; surveys highlight emerging techniques here.21 Key ideas:
- Use text prompts to specify how to interpret visual inputs (e.g., "Focus on UI elements and describe usability issues").
- Use bounding box or region descriptions in text to point to image areas.
- Combine JSON + images (e.g., structured UI analysis outputs).
Context engineering can include tool outputs, not just documents. For instance, a PAL pipeline uses code execution as a tool to offload computation, while the prompt describes the interface and when to call it.12 The context is then a mix of natural language and structured tool results.
- Read one of the systematic surveys to get vocabulary and taxonomy.32
- Implement basic patterns: role + task + constraints, few-shot, CoT.
- Start using Markdown structure in all prompts.
Exercises:
- Take 3 everyday tasks (summarization, email drafting, code explanation) and design 3 prompt variants each; compare outputs.
- Learn JSON prompting thoroughly; define schemas for 3–5 internal tools.
- Build a simple RAG system with heading-aware chunking.65
- Experiment with context formatting and compression.
Exercises:
- For one of your products, build a doc-QA bot and systematically experiment with chunk sizes, delimiters, and summarization strategies.
- Implement a ReAct-style agent that uses at least 2 tools (search + code execution).21
- Add JSON prompts for tool inputs/outputs.
- Experiment with JSON-based prompts for image generation and brand style guides.1087
- Study The Prompt Report's taxonomy and vocabulary in detail; map techniques to your own work.1
- Read multiple survey papers and compare their taxonomies and benchmarks.32
- Design controlled experiments across models and tasks, publish internal or public reports.
Below are core references for deeper self-study (all open-access at the time of writing):
| Area | Reference |
|---|---|
| Comprehensive survey of prompting techniques, taxonomy, vocabulary | The Prompt Report: A Systematic Survey of Prompt Engineering Techniques (Schulhoff et al., 2024–2025)121 |
| Survey of prompt engineering techniques and applications across NLP tasks | A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applications (Sahoo et al., 2024–2025)2 |
| Survey of prompting methods by NLP task | A Survey of Prompt Engineering Methods in Large Language Models for Different NLP Tasks (Vatsal & Dubey, 2024)3 |
| Context format and normalization in long-context RAG | Grounding Long-Context Reasoning with Contextual Normalization for RAG (Chen et al., 2025)4 |
| Context-aware RAG for engineering and technical docs | Advancing engineering research through context-aware and knowledge-graph-enhanced RAG (Frontiers in AI)5 |
| Practical RAG guides | PromptingGuide RAG overview and industry tutorials613 |
| JSON-based image prompting | PromptJSON project and JSON style guide examples for GPT-4o image generation810 |
| Comparative essay on JSON vs text prompting for images | JSON vs text image prompt showdown (Medium essay)7 |
Working through these papers and replicating their key experiments will put you at a research-grade level in both prompt and context engineering.
Footnotes
-
The Prompt Report: A Systematic Survey of Prompt Engineering Techniques - Generative Artificial Intelligence (GenAI) systems are increasingly being deployed across diverse in... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16 ↩17 ↩18 ↩19
-
A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applications - Prompt engineering has emerged as an indispensable technique for extending the capabilities of large... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16 ↩17 ↩18 ↩19 ↩20 ↩21 ↩22 ↩23 ↩24
-
[2407.12994] A Survey of Prompt Engineering Methods in ... - Large language models (LLMs) have shown remarkable performance on many different Natural Language Pr... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14
-
Grounding Long-Context Reasoning with Contextual Normalization ... - Retrieval-Augmented Generation (RAG) has become an essential approach for extending the reasoning an... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
-
Advancing engineering research through context-aware and ... - Although retrieval-augmented generation (RAG) models can address the aforementioned problems by grou... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14
-
Retrieval Augmented Generation (RAG) for LLMs - Retrieval Augmented Generation (RAG) provides a solution to mitigate some of these issues by augment... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
-
Prompt Engineering Showdown: JSON vs Text for AI Image ... - As a business student and digital creator, I've spent a lot of time experimenting with AI tools; oft... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
-
GitHub - jsutton/promptjson: PromptJSON is a JSON-based language designed for crafting structured prompts for image generation models. - PromptJSON is a JSON-based language designed for crafting structured prompts for image generation mo... ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
-
JSON Prompting for AI Image Generation - ImagineArt - Learn how to use JSON prompting for AI image generation with tools like Nano Banana, Seedream v4, Im... ↩
-
JSON Style Guides for Controlled Image Generation with GPT-4o ... - Image generation with GPT-4o and GPT-Image-1 can yield visually stunning results—but without clear..... ↩ ↩2 ↩3 ↩4 ↩5 ↩6
-
A Study on Using JSON for DallE Inputs - @polepole @Daller @mitchell_d00 @jim14 This is an offshoot of a discussion on another thread, so we ... ↩
-
UMD Researchers Lead a Comprehensive Survey on Prompting ... - Generative artificial intelligence (GenAI) systems are becoming increasingly prevalent in both indus... ↩
-
Grounding AI: What Retrieval-Augmented Generation (RAG ... - What is Retrieval-Augmented Generation? RAG is a method for grounding large language models (LLMs) i... ↩