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

Core Rules

Presentation only, never behavior: comment rot, over-abstraction, generic design defaults, AI filler, and duplicate logic (single-file and cross-file) are in scope; anything that changes runtime semantics is not. MANDATORY on every AgentX run that changes files (... -> implement -> scrub -> test -> review -> ship); ship.ps1 always runs it and ignores -SkipScrub. See .github/instructions/project-conventions.instructions.md.

When to Use / Not Use

Use after generation, refactor, or a large patch; before a PR or review handoff; after approval but before merge; periodically on machine-heavy directories. No prerequisites -- it runs standalone through the AgentX CLI. Skip during active debugging, on intentionally machine-owned output (build artifacts, OpenAPI clients), on vendored files, or as a substitute for behavioral review.

What Counts As Slop

CategoryExampleAction
Comment rot// This function handles X, naked // TODODelete
Obvious restatement// Increment counter above counter++Delete
Dead code4+ commented-out code linesDelete
AI fillerEmpty "Note that"/"To"/"Next" phrasingRewrite/delete
Duplicate logicRepeated normalized blocks, in-file or cross-fileFlag only
Over-abstractionSingle-use interface/factory/getter-only classFlag only
Generic UIPurple/blue gradient defaults, lorem ipsumFlag only
Stale boilerplateCreated by ... on ...Delete
Empty try/catchcatch (e) { } with no loggingFlag

Presentation only; runtime changes go to the reviewer, not scrub.

Cross-File Duplicate Logic

Directory scans compare normalized 5-line windows across every file, not just within one. Each duplicate-logic finding carries both file/line (the duplicate) and originalFile/originalLine (the earliest occurrence); other categories emit these two fields as null. Traversal is deterministic -- skip-dirs pruned before descending, entries sorted ordinally, reparse points never followed -- so results repeat exactly every run. Adjacent overlapping windows collapse into one finding spanning the full range. Matches only occur within the same language group (ts/tsx/js/jsx together, never vs. py/cs).

Ignored as false positives: structural-only/short blocks (<4 distinct non-keyword tokens), declarative key: value/string-list data, vendor/generated dirs (node_modules, dist, build, .git, coverage; see $SkipDirs), and anything behind a symlink or junction.

Not implied by a match: authorship -- can't be inferred from repeated text; a defect -- shared logic can be intentional; or correctness -- zero findings means none was found, not that code is safe. Never auto-rewritten -- flag-only always; -Production only changes whether it blocks the gate.

Failure Modes: Scan Failures Are Explicit

A missing or unreadable target or nested file fails (exit 2, stderr), never a partial clean result. -Json stays an array for zero, one, or many findings on successful scans. Incomplete scans emit no success-shaped findings array.

Decision Tree

No qualifying change -> skip. Otherwise scan: flag-only findings need human triage; safe-fix findings can run with -Fix and be reviewed before commit.

Workflow

  1. Scan via the CLI so it resolves in zero-copy workspaces: pwsh .agentx/agentx.ps1 scrub -Path src/components. Production gate (blocks release): pwsh .agentx/agentx.ps1 deslop -Path src/components -Production (antislop is the same alias).
  2. Triage: each finding has file/line, category, severity (HIGH auto-fixable, MEDIUM opinionated fix, LOW manual review), snippet, safe-fix flag, and for duplicate-logic the original location. -Production also blocks on empty-catch, generic-gradient, and ai-filler.
  3. Fix safe categories: pwsh .agentx/agentx.ps1 scrub -Path src/components -Fix applies comment rot, obvious restatement, stale headers, and dead code. Everything else stays flag-only, requiring manual judgment.
  4. Verify: run tests (behavior must not change); re-scan (remaining findings are the manual-triage list); re-run -Production for release candidates; commit as chore: scrub <area>.

Done Criteria

Complete scan, zero HIGH findings and zero required production blockers; tests still pass; the -Fix diff is small and mechanical; no behavior change. False positives need documented review, not a silent waiver.

Anti-Patterns

  • Running -Fix before reading the report
  • Suppressing findings instead of fixing them
  • Using scrub to refactor logic -- it is a presentation pass only
  • Treating LOW findings as mandatory
  • Treating duplicate-logic as proof of AI authorship or a defect, or auto-extracting/rewriting the flagged code

Rationalization Table

RationalizationReality
"The scanner flagged it twice, so it must be AI-written."A match is evidence for review, not proof of authorship or a defect; duplicate-logic stays flag-only -- never auto-rewrite.

Related Skills

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)01moNo flagsBeginner
effective-go32310moNo flagsBeginner
solid-principles5710moNo flagsIntermediate
typescript-review393moNo 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