What is Prompt Engineering?
The practice of writing effective inputs to LLMs to get reliable outputs. It directly impacts code quality, agent reliability, and development velocity.
TL;DR: Prompt engineering guide for AI coding tools. System prompts + few-shot + chain-of-thought + structured output + constraint prompting. Applies to Claude/GPT/Gemini. Must-read for CLAUDE.md and Cursor Rules.
Core Techniques
1. System Prompts
Set role and rules in CLAUDE.md or .cursorrules.
2. Few-Shot Learning
2–3 input/output examples often beat long instructions.
3. Chain-of-Thought
"Think step by step" boosts accuracy on complex reasoning.
4. Structured Output
Specify JSON/Markdown to ensure parseable results.
5. Constraint Prompting
Tell the model what not to do and define boundaries.
FAQ
Q: Do frontier models still need prompt engineering? A: Yes. Better prompts = more reliable output + fewer retries + lower cost.
Q: Different prompts for different models? A: Core techniques are universal; details tune to each model's quirks.