declaring-invariants

declaring-invariants is a skill for Claude Code, Codex from oaustegard/claude-skills. It costs 175 tokens per session (3,600 once invoked), scanned A, original, MIT.

A code-review tool that checks whether tests cover every member of a domain such as a registry, set, tuple, or enum. It finds tests that repeat a hand-written subset instead of using the source definition.

In plain words
What is it for?
Use it when reviewing tests for complete coverage of registries, enums, sets, tuples, parameter lists, or similar collections.
Why use it?
A copied test list can become outdated when new members are added, while the test suite still passes. This tool reports those gaps and identifies which members are not covered.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when reviewing tests for complete coverage of registries, enums, sets, tuples, parameter lists, or similar collections.

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

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/oaustegard/claude-skills/declaring-invariants/github.svg)](https://agentmods.dev/skills/oaustegard/claude-skills/declaring-invariants)
Your own site
<a href="https://agentmods.dev/skills/oaustegard/claude-skills/declaring-invariants"><img src="https://agentmods.dev/badge/skills/oaustegard/claude-skills/declaring-invariants/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for declaring-invariants

Your own site · 80×15
<a href="https://agentmods.dev/skills/oaustegard/claude-skills/declaring-invariants"><img src="https://agentmods.dev/badge/skills/oaustegard/claude-skills/declaring-invariants.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 175 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,600 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00175 $0.03600
Opus 5 $0.00088 $0.01800
Sonnet 5 $0.00035 $0.00720
Haiku 4.5 $0.00017 $0.00360

Measured 12d ago against content hash 34d9da0e1e2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

declaring-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 12d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/claims.py, scripts/totality_lint.py, tests/test_claims.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

declaring-invariants/SKILL.md · 274 lines

How it starts

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

declaring-invariants

Two scripts over one idea: a test that enumerates a domain must loop the registry rather than a copy of it. Someone also has to say which domains matter in the first place.

python3 scripts/totality_lint.py <repo>   # tests that copy a domain
python3 scripts/claims.py <repo>          # what the repo declares, and what backs it

Python only, stdlib ast only: no install, no config file, no network.

The failure it catches

A test that loops a hand-written list passes its runner and proves nothing about completeness. When the same members also exist as a registry in the source, the list is a copy, and the copy drifts the moment someone adds a member to the registry and not to the test. Nothing goes red.

Measured on oaustegard/remex, 2026-08-24: adding a fourth member to ROTATION_CODES with no construction behind it left the entire 267-test suite green. Four separate tests looked total; each parametrized ["haar", "rht"] against a three-member registry. Only a test that looped the registry itself caught it.

Adapted from the meta-oracle in daniloc/coherence (src/oracle-domain.ts), which classifies an oracle's iteration root as LIVE or LITERAL by parsing the oracle's own AST. That harness needs spec files, a claim grammar, a ledger and Node; the check does not.

totality_lint.py — tests that copy a domain

finding meaning
sampled-domain a parametrize or for over a literal whose members are a strict subset of a source registry. The uncovered members are named.
ratchet-broken a hand-list marked ratchet names a member the registry no longer contains. Detected statically, without running anything.
unratcheted a registry enumerated live with nothing pinning its membership. Suppressed when no-floor already claimed the same line.
no-floor a test iterates a live registry with no len(...) >= n assertion in the file, so an emptied registry passes vacuously.
stale-ack an acknowledgement on a test that now covers the whole domain.

Read the full file on GitHub · 274 lines

Files

What ships with it

6 files 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. 12d ago First seen · 274 lines · 175 tokens per session scan A 34d9da0e1e2a

Subscribe to this mod's changes

declaring-invariants is a skill published in the GitHub repository oaustegard/claude-skills (148 stars, last pushed 2d ago), licensed MIT. It adds 175 tokens to every session and 3,600 once invoked, about $0.0009 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

betterthink

Enforce a stricter execution workflow for coding tasks: reduce ambiguity before editing, complete and verify one work item before starting the next, keep the project's instructions file lean and current when conventions or commands change, and screenshot-check UI work across mobile, tablet, and desktop. Use when the…

RokyYTR2/BetterThink · 74 tokens

betterthink

Enforce a stricter execution workflow for coding tasks: reduce ambiguity before editing, complete and verify one work item before starting the next, keep the project's rules file lean and current when conventions or commands change, and screenshot-check UI work across mobile, tablet, and desktop. Use when the user…

RokyYTR2/BetterThink · 74 tokens

skill-check

Comprehensive testing and validation of Claude skills. Use this skill whenever the user wants to test, validate, audit, or quality-check a skill — whether they say "test my skill", "check this skill works", "validate my skill", "run skill-check", or anything similar. Also trigger when the user asks things like "does…

JckJhns/skill-check · 192 tokens

ephemeral-ci-environment

Get a clean, reproducible ephemeral environment for CI and testing — a fresh root Ubuntu VM with every major toolchain and Docker preinstalled, your GitHub repo auto-cloned in, and the whole thing thrown away after. Per-second billing makes each run cost cents. Use to run tests, reproduce a bug, or validate a build in…

ariana-dot-dev/cloud-sandbox-vm-skills · 83 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

jamditis/claude-skills-journalism · 21 tokens

test-first-bugs

Enforces a test-driven bug-fixing workflow. Use when a user reports a bug, failing code, an error, or asks to fix something.

jamditis/claude-skills-journalism · 35 tokens