1. Introduction: The “Tapestry” in Your Pull Request
Wikipedia editors maintain an internal essay titled Signs of AI Writing. It lists the dead giveaways of LLM-generated prose: unearned words like “delve” and “testament,” predictable three-part rhythmic sentences, and excessive diplomatic hedges. It exists because models trained on the internet consistently regress to a bland, bloated average.
The exact same thing happens in code.
Autonomous coding agents and IDE copilots write with an unmistakable accent. It rarely breaks syntax. Instead, it surfaces as structural padding, defensive theater, and premature abstraction.
Ask an agent to fetch data from a REST endpoint, and it routinely outputs an AbstractDataFetcherFactory, two abstract base classes, three layers of interface indirection, and thirty lines of defensive checks for edge cases that database schema constraints already make impossible.
It also narrates every basic line:
# Initialize empty list to store processed items
processed_items = []
# Loop through each item in the raw payload
for item in raw_items:
# Append the transformed item
processed_items.append(transform(item))
This is the software equivalent of padding a term paper to hit a word count.
In application code, this bloat makes PR reviews miserable. In data pipelines, it causes operational failure. Swallowing exceptions behind a catch-all except Exception: return None hides schema drift, poisons downstream tables, and burns warehouse compute credits while reporting green checkmarks on job runs.
Telling an LLM to “write clean, maintainable code” does nothing. To a model trained on millions of verbose enterprise repos, boilerplate is clean code. Fixing the output requires explicit negative constraints, borrowing Wikipedia’s playbook to catalog the exact anti-patterns agents must stop generating.
Thanks for reading Data Bytes! Subscribe for free to receive new posts and support my work.
2. The Rosetta Stone: Translating AI Prose Tells into AI Code Smells
Wikipedia’s anti-slop guide works because it names specific linguistic artifacts rather than offering vague advice like “write better.”
Coding models display identical patterns. Left unconstrained, they produce syntactic filler to simulate architectural depth.
Here is the direct translation layer between literary AI tells and real-world code smells.
Tell 1: The “Delve” Syndrome —> Comment Narration (”Captain Obvious”)
In Prose: “It is crucial to delve into the multifaceted nature of...”
In Code: Narrating syntax that is already obvious, or leaving conversational trail markers (
# Now we filter).
Pre-training rewards line-by-line hand-holding explanations. In production code, narrating syntax creates visual noise and causes documentation drift when logic updates but comments stay behind.
The AI Slop
# Initialize empty list to hold active users
active_users = []
# Loop through all retrieved user records
for user in raw_users:
# Check if the user status is active
if user.get("status") == "active":
# Append the user ID to our list
active_users.append(user["id"])
# Return the filtered user list
return active_users
The Pragmatic Refactor
return [user["id"] for user in raw_users if user.get("status") == "active"]
The Negative Constraint: Ban “what” comments. If code requires an explanatory comment to explain what it is doing, fix variable semantics and function structure instead. Reserve comments strictly for non-obvious “why” decisions (e.g., API rate-limit workarounds, non-standard regex, or hardware constraints).
Tell 2: False Balance —> The Pokémon Exception Catcher
In Prose: Treating fringe claims with the exact same weight as hard evidence to avoid taking a stance.
In Code: Broad
try ... except Exception:blocks that log a warning and returnNoneto prevent crashes.
LLMs are tuned to avoid hard stops during chat. In production, catching everything masks schema drift, conceals missing columns, and turns hard errors into silent downstream null corruption.
The AI Slop
def extract_event_timestamp(payload: dict) -> datetime | None:
try:
raw_ts = payload["event_metadata"]["timestamp"]
return datetime.fromisoformat(raw_ts)
except Exception as e:
logger.warning(f"Could not parse timestamp: {e}")
return None
The Pragmatic Refactor
def extract_event_timestamp(payload: dict) -> datetime:
return datetime.fromisoformat(payload["event_metadata"]["timestamp"])
The Negative Constraint: Fail fast. Never catch generic exceptions to return
Noneunless implementing an isolated dead-letter queue or worker loop at an external system boundary. Let invalid payloads raise immediately.
Tell 3: Syllable Padding —> Premature Enterprise Architecture
In Prose: Using forty words when six convey the point.
In Code: Scaffolding abstract base classes, generic interfaces, and factory patterns for operations that only have one implementation.
LLM Models train on millions of bloated corporate codebases where over-complicating things was mistaken for senior-level engineering. Ask for a simple API call, and an unchecked model will build an entire hierarchy of classes before it even fetches the data.
The AI Slop
from abc import ABC, abstractmethod
class BaseDataFetcher(ABC):
@abstractmethod
def fetch(self, endpoint: str) -> dict:
pass
class GenericAPIFetcher(BaseDataFetcher):
def __init__ (self, client: httpx.Client):
self._client = client
def fetch(self, endpoint: str) -> dict:
response = self._client.get(endpoint)
response.raise_for_status()
return response.json()
class FetcherFactory:
@staticmethod
def create_fetcher(client: httpx.Client) -> BaseDataFetcher:
return GenericAPIFetcher(client)
The Pragmatic Refactor
def fetch_api_payload(client: httpx.Client, endpoint: str) -> dict:
response = client.get(endpoint)
response.raise_for_status()
return response.json()
The Negative Constraint: The Rule of Three. Do not create interfaces, abstract base classes, or factories until three distinct concrete implementations already exist in the codebase. Favor locality of behavior over indirection.
Tell 4: Hallucinated Sources —> Semantic Mimicry & Phantom Stubs
In Prose: Inventing plausible journal titles, volume numbers, and author names.
In Code: Emitting flawless type signatures, docstrings, and Pydantic models with
pass,..., or# TODO: implementin the body.
Models reproduce the surface aesthetics of production code without doing the actual implementation work. Skeletons create the appearance of rapid progress while offloading all real engineering back onto the human reviewer.
The AI Slop
def reconcile_ledger_discrepancies(
source_records: list[dict], target_records: list[dict]
) -> ReconciliationReport:
"""Reconciles source and target transaction records to identify drift.
Args:
source_records: Raw transactions from primary ledger.
target_records: Replicated transactions from warehouse staging.
Returns:
A structured ReconciliationReport detailing matched and drifted records.
"""
# TODO: Implement join logic based on transaction_id
# TODO: Calculate float drift and handle currency normalization
pass
The Pragmatic Refactor
def reconcile_ledger_discrepancies(
source_records: list[dict], target_records: list[dict]
) -> dict[str, list[dict]]:
source_index = {r["transaction_id"]: r for r in source_records}
target_index = {r["transaction_id"]: r for r in target_records}
return {
"missing_in_target": [r for k, r in source_index.items() if k not in target_index],
"missing_in_source": [r for k, r in target_index.items() if k not in source_index],
}
The Negative Constraint: Ban placeholder stubs. An agent must output end-to-end working functions or refuse the request until necessary parameters are provided.
Tell 5: Unsolicited Sermons —> Defensive Paranoia & Drive-By Refactoring
In Prose: Adding a preachy wrap-up paragraph to a straightforward question.
In Code: Adding redundant type checks inside private helper functions, or reformatting nearby code you never asked it to touch..
Models often introduce defensive checks for conditions the surrounding code already prevents, and rewrite untouched functions while making unrelated edits. This creates noisy git diffs and conceals meaningful changes.
The AI Slop
def compute_moving_average(metrics: list[float], window_size: int) -> list[float]:
if not isinstance(metrics, list):
raise TypeError("Metrics must be a list.")
if not all(isinstance(x, (int, float)) for x in metrics):
raise ValueError("All elements must be numeric.")
if not isinstance(window_size, int) or window_size <= 0:
raise ValueError("Window size must be a positive integer.")
return [
sum(metrics[i : i + window_size]) / window_size
for i in range(len(metrics) - window_size + 1)
]
The Pragmatic Refactor
def compute_moving_average(metrics: list[float], window_size: int) -> list[float]:
return [
sum(metrics[i : i + window_size]) / window_size
for i in range(len(metrics) - window_size + 1)
]
The Negative Constraint: Enforce scope discipline and boundary-only validation. Validate data strictly at system ingress points (API endpoints, CLI inputs, file readers). Trust internal function contracts and keep git diffs strictly focused on requested changes.
3. The Data Engineering Multiplier
In web applications, bloated code wastes reviewer attention and burns minor CPU cycles. In data pipelines, it corrupts state, runs up BigQuery slot usage, and breaks downstream models silently.
Without explicit negative constraints, LLMs default to three destructive pipeline patterns:
Pattern 1: Row-by-Row Python Loops Instead of Native Spark Functions
Most code in an AI’s training data comes from standard, single-machine Python tutorials. As a result, when asked to transform a PySpark DataFrame, an unchecked agent often bottlenecks the job by pulling data into driver memory or writing custom Python UDFs rather than using native Spark expressions.
The AI Slop
# Pulls data through Python runtime, breaking Catalyst optimization
@udf(returnType=StringType())
def normalize_event_type(event_name):
return event_name.strip().lower() if event_name else "unknown"
df = df.withColumn("clean_event", normalize_event_type(col("raw_event")))
The Pragmatic Refactor
from pyspark.sql import functions as F
df = df.withColumn(
"clean_event",
F.coalesce(F.lower(F.trim(F.col("raw_event"))), F.lit("unknown"))
)
The Negative Constraint: Prohibit custom Python UDFs and driver-side loops (.collect(), .toPandas()) whenever a built-in Spark SQL or vectorized function can do the job.
Pattern 2: CTE Sprawl Over Partition Discipline
Given an analytical prompt, an LLM routinely outputs deeply nested Common Table Expressions with unconstrained window functions across an entire table. It simulates business logic while omitting the basic partition and cluster filters needed to prevent full scans.
The AI Slop
-- Full scan over the entire table; ignores physical partition layout
WITH ranked_events AS (
SELECT
user_id,
event_time,
payload,
ROW_NUMBER() OVER(PARTITION BY user_id ORDER BY event_time DESC) as rn
FROM `analytics.events`
)
SELECT user_id, event_time, payload
FROM ranked_events
WHERE rn = 1;
The Pragmatic Refactor
SELECT user_id, event_time, payload
FROM (
SELECT
user_id,
event_time,
payload,
ROW_NUMBER() OVER(PARTITION BY user_id ORDER BY event_time DESC) as rn
FROM `analytics.events`
WHERE _PARTITIONDATE >= DATE_SUB(CURRENT_DATE(), INTERVAL 3 DAY)
)
WHERE rn = 1;
The Negative Constraint: Forbid unpartitioned queries on partitioned tables. Every analytical query generated for warehouses like BigQuery must explicitly enforce partition and cluster bounds at the initial scan step.
Pattern 3: Masking Schema Drift with Silent Defaults
When source schemas change (an upstream field renames, a data type shifts, or nulls land in a previously required column) the agent instinctively attempts to prevent job failures by chaining defensive .get("key", default) fallbacks.
This makes the ingestion job pass, but downstream dashboards and models ingest zeroes and empty strings for weeks before the break is discovered.
The AI Slop
# Hides schema changes; lets corrupted or missing records enter staging
def ingest_record(raw: dict) -> dict:
return {
"user_id": raw.get("user_id", "unknown_user"),
"amount": float(raw.get("transaction_amount", 0.0)),
"timestamp": raw.get("timestamp", datetime.utcnow().isoformat()),
}
The Pragmatic Refactor
# Hard stop on missing required contract fields
def ingest_record(raw: dict) -> dict:
return {
"user_id": raw["user_id"],
"amount": float(raw["transaction_amount"]),
"timestamp": datetime.fromisoformat(raw["timestamp"]).isoformat(),
}
The Negative Constraint: Fail fast at ingestion boundaries. Do not inject silent fallback defaults for required contract fields. If an upstream schema violates expectations, the job must raise an immediate exception and stop data poisoning at ingestion.
4. Weaponizing AGENTS.md with Negative Constraints
Prompting an LLM with instructions like “write clean, efficient, maintainable code” is useless. Because the model learned from millions of wordy corporate codebases, its internal math genuinely treats fifty lines of setup boilerplate and three layers of wrapper classes as the gold standard for ‘clean code.
Telling an AI what to do leaves too much room for bad habits. Telling it what not to do sets hard guardrails.
Wikipedia editors didn’t stop generic writing by asking contributors to “write compelling prose.” They wrote a blacklist of terms (”delve,” “tapestry,” “testament”) and mechanical patterns to cut on sight.
To get production-grade output from autonomous coding tools (whether using Cursor, Claude Code, Antigravity, or custom local scripts), you must structure your project instructions as explicit negative filters.
Why Negative Constraints Work
They eliminate the statistical average: Models naturally fall back on the most common habits in their training data—and in corporate codebases, that means wordy, overly cautious bloat. Hard ‘don’ts’ snap the model out of autopilot.
They make checks automatic : You can’t write a test for whether code is “maintainable.” You can test whether an agent slipped in an unprompted abstract class, swallowed an exception, or wrote a comment starting with # Loop through.
They protect git diffs: Agents love drive-by refactoring; reformatting untouched code, renaming variables in adjacent methods, and adding defensive checks to unrelated functions. Negative constraints keep changes surgical.
The Anatomy of an Anti-Slop Constraint Block
Place this configuration in your repository root as AGENTS.md, .cursorrules, or within your agent system instructions:
# Agent Execution Protocol: Negative Constraints
You are an experienced engineer modifying a production system. Optimize for locality of behavior, readability, and minimal diffs over ceremony.
## Hard Prohibitions
### 1. Structure & Architecture
- DO NOT create abstract base classes, interfaces, or factory functions unless the project already contains at least three distinct implementations of that exact interface.
- DO NOT split logic into multiple files or utility modules if the total implementation fits in under 100 lines. Keep code co-located.
- DO NOT wrap primitive types in custom container classes or single-use Pydantic models unless strictly required for API serialization contracts.
### 2. Comments & Documentation
- DO NOT write inline comments explaining what code syntax does (e.g., `# Initialize list`, `# Filter items`, `# Loop through records`).
- DO NOT leave conversational comments (e.g., `# Updated per prompt`, `# Handle edge case`).
- ONLY write comments to document non-obvious "why" decisions: external API bugs, performance trade-offs, or hardware limitations.
- DO NOT write docstrings that merely restate function names and type signatures.
### 3. Error Handling & Defensiveness
- DO NOT catch generic exceptions (`except Exception:`, `catch (e)`) to log a warning and return `None` or default values. Let errors raise.
- DO NOT add defensive type checks (`isinstance()`, null checks) inside internal functions. Validate data once at system ingress; trust internal types.
- DO NOT swallow missing keys in data transformations using `.get()` chains with silent fallbacks. Fail fast when input violates schema expectations.
### 4. Diff Discipline & Completeness
- DO NOT modify, reformat, or rename variables in code outside the immediate scope of the request. Preserve clean git diffs.
- DO NOT output placeholder stubs (`pass`, `...`, `// TODO`). Emit complete, functional code or state what inputs are missing.
- DO NOT introduce third-party libraries for tasks solvable with the standard library.
Enforcing Rules via Automated Verification
Rules inside an instruction file help guide model generation, but autonomous agents require runtime verification.
Pair your AGENTS.md instructions with automated verification steps the agent must run before declaring a task complete:
AST-based Comment Checks: Run a quick linter or script that flags single-line comments directly preceding standard control structures (
for,if,while).Diff Scope Verification: Check
git diff --statagainst the original prompt scope. If an agent modified five files for a single-function fix, reject the output.Dead Code & Stub Scans: Fail builds automatically if keywords like
pass,NotImplementedError, orTODOappear in newly authored files.
5. Operational Takeaways: The Anti-Slop Audit
Fixing AI slop is not an ideological debate about code aesthetics; it is a mechanism for keeping pull requests reviewable and production systems deterministic.
Before merging an agent-generated diff, run it through this four-point sanity audit:
[] 1. Comment Density: Did the agent write any comment starting with a verb that
re-explains the syntax directly below it (# Parse, # Loop, # Filter)? Delete them.
[] 2. Catch Blocks: Are there bare `except Exception:` blocks returning `None` or `{}`?
Delete the fallback and let the upstream error raise.
[] 3. Layer Count: Can the entire implementation be represented as 1–2 flat functions
instead of a class hierarchy? Collapse the indirection.
[] 4. Boundary Discipline: Did the agent modify imports, formatting, or helper functions
in untouched files? Revert all out-of-scope edits.
Implementing Anti-Slop in Your Workflow
Commit
AGENTS.mdto Project Roots: Drop the negative constraints block directly into the root directory of your repositories. Tools like Cursor, Claude Code, and Antigravity ingest this automatically as operational context.Treat Negative Constraints as Linter Rules: Do not ask the model to “write clean code.” Explicitly list the anti-patterns it is forbidden from outputting.
Audit the Diff, Not the Prompt: The effectiveness of an agent is measured by how few lines of decorative ceremony you have to delete before hitting merge.
The goal with coding agents is not to generate more lines of code faster. It is to produce working implementations with the minimum surface area required to solve the problem.
TL;DR: Rich-text formatted version ready to highlight, copy, and paste directly into Substack’s WYSIWYG editor with proper clickable links, bolding, and bullet formatting intact.
References & Resources
Wikipedia: Signs of AI Writing - Community guide cataloging repetitive phrasing, unearned hedges,and structural filler in LLM text.
The Grug Brained Developer & Grug Brained Developer Ruleset - Turns the anti-complexity essay into weighted system constraints to stop agents from building premature abstractions.
Anti-Slop Agent Skill Pack - Modular SKILL.md rulesets (
antislop-code,antislop-ui,antislop-copywriting) for Antigravity, Cursor, and Claude Code that block narration comments and generic boilerplate.Signs of AI Design - Drop-in
design-rules.mdblock countering frontend LLM defaults like unsolicited purple Tailwind gradients and repetitive SaaS card grids.Awesome CursorRules: Anti-Overengineering - Community
.mdcrules enforcing diff boundaries,scope discipline, and minimal defensive checks.
Thanks for reading Data Bytes! This post is public so feel free to share it.



Top comments (0)