Skip to content
AI Dev Toolkit.
Esc
  • Loading…

Prompts

Prompt templates for developers

A prompt template is a reusable prompt with blanks for your code, schema or data. These 29 cover developer work from code review and unit tests to SQL, regex, RAG answers and LLM judges, each with its reasoning, a filled-in example and a token count. Written for ChatGPT, Claude and Gemini, following their prompting guides as of 14 October 2026.

29 templates

Code (8)

Git and docs (6)

Design and security (3)

Data (6)

LLM apps and evals (6)

Steps

How do I use these prompt templates?

  1. Search for the job you have, such as “review” or “SQL”, or pick a category.
  2. Open a template to read when to use it, why it is structured that way and a filled-in example.
  3. 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.
  4. In the builder, choose your model to see the token count and cost, then copy the API request as JSON, Python, TypeScript or curl.
  5. Run it on a handful of real inputs, adjust it, and compare versions with the prompt diff.

Method

What are the best ChatGPT and Claude prompts for coding?

The best coding prompts are specific: they name the language, paste the code that matters, state the constraints and ask for a fixed output format. The same text works in ChatGPT, Claude and Gemini. If you only try a few, start with these 10, which cover the jobs developers ask a model to do most often.

Prompts for code review and debugging

  • Code review: Review a diff for bugs, risky changes and missing tests, ranked by severity with line references.
  • 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.
  • Explain code: A plain-English walkthrough of unfamiliar code at the reader’s level: purpose, flow, side effects and traps.

Prompts for tests, docs and commits

  • Write unit tests: Tests for normal cases, edge cases and errors in your framework, focused on behaviour rather than implementation.
  • Commit message from a diff: Turn a staged diff into a Conventional Commits subject and a body that explains why, not what.
  • Pull request description: A PR summary with what changed and why, how it was tested, risks, and where reviewers should look.

Prompts for SQL and data

  • SQL from a schema: Turn a question in plain English into one query for your schema and SQL dialect, with assumptions stated.
  • Regex from examples: Build a regex for your flavour from strings that should and shouldn’t match, with an explanation and tests.

Prompts for RAG apps and LLM evals

  • RAG answer with citations: Answer only from retrieved documents, cite a source for every claim, and admit when the answer isn’t there.
  • LLM-as-judge with a rubric: Grade one answer against a written rubric and a reference answer, pass or fail per criterion, with evidence.

What is a prompt template?

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 do 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 do so 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.

How big is each template in tokens?

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 do I 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. You can customise in the prompt builder and copy the result as an API request, or, in Claude Code, save a template as a slash command. 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. If you are building an assistant rather than running one task, the system prompt examples are the better start. The system prompt, chain of thought and structured outputs entries in the glossary cover the techniques the templates rely on.

Examples

How do prompts differ for Claude, ChatGPT and Gemini?

Where the three providers’ prompting guides differ, as of 2026-10-14:

Prompting advice that differs between Claude, OpenAI GPT and Gemini
TopicClaudeOpenAI GPTGemini
Marking sectionsXML tags such as <context>Markdown headings or XML tagsOne delimiter style, used consistently
Where long input goesAbove the question; queries at the endNear the end of the promptAll context first, question last
Few-shot examples3 to 5, in <example> tagsZero-shot first on reasoning modelsRecommended in every prompt
Asking for step-by-step reasoningUse thinking; written-out reasoning may be declined on the newest modelsAvoid on reasoning modelsNot needed on Gemini 2.5 and 3 models, which think internally
Starting the reply for the modelPrefill not supported from Claude 4.6 models (400 error)Not covered in the guidesA 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

Can you use ChatGPT to help with coding?

Yes, and the answers get better when the prompt does four things: names the language and versions, pastes the code or error that matters, states the constraints (what must not change, which libraries are allowed) and asks for a specific output, such as a ranked list or a single diff. Each template here builds those in. The same holds for Claude and Gemini. Check the code a model writes as you would a colleague’s: run the tests and read the diff.

What are the best ChatGPT prompts for programmers?

The ones that give the model your code, the goal, the constraints and the output format you want, rather than a one-line request. That is the shape every template here follows. Start with the jobs you repeat: code review, unit tests, debugging a stack trace, SQL from a schema and commit messages.

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.