~/courses $ cd c3
Prompt Engineering & Structured Output
C3 · 20% of the exam · 6 lessons · about 56 min of reading
Prompts that hold up in production: system prompts, XML tags, few-shot examples, step-by-step reasoning, JSON schemas, tool-forced output, validation and retry.
Course progress0/6
Short by the site author (n_tech_am) on YouTube, in Armenian. Pressing play loads it from youtube-nocookie.com. ·open on YouTube
- System prompts and rolesUse the system parameter for the role and standing rules, keep task data in the user turn, and replace old prefill tricks with clear instructions.9 min
- XML tags for instructions, context and dataWrap each part of a prompt in its own descriptive tag, put long data first and the question last, and ask for answers inside tags you can parse.9 min
- Few-shot examplesShow Claude three to five relevant, varied examples wrapped in tags to pin down format and judgement, and avoid examples that teach the wrong pattern.8 min
- Step-by-step reasoning and thinkingLet Claude reason before it answers with adaptive thinking and effort, know when manual chain-of-thought still applies, and when to split work into a chain of calls.10 min
- JSON schemas and tool-forced outputGet machine-readable JSON with structured outputs, strict tools and tool_choice, and know which option each model accepts.10 min
- Validation and retry loopsCheck every structured answer against stop_reason, schema and business rules, feed specific errors back for a bounded retry, and escalate when retries run out.10 min