prompt-engineering
Installation
SKILL.md
Prompt Engineering
Source: dair-ai/Prompt-Engineering-Guide at commit 5767372 (2026-03-11), English pages, notebooks, and lecture slides. Everything below was read in full and audited. Reference files carry templates, examples, caveats, and per-file "Audit notes".
Read first: the guide is mostly a 2022 to early-2024 snapshot (GPT-3.5, text-davinci-003, GPT-4, Mixtral era). Technique concepts hold up. Model-specific claims, prices, benchmarks, and code samples do not. See references/audit-summary.md before trusting any date-bound claim.
Workflow for writing or fixing a prompt
- Define the task, the output format, and how you will judge success. Without a check, you can't tell if a rewrite helped.
- Start with the simplest prompt that could work: clear instruction, specific context, delimiters, explicit output format. Say what to do rather than what to avoid. Specificity beats length.
- If output is wrong, escalate one step at a time: add few-shot examples (format and label space matter more than label correctness) -> reasoning (CoT, or a reasoning model) -> decomposition (prompt chaining) -> tools or retrieval (PAL, ReAct, RAG) -> fine-tuning.
- Set parameters deliberately: low temperature/top-p for factual or extraction tasks, higher for creative tasks. Change one of temperature or top-p, not both.
- Test against adversarial and edge inputs, including prompt injection if the prompt handles untrusted text.
- Iterate on a fixed test set. A single lucky run proves nothing. The repo's own bias and exemplar-order examples are single-run, so don't copy that.