Prompt Engineering Across Providers
Master prompt engineering by studying best practices from Anthropic, OpenAI, and Mistral. Then see how DSPy challenges the entire paradigm by replacing prompts with programs.
Comparing approaches across providers gives you deeper intuition than studying any single provider’s guide.
Steps
- Claude Prompting Best Practices
anthropic-platform
intermediate
Anthropic's best practices emphasize XML tag structuring and explicit role assignment — techniques that transfer well to other models. Start here because Anthropic's guide is the most systematic and well-organized of any provider's.
- Overview
anthropic-platform
beginner
This covers Anthropic's full prompt engineering toolkit including chain-of-thought, few-shot, and system prompts. Read it alongside the best practices page for the complete picture of how Claude interprets and follows instructions.
- Prompt engineering
openai
intermediate
Learn strategies and tactics for better results using large language models in the OpenAI API.
OpenAI's six core tactics are broadly applicable across providers. Compare the emphasis on clear instructions and reference text with Anthropic's XML-structured approach — both work, but the prompting style that gets best results differs between models.
- Structured Outputs
anthropic-platform
intermediate
Get reliable JSON outputs from Claude using tool_use or constrained decoding.
Anthropic achieves structured output through constrained tool use — you define a tool with the desired JSON schema and force the model to call it. Compare this mechanism with OpenAI's native structured outputs to understand the reliability vs flexibility tradeoff.
- Structured model outputs
openai
intermediate
Understand how to ensure model responses follow specific JSON Schema you define.
OpenAI's structured outputs use constrained decoding to guarantee schema-valid JSON. This is stronger than Anthropic's tool-use approach in terms of reliability, but requires additionalProperties: false on every object — a constraint that surprises many developers.
- Programming Overview
dspy
beginner
DSPy challenges the entire prompt engineering paradigm by treating prompts as optimizable programs rather than hand-crafted text. Understanding this approach, even if you don't adopt it, reframes how you think about the relationship between prompts and performance.