Borrowing it
Nothing to install: this file belongs to adamw7/tools. 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/adamw7/tools/main/.claude/skills/enforcer-rules/SKILL.mdgit clone --depth 1 https://github.com/adamw7/toolsWrote 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/adamw7/tools/enforcer-rules)<a href="https://agentmods.dev/skills/adamw7/tools/enforcer-rules"><img src="https://agentmods.dev/badge/skills/adamw7/tools/enforcer-rules/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/adamw7/tools/enforcer-rules"><img src="https://agentmods.dev/badge/skills/adamw7/tools/enforcer-rules.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.00093 | $0.02545 |
| Opus 5.5 | $0.00037 | $0.01018 |
| Sonnet 5.5 | $0.00019 | $0.00509 |
| Haiku 4.5 | $0.00009 | $0.00254 |
Grade A, and why
enforcer-rules 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 1mo 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 — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Enforcer Rules Skill
Add or change a rule in claude-code-enforcer, the module of custom
maven-enforcer-plugin rules that guard this repository's agent-facing files.
Every rule follows the same shape, so getting the shape right is most of the
work.
The two-phase build (there is no shortcut)
A maven-enforcer rule must be resolvable as a JAR before the build that uses it runs, so a change to a rule needs two commands:
mvn -pl claude-code-enforcer -am install # 1. publish the rule locally
mvn -N validate -DenforceClaudeMd # 2. quick root-only doc check
Skipping step 1 runs the previous rule against your new expectations. The
check is opt-in (claude-md-enforce profile, activated by -DenforceClaudeMd),
so ordinary builds are unaffected; .github/workflows/maven.yml is the only
workflow that opts in.
Anatomy of a rule
@Named("myNewRule") // the pom's <myNewRule> element
public class MyNewRule extends ClaudeCodeEnforcerRule {
private File someFile; // injected from the configuration
@Override
public void execute() throws EnforcerRuleException {
requireDocument(someFile, "someFile"); // build-setup checks first
String content = requireContent(someFile, "someFile");
List<String> violations = new ArrayList<>();
// ... collect every problem, never stop at the first ...
report("What went wrong, in one line:", violations);
}
void setSomeFile(File someFile) { // package-private setter per parameter
this.someFile = someFile;
}
}
Rules that check a property across every definition (skills, sub-agents,
commands) extend MultiDefinitionRule instead and call forEachDefinition(...)
— it already owns commandsDir / agentsDir / skillsDir traversal, where a
skill is a directory holding a SKILL.md.
Rules that validate one kind of definition file by file extend
DefinitionFormatRule, which owns the directory scan, the autoFix parameter
and the grouped report. A subclass supplies the Naming its messages use, the
directory, entriesIn(...) (the *.md files, or the subdirectories for skills),
and collectEntryViolations(...) — reaching for contentOf(...) and
frontMatterOf(...) / requiredFrontMatterOf(...) rather than reading and
parsing again.
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.
- 1mo ago Changed 6982219bb341
- 1mo ago First seen · 190 lines · 93 tokens per session scan A 6da7bb03824a
enforcer-rules is a skill published in the GitHub repository adamw7/tools (11 stars, last pushed today), licensed MIT. It adds 93 tokens to every session and 2,545 once invoked, about $0.0004 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
java-affected-tests
Use before opening or updating an OpenMetadata PR that changes Java, a JSON schema, an index mapping, a SQL migration, seed data or a pom — PR CI no longer runs the Java integration tests (they run only in the merge queue) and the JavaUIIT/search-it suites run only nightly, so this selects the unit tests and…
oss-fuzz
Run Tika's OSS-Fuzz Jazzer targets locally against a working-tree checkout — build the image, build fuzzers from local source, fuzz a target, run a corpus as a regression pass, reproduce a crash, and add seeds. Use for "fuzz the OneNote parser", "run OneNoteParserFuzzer against these files", "reproduce an OSS-Fuzz…
tika-eval-compare
Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".
run-tests
Run project tests using Maven (mvn). Use when the user asks to run tests.
java-unit-test
A code-generation guide for Java unit tests in Spring Boot projects. Unit tests check one small piece of code in isolation; Spring Boot is a Java framework for building web applications and services.
112-java-maven-plugins
Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) …