Skip to main content

Rule-based prose linter for formulaic AI writing patterns.

Project description

slop-guard

A rule-based prose linter that scores text 0--100 for formulaic AI writing patterns. No LLM judge, no API calls. Purely programmatic.

It runs ~80 compiled patterns against your text and returns a numeric score, a list of specific violations with surrounding context, and concrete advice for each hit.

Add to Your Agent

Claude Code

Add from the command line:

claude mcp add slop-guard -- uvx slop-guard

Add to your .mcp.json:

{
  "mcpServers": {
    "slop-guard": {
      "command": "uvx",
      "args": ["slop-guard"]
    }
  }
}

Codex

Add from the command line:

codex mcp add slop-guard -- uvx slop-guard

Add to your ~/.codex/config.toml:

[mcp_servers.slop-guard]
command = "uvx"
args = ["slop-guard"]

If you want a fixed release, pin it in args, for example: ["slop-guard==0.2.0"].

CLI

The sg command lints prose files from the terminal. No API keys, no network calls.

Quick start

# Run without installing
uvx --from slop-guard sg README.md

# Or install it
uv tool install slop-guard
sg README.md

Usage

sg [OPTIONS] INPUT [INPUT ...]

sg requires at least one input. Each input can be a file path, - for stdin, or quoted inline prose text:

sg "This is some test text"
echo "This is a crucial paradigm shift." | sg -

Lint multiple files at once (shell-level glob expansion):

sg docs/*.md README.md
sg path/**/*.md

Options

Flag Description
-j, --json Output results as JSON
-v, --verbose Show individual violations and advice
-q, --quiet Only print sources that fail the threshold
-t SCORE, --threshold SCORE Minimum passing score (0-100). Exit 1 if any file scores below this
-c, --concise Print only numeric score output
--counts Show per-rule hit counts in the summary line

Examples

# One-line summary per file
sg draft.md
# => draft.md: 72/100 [light] (1843 words) *

# Concise output (score only)
sg -c draft.md

# Verbose output with violations and advice
sg -v draft.md

# JSON for scripting
sg -j report.md | jq '.score'

# CI gate: fail if any file scores below 60
sg -t 60 docs/*.md

# Quiet mode: only show failures
sg -q -t 60 **/*.md

Exit codes

Code Meaning
0 Success (all files pass threshold, or no threshold set)
1 One or more files scored below the threshold
2 Error (bad file path, read failure, etc.)

Installation

Requires uv.

Run without installing (recommended for MCP setups):

uvx slop-guard

Install persistently (gives you both slop-guard MCP server and sg CLI):

uv tool install slop-guard

Pin versions for reproducibility:

uvx slop-guard==0.2.0

Upgrade an installed tool:

uv tool upgrade slop-guard

From source

From a local checkout:

uv run slop-guard   # MCP server
uv run sg            # CLI linter

MCP Tools

check_slop(text) -- Analyze a string. Returns JSON.

check_slop_file(file_path) -- Read a file from disk and analyze it. Same output, plus a file field.

What it catches

The linter checks for overused vocabulary (adjectives, verbs, nouns, hedging adverbs), stock phrases and filler, structural patterns (bold-header-explanation blocks, long bullet runs, triadic lists, bold-term bullet runs, bullet-heavy formatting), tone markers (meta-communication, false narrativity, sentence-opener tells, weasel phrases, AI self-disclosure), rhythm monotony (uniform sentence length), em dash and elaboration colon density, contrast pairs, setup-resolution patterns, and repeated multi-word phrases (4-8 word n-grams appearing 3+ times).

Scoring uses exponential decay: score = 100 * exp(-lambda * density), where density is the weighted penalty sum normalized per 1000 words. Claude-specific categories (contrast pairs, setup-resolution, pithy fragments) get a concentration multiplier. Repeated use of the same tic costs more than diverse violations.

Scoring bands

Score Band
80-100 Clean
60-79 Light
40-59 Moderate
20-39 Heavy
0-19 Saturated

Output

Both tools return JSON with this structure:

score          0-100 integer
band           "clean" / "light" / "moderate" / "heavy" / "saturated"
word_count     integer
violations     array of {type, rule, match, context, penalty}
counts         per-category violation counts
total_penalty  sum of all penalty values
weighted_sum   after concentration multiplier
density        weighted_sum per 1000 words
advice         array of actionable strings, one per distinct issue

violations[].type is always "Violation" for typed records.

Benchmark snapshot

Example score distribution from benchmark/us_pd_newspapers_histogram.py on PleIAs/US-PD-Newspapers (first 9,001 rows of one local shard):

slop-guard score histogram

Example score-vs-length scatter plot from benchmark/us_pd_newspapers_scatter.py on the same shard:

slop-guard score vs length scatter

Example per-rule compute-time curves from benchmark/compute-time.py + benchmark/chart.py (annotated with the slowest rules at max length):

slop-guard per-rule compute time

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slop_guard-0.2.0.tar.gz (71.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slop_guard-0.2.0-py3-none-any.whl (47.8 kB view details)

Uploaded Python 3

File details

Details for the file slop_guard-0.2.0.tar.gz.

File metadata

  • Download URL: slop_guard-0.2.0.tar.gz
  • Upload date:
  • Size: 71.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for slop_guard-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d086d91777d7ac1cbbe306076d02ca0304a73adfbcae3f784a33e6366e3008a9
MD5 0f9b2463798f16b76607bdf7952d0ca1
BLAKE2b-256 bedb4b313c02d8219a25f1b4dd48bd398777232e3f438e13143a1d9dacebe87b

See more details on using hashes here.

File details

Details for the file slop_guard-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: slop_guard-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for slop_guard-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f1cecb49858a76395c77586e718f0b22d4e3683a1ad5639b14e52f4133250fa
MD5 db5157f6d4849ffe60e953528b399c25
BLAKE2b-256 ae96a9e1111228466340185b3a66be472869be404f7c564e31d1d701d532889e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page