/ai-slop:slop-rebuild [path or glob] [--base <ref>]from ai-slop
Rebuilds a recently implemented feature as a simpler version, preserving the original on a branch. Snapshots, pins tests, reimplements tests-first in a separate worktree, then compares diff size, complexity, and test results to recommend the better version.
Ships in ai-slop. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
An agent's first working version of a feature carries the uncertainty it had while it built it: abstractions it didn't need, temporary helpers, duplicated logic, extra layers, fallbacks for cases that can't happen. Once it works, the agent knows the problem. Use that knowledge to write the feature again, then let the evidence decide which version stays.
A second version isn't better by default. Keep the original safe, build the rebuild beside it, compare the two, and recommend the original when the rebuild isn't clearly better.
Arguments: $ARGUMENTS
Claude Code replaces the placeholder on the line above with the text typed after the command, and leaves the line empty when there is none. In agents that leave the placeholder unreplaced, use the text the user typed after the command.
--base <ref>: the commit the feature started from. The default is the merge base with the default branch. --base HEAD covers only the uncommitted changes.Ask questions with the AskUserQuestion tool when it's available, and in plain text otherwise, then wait for the answer.
git reset --hard, git checkout -- ., git restore, git clean, git stash drop, git branch -D, git worktree remove --force or a force push in the user's checkout, unless the user asks for that command.Say which of these applies and stop. Go on only if the user insists.
/simplify does that.git symbolic-ref --short refs/remotes/origin/HEAD. If that fails, use origin/main or origin/master, or the local branch when there's no remote. Take <base> from --base, or from git merge-base HEAD <default branch>.<base>..HEAD, then git diff --stat <base> and git status --short. If the commits look like more than one piece of work, ask which commit the feature started from, and recommend one.csv-export.The snapshot is a branch named slop-rebuild/<slug>-original. If the name is taken, add -2. Never use git branch -f.
Clean working tree: git branch slop-rebuild/<slug>-original HEAD.
Uncommitted changes: commit them to the snapshot branch through a temporary index, so the user's working tree, index and branch stay as they are. First read git status --short. If an untracked file looks like a secret or build output that .gitignore misses, ask before you include it. Then run these commands, with a literal path for the temporary index and no shell variable. Some agents block rm on a path held in a variable.
GIT_INDEX_FILE=/tmp/slop-rebuild-<slug>.index git read-tree HEAD
GIT_INDEX_FILE=/tmp/slop-rebuild-<slug>.index git add -A
GIT_INDEX_FILE=/tmp/slop-rebuild-<slug>.index git write-tree # prints <tree>
git commit-tree <tree> -p HEAD -m "slop-rebuild: snapshot of <slug>" # prints <snapshot>
git branch slop-rebuild/<slug>-original <snapshot>
rm /tmp/slop-rebuild-<slug>.index
The snapshot holds staged, unstaged and untracked changes. It leaves out files that .gitignore excludes.
Record which of the two cases applied, because step 7 needs it. Tell the user the snapshot branch's name.
git worktree add -b slop-rebuild/<slug>-rebuild <dir> slop-rebuild/<slug>-original. Put <dir> outside the checkout, such as ../<repo>-<slug>-rebuild. If your agent can't write there, use a folder inside the checkout that .gitignore already excludes, and confirm it with git check-ignore..env. Never commit it.CLAUDE.md or AGENTS.md. Run them in the worktree. This is the baseline. If the feature's own tests fail, stop: the original doesn't work yet. Record any other failures, so the rebuild isn't blamed for them.test: pin <feature> behavior. Call this commit <pinned>. If you added no tests, <pinned> is the snapshot.Before you write code, write this list and show it to the user:
If the original has code for speed, such as a cache or batching, measure both versions before you call that code unnecessary. Then sketch the rebuild in a few lines: the files, the main functions and the call path. Continue to step 5 without waiting, unless the sketch needs a change to behavior or the public API.
<base>, but not its tests: git restore --source=<base> --staged --worktree -- <code files>. This removes files the feature added and brings back files it deleted.<pinned>, in the repository's commit style, so no commit in between is broken.If the rebuild comes out as large or as complex as the original, stop there and recommend the original.
Measure both versions against <base>, for code files and test files separately: git diff --shortstat <base> <pinned> -- <code paths> and the same for the rebuild. Read git diff <pinned> slop-rebuild/<slug>-rebuild in full. That diff is what a reviewer reads if the user switches. Count the new files, exported names, types, dependencies and settings from the diffs. If the project has a complexity tool, such as ESLint's complexity rule, radon, gocyclo or lizard, run it on both versions. Otherwise, leave complexity scores out. Don't estimate them.
Recommend one of three outcomes:
Use this format:
<One paragraph: the feature in one sentence, the base, whether you built it in this conversation, the snapshot branch, the rebuild branch and the worktree path, and "Your checkout hasn't changed.">
| | Original | Rebuild |
|---|---|---|
| Code files changed | | |
| Code lines added / removed | | |
| Test files / test cases | | |
| New files | | |
| New exported names | | |
| New types, classes or interfaces | | |
| New dependencies or settings | | |
| Call path from the entry point | <e.g. handler → service → repository → client> | <e.g. handler → client> |
| Complexity (<tool>) | | |
| Typecheck / lint / tests | <e.g. pass / pass / 48 of 48> | |
## What the rebuild dropped
- <the abstraction, helper, layer, scaffolding or duplicate>, and why it wasn't needed
## What it kept from the original
## Differences in behavior or public API
<"None found", or each one, with the test that shows it.>
## Tests changed or deleted
## Recommendation
<Use the rebuild | Keep the original | Take parts: <parts>>, and the reason in two or three sentences.
## Your choice
<The three options, with what each one does to the checkout and the branches. Recommended option first.>
Leave out a table row when neither version has anything for it. End your turn after the report. Without an answer, change nothing.
Before you change the user's checkout, check that it still matches the snapshot. Run the read-tree, add and write-tree commands from step 2 again, delete the temporary index, and compare the printed tree with git rev-parse slop-rebuild/<slug>-original^{tree}. If they differ, the user has changed something since. Stop and ask. Don't apply over their new work.
git merge --ff-only slop-rebuild/<slug>-rebuild in the user's checkout. Their branch gains the pinned tests and the rebuild as new commits, and keeps its old ones.git diff --binary slop-rebuild/<slug>-original slop-rebuild/<slug>-rebuild | git apply. The rebuild then replaces the original as uncommitted changes, as the original was.Then remove the worktree with git worktree remove <dir>. If git refuses because the worktree has changes, leave it and say why. Keep both branches. Tell the user their names and the command that deletes them, git branch -D slop-rebuild/<slug>-original slop-rebuild/<slug>-rebuild, but don't run it yourself.
End with what changed in the checkout, the check results, and the branches that remain.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub charlesjones-dev/ai-agent-plugins --plugin ai-slop6 skills in this plugin
/slop-auditAudit a codebase's user-facing copy, metadata and page layouts for AI-written tells ("AI slop") and for factual errors in that copy. Scores each area, gives a concrete fix for every finding, and ends with numbered clarifying questions. Report-only until the user answers. Use when the user runs /slop-audit or asks for an AI slop audit, an AI-writing check, or whether a site, app or README "reads as AI-written"./slop-commentsFind code comments that add nothing to the code (narration, history, commented-out code, stale notes, signature restatements) and the workarounds they explain, then plan which to delete, which to rewrite, and which workarounds to fix at the cause. Report-only until the user approves, unless run with --fix. Use when the user runs /slop-comments, asks to remove, prune or clean up code comments, or asks which comments or workarounds in a codebase should go./slop-designReview one screen of a web, iOS or Android app for the marks of AI-generated design (hue gradients, glows, emoji used as icons, shouty copy, uneven spacing, generic cards, a template theme nobody changed) and fix it the way a designer works through a redline. Audits first and says where each sign lives, proposes a direction taken from the product and waits for the user, then fixes in ordered passes: spacing, color, icons, copy, type, layout, details, visuals and motion. Says so when the screen is already good. Follows Apple's Human Interface Guidelines on iOS and Material 3 on Android, and works from code and the user's screenshots without extra tools. Use when the user runs /slop-design, or asks to unslop, de-slop, polish or redesign a screen, page or app UI that looks AI-generated or templated./slop-rewriteRewrite a file, or a block of text pasted after the command, to remove AI writing patterns (humanize it). Uses the same signal list as /slop-audit and adjusts to the kind of text (technical docs, README, blog post, PR or changelog) and to a light, standard or heavy rewrite./slop-testsFind tests that can't catch a bug (change detectors that break on every refactor, tests that check a removed feature is gone, and tests that can never fail), then plan which to delete, fix or rewrite without losing coverage of real behavior. Can confirm each finding by breaking the code in a scratch worktree. Report-only until the user approves, unless run with --fix. Use when the user runs /slop-tests, or asks to prune, clean up or remove low-value, useless or AI-generated tests.Other plugins' skills for the same job