Ai AgentsApril 25, 2026

Template Instructions: Teach Your AI Agent How to Fill the Form

Pressa Team

You ask your AI agent for this month's invoice. It loads your saved template, the LaTeX is exactly the layout you spent an hour perfecting, the typography is on point. Then it stops and asks you four questions. What is the date. What is the invoice number. Should the EU client get a VAT line. Where do the hours go on the table. You answer all four, every month, forever.

The template captured how the document looks. It did not capture how it gets filled in. The agent has no idea that the date is just today, that invoice numbers count sequentially within the calendar year, that EU clients always need a reverse-charge line. Every compile starts from a blank slate of policy.

The Real Problem

A saved template stores LaTeX source. LaTeX is a layout language - it tells the compiler how to typeset words once those words exist. It cannot say "ask the user for the total but compute the date yourself." Anything procedural lives outside the template, in your head, surfacing as a fresh prompt every time.

For a fully static template - say, a one-pager that just needs three replacements - that is fine. For anything with real workflow, it means the user becomes a human checklist. Every reuse, every month, the same conversation. The same forgotten edge case the third time you forgot to add the VAT line and the auditor noticed.

The Fix: Template Instructions

V1.4.1 ships an optional instructions field on every saved template. It is prose markdown, up to 50000 characters, sitting alongside the LaTeX source. The LaTeX captures how the document looks. The instructions capture how it gets populated - defaults, workflow rules, conditional logic, edge cases. The two fields travel together. Save them once, fetch them together, run forever.

The workflow is the same as before, with one extra field on save:

MCP Tool Call
Tool: save_template
Input: {
"name": "monthly-invoice",
"latex_content": "\\documentclass{article}...",
"description": "Toptal monthly invoice",
"instructions": "Ask the user only for the total amount.\\nDate is today's date in YYYY-MM-DD.\\nInvoice number is YYYYMMDD-N where N is the sequential count of invoices this calendar year.\\nFor EU clients (country in description), append a 'VAT 0% reverse charge' line."
}

Three months later, your agent calls get_template and receives both back in a single round trip:

get_template response
{
"template": {
"name": "monthly-invoice",
"latex_content": "\\documentclass{article}...",
"instructions": "Ask the user only for the total amount..."
}
}

The agent reads both. It applies the rules to whatever input it has. It compiles. The user typed one number and got a finished invoice with the right date, the right number, and the VAT line if the client country triggered it. No checklist, no follow-up questions, no drift across months.

description vs instructions

These are two different fields and they do two different jobs.

description is a short one-line summary, max 500 characters, intended for humans reading a list of templates. "Standard Toptal monthly invoice." It shows up in pressa templates list next to the name and in the dashboard table. It is not for the agent to act on.

instructions is the longer playbook, max 50000 characters, intended for the agent to act on. Workflow rules. Field defaults. Conditional logic. The kind of thing you would tell a new hire on day one of running this template themselves.

Mixing them up is a common temptation - they are both metadata next to the LaTeX. Keep them separate. A template can have either, both, or neither.

Available Everywhere

Template Instructions are exposed across the three Pressa surfaces, same shape, different syntax.

MCP Server. The save_template tool gains an optional instructions parameter; the get_template tool returns it alongside the LaTeX. The list_templates response carries a has_instructions boolean per row so the agent can see at a glance which templates ship with a playbook and which do not.

CLI. Two new flags on templates save and one on templates get:

Terminal
$ pressa templates save monthly-invoice invoice.tex \
--description "Toptal monthly invoice" \
--instructions-file invoice-rules.md
Template "monthly-invoice" saved.

$ pressa templates list
monthly-invoice [instructions] (2.1 KB) Updated: Apr 25, 2026
cover-letter (1.4 KB) Updated: Mar 18, 2026

$ pressa templates get monthly-invoice \
--output invoice.tex \
--instructions-out invoice-rules.md

The badge in the list output marks templates that ship with a playbook so you can tell at a glance which ones the agent has guidance on.

REST API. POST /api/v1/templates accepts an optional instructions string. GET /api/v1/templates/:id returns it. GET /api/v1/templates (list) returns has_instructions but not the body, since instructions can be long and a list response should stay light. Full reference in the API documentation .

When to Use Instructions, When to Skip

Use the instructions field when the template has dynamic parts that need policy. A monthly invoice is the textbook case - the layout is identical, the data changes, and the rules around that data should not be re-described every time. Same for engagement letters where the date conventions matter, certificates where the issue date is computed, contracts where the jurisdiction toggles a clause.

Skip it when the template is fully static. A one-pager NDA whose only variable is the counterparty name does not need a playbook. The agent will figure out where the name goes from a one-line prompt. Adding instructions for the sake of it is just clutter - you are storing unnecessary tokens for the agent to read every fetch.

A useful test: if you find yourself saying the same procedural sentence to your agent two months in a row about the same template, that sentence belongs in instructions.

Why This Matters for Real Workflows

The promise of saved templates was reusable layout. The promise of saved templates plus instructions is reusable policy. Together, they collapse a multi-turn monthly conversation into a single sentence: "issue this month's invoice for client X for $Y." Everything else - the date, the number, the VAT logic, the formatting - is already on file.

This compounds. A consultancy with twelve client templates does not just save twelve LaTeX files; it saves twelve playbooks. A finance team running quarterly board reports does not just save the layout; it saves the rule that the cover date is the last business day of the quarter. The institutional knowledge that used to live in a senior employee's head now lives next to the template, fetched in the same call as the LaTeX, and applied identically every time the agent runs.

The drift problem disappears too. When the rules live in instructions, every compile applies the same rules. The April invoice numbering follows the same scheme as the January invoice numbering. The cover letter signature block is the one you wrote, not the one the agent improvised this morning.

Limits and Storage

Instructions are capped at 50000 characters per template. That is roughly 8000 words - more than enough for any realistic playbook, far short of letting someone shove an entire knowledge base into a single field. Templates without instructions stay exactly as they were; the field is opt-in and nullable. Plan limits on saved-template count are unchanged.

Get Started

Template Instructions are available now on Starter, Pro, and Business plans. If you already have saved templates, you can add instructions to any of them by re-saving with the new field - the upsert overwrites the existing row. Log in to your dashboard to start adding playbooks to your templates, or read the documentation for the full API, CLI, and MCP reference.

Try Pressa Free

One API call. LaTeX in, PDF out. Professional documents in seconds.