repository-harness is a repository protocol that makes a software codebase easier for coding agents to understand and work on safely. It is for teams using Claude Code, Codex, Cursor, and similar agents who need authoritative documents, durable plans, explicit decision boundaries, and evidence for completed work. Its catalogue entries install the protocol's skills and instructions.
Borrowing it
Nothing to install: this file belongs to hoangnb24/repository-harness. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/hoangnb24/repository-harness/main/.agents/skills/encode-invariant/SKILL.mdgit clone --depth 1 https://github.com/hoangnb24/repository-harnessWrote 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.
[](https://agentmods.dev/skills/hoangnb24/repository-harness/encode-invariant)<a href="https://agentmods.dev/skills/hoangnb24/repository-harness/encode-invariant"><img src="https://agentmods.dev/badge/skills/hoangnb24/repository-harness/encode-invariant/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.
<a href="https://agentmods.dev/skills/hoangnb24/repository-harness/encode-invariant"><img src="https://agentmods.dev/badge/skills/hoangnb24/repository-harness/encode-invariant.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.00527 |
| Opus 5.5 | $0.00019 | $0.00211 |
| Sonnet 5.5 | $0.00010 | $0.00105 |
| Haiku 4.5 | $0.00005 | $0.00053 |
Grade A, and why
encode-invariant 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 23d 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.
How it starts
The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Encode Invariant
Turn an accepted rule into a focused guard without creating new product policy.
1. Read The Owners
Read applicable AGENTS.md, docs/WORKFLOW.md, and the complete
encoding pattern. Locate the
repository's product or technical authority and its native validation owner.
2. Pass The Authority Gate
Cite the accepted source and restate the exact scope, allowed behavior, forbidden behavior, and authorized exceptions. Stop before edits if authority is absent or materially ambiguous.
Do not promote conventions, code patterns, tests, defaults, tool behavior, or undocumented preferences into policy. An existing check without accepted authority is a mismatch to report, not authority to expand.
3. Design The Smallest Guard
Reuse the repository's existing test, build, task, lint, scan, or validation owner. Choose the lowest deterministic layer that sees the complete accepted scope. Avoid a parallel framework or duplicated source of truth.
Make failures actionable: name the violating item, the broken rule, the authority source, and a concrete compliant next action.
4. Implement And Prove
Implement only the authorized boundary. Add or run:
- positive proof showing a conforming case passes; and
- negative proof showing the targeted violation fails for the intended rule and diagnostic.
Use recoverable fixtures or test mutations for negative proof. Preserve unrelated work and never leave a deliberate violation in product files.
5. Discover Enforcement Without Expanding It
Inspect the checked-in validation and CI paths. Do not install hooks, choose a CI provider, change merge policy, or mutate external branch protection unless the user separately authorizes that action.
Report each level independently:
- local validation command and observed result;
- optional hook availability, if any;
- CI invocation discovered or absent, plus observed run status only when verified; and
- branch-protection enforcement verified or unverified.
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.
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.
- 23d ago Changed · -33 tokens per session 025d09975778
- 1mo ago First seen · 68 lines · 81 tokens per session scan A cd2742df488a
encode-invariant is a skill published in the GitHub repository hoangnb24/repository-harness (1,256 stars, last pushed 23d ago), licensed MIT. It adds 48 tokens to every session and 527 once invoked, about $0.0002 per session on Opus 5.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.
Other skills, from other repositories
pin-guardrail
Pin a shell guardrail (a hook, a git hook, a checker script) with a behavioral test suite, prove the suite is real by mutating the code, and wire it into CI with its mutation ledger. Use when asked to "add tests for this hook", "pin that guard", "mutation-test this script", "this hook has no test", "wire the suite…
build-verification-skill
Build this project's verification skill - a small CLI that drives the running app and captures evidence, plus a feature map of what exists and how to reach it - and the CI check that keeps the map current. Use when asked to 'build a verification skill', 'let the agent drive the app', 'make a feature map', 'the agent…
launch-check
Run a pre-demo/pre-launch audit of the app - test data, broken screens, missing error states, brand consistency. Use when asked to 'demo check', 'launch check', 'pre-demo audit', 'check before user interview', 'audit before demo'.
tdd
TDD workflow - red-green-refactor per docs/methodology/tdd.md. Use when asked to '/tdd', 'TDD workflow', 'red-green-refactor', 'test-first development', 'write the failing test first'.
adding-an-audit-check
Add a new audit check to agent-context-doctor end to end, including config, suppressions, the check catalog, tests, and docs. Use when asked to detect a new kind of problem in agent instruction files.
safe-change
Trace, implement, test, and independently review one bounded software change. Use for ordinary feature, bug-fix, or refactor work after the repository is bootstrapped; do not use for broad repository cleanup, production operations, or undefined rewrites.