cd /news/ai-agents/the-22-patterns-of-ai-code-slop-and-… · home › topics › ai-agents › article
[ARTICLE · art-139277] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

The 22 patterns of AI code slop, and how to delete them

A developer built an agent skill called stop-ai-slop that catalogs 22 patterns of AI-generated code slop and deletes them, demonstrated by collapsing an 8-insertion/54-deletion diff that removed a single-implementation interface, a one-product factory, restating comments, and an error-swallowing except clause. The skill ships with three labeled fixtures and a harness scoring recall, precision, and false positives on clean code, where gpt-6-luna scored 1.00 recall and 0.91 precision and claude-haiku-4-5-20251001 scored 1.00 recall and 0.83 precision, both with zero findings on the clean file. It installs via 'npx skills add kirankunapuli/stop-ai-slop' to 79 agents and offers a report-only GitHub Action for pull requests.

by read3 min views2 publishedSep 24, 2026

Your agent writes code that looks right. Interfaces with one implementation. Comments that restate the next line. try/except that swallows errors. Names like data and process. A dependency that does not exist. Tests that were edited to pass.

Reviewers approve it because it resembles the patterns good engineers write. That is the failure mode. AI output does not usually look broken. It looks thorough.

I built an agent skill that catalogs these patterns and deletes them. This post is the catalog, a real before/after, and the eval I added so the claim can be checked.

Before anything else, ask: does this need to exist?

If a feature, abstraction, flag, or line is not required, delete it. Cleaning up code that should not exist is wasted work.

Then the portability test. If a function, comment, or sentence could move unchanged into an unrelated project, it carries no information about this one. processData, // Initialize the service, and Handles the request. pass between any two repositories. That is the tell.

An agent asked to add invoice saving produced this:

    class InvoiceProcessorInterface(ABC):
        """Interface for invoice processors."""

        @abstractmethod
        def process(self, data) -> dict:
            """Process the invoice."""
            ...

    class InvoiceProcessor(InvoiceProcessorInterface):
        def __init__(self, db):
            self.db = db

        def process(self, data) -> dict:
            result = {}
            for item in data:
                try:
                    amount = Decimal(item["amount"])
                except Exception:
                    amount = 0
                result[item["id"]] = self._handle(amount)
            return result

    class InvoiceProcessorFactory:
        """Factory for invoice processors."""

        @staticmethod
        def create(db) -> InvoiceProcessorInterface:
            return InvoiceProcessor(db)

The skill returned this:

    def save_invoice_amounts(db, invoice_lines) -> dict:
        return {
            line["id"]: db.save({"amount": Decimal(line["amount"])})
            for line in invoice_lines
        }

Diff: 8 insertions, 54 deletions.

It inlined the one-implementation interface and the single-product factory, renamed data, result, and _handle, deleted six restating comments, and removed the except Exception that turned an unparseable amount into zero.

Code:

Retry-After, missing timeouts, no rate-limit handling. Generated prose:

An agent that writes a redundant comment and then edits a failing assertion to make the suite green is not a style problem. It is a correctness problem, and the suite is now lying.

So the skill also reviews the agent's own behavior:

Most skills ship on claims. I added three labeled fixtures, two sloppy and one clean, and a harness that scores recall, precision, and false positives on the clean file.

Model Recall Precision Findings on clean
gpt-6-luna (default) 1.00 0.91 0
claude-haiku-4-5-20251001 1.00 0.83 0

The harness exits non-zero when recall drops or when the skill reports a finding on clean code. That second check matters most. A skill that invents problems is worse than one that misses a few.

The limits are in the repo: three fixtures, keyword scoring, one run per model. Keyword scoring is a floor, not a grade.

    npx skills add kirankunapuli/stop-ai-slop

It installs to 79 agents, including Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, Windsurf, Zed, and Pi.

There is also a GitHub Action that reviews a pull request in report-only mode:

    - uses: kirankunapuli/stop-ai-slop@v1
      with:
        api-key: ${{ secrets.OPENAI_API_KEY }}

It runs on OpenAI, Anthropic, Google, Groq, OpenRouter, local Ollama, or any OpenAI-compatible endpoint.

Validation and authorization at trust boundaries, error handling that prevents data loss, security, accessibility, concurrency correctness, domain rules that are load-bearing, and the writer's voice. It never adds an abstraction, dependency, or config knob in the same pass that removes one.

Where has your agent produced slop that a reviewer waved through?

── more in #ai-agents 4 stories · sorted by recency
── more on @stop-ai-slop 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-22-patterns-of-a…] indexed:0 read:3min 2026-09-24 · —