XML-Structured Prompt Template

Anthropic docs

Submit a prompt

Overview

Structure a complex LLM task with XML tags for context, constraints, and output format.

Use cases

Prompt
Copied 0
<instructions>
Do the task specified in <task>. Follow <constraints>. Use <context>. Return output in <output_format>.
</instructions>

<task>
<<<what you want done>>>
</task>

<context>
<<<background docs, audience, examples>>>
</context>

<constraints>
- <<<tone, length, must/must-not>>>
</constraints>

<output_format>
<<<bullets / markdown / JSON schema>>>
</output_format>

Can AI?

Alternatives

  • JSON Objects in XML TagsProduce multiple JSON objects inside named XML tags for structured multi-object extraction.AI agent framework
  • Brainstormer instructions for a Gemini Gem or any assistantGoogle's example instructions for a Brainstormer Gem in Gemini, set out as persona, task, context and format. The assistant asks pointed questions about your request first, offers at least three numbered ideas, checks whether you want to add anything and then goes deeper on the idea you pick. Use it for presents, parties, stories, trips and weekends.Personal assistant
  • Grade an AI response against expert workThis prompt rates an AI answer on how well it follows its original instructions, measured against what a top human expert would deliver. It returns a letter grade from A+ to F, five reasons for the grade, a score out of 100, and how the score was reached.AI agent framework

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall