M

Foundations · Days 8-13

Prompt Engineering

Learn prompt design as software design: message roles, few-shot examples, persona boundaries, templating, output parsers, and prompt injection defense.

Foundation 8 subtopics 6 daily blocks

Outcome

Design prompts that are versioned, parseable, defensive, and easy to test.

Practice builds

Prompt version registryPrompt injection test benchJSON parser with repair path

What to learn

System vs user vs assistant message design
Few-shot examples, role prompting, and persona design
Chain-of-thought, ReAct, and reflection patterns
XML and Markdown structuring for reliable parsing
Prompt templating and variable injection
Prompt versioning: treating prompts like code
Output parsers and graceful failure handling
Prompt injection defense at the prompt layer

Daily study plan

Day 8: Rewrite one messy prompt into system, developer, and user responsibilities.
Day 9: Add few-shot examples and compare output reliability.
Day 10: Structure outputs with XML or Markdown boundaries and parse them.
Day 11: Build a prompt template with typed variables and escaping rules.
Day 12: Add prompt versions and record sample outputs as regression fixtures.
Day 13: Try prompt injection examples and harden the instruction hierarchy.

Resources