Skip to content
agenoverse
AI Development

Prompt patterns that hold up

Reusable ways to structure a prompt that survive model updates: role and task, constraints, examples and output format.

Lesson 2 of 3Start building with AI

Updated

  • Level: Beginner
  • 20 min to complete

These patterns are boring on purpose. Boring prompts keep working when the model changes underneath you.

State the task, not just the role#

"You are a helpful assistant" does very little. "Summarise this support ticket for an engineer in three bullet points" does a lot. Say what the output is for.

Give constraints a place#

Put rules in a short list, one rule per line. Models follow a list more reliably than a paragraph of "never" and "always".

Show, do not only tell#

One or two examples of the exact output you want beat a page of description. Make sure the examples are different from each other.

markdown
Task: classify the ticket.Return JSON: {"category": "billing" | "bug" | "other", "urgent": boolean}Example input: "I was charged twice this month"Example output: {"category": "billing", "urgent": false}

Ask for a format you can parse#

If code will read the answer, ask for JSON (or another strict format) and validate it. Retry once on failure, then fail loudly.

Tip

Change one thing at a time and re-run your examples. Prompts are easy to make worse without noticing.

// prompt · Summarise a support ticket
Summarise this support ticket for an engineer in {{number}} bullet points. Rules: - Say what the customer wants. - Say what they already tried. - Do not guess at causes. Ticket: {{paste the ticket here}}

Replace the highlighted parts, then paste it into your assistant.

Which prompt is most likely to keep working when the model changes?

Choose one.

Was this guide helpful?

These guides stay current because readers tell us what is off. One tap is plenty.