anti-slop

Enforces measurable code quality gates that block agents from degrading codebases during iterative edits.

1|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/SgtPooki/skills --skill anti-slop-sgtpooki
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: anti-slop
Source: https://github.com/SgtPooki/skills/tree/main/skills/anti-slop
Command: npx skills add https://github.com/SgtPooki/skills --skill anti-slop-sgtpooki

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lizard, ruff, pyflakes, and includes scripts (resource) and references (resource) components.

What problem does it solve? Coding agents that repeatedly extend their own code accumulate structural rot — god-functions grown one branch at a time, copy-paste duplication, and dead code from abandoned iterations — while every individual edit still passes tests. Research (SlopCodeBench) shows quality-aware prompting does not stop this degradation; only a measured gate with a failing exit code does. ## Core Features & Use Cases - Measured quality gate: The slopcheck.py script computes structural erosion (complexity mass via CCN×√NLOC), structural clone duplication, and dead-code counts across ~20 languages via lizard, then fails with exit code 1 when any gate is breached. - Ratcheting baseline with anti-gaming policy: A once-per-project baseline advances automatically on every passing check, refuses to be overwritten mid-task, and ignores looser tolerance flags unless a human sets an environment override. - Extend-vs-restructure decision rules: Reference guides with worked examples help decide when to restructure before adding a feature, plus a prose-slop sweep for AI-signature vocabulary in PRs and comments. - Use Case: An agent adds a third language to a CLI tool. Instead of grafting another elif into main(), it extracts a dispatch table, then runs slopcheck.py check . before declaring done — the gate confirms erosion and duplication did not rise. ## Quick Start Ask the agent to run the anti-slop baseline on your project, make its code changes, and then verify the quality gate passes with slopcheck before declaring the task done.

Frequently Asked Questions about anti-slop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop AI coding agents from degrading code quality over time?▼

Run slopcheck.py baseline once per project, then require slopcheck.py check to pass before any task is declared done. The gate measures structural erosion, duplication, and dead code, and fails with exit code 1 if quality regresses beyond per-iteration tolerances.

How do I measure cyclomatic complexity and code duplication in a repo?▼

Use slopcheck.py report, which runs lizard for per-function CCN across about 20 languages and a built-in normalized line-window clone detector for duplication. It prints erosion, duplication ratio, max CCN, and the highest-complexity functions.

Does slopcheck work with languages other than Python?▼

Yes, complexity and duplication analysis support roughly 20 languages via lizard, including JavaScript, TypeScript, Go, Rust, Java, C/C++, and Ruby. Only the dead-code gate is Python-only, using ruff or pyflakes when available.

Can I loosen the quality gate tolerances for legacy code?▼

Flags looser than the defaults are ignored unless a human sets SLOPCHECK_ALLOW_OVERRIDE=1; stricter values always work. Pre-existing offenders are grandfathered automatically but may not grow more than +2 CCN.

Why does slopcheck baseline refuse to run twice?▼

Re-baselining would launder accumulated slop into accepted history, so baseline refuses to overwrite an existing file. The baseline advances automatically on every passing check; a deliberate reset requires --force plus SLOPCHECK_ALLOW_RESET=1.

What are the limitations of the slopcheck quality gate?▼

Clone detection uses line-window hashing, so renamed-identifier and sub-window clones slip through. Dead-code detection covers Python only, and the extend-vs-restructure decision step is prose guidance with no automated measurement.