# prosecop
Prosecop checks code documentation, comments, identifiers, and strings for vague words,
unusual sentence structures, excessive verbosity, and lack of attention to target audience.
It defines rulesets to catch the quirks of specific models to help prevent their excesses
while attempting to avoid reporting false positives on well written prose.
Prosecop is fast enough to run on every agent edit (or in a commit hook).
> While prosecop improves code legibility, its purpose is to improve agent<->human communication:
>
> - Your agent wants to rewrite the "GeneratedFile" class instead of the "Made" class.
> - Your UI will say "parse failed: file not found" rather than "a file must exist to run parse".
## Install
cargo install --path .
## Usage
Run in your codebase:
# Check a specific model
prosecop claude@5
prosecop claude@5 src/
# Only docs+comments, identifiers or strings
prosecop claude@5/docs
prosecop claude@5/identifiers
prosecop claude@5/strings
# Forbid or allow identifiers
prosecop claude@5 --forbid get,util
prosecop claude@5 --allow held_kib
# Forbid or allow identifiers
prosecop claude@5 --forbid get,util
prosecop claude@5 --allow held_kib
# Include or exclude files
prosecop claude@5 --ext .rs,.py
prosecop claude@5 --exclude 'tests/*,vendor/*'
# Your own ruleset (./rules/docs.txt, etc)
prosecop ./rules
## Custom rules
A ruleset can also be a directory of your own rules, with any of these files:
- `identifiers.txt` has one forbidden word per line and an optional `# reason`.
- Use `idenifiers-advice.txt` to provide agents with naming advice.
- `docs.txt` and `strings.txt` match sentences by regular expression.
- Use `idenifiers-advice.txt` to provide agents with grammar advice.
See examples in [`src/rules/claude@5`](src/rules/claude@5).