Agent template:

This template aims to assist you in writing a masterprompt. Masterprompts can be pasted into the “Instructions” tab of a Project from the AI provider of our choice.

When we then pose a question/problem in the chat of that Project, the masterprompt leads our request over a path of predefined steps, as well as personalizes and enhances the output to our needs. This is a basic understanding of an ai agent, since the masterprompt allows the ai to work through a series of steps on its own, and produces output tailored to a predefined standard.

More complex agents can be understood in the same way, as they have a predefined workflow; the difference: They can scrape input on their own and send output to the next link in the chain.

Step-by-Step Instructions


Before building an Agent, we must critically assess success / failure by defining test cases.

Evaluation set

Step 0: How will you know it works? Write 5–10 test inputs with success criteria.

 

TEST 1 — Standard input

Input:

Success criteria:

 

TEST 2 — Standard input

Input:

Success criteria:

 

TEST 3 — Edge case (too vague)

Input:

Success criteria:

 

TEST 4 — Edge case (too long / unusual format)

Input:

Success criteria:

 

TEST 5 — Stress test (out of scope)

Input:

Success criteria:

 

Evaluation type: [ ] Objective  [ ] Subjective

 

 

 

 

 

 

Masterprompt:

(this is the part you’ll paste in the instructions textbox of your project; Delete “Step x:…” after filling in!!!)

 

<identity>

“Step 1: One paragraph. What is it, what does it do, who is it for? Noun first. Verbs over adjectives.”

 

You are

 

</identity>

 

<cognitive_approach>

“Step 2: How does it think before it acts? The internal sequence before producing output.”

 

Before responding, work through this sequence internally:

 

STEP 1 —

 

STEP 2 —

 

STEP 3 —

 

STEP 4 —

 

</cognitive_approach>

 

<domain_knowledge>

“Step 3: Only for specialists. Practitioner-level knowledge, common errors, where to source information. Delete this block if not needed.”

 

WHAT MAKES GOOD OUTPUT IN THIS DOMAIN

 

COMMON ERRORS TO AVOID

 

SOURCES TO DRAW FROM

 

</domain_knowledge>

 

<workflow>

“Step 4: Numbered operational sequence from input to output.”

 

STEP 1 —

 

STEP 2 —

 

STEP 3 —

 

STEP 4 —

 

STEP 5 — DELIVER

 

</workflow>

 

<tools>

“Step 4b: Only if the agent has tools. Delete this block if text-only.”

 

TOOL 1: [name]

What it does:

Input it expects:

What it returns:

When to call it:

When NOT to call it:

 

</tools>

 

<output_standards>

“Step 5: Exact format, tone, length. One positive example + one negative example.”

 

FORMAT

 

TONE

 

LENGTH

 

EXAMPLE OF IDEAL OUTPUT:

 

EXAMPLE OF WHAT TO AVOID:

 

</output_standards>

 

<constraints>

“Step 6: Format as "You never do X because Y." Values with reasons, not bare rules.”

 

You never

 

because

 

You never

 

because

 

You never

 

because

 

</constraints>

 

<edge_cases>

“Step 7: How the agent responds when input doesn't match the expected pattern.”

 

INPUT TOO VAGUE

 

INPUT TOO LONG

 

OUT OF SCOPE REQUEST

 

OUTSIDE AGENT'S KNOWLEDGE

 

AMBIGUOUS OR CONTESTED CONTENT

 

</edge_cases>

 

<verification>

“Step 8: Internal checklist the agent runs before delivering.”

 

Before delivering any output, run this checklist:

 

 

 

 

 

 

If a check fails: fix it, drop it, or flag it to the user.

Never deliver output you know fails these criteria.

 

</verification>

 

<memory>

“Step 9: Only for stateful agents. Delete this block if one-shot.”

 

WITHIN A SESSION (working memory)

Track and update:

 

BETWEEN SESSIONS (persistent memory)

Store:

Format:

 

AT SESSION START (preloaded context)

Load:

How it shapes the first response:

 

</memory>

 

 

--- Masterprompt stops here ---

 

 

 

 

Step 10: Token optimization (manual)

Made to prevent token inflation in your written instructions: a finished prompt you can audit with.

Run this prompt in the project AFTER filling out the masterprompt.

 

Prompt:

I want to optimize my token usage for this masterprompt and need you to audit it(pasted) by following criteria. After auditing, point out where improvements can be made, and await further user instructions to imply them and deliver the new masterprompt.

Only cut things when they don’t affect the relevant attributes of the masterprompt!

Audit checklist:

□ Any instruction stated twice? Cut one.

□ Any 20-word sentence that could be 8? Tighten.

□ Any preamble explaining what you're about to say? Delete.

□ Any hedging ("try to", "aim to", "if possible")? Remove.

□ Any example that repeats another example? Drop it.

□ Any workflow step the model would do by default? Cut.

 

— Prompt ends here ---

The link has been copied!