Skip to content

Stop retyping prompts: templates, personas and few-shot examples

Blog / Published 

Everyone who uses a language model regularly has the same archaeology problem: somewhere in a chat history is the prompt that produced exactly the output you wanted, three weeks ago, and you cannot find it. So you retype an approximation, get something close, and adjust — every time, for the same recurring task. The fix is not a better memory. It is treating a prompt that works as an artefact you keep.

Separate what changes from what does not

Look at a prompt you run weekly and you will find two parts. There is a stable part — the role, the constraints, the output format, the things you want avoided — and a variable part, which is usually one document and two or three details. Retyping the stable part every time is where the drift comes from: each retype is slightly different, and you never know whether the output changed because your input changed or because you rephrased an instruction without meaning to.

Write it once with placeholders instead. The prompt templater takes a template with {{placeholder}} markers and a list of key = value pairs, and fills them in. Store the template, supply the values, paste the result. The stable part is now byte-identical every run, which makes your output differences meaningful — and, as a side benefit, keeps provider prompt caching working, since caching depends on an unchanged prefix.

Some placeholders worth having even when you think you do not need them: the audience, the output length, the format, and the tone. Those are exactly the parameters you end up correcting in a follow-up message, and a follow-up costs a full extra round trip of the whole conversation.

The persona block

The stable part usually opens with a description of who the model is supposed to be. Written casually, this ends up as three vague sentences that do less than people assume. Written deliberately, it is the highest-leverage part of the prompt, because it sets defaults for everything you do not specify later.

What actually helps: a specific role rather than a flattering one ("a technical editor who cuts 30% of every draft" beats "a world-class writing expert"), the audience and their level, an explicit output format, and — most underrated — a short list of things not to do. Negative constraints are unglamorous and they work: "no preamble, no summary at the end, no bullet lists longer than five items" removes the three most common annoyances in one line.

The AI persona prompt generator assembles that block from a few fields, so the result has the same structure every time rather than depending on what you happened to think of. Keep the assembled block in your notes and reuse it as the header of every template that shares an audience.

Examples beat adjectives

When the task is a transformation with a specific style — rewriting support replies, extracting fields, classifying tickets, converting notes into a house format — instructions plateau quickly. You can write three paragraphs about the tone you want and get output that is nearly right in a way you cannot quite articulate. Two worked examples fix it immediately, because the model can see the mapping instead of inferring it from description.

Formatting matters here more than people expect. Examples need consistent delimiters, consistent labels, and the same field order every time, or the model spends attention working out the convention instead of the content. The few-shot prompt builder generates a blank template with numbered input/output blocks so the structure is fixed before you start filling it in — which is precisely the discipline that hand-written examples lack by the third one.

Three practical rules. Use two to five examples; beyond that you are paying tokens for diminishing returns. Include one edge case — an empty field, an ambiguous input, something that should produce the "I don't know" answer — because examples define the boundaries as much as the centre. And make the examples real: invented ones tend to be tidier than your actual data, and the model learns the tidiness.

When the input is bigger than the window

A template survives contact with a long document only if the document fits. When it does not, splitting is the answer, and splitting well is a matter of chunk boundaries: a chunk that ends mid-sentence forces the model to guess, and a chunk that ends mid-record produces a partial extraction it will confidently report as complete.

The prompt splitter divides text into sequential chunks under a character limit you set, breaking on sensible boundaries and numbering the parts, so each one can go out with the same instruction block attached. Two things make the results dramatically better: state the total in each chunk's instruction ("part 3 of 7, do not summarise until the last part"), and keep the instruction identical across chunks rather than editing it as you go.

Mine your own history

The best source of templates is the prompts you already wrote that worked. Chat transcripts copied out of a web interface are a mess — interleaved roles, UI artefacts, timestamps, copy buttons rendered as stray text — and that mess is why nobody goes back through them.

The AI chat log parser cleans a pasted ChatGPT or Claude transcript into a tidy user/assistant dialogue you can actually read and search. Once a week, run the sessions that produced something you used, pull out the prompts that worked, and turn them into templates. That is a fifteen-minute habit that compounds faster than any amount of prompt-engineering advice.

Treat prompts like code

Three practices that people arrive at eventually and should adopt at the start:

None of this requires a platform. A folder of text files, a template with placeholders, and a habit of saving the ones that worked will outperform an unstructured chat history indefinitely. Every tool mentioned here runs locally in your browser, so the prompts and transcripts you are organising — which routinely contain client material and internal detail — stay on your machine.

Written by Ján Turský

Creator of TextArray — building free, privacy-first tools that run entirely in your browser.