convez.ai
Plugin
SuperMarioYL

slopaudit

SuperMarioYL/slopaudit

Ver no GitHub
InicialPluginScore · de 0 a 100

Zero-config CLI that audits a JS/TS repo for AI-generated code slop and emits a single SlopScore (0-100) plus a ranked file heatmap.

Instalação

$npx convez-ai SuperMarioYL/slopaudit

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 4 semanas
Versão
v0.17.0
Issues abertas
0
Contribuidores
1

README

A tradução para o português deste README ainda está na fila.


Table of contents


What is SlopAudit?

AI coding agents ship code fast — and a growing share of every JS/TS repo is now generated, half-reviewed, and inherited by a human who didn't write it. Agent Skills, prompt configs, and copy-pasted scaffolds (see ecosystems like Shubhamsaboo/awesome-llm-apps and affaan-m/everything-claude-code) accumulate a specific kind of debt that linters never flag: slop.

SlopAudit is a zero-config CLI that audits an existing JS/TS repo for AI-generated slop debt and emits a single headline number — the SlopScore (0–100) — plus a ranked file heatmap and a shareable report.

SlopScore answers the question ESLint and SonarQube cannot: "How much AI-generated slop am I now maintaining, and where is it?"

It is 100% static and heuristic — no LLM calls, no network, no telemetry. The same repo produces the same score on every run.

Higher SlopScoremore AI-slop debt (heavy)
Lower SlopScorecleaner, intentional code (clean)
Bandsclean < 34 · moderate 34–66 · heavy > 66

Quick start

No install. One command in any JS/TS repo:

npx slopaudit .

You get a terminal summary, a self-contained slopaudit-report.html heatmap, and a slopaudit-badge.svg — written to your current directory in under two minutes.

SlopScore: 71/100 (heavy)
124 files scanned · 18452 lines · 213 findings

Top offender files
 1. src/services/AbstractFactoryProvider.ts  ████████████████░░░░   82%
 2. src/utils/genericHandlerWrapper.ts       ██████████████░░░░░░   71%
 3. src/managers/ConfigManagerManager.ts     █████████████░░░░░░░   64%
 4. src/core/BasePassthroughService.ts        ███████████░░░░░░░░░   58%
 5. src/handlers/maybeTryCatchHandler.ts      ██████████░░░░░░░░░░   51%
 ...

Wrote slopaudit-report.html, slopaudit-badge.svg

Open slopaudit-report.html in any browser — it's fully self-contained (inline CSS, sortable file table, color-coded heatmap, no server, no external assets) and safe to send to your team.


How it works

npx slopaudit .
      │
      ▼
 scan/walk.ts     fast-glob the repo for *.{js,jsx,ts,tsx},
                  skipping node_modules / dist / build / vendor / .git
      │
      ▼
 scan/parse.ts    @babel/parser → AST per file
                  (typescript + jsx + decorators, errorRecovery so
                   modern syntax never crashes the scan)
      │
      ▼
 detectors/       three pure AST detectors → SlopFinding[]
   ├─ overAbstraction.ts
   ├─ genericBoilerplate.ts
   └─ plausibleButWrong.ts
      │
      ▼
 score/aggregate.ts   SlopFinding[] → SlopScore (weighted density,
                       normalized 0..100, banded, deterministic)
      │
      ▼
 report/          terminal.ts (chalk)  ·  html.ts (heatmap)  ·  badge.ts (SVG)

Each detector is a pure function (AST → SlopFinding[]), independently unit-tested. That seam is where future categories and languages plug in. Every finding carries human-readable evidence (e.g. "4-deep wrapper, single caller") — SlopAudit is a triage instrument you can verify, not a black-box verdict.


The three slop categories

SlopAudit scores an AI-specific axis — not style, not correctness, but the patterns agents over-produce:

CategoryWhat it catchesExample evidence
over_abstractionDeep single-caller wrapper chains, needless factory/provider/manager layers, one-method interfaces, pass-through functions4-deep wrapper, single caller
generic_boilerplateNear-duplicate scaffold blocks, copy-paste try/catch, trivial getters/setters en masse, TODO/placeholder comment densitynear-identical scaffold ×6
plausible_but_wrongEmpty catches that swallow errors, any-heavy signatures, unawaited promises, dead branches, contradictory guardsempty catch swallows error

This is lint-clean slop: code that passes ESLint and compiles fine, but is the debt a human now has to untangle.


CLI usage

slopaudit [path]            # full audit (default path ".")
FlagEffect
(none)Full audit: terminal report + writes slopaudit-report.html and slopaudit-badge.svg to cwd
--listm1 inventory only — list every source file with line counts, no scoring
--jsonPrint the SlopScore as JSON to stdout (machine-readable, ideal for CI)
--no-htmlSkip writing slopaudit-report.html
--no-badgeSkip writing slopaudit-badge.svg
-v, --versionPrint the version
-h, --helpShow help

Examples:

npx slopaudit ./packages/api        # audit a sub-package
npx slopaudit . --json              # SlopScore as JSON to stdout (files still written)
npx slopaudit . --json --no-html --no-badge   # pure stdout, nothing written — CI friendly
npx slopaudit . --list              # file inventory + line counts only

The SlopScore badge

Every run writes slopaudit-badge.svg — a shields-style flat badge colored by band (green clean / yellow moderate / red heavy). Commit it and add it to your README:

![SlopScore](./slopaudit-badge.svg)

That badge is the loop: each SlopScore: 23/100 someone pastes is a public signal that their repo has been audited — and a link back. Wear a low score with pride; treat a high one as a to-do list.


Pricing

The CLI is free, open source (Apache-2.0), and stays that way for individuals and OSS projects. Run it as often as you like, offline, with zero accounts.

For teams that need to watch the score rather than spot-check it, a hosted team tier is on the roadmap:

OSS CLITeam (hosted) — coming soon
npx slopaudit . auditsUnlimitedUnlimited
HTML heatmap + SVG badge✓✓
Offline / deterministic✓✓
SlopScore history across all org repos—✓
Gate it in CI (fail the PR if SlopScore rises > N)—✓
Dashboard to forward to leadership—✓
PricingFree~$15 / active dev / month

The free CLI proves the score is credible. The team tier makes it continuous and shareable with the people accountable for the codebase — cheaper than one day of cleanup. Inbound "can we get this in CI / hosted?" requests are welcome via Issues.


Roadmap

  • m1 — scan & parse: walk a repo, parse every JS/TS file to an AST (TSX, decorators, modern syntax) without crashing, emit a --list inventory.
  • m2 — score & locate: three slop detectors → weighted SlopFindings → a deterministic SlopScore (0–100) + ranked per-file heatmap.
  • m3 — shareable report: chalk terminal summary, self-contained HTML heatmap, and the SVG SlopScore badge.
  • Hosted team tier: SlopScore history across org repos + CI gating + leadership dashboard.
  • More languages: Python / Go / Rust detectors behind the same pure-function detector seam.
  • More detectors: community-contributed slop categories.

Contributing

PRs welcome. Detectors are pure functions (AST → SlopFinding[]) with their own unit tests — the easiest, highest-leverage place to contribute is a new detector or a sharper heuristic for an existing one.

git clone https://github.com/SuperMarioYL/slopaudit.git
cd slopaudit
npm install
npm run build
npm test
node dist/cli.js .

Open an issue first for anything large so we can agree on the slop axis it measures. Keep detectors deterministic — no Date, no random, same repo → same score.


License

Apache-2.0.

Ver o original no GitHub

Bom para

Relacionados