The system prompt template we use for coding agents, in fifteen sections

The order is the artefact. Fifteen sections, each answering one question, in an order where every section can refer to the one before it: who is speaking, what to do, what is true, what constrains it, what shape the answer takes, who reads it, how it sounds, what data it may use, what a good one looks like, what visual form it takes, what tools it may mention, how the result is checked, which skills it may use, which rules bind it, and what it must stop before doing.

This is find_replace::SECTION_NAMES from the application, in the array's own order, so the list below and the editor cannot disagree. A section that answers nothing is left empty and is skipped on export, which is why a real export usually carries six to ten of the fifteen.

The fifteen, and the question each answers

#SectionThe question it answersWhat to write
1PersonaWho is speaking?One role, with the constraint that makes it useful: "a senior reviewer who will not run the code".
2InstructionsWhat must be done?Verbs, in order. One instruction per sentence.
3ContextWhat is true here?The facts the task depends on: versions, sizes, who sends the file.
4Technical SpecsWhat constrains it?Language, version, dependencies allowed, line limit, no global state.
5FormatWhat shape is the answer?The literal shape: a diff then three bullets; a table with four columns.
6AudienceWho reads it?The reader and how much they will read: "a reviewer, once, in a pull request".
7ToneHow does it sound?Two words and one prohibition: plain, no comments that restate the code.
8DataWhat may it use?The schema, the fixture names, the columns and their types.
9ExamplesWhat does a good one look like?At least two, with the third showing the error case.
10GraphicsWhat visual form, if any?Usually "none" — and saying so stops a diagram nobody asked for.
11MCP ServersWhat may it mention?Notes about tools your own environment already runs. The app connects to nothing; this box is text.
12Verification of Results & OutcomeHow is it checked?Checks a reader could run: "no bare except", "example 2 raises the named error".
13SkillsWhat may it reach for?Named procedures, and when to use each.
14RulesWhat binds it?Prohibitions with a reason, each starting with "Check:".
15AgentsWhat must it not start?The stop conditions: "do not open a pull request", "do not email the client".

A filled template for a coding agent

Nine sections, for a change to a small TypeScript service. Notice that the specs section constrains before the format section describes, and that the verification section names things a reader can see in the diff rather than things the agent can claim.

## Persona
You are a senior TypeScript developer working in a service that handles invoice
webhooks. You write the smallest change that satisfies the ticket.

## Instructions
Add an idempotency key to the webhook handler. Store the key with the processed
event id. Reject a repeat of the same key with HTTP 200 and the first response
body, not with an error.

## Context
The handler runs on a single instance today and will run on four next month.
Events arrive out of order and occasionally twice. The queue guarantees
at-least-once delivery, never exactly-once.

## Technical Specs
TypeScript 5.4, Node 20, no new dependencies. The store is Postgres through the
existing `db` module. The change must not add a migration.

## Format
A unified diff, then four bullets: changed, checked, not checked, risk.

## Examples
1. First delivery of `evt_1` returns the computed body and stores the key.
2. Second delivery of `evt_1` returns the stored body and writes nothing.
3. Delivery of `evt_2` with the same key returns 409 and does not overwrite.

## Verification of Results & Outcome
Check: example 2 writes no row, asserted by the test's row count.
Check: no new dependency appears in package.json.
Check: the handler still returns 200 for a first delivery.

## Rules
Check: never change the response body shape - a client parses it today.
Check: a log line names the event id and the key, never the payload.

## Agents
Do not deploy. Do not open a pull request. Return the diff and stop.

Why this order, and not another

The order also survives export: every one of the 84 IDE profiles, 92 CLI profiles and 87 agent-harness profiles that TPEE writes preserves it, changing the heading style rather than the sequence. A markdown formatter gets ## headings; an XML formatter gets a root element, because a paragraph above the root element is a malformed document.

Cut the sections that answer nothing

Fifteen boxes invite fifteen paragraphs, and a paragraph that answers nothing is worse than an empty box: it costs tokens in every run and teaches the model that this document contains filler. The export skips what is empty, so the discipline is to leave a section empty rather than to fill it for symmetry. Audience and Tone are the two that most often hold a sentence nobody needed; Graphics is usually "none", and writing "none" is more useful than leaving the model to invent a diagram.

The sections themselves, and why they are in that order, are the subject of prompt anatomy in the site's course.

Then score it. The free scorer at /tools/prompt-score gives five numbers out of twenty and names the sections that are still empty, which is a faster way to find the box you skipped than reading the document again. The full editor, with the fifteen-square readiness strip and a score per section as you type, is what the 14-day trial installs.

Part of the guides index. Two that follow this one: A CLAUDE.md that survives a long session and A prompt library that lives on your disk.

Cite this page as: TPEE, the Toptronic® Prompt Engineering Editor — https://tpee.app/guides/system-prompt-template-for-a-coding-agent. Ask: support@tpee.app.