Tools

Slopgate

Checks coding-agent changes against project rules before they are committed.

The problem it solves

Your coding agent fixes one problem, then reintroduces the same unsafe cast, empty error handler or forbidden import in the next change. Slopgate turns project rules into repeatable checks after edits and before commits, so you do not have to repeat the same review comments in every chat.

Ways to use it

  • Catch repeated unsafe casts

    Enable the as-any rule pack. When an agent adds an unsafe cast, the fast check points to that file and rule; fix the type or validation before continuing.

  • Adopt checks in an older app

    Review an initial ratchet baseline for existing violations. New violations block later commits while the recorded older debt can be fixed gradually; do not keep updating the baseline to absorb regressions.

  • Keep UI code away from database modules

    Add a project-owned dependency-cruiser boundary. The commit-tier check can then report an import that crosses that boundary rather than relying on a written instruction alone.

Before you start

  • A Git repository and Node.js 18 or newer with npm.
  • Permission to install the CLI and add project-local Git/Claude Code hooks.
  • Project-specific checker dependencies for the checks you enable; the package includes its native engine and pinned ast-grep.

Install and set up

  1. Install the documented release

    Run in a terminal with Node/npm available. The current documented release is 0.3.4; a Rust toolchain is not needed for the packaged engine.

    npm install -g @alexcodeplace/slopgate@0.3.4
  2. Initialize the target project

    From the repository root, initialize Slopgate. Review the generated .slopgate configuration and hook changes before accepting them.

    slopgate init .
  3. Review the initial baseline

    Only after reviewing the current violations, create the initial baseline. The command refuses to overwrite an existing one; updating a baseline is a separate deliberate decision.

    slopgate baseline --config .slopgate/config.toml

Use it in your project

  1. Check a changed file

    Replace src/app.ts with your own source file. The fast tier gives focused feedback without running every heavyweight project checker.

    slopgate --file src/app.ts --config .slopgate/config.toml
  2. Check the staged change

    Stage only the files you intend to commit, then run the gate. Exit 0 means the configured checks passed, 1 reports blocking findings, and 2 requires configuration or AST-runtime repair.

    slopgate --staged --config .slopgate/config.toml
  3. Reduce old debt without accepting new debt

    After fixing existing violations, prune resolved fingerprints. This writes the baseline; it is not a dry run and does not accept new violations.

    slopgate baseline --prune --config .slopgate/config.toml

What success looks like

A small test change produces a file/rule report, and fixing it lets the configured gate pass. Read skipped-checker notices: a missing optional checker did not validate your code.

Ask your agent to set it up

Copy this into a coding agent that can access your environment. The prompt asks it to check the current instructions and verify the setup before calling it done.

You can also select and copy the text directly.

What to know first

A rule-based check is not a guarantee that an app is correct or secure. Some checks need project-specific tools.

Current project README