semantic-diff

semantic-diff is a skill for Claude Code from Cadasto/openehr-assistant-plugin. It costs 135 tokens per session (2,325 once invoked), scanned C, original, MIT.

A comparison tool for openEHR clinical data definitions. openEHR is an open standard for electronic health records; this tool compares its archetypes and templates by meaning and structure rather than by text alone.

In plain words
What is it for?
Use it to compare two openEHR archetype or template files, classify the change, and review whether one can replace or work with the other.
Why use it?
Text differences can hide whether a clinical definition has actually changed in a meaningful way. The comparison helps identify changes between versions or between related definitions and assess their compatibility.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the openehr-assistant plugin — 8 skills, 3 commands, 3 agents, 2 hooks, 1 MCP server shipped together

Good fit Use it to compare two openEHR archetype or template files, classify the change, and review whether one can replace or work with the other.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cadasto/openehr-assistant-plugin/semantic-diff
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.

Any agent
npx skills add Cadasto/openehr-assistant-plugin --skill semantic-diff
Clone the repo
git clone --depth 1 https://github.com/Cadasto/openehr-assistant-plugin

Made for: Claude Code.

Or install openehr-assistant, the plugin that ships this one along with the rest of its 8 skills, 3 commands, 3 agents, 2 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for semantic-diff

README.md
[![agentmods](https://agentmods.dev/badge/skills/cadasto/openehr-assistant-plugin/semantic-diff.svg)](https://agentmods.dev/skills/cadasto/openehr-assistant-plugin/semantic-diff)
Your own site
<a href="https://agentmods.dev/skills/cadasto/openehr-assistant-plugin/semantic-diff"><img src="https://agentmods.dev/badge/skills/cadasto/openehr-assistant-plugin/semantic-diff.svg" alt="Measured on agentmods" height="20"></a>
Per session 135 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,325 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00135 $0.02325
Opus 5 $0.00068 $0.01162
Sonnet 5 $0.00027 $0.00465
Haiku 4.5 $0.00014 $0.00232

Measured 8d ago against content hash 31e1ec6e27d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

semantic-diff scanned grade C with 1 finding 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 8d 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.

Tells the agent never to refusehighAnti-refusal

Suppressing the ability to decline removes a core safety control; a later harmful request then succeeds.

- If the two files turn out to have **different** root concepts, do not refuse: emit a one-line note that input concepts differ and the comparison has auto-switched to **sibling mode** (§B), then produce the §B report in
skills/semantic-diff/SKILL.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Semantic Diff

Compare two openEHR artefacts at the semantic level — not textual. Auto-detect whether the inputs are archetypes (ADL) or templates (OET, .t.json, OPT, web template), and whether the comparison is between two versions of the same concept or between siblings / distinct concepts, then produce the appropriate report.

Instructions

  1. Parse $ARGUMENTS into <file-a> and <file-b>. When invoked from conversation rather than /semantic-diff (no arguments), take the two artefact paths (or CKM ids) from the user's request. If only one artefact is identifiable, ask the user for the second and stop.
  2. Read both files.
  3. Read the rubric bundled with this skill — references/semantic-diff-rubric.md. Follow its classification rules exactly.
  4. Detect the artefact type from the file content/extension:
    • Archetype — ADL source (.adl; archetype (...) header, definition, term_definitions). Load the archetype rules guide:
      guide_get("openehr://guides/archetypes/rules")
      
    • Template — one of four serialisations; load the template rules guide, plus the serialisation map when the pair is not OET:
      guide_get("openehr://guides/templates/rules")
      guide_get("openehr://guides/templates/serialization-formats")
      
      • OET (.oet) — authoring XML, <template>: diff archetype includes and <Rule> narrowing.
      • .t.json — Archetype Designer source template (AOM2 differential JSON: @type: TEMPLATE, parentArchetypeId, differential: true, templateOverlays): diff the root definition and the per-archetype overlays. It is not a web template.
      • OPT (.opt/.optx/.optj) — compiled operational template with archetype constraints inlined; also guide_get("openehr://guides/templates/opt-structure"). Differences here may come from a recompile rather than a design change, so say which; a raw-vs-profiled OPT pair differs in retained languages/bindings, not in design.
      • Web template (derived runtime JSON: templateId, webTemplate/tree, per-leaf inputs, aqlPath) — generated from an OPT; also guide_get("openehr://guides/templates/web-template"). Diff it only to assess FLAT/STRUCTURED path-schema impact on clients; never treat a web-template delta as the design delta, and point the user at the OET/.t.json pair for that.
    • Different serialisations of the same design are not comparable node-for-node (a .t.json keeps slots that its OPT has inlined). If the two files are different artefact types (e.g. an ADL vs an OPT, or an OET vs its own web template), report the mismatch, say which layer each sits at, and ask the user to confirm intent before proceeding.
  5. Detect the comparison mode from the root identifiers:
    • Version mode — same root concept / archetype id / template id, differing version (or differing revision of the same concept). Use the version-bump workflow in §A.
    • Sibling / cross-artefact modedifferent root concepts (e.g. ...health_summary vs ...report, or two distinct templates). Use the compatibility/divergence workflow in §B. Do not refuse, and do not emit a version-bump verdict — a bump is meaningless across distinct concepts.
  6. Produce the report for the detected mode.

Read the full file on GitHub · 109 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 109 lines · 135 tokens per session scan C 31e1ec6e27d9

Subscribe to this mod's changes

semantic-diff is a skill published in the GitHub repository Cadasto/openehr-assistant-plugin (4 stars, last pushed 13d ago), licensed MIT. It adds 135 tokens to every session and 2,325 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it C with 1 finding (tells the agent never to refuse). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.