Curio

Playbook, prompting

Build a prompt template that survives edits

Five named sections, in order, with the stable part frozen so your cache keeps hitting.

The short version

  • Five named parts: Role, Task, Constraints, Format, Example, always in that order.
  • Put the stable text first so the prefix caches and reruns get cheaper.
  • Freeze the top four sections; only user data changes below the line.
  • Version the stable block and review edits like source code.
  • One example beats five; two just doubles your token cost.

A good prompt is a contract, not a wish. We treat ours like code: five named parts, in the same order, every time. Role. Task. Constraints. Format. Example. When one section changes, the others hold still, and that stillness is what lets a template survive months of edits.1

Most templates rot the same way. Someone adds a rule inline, someone else reorders the sections, and within a month the prompt is a pile of patches nobody trusts. Named sections stop that. When every teammate knows Constraints is a bulleted block near the top, edits land in the right place and the diff stays readable.

The order matters more than people expect. We put the stable material first because most model APIs cache long prefixes, and a cached prefix is cheaper and faster to reuse. Anthropic and OpenAI both bill cached input tokens at a steep discount, so the parts you never edit belong up top.1 2

  1. Write the Role in one sentence. Tell the model who it is and what it optimizes for. Keep it narrow. A support agent that values brevity beats a helpful assistant that values everything.
  2. State the Task as a single imperative. One verb, one object. If you need two things, you need two prompts, or a numbered list inside one task. Vague tasks produce vague output, and we have measured that pain.
  3. List Constraints as bullets the model can check itself against. Word limits, banned moves, tone, what to do when unsure. Constraints are where quality lives, so spend time here.
  4. Pin the Format exactly. Show the shape you want, ideally as JSON keys or a labeled skeleton. Ambiguous format is the top cause of parsing bugs downstream.
  5. Add one Example. A single worked input and its ideal output teaches more than a paragraph of description. We include exactly one, because two examples double your token cost for little gain.

Now split the file. Everything above the user's input is the stable prefix: role, constraints, format rules, the example. That block should be byte-for-byte identical across calls so the cache hits. The variable part, the actual user data, goes last. We keep a comment marking the boundary so nobody edits above the line by accident.1

Caching rewards discipline. If you tweak a comma in the role text, the prefix changes and the discount evaporates. So we version the stable block, review it like source code, and change it on purpose, not in passing.2

A prompt you can't diff is a prompt you can't trust.

Start today with one prompt you run often. Split it into the five parts, freeze the top four, and mark the line where user data begins. Run it twice and watch your latency drop on the second call. That drop is the cache working, and it is the clearest signal that our template is built to last.

Use it this week

  • Convert your most-used prompt into the five-part template this week.
    ROLE: You are a [who], optimizing for [single priority]. TASK: [One imperative verb + object.] CONSTRAINTS: - [word or scope limit] - [banned move] - If unsure, [explicit fallback]. FORMAT: Return exactly this shape: [labeled skeleton or JSON keys] EXAMPLE: Input: [one worked input] Output: [ideal output] --- USER INPUT: [variable data goes here, below the line]
  • Freeze the top four sections and run the prompt twice to confirm the prefix caches.
  • Commit the stable block to git and review edits above the line like code.
Post on LinkedInPost on X

Learn this properly: Everyday AI Fluency, a free Curio course.

Start learning free