Catch AI-generated slop before it ships.
SlopSentinel is a local-first auditor for AI-generated code patterns. It scans your repo, reports findings with line-level context, computes a 0–100 score, and can apply conservative auto-fixes.
It runs entirely on your machine/CI runner — no network calls, no code upload.
Traditional linters are great at correctness and style. They’re not designed to catch the “AI-shaped” failure modes you see in real PRs:
- narrative / overly polite comments (“we need to ensure…”, “here’s a comprehensive…”)
- training-cutoff references (“as of my last update…”)
- unused scaffolding imports and cargo-cult patterns
- repeated literals and weak hygiene that erodes maintainability over time
SlopSentinel complements your existing tooling by focusing on AI-specific signals and multi-language heuristics.
| Feature | SlopSentinel | ruff | pylint | semgrep |
|---|---|---|---|---|
| AI-specific patterns | ✅ | ❌ | ❌ | partial |
| Multi-language slop | ✅ | Python only | Python only | ✅ |
| AutoFix | ✅ | ✅ | ❌ | ❌ |
| Score / trend | ✅ | ❌ | ❌ | ❌ |
| GitHub Action | ✅ | ✅ | ❌ | ✅ |
| LSP | ✅ | ✅ | ✅ | ❌ |
| Baseline | ✅ | ❌ | ❌ | ❌ |
pip install slopsentinel
# pretty terminal output (alias: `slopsentinel`)
slop scan .
# conservative auto-fix preview
slop fix . --dry-runWant machine-readable output?
slop scan . --format json > slopsentinel.json
slop scan . --format sarif > slopsentinel.sarif
slop scan . --format html > slopsentinel.html
slop scan . --format markdown > slopsentinel.mdSlopSentinel ships built-in rules grouped by “fingerprint family” plus generic heuristics. You can list the exact rules in your install:
slop rules
slop rules --format jsonHighlights:
- Claude (
Axx)A03: overly polite / narrative commentsA04: trivial function with verbose docstringA06: leaked<thinking>tagsA10: banner / separator comments
- Cursor (
Bxx)B03: console.log spray (TS/JS)B06: empty TS interface/type shellsB07: overuse ofas any
- Copilot / GPT (
Cxx)C03: hallucinated imports / dependenciesC09: “as of my last update…” commentsC10:except Exception: passswallowing
- Gemini (
Dxx)D01: “here’s a comprehensive…” intro commentsD04: async without awaitD06: exec/eval usage
- Generic (
Exx)E03: unused imports (conservative)E04: empty/broad except blocksE06: repeated string literals (extract constant)E09: hardcoded credential-like literals (security)
For full details, see docs/RULES.md.
Example workflow (.github/workflows/slopsentinel.yml):
name: SlopSentinel
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
security-events: write
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required to diff against the PR base commit
- id: slopsentinel
uses: PeppaPigw/Slopsentinel@v1.0.0
with:
github-token: ${{ github.token }}
threshold: 60
comment: true
fail-on-slop: false
rules: "all"
sarif: true
sarif-path: slopsentinel.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.slopsentinel.outputs.sarif_path }}SlopSentinel reads pyproject.toml:
[tool.slopsentinel]
threshold = 60
fail-on-slop = false
languages = ["python", "typescript", "javascript", "go", "rust", "java", "kotlin", "ruby", "php"]
baseline = ".slopsentinel-baseline.json" # optional
plugins = [] # optional: ["my_rules", "my_rules:export_rules"]
[tool.slopsentinel.rules]
enable = "all"
disable = []
severity_overrides = { "A03" = "warning", "C01" = "info" }More:
- Rule reference:
docs/RULES.md - Scoring model:
docs/scoring.md - Architecture:
docs/ARCHITECTURE.md - Quickstart:
docs/quickstart.md - FAQ:
docs/faq.md - Plugin guide:
docs/plugin-guide.md - Case studies:
docs/case-studies.md
SlopSentinel ships a minimal stdio LSP server:
slop lspIt supports diagnostics, hover, and QuickFix code actions for conservative auto-fixes.
See docs/ide-integration.md for Neovim / VS Code / Emacs examples.
You can load custom rules via plugins = [...] in pyproject.toml.
See docs/plugin-guide.md (examples + packaging) and CONTRIBUTING.md (export
mechanics + error handling).
See CONTRIBUTING.md.
MIT — see LICENSE.