Scans diffs and project files to identify and remove redundant comments, excessive defensive guards, and AI-typical code clutter.

Install

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

Installs to .claude/skills/deslop-bitsocialnet

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 code slop and remove it. Use when the user says "deslop", "remove slop", "clean up AI code", or asks to remove AI-generated artifacts from the codebase.
189 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Get the git diff against master or HEAD
  • Scan changed files for AI-generated comments
  • Remove unnecessary comments that restate code
  • Identify and remove excessive defensive checks
  • Fix `as any` casts by addressing underlying type issues
  • Correct inconsistent code style

How it works

The skill analyzes git diffs to identify and remove common patterns of AI-generated code slop, such as unnecessary comments, excessive defensive checks, and `as any` casts, then verifies the build.

Inputs & outputs

You give it
Git diff of recent changes
You get back
Cleaned codebase with AI-generated slop removed and a summary of changes

When to use deslop

  • Clean up AI-generated comments
  • Remove defensive programming bloat
  • Restore human-readable code style

About this skill

Remove AI Code Slop

Scan the diff against master and remove AI-generated slop introduced in this branch.

Workflow

  1. Get the diff

    git diff master...HEAD
    

    If there are also uncommitted changes, include them:

    git diff master
    
  2. Scan each changed file for the slop categories below

  3. Fix each instance — remove or rewrite to match the surrounding code style

  4. Verify the build still passes:

    yarn build && yarn lint && yarn type-check
    
  5. Report a 1-3 sentence summary of what you changed

Slop Categories

Unnecessary comments

AI loves adding comments that restate the code. Remove comments that a human wouldn't write. Keep comments that explain why — domain reasoning, constraints, trade-offs, or non-obvious intent.

// ❌ Slop — restates the code
const [count, setCount] = useState(0); // Initialize count state to 0

// ❌ Slop — obvious from context
// Fetch the user data
const user = useComment({ commentCid });

// ✅ Keep — explains non-obvious intent
// bitsocial-react-hooks returns undefined while loading, null if not found
const isLoading = comment === undefined;

Excessive defensive checks

AI adds try/catch blocks and null guards everywhere, even on trusted codepaths. Remove guards that the surrounding code doesn't need.

// ❌ Slop — bitsocial-react-hooks already handles errors internally
try {
  const { feed } = useFeed({ communities });
} catch (error) {
  console.error('Failed to fetch feed:', error);
}

// ✅ Clean — just use the hook directly
const { feed } = useFeed({ communities });

as any casts

AI casts to any to bypass type errors instead of fixing the actual types. Remove the cast and fix the underlying type issue.

Inconsistent style

Any pattern that doesn't match the rest of the file: different naming conventions, different import ordering, unnecessary abstractions, or overly verbose code where the file is concise.

Over-engineering

AI tends to add unnecessary abstractions, utility functions, or wrapper components that obscure simple logic. If a one-liner was wrapped in a helper, unwrap it.

Judgment Call: When to Keep Comments

Comments are necessary when code expresses:

  • Non-obvious intent or domain-specific reasoning
  • Constraints that aren't apparent from the implementation
  • Trade-offs or "why not X" decisions
  • Workarounds with context on when they can be removed

When in doubt, check if similar code nearby has comments. Match the file's existing comment density.

When not to use it

  • When the user wants to generate new code
  • When the user wants to add comments or defensive checks
  • When the user wants to introduce `as any` casts

Limitations

  • Requires a git diff to operate
  • Relies on specific patterns for identifying 'slop'
  • Requires verification of build, lint, and type-check after changes

How it compares

This workflow systematically purges AI-generated code artifacts, maintaining code quality and readability, unlike manual code review which can miss subtle patterns.

Compared to similar skills

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

SkillInstallsUpdatedSafetyDifficulty
deslop (this skill)03moReviewIntermediate
effective-go3239moNo flagsBeginner
solid-principles579moNo flagsIntermediate
typescript-review392moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

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