mx-api-doctrine

A set of design rules for mx::api, a programming interface for creating, reading, and changing MusicXML music files.

In plain words
What is it for?
It is for designing, changing, or reviewing public mx::api types and their supporting reader and writer code. It guides how musical meaning should be represented rather than copying the file format’s raw structure.
Why use it?
It keeps the programming model clear and makes invalid or ambiguous music data harder to represent, even though MusicXML itself allows such forms.

Skill for Claude CodeCodex

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 skills/webern/mx/mx-api-doctrine
Any agent
npx skills add webern/mx --skill mx-api-doctrine
Clone the repo
git clone --depth 1 https://github.com/webern/mx

Made for: Claude Code, Codex.

Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,936 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.00061 $0.01936
Opus 5 $0.00030 $0.00968
Sonnet 5 $0.00012 $0.00387
Haiku 4.5 $0.00006 $0.00194

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

Security

Grade A, and why

mx-api-doctrine 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.

.agents/skills/mx-api-doctrine/SKILL.md · 142 lines

How it starts

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

mx::api doctrine

mx::api is not "MusicXML minus rare features." It re-shapes MusicXML into a model where invalid or ambiguous documents are hard or impossible to express. MusicXML's recurring defects -- stateful encodings, flat streams with label fields, one fact stated in two places, id-linked declarations, order-dependent meaning -- each have a countering principle below. Never mirror an element's raw shape. The price of every simplification is paid in mx::impl: the writer regenerates the spec-compliant encoding, the reader accepts every spec-legal variant.

The audience is a musician, not the round-trip harness

Corpus round-tripping is how we develop mx::api; it is not what the api is for. The api exists for people who create music and who build, modify, and interpret MusicXML files. Public-header comments must explain the notation semantics, how MusicXML encodes them, and how to author or read them through the api.

  • Never write from the harness's viewpoint. "The source", "preserved on round-trip", "populated by the reader" are wrong unless the field truly records non-semantic source fidelity (a principle-7 knob) -- then say so plainly (i.e. "Do not populate this when authoring").
  • Do not document what is not modeled; listing what isn't there is noise.
  • No separator/banner comments.

Bad: // staffIndex is zero-based; a source with an explicit number attribute always populates Good: // Which staff of the part this layout applies to, zero-based from the top staff.

Failure model: misuse must be boring

Responses to wrong api usage, in order of preference:

  1. Unrepresentable: shape the type so the wrong state cannot be expressed (choice types below; merged fields, principle 3).
  2. Defined fallback: document a harmless result and return it. A wrong-kind choice accessor returns a default-constructed copy; the writer drops the half of an encoding that is meaningless for the note it is on (a tie on a silent cue note is written as <tied> notation only, never as a sound-level <tie>). No signal to the caller.
  3. Result<T> (Result.h): the error channel of last resort. It exists for the DocumentManager I/O boundary, where failure is real (unreadable file, unparseable XML). Do not spread it into the data model.

Read the full file on GitHub · 142 lines

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 · 142 lines · 61 tokens per session scan A 19981300d455

Subscribe to this mod's changes

mx-api-doctrine is a skill published in the GitHub repository webern/mx (93 stars, last pushed 3d ago), licensed MIT. It adds 61 tokens to every session and 1,936 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

musicbox

Use when the user wants to play/pause/skip music, control volume, seek, search songs/playlists, query NetEase Music data, or operate NetEase MusicBox. Drives MusicBox through the musicbox CLI + daemon; never simulates terminal keypresses to the curses TUI.

darknessomi/musicbox · 65 tokens

spotatui-dj

Be the DJ for spotatui, the terminal music player, by driving its MCP server. Use whenever the user asks for music, asks you to DJ, wants tracks queued, played, skipped, or searched, asks what they have been listening to, or mentions spotatui.

LargeModGames/spotatui · 63 tokens

videoagent-audio-studio

Tired of juggling multiple audio APIs? This skill gives you one-command access to TTS, music generation, sound effects, and voice cloning. Use when you want to generate any audio without managing multiple API keys.

pexoai/pexo-skills · 50 tokens

agents

Build voice AI agents with ElevenLabs. Use when creating voice assistants, customer service bots, interactive voice characters, or any real-time voice conversation experience, and when configuring an agent's tools, workflows, or procedures, including creating, editing, compiling, and publishing procedure drafts on an…

elevenlabs/skills · 68 tokens

update-skills-from-changelog

Update ElevenLabs agent skills from a merged weekly changelog in elevenlabs-dx, then open a pull request in elevenlabs/skills. Trigger after a changelog merges to main on elevenlabs-dx, or when asked to update skills from changelog YYYY-MM-DD.

elevenlabs/skills · 62 tokens

dubbing

Dub audio and video into other languages using the ElevenLabs Dubbing API (dubbingv2), preserving the original speakers' voices. Use when translating videos, podcasts, or recordings into other languages, localizing media content, reviewing or correcting dubbing transcripts and translations, or regenerating a dub after…

elevenlabs/skills · 65 tokens