repository-harness: Skill for Codex

.agents/skills/encode-invariant/SKILL.md

encode-invariant is a skill for Codex from hoangnb24/repository-harness. It costs 81 tokens per session (560 once invoked), scanned A, original, MIT.

A method for turning an accepted repository rule into a small automated check. It also defines how to prove that compliant code passes and violating code fails.

In plain words
What is it for?
Use it to add or improve a test, build check, lint rule, scan, or other repository-native validation for an agreed rule.
Why use it?
It prevents important architecture, reliability, security, or quality rules from being forgotten or applied inconsistently.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

This is hoangnb24/repository-harness's own configuration. It tells Codex how to work on repository-harness itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything repository-harness configures →

About the project

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.

hoangnb24/repository-harness · 1,215 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/hoangnb24/repository-harness/main/.agents/skills/encode-invariant/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/hoangnb24/repository-harness

Made for: 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 encode-invariant

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoangnb24/repository-harness/encode-invariant/github.svg)](https://agentmods.dev/skills/hoangnb24/repository-harness/encode-invariant)
Your own site
<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.

agentmods 80×15 button for encode-invariant

Your own site · 80×15
<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>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 560 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.00081 $0.00560
Opus 5 $0.00041 $0.00280
Sonnet 5 $0.00016 $0.00112
Haiku 4.5 $0.00008 $0.00056

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

Security

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 9d 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/encode-invariant/SKILL.md · 68 lines

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.

Read the full file on GitHub · 68 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. 9d ago First seen · 68 lines · 81 tokens per session scan A cd2742df488a

Subscribe to this mod's changes

encode-invariant is a skill published in the GitHub repository hoangnb24/repository-harness (1,215 stars, last pushed 26d ago), licensed MIT. It adds 81 tokens to every session and 560 once invoked, about $0.0004 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.