prompt-engineering-output-xml

Installation
SKILL.md

XML-Tagged Prompts & Outputs

Disclaimer. Anthropic's published prompt-engineering guidance is the authoritative source for XML-tag behavior on Claude. Patterns below distill that guidance plus practitioner experience; verify against current Anthropic docs for any model-specific changes.

Anthropic's models pay strong attention to XML-style tags. Tags solve two problems that prose alone struggles with:

  1. Input sandboxing. Wrapping user-supplied content in <user_input>...</user_input> tells the model "this is data, not instructions" and dramatically reduces prompt-injection success.
  2. Nested structure with prose. When the output is a mix of structured fields and free text (a code review with a verdict + per-file comments + a summary), JSON forces awkward escaping while XML keeps the prose clean.

Use this skill on Claude. On other models, prefer JSON via prompt-engineering-output-json unless you have a specific reason.

When to use XML over JSON

Installs
2
GitHub Stars
6
First Seen
May 23, 2026
prompt-engineering-output-xml — jimnguyendev/jimmy-skills