enforcer-rules

enforcer-rules is a skill for Claude Code, Codex from adamw7/tools. It costs 93 tokens per session (2,533 once invoked), scanned A, original, MIT.

A guide for creating, testing, and connecting Maven enforcer rules that check agent-facing files such as CLAUDE.md, AGENTS.md, and README.md.

In plain words
What is it for?
Use it when adding or changing an enforcer rule, or configuring its severity, report file, baseline file, or activation settings.
Why use it?
It explains the required two-stage build process and configuration details needed for documentation checks to use the newly changed rule.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/adamw7/tools/enforcer-rules
Any agent
npx skills add adamw7/tools --skill enforcer-rules
Clone the repo
git clone --depth 1 https://github.com/adamw7/tools

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 enforcer-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/adamw7/tools/enforcer-rules.svg)](https://agentmods.dev/skills/adamw7/tools/enforcer-rules)
Your own site
<a href="https://agentmods.dev/skills/adamw7/tools/enforcer-rules"><img src="https://agentmods.dev/badge/skills/adamw7/tools/enforcer-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,533 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00093 $0.02533
Opus 5 $0.00046 $0.01267
Sonnet 5 $0.00019 $0.00507
Haiku 4.5 $0.00009 $0.00253

Measured 4d ago against content hash 6da7bb03824a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 4d 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.

.claude/skills/enforcer-rules/SKILL.md · 190 lines

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.

Read the full file on GitHub · 190 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. 4d ago First seen · 190 lines · 93 tokens per session scan A 6da7bb03824a

Subscribe to this mod's changes

enforcer-rules is a skill published in the GitHub repository adamw7/tools (11 stars, last pushed 6d ago), licensed MIT. It adds 93 tokens to every session and 2,533 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-30.

Related

Other skills, from other repositories

network-rca

Kubernetes network root cause analysis skill powered by Kubeshark MCP. Use this skill whenever the user wants to investigate past incidents, perform retrospective traffic analysis, take or manage traffic snapshots, extract PCAPs, dissect L7 API calls from historical captures, compare traffic patterns over time, detect…

kubeshark/kubeshark · 163 tokens

kfl

KFL2 (Kubeshark Filter Language) reference. This skill MUST be loaded before writing, constructing, or suggesting any KFL filter expression. KFL is statically typed — incorrect field names or syntax will fail silently or error. Do not guess at KFL syntax without this skill loaded. Trigger on any mention of KFL, CEL…

kubeshark/kubeshark · 203 tokens

build-with-tinybase

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, configuring browser or database persistence, configuring MergeableStore…

tinyplex/tinybase · 76 tokens

docetl

Build and run LLM-powered data processing pipelines with DocETL. Use when users say "docetl", want to analyze unstructured data, process documents, extract information, or run ETL tasks on text. Helps with data collection, pipeline creation, execution, and optimization.

ucbepic/docetl · 59 tokens

Workspace Data Analyst

Analyze CSV files in the workspace and summarize insights.

VoltAgent/voltagent · 14 tokens

data-report

把 CSV/Excel/JSON 数据转成漂亮的可视化报告页.

nexu-io/html-anything · 19 tokens