On this page
_index.xml format
The _index.xml file is the single most important runtime artifact:
it is what the agent sees at boot. Every Prime publishes one. The format is fixed
at v1.
Why XML?
Tag boundaries matter when the consumer is an LLM. JSON's { /
} noise is harder to parse for the model than <atom>...</atom>.
Anthropic's documentation explicitly recommends XML-tagged content for prompt
construction; the index leans into that.
Schema
<?xml version="1.0" encoding="UTF-8"?>
<prime_index version="1.0" total="898" total_tokens="422867">
<!-- One <cluster> per domain (optional grouping). -->
<cluster name="accessibility" density="0.42">
<!-- One <atom> per atom in the Prime. -->
<atom id="@community/rule-keyboard-accessible"
kind="rule"
tokens="312"
q="4.0">
<!-- The summary projection (~30 tokens). Inline. -->
Every interactive control must be operable from the keyboard…
<!-- All edges out. Self-closing. -->
<edge type="related" target="@community/anti-pattern-..."/>
<edge type="validates-with" target="@w3c/source-wcag-2.1.1"/>
<edge type="contradicts" target="@community/anti-pattern-..."/>
</atom>
<atom id="..." kind="..." tokens="..." q="...">
...
</atom>
</cluster>
<!-- More clusters... -->
</prime_index> Required attributes
| Element | Attribute | Required? | Notes |
|---|---|---|---|
prime_index | version | yes | Protocol version. Currently 1.0. |
prime_index | total | yes | Atom count. |
prime_index | total_tokens | recommended | Sum of full-projection tokens. |
cluster | name | yes | Domain tag or a free-form group. |
cluster | density | recommended | Edges-per-atom for this cluster. |
atom | id | yes | Fully-qualified @scope/kind-name. |
atom | kind | yes | One of the 28 kinds. |
atom | tokens | yes | Token count of the full projection. |
atom | q | recommended | Quality score (0.0 – 5.0). |
edge | type | yes | One of the 14 verbs. |
edge | target | yes | Atom id (may cross Primes). |
Size budget
Each <atom> entry should be ≤ 50 tokens including its inline
summary and edges. A 100-atom corpus produces a ~5 KB index; a 1,000-atom corpus
fits in ~50 KB. The reference frontend-design Prime (898 atoms) compiles to a
~52 KB _index.xml.
How agents use it
The MCP server emits the index lazily — the first prime_query call
boots the runtime, which reads the index file once and serves hits
from in-memory structures. The XML on disk is the source of truth; the in-memory
representation is a transient cache.
Agents typically receive a filtered view of the index in their MCP tool response — not the full ~50 KB. The full XML is the protocol surface; what each turn sees is determined by the query.