enforce_standards

A command that prepares a stacked branch and then runs the code-standards check. A stacked branch is a series of dependent changes managed together.

In plain words
What is it for?
Use it to squash and synchronize the current stack, detect conflicts, and start the code standards enforcer when preparation succeeds.
Why use it?
It prevents standards checks from running on a branch with unsolved merge conflicts or an out-of-date stack.

Command 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 commands/dagster-io/dagster/enforce_standards
Clone the repo
git clone --depth 1 https://github.com/dagster-io/dagster

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 538 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.00000 $0.00538
Opus 5 $0.00000 $0.00269
Sonnet 5 $0.00000 $0.00108
Haiku 4.5 $0.00000 $0.00054

Measured yesterday against content hash 44b18df188f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

enforce_standards 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/commands/enforce_standards.md · 66 lines

How it starts

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

Enforce Standards Command

Step 0: Stack Preparation with Merge Conflict Detection

CRITICAL: Before running the code standards enforcer, we must prepare the stack properly and abort if there are merge conflicts.

Sequential commands (must be run in order):

  1. gt squash - Squash commits in the current branch for cleaner history
  2. gt restack - Ensure the stack is properly synced and up-to-date

Important: These commands must be run sequentially, not in parallel. If either command fails due to merge conflicts, abort the entire operation and inform the user that merge conflicts must be resolved manually before running standards enforcement.

Merge Conflict Detection:

  • If gt squash fails with merge conflicts, abort and tell user to resolve conflicts first
  • If gt restack fails with merge conflicts, abort and tell user to resolve conflicts first
  • Only proceed to standards enforcement if both commands succeed without conflicts

Step 1: Invoke Code Standards Enforcer Agent

After successful stack preparation, use the Task tool to launch the code-standards-enforcer agent with the following configuration:

Agent Type: code-standards-enforcer

Task Description: "Audit changed files for standards compliance"

Detailed Prompt:

Please perform a comprehensive audit of all changed files in the current PR against the coding standards defined in CLAUDE.md.

Focus on:
1. Files that have been modified in the current branch compared to the base branch
2. Compliance with coding conventions from .claude/coding_conventions.md
3. Adherence to development workflow requirements from .claude/dev_workflow.md
4. Proper use of type annotations and @record decorators
5. Code quality requirements including mandatory `just ruff` execution

After the audit, provide:
- A summary of any standards violations found
- Specific recommendations for fixes
- List of files that need attention
- Confirmation that mandatory code quality checks (just ruff) have been run

If no violations are found, confirm that all changed files comply with the project's coding standards.

Read the full file on GitHub · 66 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 First seen · 66 lines · 0 tokens per session scan A 44b18df188f3

Subscribe to this mod's changes

enforce_standards is a command published in the GitHub repository dagster-io/dagster (16,073 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 538 tokens. 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.