This document consolidates research on RFC 2119 keywords and XML tag usage for restructuring Opencode Workflows documentation. It will serve as the authoritative reference for the overhaul.
RFC 2119: "Key words for use in RFCs to Indicate Requirement Levels" (March 1997, BCP 14)
Updated by RFC 8174.
Every document using these keywords SHOULD include this statement near the beginning:
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
| Keyword | Synonyms | Meaning |
|---|---|---|
| MUST | REQUIRED, SHALL | Absolute requirement. No exceptions. |
| MUST NOT | SHALL NOT | Absolute prohibition. No exceptions. |
| SHOULD | RECOMMENDED | Strong preference, but valid reasons may exist to deviate. Full implications MUST be understood before deviating. |
| SHOULD NOT | NOT RECOMMENDED | Strong preference against, but behavior MAY be acceptable in particular circumstances. Weigh carefully. |
| MAY | OPTIONAL | Truly optional. Implementations MUST interoperate whether or not the option is present. |
- Definition: The item is an absolute requirement of the specification.
- When to use: For behaviors essential to interoperability or safety.
- Example: "Agents MUST include a
descriptionfield in frontmatter."
- Definition: The item is an absolute prohibition of the specification.
- When to use: For behaviors that would cause harm or break compatibility.
- Example: "Commands MUST NOT execute shell commands without user approval."
- Definition: Valid reasons MAY exist to ignore this requirement in particular circumstances.
- When to use: For best practices where exceptions are sometimes justified.
- Caveat: The full implications MUST be understood and carefully weighed before choosing a different course.
- Example: "Skills SHOULD keep SKILL.md under 500 lines."
- Definition: Valid reasons MAY exist where the behavior is acceptable or useful.
- When to use: For practices that are generally discouraged but not forbidden.
- Caveat: The full implications SHOULD be understood before implementing.
- Example: "Agents SHOULD NOT use first person in system prompts."
- Definition: The item is truly optional.
- When to use: For features that some implementations will include and others will not.
- Interoperability: An implementation without the option MUST still work with one that has it.
- Example: "Commands MAY specify a custom model via the
modelfrontmatter field."
-
Don't force methods: Keywords MUST NOT be used to impose a particular method when it's not required for interoperability.
-
Security implications: Authors SHOULD elaborate on security implications of not following MUST/SHOULD requirements.
-
Capitalization: Keywords are typically CAPITALIZED to signal RFC 2119 meaning.
MUST > SHOULD > MAY
│ │ │
│ │ └── "You can if you want"
│ └────────── "You should, unless you have good reason not to"
└────────────────── "You have to, no exceptions"
When you want to use similar words WITHOUT RFC 2119 meaning, use lowercase or alternatives:
| Normative (RFC 2119) | Non-Normative Alternative |
|---|---|
| MUST | need to, have to, will |
| SHOULD | ought to, is expected to, is preferable |
| MAY | can, might, is allowed to |
- Claude/Anthropic official documentation
- W3C XML 1.0/1.1 specifications
- Industry best practices
| Rule | Description | Example |
|---|---|---|
| Case Sensitive | Tags MUST match case exactly | <Tag> ≠ <tag> |
| Must Close | All elements MUST have closing tags | <tag>content</tag> |
| Proper Nesting | Tags MUST close in LIFO order | <a><b></b></a> ✓ |
| Reserved Characters | <, >, & MUST be escaped |
<, >, & |
| Attributes | Use quotes for attribute values | <tag attr="value"> |
<!-- Both valid -->
<empty></empty>
<empty/><tag_catalog>
| Tag | Purpose | When to Use |
|---|---|---|
<instructions> |
Core behavioral rules | Always—primary directive section |
<context> |
Background information | When agent needs domain knowledge |
<constraints> |
Limitations and boundaries | For safety/scope restrictions |
<workflow> |
Step-by-step process | For multi-step procedures |
| Tag | Purpose | When to Use |
|---|---|---|
<examples> |
Container for demonstrations | For few-shot learning |
<example> |
Single demonstration | Inside <examples> |
<input> |
Example input | Inside <example> |
<output> |
Expected output | Inside <example> |
| Tag | Purpose | When to Use |
|---|---|---|
<thinking> |
Chain-of-thought reasoning | For complex analysis tasks |
<analysis> |
Structured examination | For breaking down problems |
<findings> |
Discovered issues/insights | For review/audit tasks |
<recommendations> |
Actionable suggestions | For advisory outputs |
| Tag | Purpose | When to Use |
|---|---|---|
<data> |
Raw data to process | For data analysis tasks |
<code> |
Code snippets | For programming context |
<document> |
Long-form text | For document analysis |
<reference> |
Cited material | For grounded responses |
| Tag | Purpose | When to Use |
|---|---|---|
<format> |
Output format specification | For structured outputs |
<formatting_example> |
Template to follow | For format demonstration |
<guidelines> |
Soft rules and preferences | For style guidance |
<rules> |
Hard rules and requirements | For strict constraints |
</tag_catalog>
<best_practices>
- Use the same tag names throughout your prompts
- Reference tags explicitly in instructions: "Using the data in
<context>tags..."
- Use nested tags for hierarchical content
- Keep nesting depth reasonable (3-4 levels max)
<examples>
<example>
<input>User request</input>
<output>Expected response</output>
</example>
</examples>- Use lowercase with hyphens:
<my-tag>or underscores:<my_tag> - Make names self-descriptive
- Avoid abbreviations unless universally understood
- Pair XML with RFC keywords:
<instructions>The agent MUST...</instructions> - Use with multishot prompting: wrap examples in
<examples> - Use with chain-of-thought: wrap reasoning in
<thinking>
</best_practices>
You're a code reviewer. Analyze this code for bugs.
Focus on security issues. Here's an example of good
feedback: "The null check is missing on line 5."
Use this data: [code here]. Be concise.
Problems: Boundaries unclear, example mixed with instructions, data ambiguous.
<role>You are a senior code reviewer specializing in security.</role>
<instructions>
1. Analyze the code in <code> tags for security vulnerabilities
2. Report issues in <findings> tags
3. Provide fixes in <recommendations> tags
</instructions>
<code>
[code here]
</code>
<examples>
<example>
<input>Unchecked user input</input>
<output><findings>SQL injection vulnerability at line 5</findings></output>
</example>
</examples>
<format>Be concise. Use bullet points.</format><preamble>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119.
</preamble>
<role>
You are [expert persona]. Your objective is [goal].
</role>
<instructions>
- Agents MUST [absolute requirement]
- Agents SHOULD [strong recommendation]
- Agents MAY [optional behavior]
- Agents MUST NOT [absolute prohibition]
</instructions>
<workflow>
1. First, [step]
2. Then, [step]
3. Finally, [step]
</workflow>
<constraints>
- MUST NOT exceed [limit]
- SHOULD NOT [discouraged behavior]
</constraints>
<examples>
<example>
<input>[user request]</input>
<output>[expected response]</output>
</example>
</examples>
<format>
Output MUST be formatted as [structure].
</format>---
description: [trigger description]. Use when [contexts].
mode: primary | subagent | all
---<role>
You are [persona]. You specialize in [domain].
</role>
<instructions>
- You MUST [requirement]
- You SHOULD [recommendation]
- You MAY [option]
- You MUST NOT [prohibition]
</instructions>
<workflow>
[numbered steps]
</workflow>---
name: skill-name
description: [comprehensive trigger description]
---<overview>
Brief description of capability.
</overview>
<workflow>
<phase name="understand">
[steps]
</phase>
<phase name="execute">
[steps]
</phase>
</workflow>
<rules>
- Skill MUST [requirement]
- Skill SHOULD [recommendation]
</rules>---
description: [what command does]
agent: build | plan
---<instructions>
1. [Step with RFC keywords]
2. The agent MUST [requirement]
3. The agent SHOULD [recommendation]
</instructions>- Add RFC 2119 boilerplate if using keywords
- Wrap major sections in appropriate XML tags
- Convert vague language to RFC keywords where appropriate
- Ensure XML is well-formed (proper nesting, closing tags)
- Test readability—tags SHOULD enhance, not obscure
- Replace "must" (lowercase) with "MUST" where it's truly required
- Replace "should" with "SHOULD" for strong recommendations
- Replace "can/may" with "MAY" for optional items
- Use non-normative alternatives for casual usage
- Consistent tag naming across all files
- Tags referenced in instructions match actual tag names
- Nesting is logical and not too deep
- Empty tags use self-closing syntax
| Level | Keywords | Meaning |
|---|---|---|
| Mandatory | MUST, REQUIRED, SHALL | Absolute requirement |
| Forbidden | MUST NOT, SHALL NOT | Absolute prohibition |
| Recommended | SHOULD, RECOMMENDED | Strong preference, exceptions allowed |
| Discouraged | SHOULD NOT, NOT RECOMMENDED | Generally avoid, exceptions allowed |
| Optional | MAY, OPTIONAL | Truly optional |
<role> <!-- Agent identity -->
<instructions> <!-- Core directives -->
<context> <!-- Background info -->
<workflow> <!-- Step-by-step process -->
<constraints> <!-- Limitations -->
<examples> <!-- Few-shot demos -->
<example> <!-- Single demo -->
<input> <!-- Example input -->
<output> <!-- Expected output -->
<thinking> <!-- Chain of thought -->
<findings> <!-- Analysis results -->
<recommendations> <!-- Action items -->
<format> <!-- Output structure -->
<rules> <!-- Hard requirements -->
<guidelines> <!-- Soft preferences -->- RFC 2119 - https://www.rfc-editor.org/rfc/rfc2119
- RFC 8174 (Update) - https://www.rfc-editor.org/rfc/rfc8174
- Claude XML Documentation - https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/use-xml-tags
- W3C XML 1.0 Specification - https://w3.org/TR/2008/REC-xml-20081126
- OASIS Keyword Guidelines - https://www.oasis-open.org/policies-guidelines/keyword-guidelines/