/mattpocock:deslopfrom Matt Pocock Skills
Removes AI-generated code patterns (fabricated casts, defensive clutter, mock patching, vacuous names) from diffs while keeping tests green. Apply to clean up AI slop from recent changes.
Ships in Matt Pocock Skills. 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.
Remove AI slop from a bounded change set without changing behavior. AI slop is the set of low-evidence, low-signal patterns that language-model-generated code tends to emit under completion pressure: fabricated evidence, discarded type information, defensive clutter, test-cheating seams, and vacuous names. The categories are language-neutral: apply them to whatever stack the change set touches.
Run this as a focused pass over a diff, an uncommitted change set, or named files. Never add features, never change public behavior, and never trade a working product for cleanup. Tests and types must stay green; if the change set has no test coverage, report that and stop before rewriting anything.
Each category reads what it is → how to fix it. Match them against the change set:
as/as unknown as, cast(Any, x), # type: ignore, @ts-ignore/@ts-expect-error without justification, unsafe blocks or .unwrap() standing in for real handling, non-null ! assertions on nullable values. → Replace with boundary parsing, type guards, or pattern matching; when a suppression is genuinely required, pair it with a non-empty invariant justification.object/unknown/any/interface{}/dict[str, Any], finite records degraded to open maps, as any to silence a mismatch. → Preserve the precise type end to end; widen only at an unparsed boundary and parse there.try/except: pass, redundant null checks inside internal call chains where the value is guaranteed, conditional empty-object spreads and similar omission tricks, silent fallback defaults. → Delete the check; validate at the boundary once instead of everywhere.patch("module.path") on the subject's own collaborators, vi.mock/jest.mock on internal modules, snapshots derived from the implementation. → Test through real seams: inject an adapter, point the code at an in-memory implementation, or exercise the public interface.data, info, item, result, obj, helper, manager, *Shape, handleX. → Rename to the domain concept the symbol carries; if no honest name exists, the design is murky and that is a finding, not a rename.Two binding rules:
Resolve the change set before touching anything:
git status plus git diff).For a compound guard, justify each predicate separately by tracing the exact expression and conversion order on a concrete input. A failure rejected by another predicate does not prove this one necessary. If no distinguishing input is established, record the claimed necessity as unverified rather than converting a redundant check into a proven requirement. Removing a proven inert predicate preserves the accepted grammar and does not require changing the spec or obtaining a new product decision. Reconcile cleanup, review and handoff verdicts against the final candidate after remediation.
Scan the scope once per category. Produce a findings list: category, location (file plus hunk), the offending line quoted, and the replacement plan. A finding without a concrete replacement plan is not ready to fix: leave it as a reported finding.
Apply the plans in one pass, category by category. For each rewrite:
Run the verification the repository already uses: tests, typecheck, and lint. A de-slop pass ends green or it has not ended. Record each actually failed command and its observed result separately from reasoning about an unexecuted alternative. Do not describe a rejected design, source inspection or hypothetical regression as a test failure unless that candidate was executed and failed. Label untested conclusions and preserve the real verification sequence in cleanup and handoff notes. Reconcile the summary, findings, verdict and handoff against that sequence before finishing; remove contradictory counts or claims about failed attempts.
Report under three headings:
category → file:line → one-line replacement summary.End with a binary verdict: CLEAN only if every planned rewrite landed, verification is green, and no findings remain; PARTIAL when findings remain. A retained finding cannot be made CLEAN by excluding it from the rewrite plan. A readability preference is not a behavioral compatibility requirement: if a known redundant check is kept only to document intent, state that reason honestly and keep the finding in the PARTIAL verdict. Proven necessary guards are not clutter; explain their current requirement rather than listing them as unresolved findings. Never report CLEAN with unverified skips.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ai-slop, code-cleanup, diff-review, defensive-code, type-safety
npx claudepluginhub fradser/dotclaude --plugin mattpocock50 skills in this plugin
/ask-mattRecommends the skill or flow that fits the user's situation. A router over the skills in this repo. Use when the user asks which skill to use, is unsure what fits, or needs a pointer to the right workflow./batch-grill-meRuns a relentless interview that asks every frontier question at once, round by round. Use when the user wants to be grilled on a design or map a design tree./bddBehavior-driven development: Discovery → Formulation → Automation. Use when the user wants to build features or fix bugs via Gherkin scenarios and the BDD lifecycle, or mentions BDD/Gherkin/Executable Specifications. Delegates test implementation to /mattpocock:tdd.Other plugins' skills for the same job