gretchenfitze/anti-slop / skills/anti-slop-rollout
anti-slop-rollout
VerifiedCarry out the next step of an anti-AI-slop rollout plan (anti-slop/todo.md, with the reasoning in anti-slop/plan.md) as one pull request: add a single check in whatever stack the plan records (a strict TypeScript flag, sonarjs, unnecessary-effect, or test lint rules, layer boundaries, a custom lint rule from a past bug, an agent hook, Stryker mutation testing, knip and dead-file scripts, jscpd, react-doctor, a CI gate, a scheduled report, and the final trim of the agent rules file), fix or baseline what it finds, document its commands in the agent rules file, verify it, and open the PR. Use when the user says "next anti-slop step", "do step N of the plan", asks which rules in AGENTS.md or CLAUDE.md the linters now cover, or asks to set up knip, jscpd, react-doctor, Stryker, sonarjs, or boundaries the gradual way (warnings first, CI gate last) in a repo that has an anti-slop plan. Needs the plan from anti-slop-audit; without one, run the audit first.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.4 KB |
| assets/agent-check.shexecutable | script | 3.0 KB |
| assets/lint-rules/index.cjs | script | 1.6 KB |
| assets/lint-rules/lint-rules.test.mjs | script | 2.2 KB |
| assets/scripts/changed-mutants.mjs | script | 1.2 KB |
| assets/scripts/find-dead-code.mjs | script | 2.1 KB |
| assets/scripts/find-dead-mocks.mjs | script | 6.2 KB |
| assets/scripts/jscpd-top.mjs | script | 4.3 KB |
| assets/scripts/mutation-pr-report.mjs | script | 4.1 KB |
| assets/scripts/pr-comment.mjs | script | 1.8 KB |
| assets/scripts/resolve-module.mjs | script | 4.8 KB |
| references/recipes.md | markdown | 54.6 KB |
assets/agent-check.sh
View on GitHub#!/bin/sh
# Agent hook: check what the agent changed before it stops. Written for Claude Code's Stop hook;
# wire the same script into another agent's after-turn hook, adapting the exit code and input to its docs.
# Exit 2 sends the findings back so the agent fixes them; a second block in a row
# lets it stop, so a finding it can't fix doesn't loop forever. Checks run in parallel
# and every failure lands in this one block, because the stand-down skips the next stop.
#
# Wire it in .claude/settings.json:
# { "hooks": { "Stop": [{ "hooks": [{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/scripts/agent-check.sh", "timeout": 180 }] }] } }
cd "$(dirname "$0")/.." || exit 0
if command -v jq >/dev/null 2>&1 && [ "$(jq -r '.stop_hook_active // false' 2>/dev/null)" = "true" ]; then
exit 0
fi
# File-scoped checks lint the changed source files.
# ponytail: word-splits on spaces in file names; switch to xargs -0 if the repo has them.
files=$({ git diff --name-only --diff-filter=d HEAD; git ls-files --others --exclude-standard; } |
grep -E '\.([cm]?[jt]sx?|vue|svelte|astro)$' | sort -u)
# Whole-project checks run on any change outside the content folders: tsc and tests read
# imported JSON, package.json and tsconfig; knip's plugins read configs and workflows.
# Set the pattern to the folders no check reads.
project=$({ git diff --name-only HEAD; git ls-files --others --exclude-standard; } | grep -vE '^(docs|public)/')
[ -z "$files$project" ] && exit 0
bin=./node_modules/.bin
tmp=$(mktemp -d) || exit 0
trap 'rm -rf "$tmp"' EXIT
# check <name> <command...>: runs in the background; a failure's output lands in $tmp/<name>.failed.
check() {
name=$1
shift
{ "$@" >"$tmp/$name" 2>&1 || mv "$tmp/$name" "$tmp/$name.failed"; } &
}
# One line per check. Delete the lines for tools the project doesn't use.
# Keep the line for the project's linter; each treats warnings as errors on changed files.
[ -n "$files" ] && check oxlint $bin/oxlint --deny-warnings $files
# [ -n "$files" ] && check eslint $bin/eslint --max-warnings=0 $files
# [ -n "$files" ] && check biome $bin/biome lint --error-on-warnings $files
[ -n "$files" ] && check react-doctor npx -y --min-release-age=7 react-doctor@latest --no-telemetry --no-supply-chain --scope changed --base HEAD --include-untracked --blocking error
# Whole-project: they see what a change breaks in files it didn't touch, like the unchanged
# callers of a function that gained a required parameter. Add one only while it reports new
# findings only (a clean baseline, a backlog at zero) and the hook stays within its budget.
[ -n "$project" ] && check tsc $bin/tsc --noEmit
[ -n "$project" ] && check test npm test --silent # the unit suite, not e2e, through the project's package manager
[ -n "$project" ] && check knip $bin/knip --cache
# At zero clones with "threshold": 0 in the config; with a backlog, add --baseline-from-ref HEAD --fail-on-new-clones.
[ -n "$project" ] && check jscpd $bin/jscpd
wait
for f in "$tmp"/*.failed; do
[ -e "$f" ] || exit 0
printf '\n## %s\n' "$(basename "$f" .failed)" >&2
cat "$f" >&2
done
exit 2
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |