Prompt template builder

Role, task, context, format and examples, assembled into a structured prompt.

FreeRuns in your browserNo signupUpdated 2026-10-29

Prompt length

165 tokens

801 characters · o200k_base tokenizer

Sections

7 of 7

Placeholders: {{customer_message}}

prompt.md
## Role
You are a support assistant for a small accounting software company.

## Task
Answer the customer's question about invoices using only the documentation provided.

## Context
Invoices can be edited until they are sent. After sending, the customer must issue a credit note and a new invoice. Recurring invoices are available on the Pro plan.

## Constraints
If the answer is not in the documentation, say so and offer to connect them with a person.
Never quote prices.
Keep replies under 120 words.

## Output format
Plain text. Start with the direct answer, then one short explanation if needed.

## Examples
Q: Can I change an invoice after sending it?
A: Not directly. Issue a credit note for the original, then create a new invoice with the corrected details.

## Input
{{customer_message}}

Empty sections are left out. Put long documents in Context and keep Constraints to things that actually went wrong in testing.

About this tool

How it works and how to read the result.

Need this done for you?

AI features for your product

Add AI search, chat and generation to your existing app.

See the service

What it does

A prompt template generator gives a prompt a repeatable shape. Instead of one long paragraph, you fill seven short fields: who the model is, what it must do, the facts it needs, the rules it must follow, the output format, one or two examples, and the input placeholder. The page assembles them into a clean prompt with Markdown headings or XML tags, counts its tokens and lists the placeholders. Empty fields are left out. Everything stays in your browser.

How to use it

  1. Choose Markdown headings or XML tags for the structure.
  2. Write the role in one sentence and the task in one or two.
  3. Paste the context the model needs and list constraints one per line.
  4. Describe the output format and add a short example pair.
  5. Copy the result into your code or download it as a file.

How to read the result

The token figure is the fixed cost of every call that uses the prompt, before the user's input and the reply. A template of 310 tokens sent 10,000 times a day on a model at $0.40 per million input tokens costs about $1.24 a day for the template alone. That is cheap; a 3,000-token template with a long pasted policy would cost ten times as much and is a candidate for prompt caching or trimming.

Sections of 7 means every field is filled. That is not always right: a simple classification task may need only role, task, output format and input. Leave out what the model does not need.

The placeholder list should match the variables your code sets. If the prompt shows a placeholder you did not expect, a stray pair of braces in the context is being read as a variable.

Check the length against your budget with the system prompt budget checker. Prompt design is part of every AI product feature we build.

Questions

Frequently asked.

Should I use Markdown headings or XML tags?

Both work with current models. XML tags are a little clearer when a section contains Markdown of its own, such as a pasted document, and Anthropic's guidance favours them for Claude. Headings are easier for people to read and edit. Pick one and keep it consistent across your prompts.

How many examples should I include?

One or two short, representative pairs are usually enough to fix the format and tone. More examples help with tricky edge cases but cost tokens on every call. If you find yourself adding a fifth example, the task description probably needs to be clearer instead.

What are the double-brace placeholders for?

They mark the values your code inserts at runtime, such as the customer's message or a product name. The page lists every placeholder it finds so you can check that your code fills each one. Leaving one unfilled is a common source of odd replies.

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

We reply within a working day. No spam, ever.