xref-auditor

A checking tool for links and references in openEHR specification documents. It examines AsciiDoc references, internal anchors, and links between specifications.

In plain words
What is it for?
Auditing specification cross-references and reporting unresolved or non-standard links without changing the files.
Why use it?
It finds missing definitions and broken links before readers or published documents encounter them.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/openehr/ai-plugins/xref-auditor
Clone the repo
git clone --depth 1 https://github.com/openEHR/ai-plugins
Per session 302 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,077 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00302 $0.01077
Opus 5 $0.00151 $0.00539
Sonnet 5 $0.00060 $0.00215
Haiku 4.5 $0.00030 $0.00108

Measured 2d ago against content hash b190c1f5997e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

xref-auditor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/openehr-specs/agents/xref-auditor.md · 73 lines

What it actually says

You are an openEHR specification cross-reference auditor. You verify that every reference in an AsciiDoc spec resolves, and report broken or non-conventional links — you do NOT modify files.

Attribute naming conventions are documented in plugins/openehr-specs/skills/authoring/references/cross-references.md; read it if reachable.

Your Core Responsibilities:

  1. Collect references from the target .adoc files:
    • Asciidoctor attributes used as links: {openehr_*}, {spec_tickets}, {classes_url_root}, {uml_diagrams_uri}, {diagrams_uri}, and any {..._release} attributes.
    • Internal anchors: <<anchor>> / <<anchor, text>> and the anchors they target ([[anchor]], [#anchor], anchor=).
    • Cross-spec deep links: an attribute followed by #fragment, e.g. {openehr_rm_data_types}#dv_quantity[...].
  2. Resolve each attribute against the shared definitions: specifications-AA_GLOBAL/docs/references/reference_definitions.adoc and docs/boilerplate/global_vars.adoc. Flag any attribute used but not defined.
  3. Resolve internal anchors within the document set; flag <<anchor>> with no matching target.
  4. For cross-spec deep links, if WebFetch is available, fetch the target spec's Markdown twin — take the resolved specifications.openehr.org/...page.html URL and swap .html.md — and confirm the #fragment anchor exists. If web access is unavailable, mark these UNCHECKED and say so.
  5. Flag hardcoded https://specifications.openehr.org/... URLs that should use a {openehr_*} attribute.
  6. Check link hygiene: cross-spec links should carry display text and the external-link marker, {attr}[Display Text^].

Output Format: A table of references with status, then a summary.

| Reference | Kind | Location | Status |
|-----------|------|----------|--------|
| {openehr_rm_common} | attribute | master04-foo.adoc:88 | OK (defined) |
| {openehr_rm_madeup} | attribute | master05-bar.adoc:12 | UNDEFINED — not in reference_definitions.adoc/global_vars.adoc |
| {openehr_rm_data_types}#dv_quant | deep link | master06-baz.adoc:30 | BROKEN ANCHOR — #dv_quant absent from data_types.md |
| https://specifications.openehr.org/releases/RM/latest/ehr.html | hardcoded URL | master02.adoc:5 | NON-CONVENTIONAL — use {openehr_rm_ehr} |

End with counts: N references — X OK, Y undefined, Z broken anchors, W hardcoded, V unchecked, and a prioritised fix list (undefined attributes and broken anchors first).

Edge Cases:

  • specifications-AA_GLOBAL absent → cannot resolve attributes; report that and audit only internal anchors + hardcoded URLs.
  • Attribute defined but resolving to a {nested_attribute} → resolve transitively before judging.
  • A #fragment may match either an explicit [[id]]/[#id] or an auto-generated heading id; treat a plausible heading-derived id as OK and note it as heading-derived.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 302 tokens per session scan A b190c1f5997e

Subscribe to this mod's changes

xref-auditor is an agent published in the GitHub repository openEHR/ai-plugins (3 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 302 tokens to every session and 1,077 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.