Skill Wiki v0.1.0

Docs / spec / index-format

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

ElementAttributeRequired?Notes
prime_indexversionyesProtocol version. Currently 1.0.
prime_indextotalyesAtom count.
prime_indextotal_tokensrecommendedSum of full-projection tokens.
clusternameyesDomain tag or a free-form group.
clusterdensityrecommendedEdges-per-atom for this cluster.
atomidyesFully-qualified @scope/kind-name.
atomkindyesOne of the 28 kinds.
atomtokensyesToken count of the full projection.
atomqrecommendedQuality score (0.0 – 5.0).
edgetypeyesOne of the 14 verbs.
edgetargetyesAtom 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.