Prompt collections
Ready prompt templates, grouped into collections.
Agent foundationsStarter scaffolds for a reliable tool-using agent.7
- System prompt scaffoldA skeleton system prompt - fill the role, goal, tools and constraints.
- Tool-use loopSteers the model to plan → act → observe → repeat, then finish cleanly.
- Reflection before finishingA cheap quality gate: the agent checks its own work before returning.
- Recovering from a failed tool callKeeps the agent from panicking, looping, or silently giving up after an error.
- Breaking a goal into subgoalsTurns a vague, large goal into an ordered, checkable task list before acting.
- Explicit stopping criteriaPrevents an agent from over-working a task or stopping one step too early.
- Draft a SKILL.mdTurn a workflow into an Agent Skill in the open format read by Claude, Codex and Google’s agents.
Tool design & usePatterns for defining tools an agent can call, and deciding when to call them.7
- Writing a clear tool descriptionA tool the model can misuse is a prompt problem, not just a schema problem.
- Deciding whether to call a tool at allStops reflexive tool calls when the model already knows the answer.
- Designing tool error responsesWell-shaped error output lets the agent recover instead of hallucinating a cause.
- Choosing parallel vs. sequential tool callsPrevents wasted round-trips on independent calls and races on dependent ones.
- Dry-run before a destructive callA required preview step for anything hard to undo (delete, send, pay, deploy).
- Trimming an overgrown toolsetToo many overlapping tools quietly hurts selection accuracy; audit and prune them.
- Make tools discoverableFor agents that find tools by search: prefixed names, action-first descriptions, which tools to always load.
Prompt engineeringReusable patterns that make outputs sharper and more predictable.7
- Role · Task · FormatThe three levers that most improve a single-shot response.
- Few-shot examplesShow 2–3 input→output pairs to lock in the exact style and shape.
- Step-by-step reasoningAsk for the reasoning first, then a clearly separated answer.
- Naming what NOT to doExplicit anti-goals stop the model from reaching for its default bad habits.
- Locking the output shapeGives the model an exact template to fill in, reducing format drift across calls.
- Splitting a task into a prompt chainBreaks one overloaded prompt into sequential steps, each with a narrow job.
- Plain technical explanations (ASD-STE100 style)Borrows the rules of Simplified Technical English from aircraft manuals: short sentences, one idea each, one meaning per word. Loosen it to about 80% when the strict version reads stiff.
Data extraction & structured outputGetting clean, machine-parseable output out of messy, unstructured input.6
- Extracting fields into a fixed JSON schemaThe base pattern for turning free text into a strict, predictable object shape.
- Explicit policy for missing/uncertain fieldsStops the model from inventing plausible-looking values for data that is not actually present.
- Converting unstructured text to structured rowsHandles messy tables, lists, or free text that should become a clean array of records.
- Classifying into a fixed label setConstrains classification to an exact allowed label list instead of free-form categories.
- Validating and repairing malformed JSONFixes structurally broken JSON output without silently changing its actual data.
- Mapping messy input fields onto a target schemaReconciles inconsistent source field names/shapes with a fixed target schema before ingestion.
Claude-style (Anthropic)Prompting the way Anthropic recommends - XML tags and prefilling.2
- XML-structured promptAnthropic recommends XML tags to separate instructions, context and data.
- Prefill the replyStart Claude’s turn for it - forces a format (e.g. JSON) and skips preamble.
Coding agentsPrompts for agents that read, plan, and modify a real codebase safely.8
- Plan before touching codeSeparates "what should change and why" from the mechanics of editing, catching bad plans early.
- Smallest safe diffKeeps changes reviewable by explicitly forbidding drive-by refactors mixed into a fix.
- Orienting in an unfamiliar codebaseForces exploration before edits so changes match existing conventions instead of fighting them.
- Safety checklist for a data/schema migrationA dedicated pass for the highest-blast-radius category of change.
- Vetting a new dependencyA quick due-diligence pass before pulling in third-party code.
- Writing a clear PR description from a diffTurns a raw diff into a reviewer-friendly summary focused on why, not just what changed.
- Interview me, then write the specSpec-driven work: the agent asks one question at a time, then writes SPEC.md and waits for approval.
- Surgical change contractThink first, change only what the task needs, prove it with a check you named up front.
GPT-style (OpenAI)Role messages and explicit output contracts, as OpenAI suggests.3
- Developer + user rolesOpenAI’s newer models take durable rules in the developer message.
- Few-shot with delimitersTwo labelled examples set the pattern; the model completes the third.
- Outcome-first brief with updatesDescribe what done looks like, keep MUST for real invariants, let the model choose the path and say what it checks.
Multi-agent orchestrationSplitting work across cooperating agents without them tripping over each other.8
- Orchestrator/worker task splitOne agent plans and delegates, dedicated workers execute narrow subtasks.
- Handoff brief between agentsA structured handoff prevents the next agent from re-deriving context from scratch.
- Defining non-overlapping agent rolesPrevents two agents from silently duplicating or contradicting each other's work.
- Dedicated critic/reviewer agentA separate reviewing pass catches issues an agent under-checks in its own output.
- Resolving disagreement between agentsA structured way to reconcile two agents that reached different conclusions.
- When to delegate vs. do it yourselfStops an orchestrator from spinning up sub-agents for trivial work.
- Fan-out + harsh-critic loopQuality-by-iteration: split the work, then a separate strict critic loops each part against a reference until it passes.
- Skeptical evaluator agentA grader separate from the author: it exercises the artifact and never passes what it did not verify.
Gemini-style (Google)A system instruction plus grounding-friendly phrasing.1
- System instructionGemini takes a separate systemInstruction that persists across the chat.
Open models (Llama / Mistral / DeepSeek)Explicit formatting and reasoning cues that open models reward.2
- Explicit output formatOpen models drift without a strict format - state it and give one example.
- Reasoning-model prompt (R1)For reasoning models: state the goal + constraints, and DON’T ask for chain-of-thought - it thinks on its own.
Context & memory managementKeeping long-running agents grounded as context fills up or spans sessions.8
- Deciding what belongs in contextForces a deliberate include/exclude call instead of dumping everything in.
- Summarize before pruning old turnsA compaction step that keeps decisions and open threads, not just chat history.
- What to persist to long-term memoryA filter so memory accumulates durable facts, not one-off conversational noise.
- Recap after context compactionA re-orientation prompt so the agent does not repeat or contradict earlier work after a reset.
- Tagging retrieved facts vs. inferencesKeeps sourced information and model guesses from blurring together over a long task.
- Structured state checkpointA resumable snapshot so a long task can be picked up cleanly after an interruption.
- Multi-session progress protocolTreat the context as wipeable: a progress log and a feature list that let a fresh session pick up the work.
- Custom compaction summaryYour own summarisation prompt so a fresh agent continues with no loss of working state.
Evaluations & testingMeasuring whether an agent or prompt actually works, not just whether it looks fine once.8
- Writing a scoring rubricTurns "does this look good?" into specific, repeatable scoring criteria.
- LLM-as-judge comparisonA structured pairwise-comparison prompt to reduce position and verbosity bias.
- Building a golden test setGenerates a small, representative set of known-good input/output pairs to test against.
- Generating adversarial edge casesActively hunts for inputs likely to break a prompt or agent, rather than waiting to find them in production.
- Comparing outputs for regressionsDiffs old vs. new behavior on the same inputs to catch silent regressions after a prompt change.
- Classifying failure modesGroups observed failures into categories so fixes target root causes, not individual symptoms.
- Error analysis from tracesRead the traces before building metrics: cluster failures, count them, pick checks for the top ones.
- Write a gradable rubricTurn a task into binary criteria an independent grader can check - plus one “must not” against the obvious shortcut.
Review & debuggingPrompts that turn a model into a rigorous reviewer of code and output.7
- Adversarial self-reviewHave the model attack its own answer to surface real defects.
- Write the tests firstForce the failure cases into the open before writing the fix.
- Root cause with five whysStops the model from patching a symptom instead of the underlying bug.
- Minimal reproduction requestGets a precise, isolated repro before the model guesses at a fix.
- Structured code review passA fixed checklist keeps reviews consistent instead of a scattershot skim.
- Post-fix regression checkMakes the model check the fix does not break the cases that used to work.
- Hypothesize, instrument, then fixDebugging from runtime evidence: no fix until the evidence points to one cause.
Safety & guardrailsDefending an agent against untrusted input, prompt injection, and unsafe actions.7
- Resisting prompt injection from tool contentInstructs the model to treat fetched content as data, never as new instructions.
- Wrapping untrusted content safelyA delimiter convention that keeps user/attacker text from being parsed as prompt structure.
- Safe refusal with a constructive alternativeKeeps a refusal useful instead of a dead end, without granting the unsafe request.
- Redacting sensitive data before output/loggingStrips personal or secret data from content that will be logged, displayed, or shared onward.
- Checking an action against allowed scopeA pre-action gate that stops an agent from silently acting outside its granted permissions.
- Reviewing a prompt for jailbreak resistanceAudits a system prompt for common manipulation patterns before it ships.
- Treat web content as dataFor browser and shell agents: page text is never an instruction, and consequential actions wait for you.
Retrieval / RAGGrounding answers in retrieved documents instead of the model's unverified memory.6
- Answer strictly from retrieved contextThe core RAG guardrail: forbids filling gaps with the model's own memory.
- Citing sources inlineForces every claim to be traceable back to a specific retrieved chunk.
- Rewriting a question into a search queryBridges the gap between how users ask and how a retrieval index is best searched.
- Flagging when retrieved context is insufficientMakes "I don't have enough information" a first-class, expected output rather than a failure to avoid.
- Synthesizing across multiple documentsHandles overlapping/conflicting retrieved sources instead of just concatenating them.
- Filtering irrelevant chunks before answeringA relevance-triage pass that keeps noisy retrieval results from diluting the answer.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Daily drill casesReal situations from building agents - with the answer and why.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.