A mandatory cleanup utility that removes common AI-generated coding artifacts like redundant comments and filler phrases.

Install

mkdir -p .claude/skills/scrub && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19305" && unzip -o skill.zip -d .claude/skills/scrub && rm skill.zip

Installs to .claude/skills/scrub

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Scan recent changes for AI-generated slop -- redundant comments, over-abstraction, generic UI defaults, and design tells -- and optionally apply safe automated fixes. Use after a code-generation or refactor pass to remove the visible signs of machine authorship before review.
276 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

Key capabilities

  • Scan code for AI-generated comment rot
  • Detect over-abstracted code structures
  • Identify generic UI defaults
  • Apply automated safe fixes for machine-generated artifacts

How it works

The scanner parses code files to detect patterns like redundant comments or filler phrasing, then optionally applies safe automated fixes to remove them.

Inputs & outputs

You give it
Directory path of code changes
You get back
Scan report or cleaned code diff

When to use scrub

  • Remove redundant AI comments after generation
  • Clean up code before submitting a PR
  • Standardize formatting for human readability

About this skill

Scrub

Purpose: Detect and remove the visible tells of AI-generated code without changing behavior. Scope: Comment rot, over-abstracted code, generic design defaults, AI filler phrasing.

MANDATORY in AgentX: A deslop scrub runs on EVERY AgentX run that changes files, as a required step in the canonical workflow (... -> implement -> scrub -> test -> review -> ship). It is not opt-in. ship.ps1 runs scrub unconditionally; the deprecated -SkipScrub switch is ignored. See the always-on rule in .github/instructions/project-conventions.instructions.md.


When to Use This Skill

  • Right after a code generation, refactor, or large patch
  • Before opening a pull request or a review handoff
  • After review approval but before merge -- final polish pass
  • Periodically on a directory that has accumulated machine output

When NOT to Use

  • During active debugging -- focus on correctness first
  • On generated code that is intentionally machine-owned (build output, OpenAPI clients)
  • On vendored third-party files
  • As a substitute for code review -- scrub catches presentation, review catches behavior

What Counts As Slop

CategoryExamplesAction
Comment rot// This function handles the logic for X, // Helper to do thing, naked // TODODelete
Restating the obvious// Increment counter above counter++Delete
Dead codeCommented-out code blocks of 4+ code-like linesDelete
AI filler phrasingPhrases like "Note that", "To", or "Next" when they add no meaningRewrite or delete
Duplicate logicRepeated normalized code blocks within one fileConsolidate manually (flag only)
Over-abstractionSingle-use interface, factory wrapping one constructor, getter-only classInline manually (flag only)
Generic UI defaultsbg-gradient-to-r from-purple-500 to-blue-500, placeholder lorem ipsumReplace with brand palette (flag only)
Stale boilerplateCreated by ... on ..., Last modified by ...Delete
Empty try/catchcatch (e) { /* ignore */ } with no loggingFlag for review

Code-slop is about presentation, not behavior. Anything that changes runtime semantics is out of scope -- send it to the reviewer.


Decision Tree

Recent diff contains machine-generated text?
+- No -> skip
+- Yes -> run scanner
   +- Findings, all in flag categories -> human triage required
   +- Findings, some in safe-fix categories -> run with --fix, review the diff
   +- No findings -> done

Workflow

1. Scan

Run the scanner over the directory or files that changed. Invoke it through the agentx CLI so it resolves the bundled scanner in zero-copy workspaces (a literal scripts/scrub.ps1 path does not exist there):

pwsh .agentx/agentx.ps1 scrub -Path src/components

For production-release readiness, use the stricter production gate. It keeps normal scrub behavior advisory for MEDIUM/LOW findings, but blocks release on categories that commonly turn generated code into production maintenance risk:

pwsh .agentx/agentx.ps1 deslop -Path src/components -Production
pwsh .agentx/agentx.ps1 antislop -Path src/components -Production

deslop and antislop are CLI aliases for the same scanner. Use deslop when the main concern is production code hygiene, and antislop when the main concern is AI-generated UI or product-surface tells.

The scanner walks the path, parses comments and content by file extension, and prints findings grouped by category and severity. It does not modify any file in scan mode.

2. Triage

Read the report. Each finding includes:

  • File path and line number
  • Category and severity
  • The exact text that triggered detection
  • Whether the category is safe to auto-fix

Findings come in three severities:

SeverityMeaning
HIGHAlmost certainly slop. Auto-fix is safe in supported categories.
MEDIUMLikely slop. Auto-fix is opinionated; review the diff.
LOWPossible slop. Manual review only.

In -Production mode, the release gate fails on HIGH findings plus these production-blocking advisory categories:

CategoryWhy It Blocks Production
duplicate-logicRepeated validation, mapping, parsing, or error handling can drift after release.
empty-catchSwallowed failures hide production incidents and make support harder.
generic-gradientAI-default UI styling is not release-ready without product/design intent.
ai-fillerFiller copy in release docs or product surfaces weakens operator trust.

3. Apply Safe Fixes

Only after reading the report, run with -Fix to apply the auto-safe categories:

pwsh .agentx/agentx.ps1 scrub -Path src/components -Fix

Safe-fix categories (v1):

  • Comment rot in code files
  • Restating the obvious
  • Stale Created by / Last modified by headers
  • Commented-out code blocks

Unsafe categories require manual edits and are flag-only:

  • Duplicate logic (requires refactor judgment)
  • Over-abstraction (refactor judgment)
  • Generic UI defaults (brand decisions)
  • Empty try/catch (might be intentional in narrow cases)

4. Verify

After fixes:

  • Run the test suite. Behavior must not change.
  • Re-run the scanner. The remaining findings are the manual-triage list.
  • For release candidates, re-run with -Production and clear or justify every production blocker.
  • Commit fixes as a single change with chore: scrub <area>.

Done Criteria

  • Scanner reports zero HIGH findings, or every HIGH finding has been addressed or explicitly justified
  • Production-release runs report zero production blockers, or every blocker has a documented release-owner waiver
  • Tests still pass after fixes
  • Diff from --fix is small, mechanical, and reviewable line-by-line
  • No behavior change introduced

Anti-Patterns

  • Running --fix without reading the scan report first
  • Suppressing findings instead of fixing them
  • Using scrub to refactor logic -- it is a presentation pass only
  • Treating LOW findings as required fixes -- they are signals, not gates

Related Skills

  • Code Hygiene -- broader cleanup discipline including dead code and over-engineering
  • Code Review -- behavioral review that runs alongside scrub
  • Karpathy Guidelines -- the underlying behavioral contract that prevents slop in the first place

When not to use it

  • During active debugging
  • On machine-owned build output
  • On vendored third-party files

Limitations

  • Safe-fix categories are limited to specific patterns like comment rot
  • Unsafe categories require manual triage

How it compares

It specifically targets machine-authorship indicators to improve readability before human review rather than performing functional refactoring.

Compared to similar skills

scrub side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
scrub (this skill)012dNo flagsBeginner
effective-go3239moNo flagsBeginner
solid-principles579moNo flagsIntermediate
typescript-review391moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jnPiyush

View all by jnPiyush

ux-ui-design

jnPiyush

Design user experiences with wireframing, prototyping, user flows, accessibility, and production-ready HTML prototypes. Use when creating wireframes, building interactive prototypes, designing user flows, implementing accessibility standards, or producing HTML/CSS design deliverables.

00

copilot-studio-agents

jnPiyush

Design Microsoft Copilot Studio agents (formerly Power Virtual Agents) -- topics, trigger phrases, generative answers, knowledge sources, connector and MCP actions, authentication, channels, and agent flows -- so an agent can author the conversational logic that ships as a Bot component inside a Pow

00

verification-before-completion

jnPiyush

Block false completion claims. Force the agent to identify the claim, run the exact verification command, read the actual output, compare against the claim, and only then report. Use whenever an agent is about to say "done", "fixed", "tests pass", "deployed", "loop complete", or close an issue.

00

configuration

jnPiyush

Implement configuration management patterns including environment variables, secrets, feature flags, and validation strategies. Use when setting up app configuration, managing environment-specific settings, implementing feature flags, storing secrets securely, or validating configuration at startup.

00

docx

jnPiyush

Read, write, and transform Microsoft Word .docx files. Use when extracting text or tables from Word documents, generating reports from templates, applying styles, inserting images, building tables, or converting Markdown/HTML to Word.

00

error-handling

jnPiyush

Implement robust error handling with exceptions, retry logic, circuit breakers, and graceful degradation. Use when designing error handling strategies, implementing retry policies, adding circuit breakers, configuring timeouts, or building health check endpoints.

00

You might also like

effective-go

openshift

Apply Go best practices, idioms, and conventions from golang.org/doc/effective_go. Use when writing, reviewing, or refactoring Go code to ensure idiomatic, clean, and efficient implementations.

323536

solid-principles

SmidigStorm

Enforce SOLID principles (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) in object-oriented design. Use when writing or reviewing classes and modules.

57236

typescript-review

metabase

Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.

39178

ast-grep

ast-grep

Guide for writing ast-grep rules to perform structural code search and analysis. Use when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search. This skill should be used when users ask to search for code patterns, find specific language constructs, or locate code with particular structural characteristics.

17135

serena

massgen

This skill provides symbol-level code understanding and navigation using Language Server Protocol (LSP). Enables IDE-like capabilities for finding symbols, tracking references, and making precise code edits at the symbol level.

1597

typescript

lobehub

TypeScript code style and optimization guidelines. Use when writing TypeScript code (.ts, .tsx, .mts files), reviewing code quality, or implementing type-safe patterns. Triggers on TypeScript development, type safety questions, or code style discussions.

2877

Search skills

Search the agent skills registry