Deterministic scanner for AI-style code failures. 72 rules for Python, JS/TS, Go, C/C++, SQL.
Project description
slopcheck
A deterministic, GitHub-first scanner for catching AI-style code failures without using an LLM in the product.
42 rules. 463 tests. Multi-language. Tree-sitter optional. SARIF output.
What this project is
slopcheck is a deterministic reviewer for pull requests:
- local-first, no backend, no database, no SaaS dependency
- no LLM calls in the product path
- runs in GitHub Actions: checkout → scan → findings.json → annotations + exit code
- covers Python, JavaScript, TypeScript, Go, and cross-language patterns
The point is not to detect whether code was generated by AI. The point is to catch failure modes that show up often in AI-generated or rushed code:
- AI artifacts committed as source (conversational bleed, identity refusals, hallucinated placeholders)
- stub function bodies and omission comments
- sloppy error handling (bare except, ignored Go errors, unhandled promises)
- hardcoded secrets, insecure defaults, weak hashes
- language-specific antipatterns (React, TypeScript, Go, Python)
- architectural boundary violations
Current working slice
- 42 rules across 8 categories (AI detection, security, JS/Node, Go, Python, cross-language, structural, repo)
- 463 tests
- threaded scanning (up to 8 workers, auto-detected)
- diff-only mode (
--changed-files gitor--changed-files @file.txt) - inline suppression (
# slopcheck: ignore[rule_id]) - baseline suppression (
create-baselinecommand) - confidence filtering (
--min-confidence medium) - SARIF v2.1.0 output for GitHub Security tab
- tree-sitter integration (optional; graceful fallback when not installed)
- GitHub workflow annotations and Markdown step summary
Design principles
- Deterministic first. Checks are explainable, stable, and testable.
- GitHub first. The first production target is GitHub pull requests.
- No backend for v1. CLI plus GitHub Actions is enough.
- Vertical slices. Each milestone produces something runnable.
- Rule quality over rule count. A noisy scanner dies fast.
- Docs are part of the product. Agents should not need tribal knowledge.
Quick start
With uv
uv venv
source .venv/bin/activate
uv pip install -e .[dev]
pytest
ruff check .
With standard Python tooling
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .[dev]
pytest
ruff check .
Optional: tree-sitter grammars
pip install tree-sitter tree-sitter-python tree-sitter-javascript \
tree-sitter-typescript tree-sitter-go
Try the scanner
# Scan the included fixture repo
python -m slopcheck scan . --repo-root tests/fixtures/sample_repo \
--output /tmp/findings.json --fail-on none
# Render outputs
python -m slopcheck summary /tmp/findings.json
python -m slopcheck github-annotations /tmp/findings.json
python -m slopcheck sarif /tmp/findings.json
# Create a baseline to suppress existing findings
python -m slopcheck create-baseline /tmp/findings.json --output .slopcheck/baseline.json
# Scan only changed files (CI diff mode)
python -m slopcheck scan . --repo-root . --changed-files git --output /tmp/findings.json
CLI reference
| Command | Purpose |
|---|---|
scan [paths] |
Scan files and write findings.json |
summary <findings> |
Print Markdown summary |
github-annotations <findings> |
Print ::warning/error:: annotations |
sarif <findings> |
Print SARIF v2.1.0 JSON |
create-baseline <findings> |
Write baseline of current fingerprints |
Key scan options:
| Option | Default | Description |
|---|---|---|
--repo-root |
. |
Repository root for config lookup and relative paths |
--output |
findings.json |
Output path (use - for stdout) |
--fail-on |
error |
Exit 1 when findings reach this severity: none/note/warning/error |
--min-confidence |
low |
Filter findings below this confidence: low/medium/high |
--baseline |
— | Suppress fingerprints in this baseline file |
--changed-files |
— | Diff-only mode: git or @file.txt |
--jobs |
auto | Thread count (0 = auto, 1 = sequential) |
--config |
— | Explicit config file path |
Repository layout
.agent/PLANS.md Codex-style execution plan instructions
.claude/rules/ Claude Code scoped rules
docs/ Architecture, roadmap, security, and authoring docs
adr/ Architecture Decision Records
examples/workflows/ Example GitHub workflows
prompts/ Ready-to-use prompts for Codex and Claude Code
slopcheck/ Python package
engine/ Scanner, file discovery, suppression, context filter
parsers/ Tree-sitter adapter (optional)
rules/generic/ 41 cross-repo rules
rules/repo/ 1 architecture-specific rule
output/ Annotation, Markdown, SARIF renderers
state/ Baseline store
tests/ 463 unit tests and fixtures
AGENTS.md Codex instructions
CLAUDE.md Claude Code instructions
code_review.md Shared review rubric
Rule overview
42 rules in 8 categories. Rules marked opt-in are enabled: false by default due to noise at scale.
| Category | Count | Notes |
|---|---|---|
| AI detection (Tier 1) | 7 | Stub bodies, instruction comments, bare except — all on |
| AI smoking guns (Tier 2) | 3 | Conversational bleed, identity refusals, hallucinated placeholders — all on |
| Quality / supplementary | 5 | Placeholder tokens, dead code comments, incomplete errors; 2 opt-in |
| Security | 5 | Secrets, SQL injection, insecure defaults, weak hashes; 1 opt-in |
| JavaScript / Node | 11 | Async/await, promises, React, TypeScript, regex — all on |
| Go | 3 | Ignored errors, missing defer, error wrapping — all on |
| Python | 1 | Mutable default arguments — on |
| Cross-language / structural | 5 | Idiom mismatches, SELECT *, nesting/size (3 opt-in) |
| Repo-specific | 1 | Forbidden import edges (configured per-repo) |
| Meta | 1 | Unused suppression directives — on |
See docs/architecture.md for the full table. See docs/rule-authoring.md to add a rule.
Suggested reading order
AGENTS.mdcode_review.mddocs/architecture.mddocs/implementation-roadmap.mddocs/security-model.mddocs/github-integration.mddocs/rule-authoring.md
Claude Code users should also read CLAUDE.md and .claude/rules/.
Agent entry points
- Start Codex with
prompts/codex-first-prompt.md - Start Claude Code with
prompts/claude-first-prompt.md
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_slopcheck-1.0.0.tar.gz.
File metadata
- Download URL: ai_slopcheck-1.0.0.tar.gz
- Upload date:
- Size: 121.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b0d0d2e57a0db1c33f01a331f7dbd4ef6257ffef49ec6d78c58484abe2ac3c6
|
|
| MD5 |
9d01f041efac963f3aa58a9c8d047f07
|
|
| BLAKE2b-256 |
9c3a12f13a2b37a9c3a9b0d60ea6e7510edc33d89873809ea20d42a1eb29652f
|
Provenance
The following attestation bundles were made for ai_slopcheck-1.0.0.tar.gz:
Publisher:
publish.yml on anubissbe/ai-slopcheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_slopcheck-1.0.0.tar.gz -
Subject digest:
6b0d0d2e57a0db1c33f01a331f7dbd4ef6257ffef49ec6d78c58484abe2ac3c6 - Sigstore transparency entry: 1225107162
- Sigstore integration time:
-
Permalink:
anubissbe/ai-slopcheck@69d7a0e258cdc452aa1272bd0da9a1805dc650a9 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anubissbe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@69d7a0e258cdc452aa1272bd0da9a1805dc650a9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai_slopcheck-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ai_slopcheck-1.0.0-py3-none-any.whl
- Upload date:
- Size: 138.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee30a0d0867040cae5a9d0e5263fc280e538667ffeb0017f54d54a64d28f7e11
|
|
| MD5 |
daa1c04ec531b26caee1e5ad284e5f4d
|
|
| BLAKE2b-256 |
1b9c7ce0f596e2b09447caf92858ed1d3b89efe2c8f529fd91106b116fd61444
|
Provenance
The following attestation bundles were made for ai_slopcheck-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on anubissbe/ai-slopcheck
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_slopcheck-1.0.0-py3-none-any.whl -
Subject digest:
ee30a0d0867040cae5a9d0e5263fc280e538667ffeb0017f54d54a64d28f7e11 - Sigstore transparency entry: 1225107232
- Sigstore integration time:
-
Permalink:
anubissbe/ai-slopcheck@69d7a0e258cdc452aa1272bd0da9a1805dc650a9 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/anubissbe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@69d7a0e258cdc452aa1272bd0da9a1805dc650a9 -
Trigger Event:
release
-
Statement type: