Prompts
Prompt templates for developers
29 prompt templates for everyday developer work, from code review and unit tests to SQL, RAG answers and LLM judges. Each one explains why it is built the way it is, shows a filled-in example and its token count, and opens in the prompt builder. Free, and it runs in your browser.
29 templates
Code (8)
- Code review
Review a diff for bugs, risky changes and missing tests, ranked by severity with line references.
294 tokens · 3 variablesOpen in builder - Security code review
Look for injection, broken access control, leaked secrets and unsafe input handling, with an exploit path per finding.
288 tokens · 3 variablesOpen in builder - Explain code
A plain-English walkthrough of unfamiliar code at the reader’s level: purpose, flow, side effects and traps.
234 tokens · 3 variablesOpen in builder - Write unit tests
Tests for normal cases, edge cases and errors in your framework, focused on behaviour rather than implementation.
268 tokens · 4 variablesOpen in builder - Debug from a stack trace
Rank likely root causes from an error and stack trace, say what to check first, and suggest the smallest fix.
293 tokens · 4 variablesOpen in builder - Refactor code
Restructure code toward one stated goal without changing behaviour, with risky steps flagged.
196 tokens · 4 variablesOpen in builder - Convert code to another language
Translate code idiomatically into another language, map libraries, and list every behaviour difference.
233 tokens · 4 variablesOpen in builder - Performance review of code
Find likely bottlenecks for a stated workload, explain their cost and say what to measure before changing anything.
252 tokens · 2 variablesOpen in builder
Git and docs (6)
- Commit message from a diff
Turn a staged diff into a Conventional Commits subject and a body that explains why, not what.
415 tokens · 2 variablesOpen in builder - Pull request description
A PR summary with what changed and why, how it was tested, risks, and where reviewers should look.
195 tokens · 3 variablesOpen in builder - Release notes from commits
Turn a list of commits or PRs into user-facing release notes, breaking changes first.
224 tokens · 3 variablesOpen in builder - Write a README
A project README from your code and notes: what it is, install, quick start, configuration and limits.
235 tokens · 3 variablesOpen in builder - Write docstrings and code comments
Docstrings in your project’s style covering parameters, returns, errors and the non-obvious why.
187 tokens · 3 variablesOpen in builder - Architecture decision record
Turn design discussion notes into a short ADR: context, options, decision and consequences.
183 tokens · 3 variablesOpen in builder
Design and security (3)
- Threat-model a change
Map assets, entry points and trust boundaries for a change, then list STRIDE threats with mitigations.
292 tokens · 2 variablesOpen in builder - API design review
Review a proposed API for naming, errors, pagination, idempotency and backwards compatibility before it ships.
248 tokens · 3 variablesOpen in builder - Incident postmortem
Turn a timeline and chat logs into a blameless postmortem: impact, causes, what went well and actions.
262 tokens · 2 variablesOpen in builder
Data (6)
- SQL from a schema
Turn a question in plain English into one query for your schema and SQL dialect, with assumptions stated.
218 tokens · 4 variablesOpen in builder - Regex from examples
Build a regex for your flavour from strings that should and shouldn’t match, with an explanation and tests.
266 tokens · 4 variablesOpen in builder - Extract structured JSON
Pull fields from emails, documents or pages into a fixed JSON shape, with null instead of guesses.
194 tokens · 2 variablesOpen in builder - Summarise logs
Turn a long log into a timeline, the distinct errors with counts, and the likely first failure.
216 tokens · 2 variablesOpen in builder - Clean and normalise data
Normalise messy records to your rules, flag the rows it can’t fix, and never drop or invent data.
203 tokens · 3 variablesOpen in builder - Generate test data
Realistic fixtures that match your schema, with deliberate edge cases and clearly fake personal data.
203 tokens · 5 variablesOpen in builder
LLM apps and evals (6)
- RAG answer with citations
Answer only from retrieved documents, cite a source for every claim, and admit when the answer isn’t there.
225 tokens · 3 variablesOpen in builder - Classify text
Sort text into fixed labels with definitions, examples and an “unclear” option, returning JSON.
281 tokens · 3 variablesOpen in builder - LLM-as-judge with a rubric
Grade one answer against a written rubric and a reference answer, pass or fail per criterion, with evidence.
263 tokens · 4 variablesOpen in builder - Pairwise comparison judge
Compare two answers on stated criteria, allow a tie, and run both orders to cancel position bias.
236 tokens · 4 variablesOpen in builder - Generate eval test cases
Draft realistic, edge-case and adversarial inputs for your prompt, each with the expected behaviour.
273 tokens · 3 variablesOpen in builder - Rewrite a question as search queries
Turn a follow-up question and chat history into standalone search queries for retrieval.
205 tokens · 4 variablesOpen in builder
Steps
How to use the prompt template library
- Search for the job you have, such as “review” or “SQL”, or pick a category.
- Open a template to read when to use it, why it is structured that way and a filled-in example.
- Copy the plain-text version into a chat window and replace each {{variable}}, or select Open in prompt builder to fill them in a form.
- In the builder, choose your model to see the token count and cost, then copy the API request as JSON, Python, TypeScript or curl.
- Run it on a handful of real inputs, adjust it, and compare versions with the prompt diff.
Method
How it works
A prompt that works reliably is mostly structure. Each template here is written in the same five parts as our prompt builder: a role, the context the model should read, the task, the constraints and the output format, with optional few-shot examples. The parts that change on every call are {{variables}}, and every variable has a note saying what to put in it.
What the templates have in common
They follow the advice that OpenAI’s, Anthropic’s and Google’s prompting guides agree on, checked on 2026-10-14. The material the model reads (a diff, a schema, retrieved documents, a log) goes in the context, above the instruction: Anthropic says queries at the end can improve response quality by up to 30% in its tests with complex inputs, and Google gives the same order for Gemini. Constraints say why where it matters, because Anthropic’s guide notes that Claude generalises from the explanation behind an instruction. And the output format is always explicit, since a program or a busy person reads the result.
Most templates also give the model an honest way out: “say what data is missing”, “use null rather than guess”, “an empty review is a valid result”. Models tend to fill every gap they are given, and these escape hatches are the simplest way to cut invented answers. They are written into the prompt rather than promised by us; check them on your own inputs.
Why few of them use examples
Only 2 of the 29 templates include few-shot examples, where the output format is easier to show than describe (commit messages, classification labels). The providers disagree here. Google recommends examples in every Gemini prompt; OpenAI suggests trying reasoning models without them first; Anthropic recommends three to five when you use them. Each template page says when adding your own examples is likely to help, and the few-shot prompting entry explains the trade-off in tokens.
Token counts
Every template shows its size with OpenAI’s o200k_base tokenizer, as the prompt builder lays it out by default (XML section tags, with a system prompt). Unfilled, the median template is 235 tokens, and the range is 183 to 415; what you paste into the variables usually dominates. The numbers are recomputed by a test from the template text, so they can’t drift. Claude and Gemini count differently, so use the token counter for your model, and the prompt caching calculator if the fixed part of a prompt is long and repeated.
How to adapt a template
Treat each one as a starting point. Change the role to your domain, replace the constraints with your team’s rules, and add an example from your own data once you see where the output misses. Keep the version that works in your codebase, next to the code that fills it, and compare edits with the prompt diff before you ship them. The system prompt, chain of thought and structured outputs entries in the glossary cover the techniques the templates rely on.
Examples
Worked examples
Where the three providers’ prompting guides differ, as of 2026-10-14:
| Topic | Claude | OpenAI GPT | Gemini |
|---|---|---|---|
| Marking sections | XML tags such as <context> | Markdown headings or XML tags | One delimiter style, used consistently |
| Where long input goes | Above the question; queries at the end | Near the end of the prompt | All context first, question last |
| Few-shot examples | 3 to 5, in <example> tags | Zero-shot first on reasoning models | Recommended in every prompt |
| Asking for step-by-step reasoning | Use thinking; written-out reasoning may be declined on the newest models | Avoid on reasoning models | Not needed on Gemini 2.5 and 3 models, which think internally |
| Starting the reply for the model | Prefill not supported from Claude 4.6 models (400 error) | Not covered in the guides | A response prefix in the prompt text |
From the Anthropic, OpenAI and Google guides listed under sources. Each template page applies these to its own task.
FAQ
Frequently asked questions
What is a prompt template?
A prompt template is a reusable prompt with named placeholders, such as {{diff}} or {{question}}, for the parts that change on every call. The fixed parts (role, rules, output format) stay the same, so results are consistent and the prompt can be reviewed and versioned like code.
What is the difference between a prompt template and a system prompt?
A prompt template is one message you fill in for each task: paste a diff, a schema or a question into its variables and send it. A system prompt is the fixed set of instructions an app sends with every request, such as a support bot’s rules. Use a template for one-off work or a chat window; for an assistant you are building, start from the system prompt library.
Do these prompts work with ChatGPT, Claude and Gemini?
Yes. The text follows advice that OpenAI’s, Anthropic’s and Google’s prompting guides share: clear role, context before the question, explicit constraints and output format. Each template page lists tips where the model families genuinely differ, such as Markdown defaults on OpenAI reasoning models or prefill on Claude.
Can I use them in ChatGPT or Claude.ai, or only through the API?
Both. Each page has a plain-text version to paste into a chat window, with the variables to replace by hand. Open a template in the prompt builder to fill the variables in a form and copy the exact OpenAI, Claude or Gemini API request.
How are the token counts measured?
With OpenAI’s o200k_base tokenizer, the encoding used by GPT-4o and later GPT models, run on each template as the prompt builder lays it out. Claude and Gemini use their own tokenizers, which aren’t published, so their counts will differ. The token counter shows the count for the model you use.
Are these prompts proven to work better?
We don’t claim that. Each template is structured the way the providers’ own guides recommend, and each page explains why. Whether it works for your task is something to measure: run it on 20 to 50 real inputs, check the outputs, and compare versions with the prompt diff.
Is anything I type sent to a server?
No. The search runs in your browser, and opening a template in the prompt builder passes only the template’s name in the address, never your text. The builder itself runs entirely in your browser.
Related
Related tools
- Prompt BuilderBuild prompts with variables and a live token count.
- Prompt DiffCompare two prompt versions side by side.
- AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.
- Prompt Caching CalculatorEstimate savings from prompt caching.
- JSON RepairFix broken JSON from LLM output.
- LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.
Read