---
name: ai-agent-system-prompt-designer
description: "A production-grade agent system prompt with role, tool rules, edge-case policy, guardrails, and an output contract, plus three test inputs aimed at its likeliest failures. Use when an engineer is building a tool-calling agent and needs a system prompt covering tool rules, edge-case policy, and a strict output contract. Do not use for a simple chatbot persona or tuning a prompt for a single one-off task. Related topics: AI, Technical, Coding."
---

# AI Agent System Prompt Designer

A production-grade agent system prompt with role, tool rules, edge-case policy, guardrails, and an output contract, plus three test inputs aimed at its likeliest failures.

## When to use

Use this skill when an engineer is building a tool-calling agent and needs a system prompt covering tool rules, edge-case policy, and a strict output contract. Do not use it for a simple chatbot persona or tuning a prompt for a single one-off task.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. State the role and objective in a few sentences, and use the tricky example to define the hardest case.
3. Write tool usage rules: when to call each tool, when not to, and the action on failure.
4. Write the decision policy for uncertainty and edge cases, matching the chosen uncertain behaviour.
5. Add guardrails each with a short reason, and the output contract with an example if strict format is on.
6. Write three test inputs aimed at the likeliest failures, each with a clear pass condition.

## Inputs

- **Agent name and one-line job** (free text, e.g. "Name and job")
- **Tasks it must handle well** (longer free text)
- **Target model type** (choose one: Chat model, Tool-calling model, Small local model, Model-agnostic)
- **Tools it can call** (longer free text)
- **Behaviour when uncertain** (choose one: Ask the user, Pick the safest option, Refuse and explain)
- **Things it must never do** (longer free text)
- **Guardrails to include** (choose any: Cite sources, Stay in persona, Admit uncertainty, Keep responses short, Escalate to a human when stuck)
- **Strict output format such as JSON or a template** (choose one: Yes, No)

## Output

The complete system prompt in sections (role, tools, decision policy, guardrails, output contract), followed by three test inputs each with a pass condition.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Agent System Prompt Design

Design a system prompt for an agent that behaves predictably in production.

- Agent name and one-line job: {{Agent name and one-line job}}
- Tasks it must handle well: {{Tasks it must handle well}}
- Target model type: {{Target model type}}
- Tools it can call: {{Tools it can call}}
- Behaviour when uncertain: {{Behaviour when uncertain}}
- Things it must never do: {{Things it must never do}}
- Guardrails to include: {{Guardrails to include}}
- Strict output format such as JSON or a template: {{Strict output format such as JSON or a template}}

Write the complete system prompt with these sections: role and objective, tool usage rules (when to call each tool, when not to, and what to do on failure), decision policy for the edge cases including the tricky example, guardrails with a reason for each, and the output contract with an example. Phrase rules positively where possible. Then list three test inputs that would catch the most likely failure modes, each with the behaviour that counts as a pass.

## Pitfalls

- Describing tools by name only, so the agent calls them in the wrong situations.
- Writing guardrails as a list of prohibitions with no policy for the cases between them.
- Skipping the failure path for tools, which leaves the agent looping or inventing results.
