The ruthless multi-layer purifier for AI coding agents. Strips away bloated boilerplate, hallucinated abstractions, narrative comments, generic AI template UIs, and robotic prose.
Large Language Models (LLMs) and AI coding agents have an innate bias toward AI Slop:
- Code Slop: Trivial comments restating syntax, empty
catch (e) {}blocks, uncheckedas anyband-aids. - YAGNI & Architecture Bloat: Single-use interfaces, premature factories, speculative configuration, and wrapper functions that add zero semantic value.
- UI Slop: Cookie-cutter purple gradients, unstyled floating cards, hardcoded pixel widths breaking mobile viewports.
- Prose Slop: Buzzword salads ("delve", "leverage", "testament", "in today's rapidly evolving world").
anti-slop-stack operates as an automated Senior Staff Engineer and QA gatekeeper that detects, catalogs, and mechanically purges these patterns.
npx anti-slop scan src/Automatically strips trivial narrative comments, dead imports, and obvious residue:
npx anti-slop fix src/Output structured findings for CI/CD dashboards or GitHub Code Scanning:
# JSON output
npx anti-slop json src/
# SARIF v2.1.0 output for GitHub Security tab
npx anti-slop sarif src/ > results.sarifConfigure thresholds and toggle rules per repository:
{
"rules": {
"bloatSlop": {
"maxLOC": 200
}
}
}Prevent degraded AI code from ever entering your Git history:
npx anti-slop init-hookYou can also audit only currently staged Git files or check changes across branch diffs:
# Audit staged files before commit
npx anti-slop staged
# Audit changed files against base branch
npx anti-slop diff origin/mainSee docs/PRE-COMMIT.md for Husky and Python pre-commit integrations.
Add to your repository's .github/workflows/quality.yml:
steps:
- uses: actions/checkout@v4
- uses: Dhani078/anti-slop-stack@main
with:
path: 'src'
fail-on-violation: 'true'Fails the build with exit code 1 if high-severity violations exist:
npx anti-slop ci src/| Layer | Target | What it Eliminates |
|---|---|---|
| 1. Code Slop | TypeScript, JavaScript, Python, PHP, Go, Rust | Narrative comments, swallowed exceptions (catch {}), as any / @ts-ignore, dead residue, leftover debug logs, destructive error wrapping, dangerous eval(), hardcoded secrets/API keys, blind sleep timeouts. |
| 2. Architecture & Bloat | Architecture & Modules | Single-implementation interfaces, speculative wrappers, files exceeding 200 LOC ceiling. |
| 3. UI & Visual Slop | CSS, Tailwind, JSX, Vue | Generic AI purple glows, template card layouts, hardcoded width overflow risks, Tailwind template gradients (from-purple-500 to-indigo-500). |
| 4. Prose & Copy | Markdown, HTML, Docs | AI clichΓ©s (delve, leverage, seamless), throat-clearing openings, passive voice, markdown bold overuse (term). |
anti-slop-stack is designed to run seamlessly across any AI coding environment:
Clone directly into your Hermes skills directory:
cd ~/.hermes/skills/code-quality
git clone https://github.com/Dhani078/anti-slop-stack.gitClone into your workspace or user skills folder:
git clone https://github.com/Dhani078/anti-slop-stack.git .claude/skills/anti-slop-stackAdd SKILL.md directly to your project rules (.cursorrules or .windsurfrules):
curl -s https://raw.githubusercontent.com/Dhani078/anti-slop-stack/main/SKILL.md >> .cursorrulesReference SKILL.md inside your repository instructions (AGENTS.md):
Before finalizing code changes, review and enforce SKILL.md from anti-slop-stack to eliminate boilerplate, narrative comments, and template UI bloat.Use as a pre-commit or post-generation check script:
npx anti-slop scan srcEmbed into .github/copilot-instructions.md:
Follow the anti-slop-stack rules: write minimal code (YAGNI), avoid Hungarian interfaces (no IFoo), ban narrative comments, and eliminate generic purple gradients.Run the included standalone verification suite (0 external dependencies):
npm testSample test output:
Running test suite for anti-slop-stack...
β Code Slop scanner passed
β Code Slop fixer passed
β Architecture Bloat scanner passed
β UI Slop scanner passed
β Prose Slop scanner passed
All 5 test suites passed cleanly with 0 failures!
- Architecture Overview - Subsystem flow, directory hierarchy, and pipeline design.
- Rules Reference Catalog - Granular catalog and descriptions of all detection rules.
- Performance Benchmarks - Latency, throughput, and memory consumption stats.
- CI/CD Integration - Setups for GitHub Actions, GitLab CI, Bitbucket, and Docker.
- Extending Rules - Guide for adding custom project rules and configuration.
- Frequently Asked Questions (FAQ) - Common questions, comparison with ESLint, and edge cases.
- Architecture & Specification - Full technical design, rule taxonomy, and QA gates.
- Visual Demonstration - Before vs. after code comparison showing 48% LOC reduction.
- Pre-Commit Hook Guide - Native Git, Husky, and Python pre-commit setup.
- Contributing Guide - Developer guidelines and zero-dependency principles.
- Contributor Code of Conduct - Community guidelines and behavioral pledge.
- Security Policy - Vulnerability disclosure policy and reporting process.
- Changelog - Version release history and migration notes.
MIT Β© Dhani078