← Back to Codex Library
Prompt Engineering Codex
Learn the deep mechanics of prompting generative AI models for software development. Cover syntax trees, context injection, standard system configurations, and prompt versioning.
📚 25 Chapters⏱️ 109 Min Study Time
CH 17 min read
The Anatomy of a Perfect Prompt
Master the structural sections of prompts to get precise, deterministic outputs.
- Explicitly assign a persona to ground the model's vocabulary.
- Declare clear boundaries around user input data.
- Few-shot examples are the single most effective way to lock in formats.
CH 28 min read
Context Injection & Vector RAG
How to feed external codebase structures, schemas, and assets without overloading model memory.
- RAG bridges the gap between static LLM training data and live codebase schemas.
- Pruning index files saves massive amounts of context tokens.
- Tagging specific files avoids model distraction and logical loops.
CH 36 min read
Custom System Rules & .cursorrules
Authoring project-level directives that keep code editors locked into correct styling libraries.
- System rules act as a permanent prompt modifier for all editor operations.
- Declare exact tech stacks and styling parameters explicitly.
- Incorporate directory structures configurations directly inside the instructions.
CH 45 min read
Chapter 4: Role Prompting and Persona Design
CH 55 min read
Chapter 5: Few-Shot and Chain-of-Thought Prompting
CH 64 min read
Chapter 6: Structured Output Prompting — Getting Reliable JSON, Tables, and Schemas
CH 74 min read
Chapter 7: Negative Prompting — Telling the AI What NOT to Do
CH 84 min read
Chapter 8: Temperature, Top-P, and Sampling — The Parameters That Change Everything
CH 94 min read
Chapter 9: Prompt Debugging — Diagnosing and Fixing Failing Prompts
CH 104 min read
Chapter 10: Designing Multi-Turn Conversations
CH 114 min read
Chapter 11: Prompt Compression — Getting More From Fewer Tokens
CH 124 min read
Chapter 12: Prompt Injection — Attacks and Defense Strategies
CH 134 min read
Chapter 13: Evaluating and Scoring Prompt Quality
CH 145 min read
Chapter 14: Domain-Specific Prompting — Code, Legal, Medical, and Finance
CH 154 min read
Chapter 15: Image Generation Prompt Engineering
CH 164 min read
Chapter 16: Self-Consistency and Ensemble Techniques
CH 173 min read
Chapter 17: Memory and Context Management in AI Applications
CH 183 min read
Chapter 18: A/B Testing Your Prompts in Production
CH 194 min read
Chapter 19: Prompt Engineering for RAG Systems
CH 203 min read
Chapter 20: Building a Personal Prompt Library That Compounds
CH 214 min read
Chapter 21: Prompt Engineering for AI Agents
CH 224 min read
Chapter 22: Tree of Thoughts and Advanced Reasoning Techniques
CH 233 min read
Chapter 23: When to Fine-Tune vs. When to Prompt
CH 244 min read
Chapter 24: Advanced Code Generation — Prompting for Production-Ready Code
CH 255 min read