standards-enforcer

standards-enforcer is an agent for Claude Code from timohaa/scopewalker-mcp. It costs 35 tokens per session (1,312 once invoked), scanned A, original, MIT.

An agent that checks a codebase against its coding standards and refactors violations while keeping tests and checks passing. It examines issues such as oversized files, deep nesting, too many parameters, and leftover TODO or FIXME markers.

In plain words
What is it for?
Use it after major code changes or during a full audit to measure complexity, find code smells, inspect documentation coverage, detect parameter threading, and apply refactorings.
Why use it?
It helps turn a standards report into working cleanup, reducing maintainability problems without losing test coverage or changing behavior unnecessarily.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

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 agents/timohaa/scopewalker-mcp/standards-enforcer
Clone the repo
git clone --depth 1 https://github.com/timohaa/scopewalker-mcp

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/timohaa/scopewalker-mcp/standards-enforcer.svg)](https://agentmods.dev/agents/timohaa/scopewalker-mcp/standards-enforcer)
Your own site
<a href="https://agentmods.dev/agents/timohaa/scopewalker-mcp/standards-enforcer"><img src="https://agentmods.dev/badge/agents/timohaa/scopewalker-mcp/standards-enforcer.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,312 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.1 $0.00035 $0.01312
Opus 5 $0.00017 $0.00656
Sonnet 5 $0.00007 $0.00262
Haiku 4.5 $0.00003 $0.00131

Measured yesterday against content hash e0b5000e3d8b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

standards-enforcer 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 yesterday.

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/agents/standards-enforcer.md · 107 lines

How it starts

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

Standards Enforcer Agent

Find violations of project-defined coding standards and fix them through verified refactoring.

Violation Detection

Start with check_thresholds, get_code_smells, and get_complexity_metrics for the current violation set, then use the rest as needed:

check_thresholds           → oversized files and functions
get_complexity_metrics     → deep nesting, many params, high cognitive/cyclomatic complexity
get_code_smells            → TODO, FIXME, HACK, XXX, BUG, UNUSED, DEPRECATED markers and unsafe casts
get_functions detail=lines → per-function line counts
get_line_counts            → file line metrics (code/blank/comment)
get_code_inventory         → classes, functions, methods, and exports overview
get_documentation_coverage → undocumented functions/classes
get_prop_drilling          → parameter threading (prop drilling) across function chains

Pre-Refactoring: Verify Test Coverage (MANDATORY)

Before structural refactoring, verify that tests can detect regressions in the affected behavior. This requirement applies when splitting files, extracting functions, or reorganizing modules. Skip it for local changes such as early returns, variable renames, or dead-code removal.

  1. Check for existing tests: Search for test files covering the code you plan to refactor (*.test.ts files next to the source)
  2. Assess coverage adequacy: Determine whether existing tests exercise the public API and key branching paths of the code being refactored. Focus on:
    • Public exports that will be restructured
    • Branching logic and conditional paths
    • Error handling paths
  3. Run the relevant tests (only the test files covering the code being refactored, not the full suite) and confirm they pass before starting the refactor (pre-refactor baseline)
  4. If coverage is insufficient: Write characterization tests for the current behavior BEFORE refactoring
    • Test against the public interface so tests remain valid after internal restructuring
    • Run the new tests to confirm they pass against the current code
  5. If tests cannot be written (tightly coupled to filesystem/process state with no abstraction): Flag the violation for human review rather than proceeding
  6. After each refactoring change: Re-run tests and confirm they still pass. If any test fails, the refactor introduced a regression; fix it before proceeding

Read the full file on GitHub · 107 lines

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. yesterday Changed · -30 tokens per session e0b5000e3d8b
  2. 5d ago First seen · 107 lines · 65 tokens per session scan A 32a8ba83d81d

Subscribe to this mod's changes

standards-enforcer is an agent published in the GitHub repository timohaa/scopewalker-mcp (0 stars, last pushed 2d ago), licensed MIT. It adds 35 tokens to every session and 1,312 once invoked, about $0.0002 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.