Skip to main content

AGENTS.md Format Reference

This reference specifies the syntax, structural schemas, and constraints for AGENTS.md context router files.


1. Context Hierarchy Directive Specification

The <context-hierarchy> XML block must be the first element in any Layer-2 or Layer-3 file.

Schema

<context-hierarchy>
<parent src="<RELATIVE_PATH_TO_PARENT_AGENTS_MD>" type="<PARENT_TYPE>" />
<system-instruction>
<IMPERATIVE_SYSTEM_INSTRUCTION>
</system-instruction>
</context-hierarchy>

Attribute Reference

AttributeRequiredValid ValuesDescription
srcYesRelative pathPath to parent AGENTS.md (e.g., ../AGENTS.md, ../../AGENTS.md)
typeYesglobal-rules, bounded-context-rulesSemantic categorization of parent rules

2. Layer Specifications

MetricLayer 1 (Global)Layer 2 (Bounded Context)Layer 3 (Sub-Domain)
File Path/AGENTS.md/[context]/AGENTS.md/[context]/[sub]/AGENTS.md
Line Budget80 lines120 lines100 lines
Hierarchy TagNoneYes (points to /AGENTS.md)Yes (points to Layer 1 & 2)
Ubiquitous LanguageNoYesNo (inherited)
Required Skillsagent-router-expert, markdown-expertContext-specific (e.g., docusaurus-expert)No (inherited)
Code SnippetsNoOptionalYes

3. Universal Constraints

  • Language: English (en-US) only.
  • Emojis: Strictly forbidden in all headings, lists, and prose.
  • Paths: Relative Markdown links only (./relative/path.md). Absolute filesystem paths and external URLs are strictly forbidden.
  • Placeholders: Prohibited (no TODO, TBD, or empty sections).