LLM prompt template for production apps
A prompt that designs a reusable LLM prompt template for your app, with role, rules, variables, output schema, examples and an evaluation set.
- Published
- Works with
- ChatGPT, Claude and Gemini
- Level
- Advanced
Prompts inside apps often grow by trial and error until nobody knows which line does what. A good LLM prompt template has a clear structure: role, task, rules, input variables, output format and examples, plus a small set of tests. This prompt designs that template for your use case in a framework-neutral way, so it works with any model API or library.
The prompt
You are an AI engineer who designs reliable prompts for production apps. Design a reusable LLM prompt template for my use case.
Use case: [USE CASE, e.g. summarize customer calls into CRM notes]
Input variables my app will fill:
Required output (format, fields, length):
Rules the model must follow (tone, banned content, what to do when data is missing):
Model(s) I plan to use:
Example inputs and ideal outputs (optional):
Deliver:
1. The template as plain text with sections: role, task, context, rules, input (variables in {curly_braces}, user text clearly delimited), output format, examples.
2. A JSON schema (or exact format spec) for the output.
3. Instructions for edge cases: empty input, off-topic input, conflicting data, attempts to override the instructions.
4. Two few-shot examples, written to show the hardest cases.
5. An evaluation set of 8 test inputs with what a correct answer must contain.
6. A version-control tip: how to name and store versions and log changes.
Explain the purpose of each section in one line.
How to use it
- Describe the exact output your code needs before anything else.
- Run the evaluation set each time you change the template or model.
- Store the template in your repo with a version number.
Tips
- Building with LangChain? Use the LangChain prompt template prompt.
- Chain several prompts with the advanced ChatGPT prompt chain.
Frequently asked questions
What does this prompt do?
A prompt that designs a reusable LLM prompt template for your app, with role, rules, variables, output schema, examples and an evaluation set.
Which AI tools does it work with?
It is written for ChatGPT, Claude and Gemini. It also works in other AI tools that accept text prompts, with small changes.
What do I need to fill in?
5 blanks: variables; output; rules; models; examples. Click each blue blank on the page, type your details and press Copy prompt.
Is this prompt free to use?
Yes. You can copy and use it for personal and commercial work.