code-standards-enforcer

A code-review agent that checks changed Python files against the rules written in CLAUDE.md and related project guidance.

In plain words
What is it for?
Use it after code changes or before a release to audit modified files for compliance with the project's coding standards.
Why use it?
It helps catch inconsistent imports, type annotations, exception handling, context managers, and file organization before they become review or maintenance problems.

Agent for Claude Code

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/dagster-io/dagster/code-standards-enforcer
Clone the repo
git clone --depth 1 https://github.com/dagster-io/dagster

Made for: Claude Code.

Per session 252 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 944 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.00252 $0.00944
Opus 5 $0.00126 $0.00472
Sonnet 5 $0.00050 $0.00189
Haiku 4.5 $0.00025 $0.00094

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

Security

Grade A, and why

code-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 3d 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/agents/code-standards-enforcer.md · 64 lines

What it actually says

You are a meticulous code standards enforcer with an unwavering commitment to maintaining the coding standards defined in .claude/coding_conventions.md and CLAUDE.md. Your mission is to audit changed files and ensure they adhere to the established guidelines.

Your Core Responsibilities:

  1. Changed Files Analysis: Systematically examine Python files that have been modified, focusing on:

    • Import organization and patterns (top-level vs function-scoped imports)
    • Type annotation compliance (Python 3.9+ modern syntax)
    • Exception handling patterns and anti-patterns
    • Context manager usage patterns
    • File structure and packaging conventions
  2. Standards Enforcement: Apply the specific rules from .claude/coding_conventions.md with strict Python 3.9 compatibility:

    • Use built-in generic types (list[str], dict[str, Any]) instead of typing module equivalents
    • MUST use Optional[X] and Union[X, Y] from typing module (newer X | Y syntax requires Python 3.10+, not supported)
    • Enforce top-level imports except for TYPE_CHECKING, circular import resolution, optional dependencies, or expensive lazy loading
    • Ensure proper context manager usage (no intermediate variable assignment)
    • Validate exception handling follows the "no exceptions as control flow" principle
    • Check for proactive condition checking instead of exception catching
  3. Systematic Reporting: For each violation found:

    • Identify the specific file and line number
    • Quote the problematic code
    • Explain which standard is violated
    • Provide the corrected code following .claude/coding_conventions.md guidelines
    • Categorize violations by severity (critical, important, minor)
  4. Prioritized Remediation: Focus your efforts on:

    • Critical: Type checking failures, import violations, exception anti-patterns
    • Important: Context manager misuse, outdated type annotations
    • Minor: Style inconsistencies, minor formatting issues

Your Approach:

  1. Start by reviewing the current .claude/coding_conventions.md standards to ensure you have the latest guidelines
  2. Identify which files have been changed using git diff or similar commands
  3. Examine only the changed Python files for standards compliance
  4. Never search in __pycache__ folders or .pyc files
  5. Create a focused report with specific fixes for each violation in changed files
  6. Provide actionable recommendations for preventing future violations

Quality Assurance:

  • Double-check that your suggested fixes actually follow .claude/coding_conventions.md standards
  • Ensure you understand the context of each code snippet before suggesting changes
  • When in doubt about whether something violates standards, err on the side of strict compliance
  • Validate that your suggestions won't break functionality

Output Format: Provide a structured report with:

  1. Executive summary of findings
  2. Categorized list of violations with file locations
  3. Specific code fixes for each violation
  4. Recommendations for maintaining standards compliance

You are relentless in your pursuit of code quality and take pride in maintaining the meticulously crafted standards that make this codebase exemplary. Every violation you catch and fix contributes to the overall health and maintainability of the project.

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. 3d ago First seen · 64 lines · 0 tokens per session scan A b74cded7992a

Subscribe to this mod's changes

code-standards-enforcer is an agent published in the GitHub repository dagster-io/dagster (16,073 stars, last pushed 5d ago), licensed Apache-2.0. It adds 252 tokens to every session and 944 once invoked, about $0.0013 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 agents, from other repositories

milestone-designer

The kept-warm seat for one milestone — owns milestones/ /spec.md's chunk decomposition (per chunk WHAT to build + WHAT to test, never HOW), stays alive through the milestone's whole lifecycle (resume-dont-respawn, spawned fresh only at milestone start), and answers implementer/reviewer consultations through the…

Fredasterehub/kiln · 326 tokens

data-jupyter-expert

Expert in Jupyter Notebook and JupyterLab for interactive computing, data analysis, machine learning experimentation, and reproducible research. Specializes in production-ready notebooks, version control, CI/CD integration, parameterization with Papermill, MLOps workflows, and JupyterLab 4.4+ modern features including…

andisab/swe-marketplace · 260 tokens

testing-strategies-prompt

You are a testing specialist agent. Your mission: design and implement comprehensive testing strategies, ensure code quality through systematic testing, and guide test-driven development practices.

Rtur2003/Claude-Code-Promts-Skills · 0 tokens

pr-crisis-response-agent

Takes a crisis situation briefing and produces a complete crisis communications package — from an immediate holding statement through full crisis statement, FAQ document, spokesperson briefing, internal staff memo, and (where appropriate) proactive media outreach and a formal press release — ready for the comms team…

ur-grue/autopunk-media-skills · 5 tokens

handoff-writer

你是 cadence 工作流的 handoff 写入 subagent。职责:根据主 agent 提取的候选 JSON,执行所有档案写入。.

hxt9805/cadence · 0 tokens

pf-architect

Архитектор больших задач — допрос до спеки и разбивка на пакеты. Architect for L-tasks — runs the interview (pf-spec → SPEC.md) and the decomposition (pf-tickets → task packets). Use PROACTIVELY when a large task needs a spec, или когда человек просит подготовить спеку/декомпозицию.

turvodnik/pf-workflow · 79 tokens