writing-checks

writing-checks is a skill for Claude Code from WangChangxin0809/repo-agent-harness. It costs 105 tokens per session (2,841 once invoked), scanned A, original, MIT.

A skill for turning repository rules into automated checks. It uses guards that inspect proposed actions and gates that inspect the whole project during continuous integration, or CI.

In plain words
What is it for?
Use it to block risky actions, fail CI when repository rules are broken, test that checks really detect failures, and enforce code structure.
Why use it?
Written instructions can be ignored or become outdated; automated checks can stop some mistakes early and flag others before the project is accepted.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/guards/selftest.py # must report exactly one failure, by name.

Part of the repo-agent-harness plugin — 6 skills, 1 agent, 4 hooks shipped together

Good fit Use it to block risky actions, fail CI when repository rules are broken, test that checks really detect failures, and enforce code structure.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/WangChangxin0809/repo-agent-harness
agentmods
npx agentmods add skills/wangchangxin0809/repo-agent-harness/writing-checks

Made for: Claude Code.

Or install repo-agent-harness, the plugin that ships this one along with the rest of its 6 skills, 1 agent, 4 hooks.

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 writing-checks

README.md
[![agentmods](https://agentmods.dev/badge/skills/wangchangxin0809/repo-agent-harness/writing-checks/github.svg)](https://agentmods.dev/skills/wangchangxin0809/repo-agent-harness/writing-checks)
Your own site
<a href="https://agentmods.dev/skills/wangchangxin0809/repo-agent-harness/writing-checks"><img src="https://agentmods.dev/badge/skills/wangchangxin0809/repo-agent-harness/writing-checks/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 writing-checks

Your own site · 80×15
<a href="https://agentmods.dev/skills/wangchangxin0809/repo-agent-harness/writing-checks"><img src="https://agentmods.dev/badge/skills/wangchangxin0809/repo-agent-harness/writing-checks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,841 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.00105 $0.02841
Opus 5 $0.00053 $0.01421
Sonnet 5 $0.00021 $0.00568
Haiku 4.5 $0.00011 $0.00284

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

Security

Grade A, and why

writing-checks 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 11d 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/writing-checks/SKILL.md · 266 lines

How it starts

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

Guards and gates

Governs: shared/scripts/guards/, shared/scripts/gates/

Two mechanisms, one discipline. A guard reads one proposed action before it runs and may block it. A gate reads the worktree at CI time and may fail the build. Everything below applies to both, because the failure modes are the same.

Guard Gate
Sees one tool call, as JSON on stdin the whole tree
Cost every matching call once per run
Use when the action is irreversible the state is detectable
Failure exit 2, stderr goes to the model non-zero, output goes to a human

A guard is a speed bump, not a boundary

Say this out loud before writing one, because the rest of this skill reads like a promise it cannot keep. A guard matches the text of a proposed command:

git push origin main | tail -5          BLOCKED
B=push; git $B origin main | tail -5    allowed

It also fails open on purpose — a broken guard must not become an unbypassable wall — so its coverage is best-effort in two independent directions. That is the right trade for what a guard is actually for: catching the thing you were about to do out of habit, and explaining why, at the moment you were doing it.

It is the wrong trade for anything adversarial, and for anything where a single miss is unacceptable. Those get three layers, in this order:

Mechanism Why it is stronger
1 permissions.deny in .claude/settings.json Evaluated by the harness, not by a regex you maintain
2 Server-side branch protection, required CI Survives the laptop, the config, and the plugin entirely
3 A guard here Explains why, in prose, at the moment of the attempt

Prefer a deny rule for anything a deny rule can express:

"deny": ["Bash(git push --force:*)", "Bash(git push -f:*)"]

Write a guard when the rule is conditional in a way a deny pattern cannot state — no_protected_branch_push.py is the worked example: the rule depends on the refspec, so Bash(git push:*) would block the branch you are allowed to push. And write a guard when the prose is the product, which is more often than it sounds. The paragraph on stderr is the highest-value text in the repository.

Read the full file on GitHub · 266 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. 11d ago First seen · 266 lines · 105 tokens per session scan A 9321db6bc0d3

Subscribe to this mod's changes

writing-checks is a skill published in the GitHub repository WangChangxin0809/repo-agent-harness (2 stars, last pushed 12d ago), licensed MIT. It adds 105 tokens to every session and 2,841 once invoked, about $0.0005 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.