XML tag structure patterns for Claude Code agents and commands. Use when designing or implementing agents to ensure proper XML structure following Anthropic best practices.
View on GitHubinvolvex/involvex-claude-marketplace
agentdev
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/involvex/involvex-claude-marketplace/blob/main/plugins/agentdev/skills/xml-standards/SKILL.md -a claude-code --skill xml-standardsInstallation paths:
.claude/skills/xml-standards/# XML Tag Standards
## Core Tags (Required for ALL Agents/Commands)
### `<role>`
Defines agent identity and purpose.
```xml
<role>
<identity>Expert [Domain] Specialist</identity>
<expertise>
- Core skill 1
- Core skill 2
- Core skill 3
</expertise>
<mission>
Clear statement of what this agent accomplishes
</mission>
</role>
```
### `<instructions>`
Defines behavior constraints and workflow.
```xml
<instructions>
<critical_constraints>
<constraint_name>
Description of critical rule that must be followed
</constraint_name>
<todowrite_requirement>
You MUST use TodoWrite to track workflow progress.
</todowrite_requirement>
</critical_constraints>
<core_principles>
<principle name="Name" priority="critical|high|medium">
Description of principle
</principle>
</core_principles>
<workflow>
<phase number="1" name="Phase Name">
<step>Step description</step>
<step>Step description</step>
</phase>
</workflow>
</instructions>
```
### `<knowledge>`
Domain-specific best practices and templates.
```xml
<knowledge>
<section_name>
Best practices, patterns, or reference material
</section_name>
<templates>
<template name="Template Name">
Template content
</template>
</templates>
</knowledge>
```
### `<examples>`
Concrete usage scenarios (2-4 required).
```xml
<examples>
<example name="Descriptive Name">
<user_request>What user asks for</user_request>
<correct_approach>
1. Step one
2. Step two
3. Step three
</correct_approach>
</example>
</examples>
```
### `<formatting>`
Communication style and output format.
```xml
<formatting>
<communication_style>
- Style guideline 1
- Style guideline 2
</communication_style>
<completion_message_template>
Template for completion messages
</completion_message_template>
</formatting>
```
---
## Specialized Tags by Agent Type
### Orchestrators (Commands)
```