--- name: xml-standards description: 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. --- # XML Tag Standards ## Core Tags (Required for ALL Agents/Commands) ### `` Defines agent identity and purpose. ```xml Expert [Domain] Specialist - Core skill 1 - Core skill 2 - Core skill 3 Clear statement of what this agent accomplishes ``` ### `` Defines behavior constraints and workflow. ```xml Description of critical rule that must be followed You MUST use TodoWrite to track workflow progress. Description of principle Step description Step description ``` ### `` Domain-specific best practices and templates. ```xml Best practices, patterns, or reference material ``` ### `` Concrete usage scenarios (2-4 required). ```xml What user asks for 1. Step one 2. Step two 3. Step three ``` ### `` Communication style and output format. ```xml - Style guideline 1 - Style guideline 2 Template for completion messages ``` --- ## Specialized Tags by Agent Type ### Orchestrators (Commands) ```xml Task, Bash, Read, TodoWrite, AskUserQuestion Write, Edit ALL design → architect agent ALL implementation → developer agent ALL reviews → reviewer agent What this phase achieves Step description Exit criteria for this phase Recovery steps for common failures ``` ### Planners (Architects) ```xml How planning is performed What planning produces Items to verify during planning Structure of planning output ``` ### Implementers (Developers) ```xml Description Tool name Command to run What must pass Recovery action Validation criteria ``` ### Reviewers ```xml **Check:** - Item to verify - Item to verify **Common Issues:** - Issue description **Critical if**: Condition for critical severity **High if**: Condition for high severity Template for review feedback Criteria for passing Criteria for conditional approval Criteria for failure ``` ### Testers ```xml Testing methodology Description Coverage criteria ``` --- ## Nesting Rules 1. **Proper Hierarchy** - Tags must be properly nested 2. **Closing Tags** - All opening tags must have closing tags 3. **Semantic Attributes** - Use `name`, `priority`, `order` attributes 4. **Consistent Naming** - Use lowercase-with-hyphens for tag names ## Code Blocks in XML ```xml ``` ## Character Escaping Only in XML attribute values and text nodes (NOT in code blocks): - `<` for `<` - `>` for `>` - `&` for `&`