AI Foundations
Module 03
Foundation
ThreadCo's Prompt Standard: ShopMate will need a dozen different prompt templates: product descriptions, customer replies, review summaries, email campaigns, social captions. The team decides every template will follow the same five-layer structure so outputs are consistent and easy to tune.

Prompting Principles

These principles apply across all major LLMs -- GPT, Gemini, Llama, and others. Master them once and they transfer to any model. Platform-specific techniques are covered in each tool track.

Anatomy of a Strong Prompt

Prompt Layer Diagram -- Universal Structure
ROLE / PERSONA "You are a senior DevOps engineer with 10 years of Kubernetes experience." Layer 1 INSTRUCTIONS "Diagnose the issue, explain root cause, and provide a corrected YAML manifest." Layer 2 CONTEXT / DATA "<manifest>...</manifest> <error>CrashLoopBackOff...</error>" Layer 3 FEW-SHOT EXAMPLES (optional) "Input: [bad YAML]. Output: [root cause + fix]. Now do the same for the manifest above." Layer 4 OUTPUT FORMAT "Respond only with valid JSON: {root_cause, fix_yaml, explanation}" Layer 5
Weak Prompt

Fix my code.

Strong Prompt

You are a Python expert. The following function raises a KeyError when the input dict is empty. Identify the bug, explain why it occurs, and return a corrected version with an inline comment explaining the fix.