slopforge
v0.1.3
Published
Detect and clean up AI slop in a codebase: dead code, duplication, over-engineering, unused deps.
Maintainers
Readme
slopforge
Detect and clean up AI slop in your codebase — dead code, duplication, over-engineered abstractions, inconsistent style, unused dependencies, dead files.
slopforge is two coordinated surfaces sharing one core:
- A CLI (
npx slopforge) that runs the deterministic pipeline: it shells out to mature existing tools (Knip, Biome/Prettier, jscpd, Ruff, Vulture, deptry), normalizes their output into one unified report, and applies fixes in safety tiers behind git checkpoints. - A Claude Code skill (
slopforge audit) that runs the judgment pipeline: over-engineering detection and semantic (non-token-identical) duplication — the lanes no static tool can own — as a bounded, verify-driven agent loop.
The CLI is the hands; the skill is the judgment. The CLI is fully usable standalone (CI, no agent).
Quick start
# 1. Analyze — writes .slopforge/report.md, modifies nothing
npx slopforge scan
# 2. Review — open the report in any editor, check the boxes you approve
code .slopforge/report.md # or: open / vim / your editor of choice
# 3. Apply — git checkpoint, then tiered execution with test gating
npx slopforge apply
# Changed your mind?
npx slopforge revert --lastDesign principles
- Wrap, don't reimplement. Every deterministic lane delegates to the best existing tool. slopforge's value is orchestration, one unified report, safe tiered auto-fix, and the agent pass — not novel static analysis.
- Report before write, always. Nothing is modified until you've approved it in the report. Even "safe" fixes are gated behind report approval.
- Tiered execution behind git. Every apply starts with a git checkpoint. Tier 1 (formatting, safe lint fixes) is pre-approved in the report; tier 2 (deletions, dependency removal) is opt-in per item with test runs between batches; tier 3 (judgment refactors) is agent-only and always diff-reviewed.
- Language-pluggable. v1 ships JavaScript/TypeScript and Python. Adding a language is one
LanguageAdapter, not a core change. - False-positive-aware. Dead-code tools lie (dynamic imports, reflection, DI, framework magic). Nothing destructive is ever auto-applied.
Commands
| Command | What it does |
|---|---|
| slopforge scan [path] | Run all analyzers, write .slopforge/report.md + findings.json. Read-only. |
| slopforge apply [path] | Execute the findings you approved in the report, behind a checkpoint. |
| slopforge revert [path] | Roll back to a checkpoint (--last or --all). |
| slopforge prevent [path] | Install a short anti-slop ruleset into the repo's agent config (asks first). |
| slopforge audit … | Harness subcommands for the agent judgment loop (driven by the skill). |
Documentation
- Getting started — install, first scan, first apply
- Concepts & architecture — lanes, tiers, findings, adapters, the report
- CLI reference — every command and flag
- Configuration —
slopforge.config.json - The audit loop — the agent judgment pass: verify gates, ledger, maker/checker
- Worked example — a full end-to-end run on a real GitHub repo
Requirements
- Node.js ≥ 20 and git.
- The underlying analyzers for the languages you use. slopforge detects what's installed, degrades gracefully, and prints exact install hints for anything missing — it never installs tools itself.
License
MIT
