runtime-invariants

runtime-invariants is a skill for Claude Code, Codex from arch3rPro/dsh-skills. It costs 66 tokens per session (670 once invoked), scanned A, original, MIT.

A guide for adding checks that run inside a live application and stop startup when an owned contract is broken. These checks may verify authoritative events or stored data, but not merely whether a service or method exists.

In plain words
What is it for?
Use it when defining runtime invariants, deciding what application state or event sequence must hold, assigning each check to the module it protects, and registering startup failures.
Why use it?
It prevents runtime checks from testing implementation details that can pass while the real behavior is wrong. It makes contract violations visible when the system starts or changes state.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the dsh-skills plugin — 15 skills shipped together

Good fit Use it when defining runtime invariants, deciding what application state or event sequence must hold, assigning each check to the module it protects, and registering startup failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arch3rpro/dsh-skills/runtime-invariants
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 arch3rPro/dsh-skills --skill runtime-invariants
Clone the repo
git clone --depth 1 https://github.com/arch3rPro/dsh-skills

Made for: Claude Code, Codex.

Or install dsh-skills, the plugin that ships this one along with the rest of its 15 skills.

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 runtime-invariants

README.md
[![agentmods](https://agentmods.dev/badge/skills/arch3rpro/dsh-skills/runtime-invariants.svg)](https://agentmods.dev/skills/arch3rpro/dsh-skills/runtime-invariants)
Your own site
<a href="https://agentmods.dev/skills/arch3rpro/dsh-skills/runtime-invariants"><img src="https://agentmods.dev/badge/skills/arch3rpro/dsh-skills/runtime-invariants.svg" alt="Measured on agentmods" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00066 $0.00670
Opus 5 $0.00033 $0.00335
Sonnet 5 $0.00013 $0.00134
Haiku 4.5 $0.00007 $0.00067

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

Security

Grade A, and why

runtime-invariants 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 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.

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.

skills/testing/runtime-invariants/SKILL.md · 44 lines

How it starts

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

Runtime Invariants

A discipline for runtime invariant checks — checks that run in the running system and fail loud when a package's contract is violated. It is distinct from testing-tiers, which decides which test tier a change needs; this skill decides what an invariant may assert and how checks are owned and registered.

The defining constraint: a check may assert authoritative event streams or mutable data — never service or method presence. An implementation-detail check ("this service exists", "this method was called") is not an invariant; it tests implementation, not contract.

What an invariant may assert

An invariant guards a contract the running system owns — an event that was produced, a durable state transition that occurred, a relationship that must hold. It asserts:

  • an authoritative event stream (this event fired in this order, with this content);
  • mutable data (this invariant over the store holds after this operation).

It never asserts service or method presence — whether a capability is wired up — because that is an implementation detail, not a contract. Asserting presence turns the check into a synthetic test that passes regardless of behavior.

Ownership and registration

  • Each check is owned by the module whose contract it guards. The check registers under the module's exact name; a duplicate registration fails loud rather than silently overwriting.
  • Fail loud at startup. An invalid, blank, or duplicate check declaration throws at startup instead of being skipped, so misconfiguration is visible immediately.
  • Reserve the name. Registration reserves the module's name even when filters keep the check inactive, so two modules can never silently claim the same contract.
  • No synthetic checks. Register a check only when the module owns an observable event or mutable-data relationship. If nothing is observable, say so and explain, module-specifically, why nothing is checkable — do not fabricate an assertion to fill a slot.

Read the full file on GitHub · 44 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 · 44 lines · 66 tokens per session scan A 67bdb0c72a90

Subscribe to this mod's changes

runtime-invariants is a skill published in the GitHub repository arch3rPro/dsh-skills (4 stars, last pushed 21d ago), licensed MIT. It adds 66 tokens to every session and 670 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-31.