AI-SLOP-Detector

AI-SLOP-Detector

Leader 3 15 60
calendar_todayschedule2 min read

Stop the Slop: A Dedicated Gatekeeper for Your AI-Generated Code

We’ve all been there. You ask an LLM to "refactor this function" or "add a quick utility," and it produces something that looks perfect. It’s clean, it’s idiomatic, and it runs... until it doesn't.

The issue isn't that AI writes bad code; it's that AI introduces a very specific class of defects: AI Slop. I'm talking about hallucinated package imports, unimplemented pass stubs, and buzzword-heavy comments that add zero value.

To solve this, I built AI-SLOP Detector. It’s designed to catch the "slop" before it ever hits your production branch.


What exactly is "AI Slop"?

AI slop isn't just a syntax error. It’s structural "noise" that includes:

  • Phantom Imports: Hallucinated package names that sound plausible but don't exist.
  • Placeholder Fatigue: Functions filled with TODO, pass, or NotImplementedError.
  • Cross-Language Pollution: Seeing java_equals or php_strlen logic accidentally leaking into your Python script.
  • Low Logic Density: Codebases that are 80% comments and "jargon" and only 20% actual executable logic.

Key Features

1. The "Phantom Import" Hunter

The detector identifies non-existent packages before you hit a ModuleNotFoundError. In the latest v3.0.2, it’s smart enough to understand your project's pyproject.toml and internal src/ layout, so it won't flag your own modules as hallucinations.

2. Geometric Mean Scoring (The "Vibe" Check)

In version 3.0.0, we moved from arithmetic to weighted geometric mean for scoring.

Why? Because in quality control, one zero should pull down the whole score. If your code has 0% used imports (DDC), it doesn't matter how "dense" the logic is—it’s probably slop.

3. Self-Calibration

The tool actually learns your coding style. If you ignore a warning and keep the code, the tool marks it as a potential false positive. If you edit a file after a high deficit score, it confirms the "slop". It then runs a grid search to optimize the weights specifically for your codebase.

4. Structural Coherence

Using AST (Abstract Syntax Tree) node distribution, it measures how "similar" your files are. If a new file looks structurally alien compared to the rest of your project, it flags it for a closer look.


️ Quick Start

You can run it without even installing it using uvx:

uvx ai-slop-detector mycode.py

Or add it to your CI/CD pipeline to fail builds that exceed a "slop threshold":

# Hard gate — fails build at deficit_score >= 70
slop-detector --project . --ci-mode hard --ci-report

I’d love to hear how you’re managing AI-generated code in your teams. Is "slop" becoming a bottleneck for your PR reviews? Let's discuss in the comments!

7 Comments

2 votes
2
2
1
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

The Sovereign Vault — A Comprehensive Guide to Protocol-Driven AI

Ken W. Algerverified - Jun 4

Dashboard Operasional Armada Rental Mobil dengan Python + FastAPI

Masbadar - Mar 12

Each /slop Is a Calibration Signal — AI-SLOP Detector v3.6.0 and the Claude Code Skill

Flamehaven - Apr 30

I Wrote a Script to Fix Audible's Unreadable PDF Filenames

snapsynapseverified - Apr 20

AI-SLOP-DETECTOR v3.8.1: When Code Generation Gets Cheap, Structural Trust Gets Expensive

Flamehaven - Jun 5
chevron_left
3.5k Points78 Badges
South Koreaflamehaven.space
49Posts
27Comments
25Connections
Founder designing Sovereign AGI & Scientific AI systems — governance, reasoning models, medical/phys... Show more

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!