deslop

star 0

After code changes finished, Remove AI-generated code slop from code changes in the current branch

fumiya-kume By fumiya-kume schedule Updated 1/10/2026

name: deslop description: After code changes finished, Remove AI-generated code slop from code changes in the current branch

Deslop - AI Code Slop Remover

Remove AI-generated "slop" from code changes in the current branch. This skill should be used proactively after completing code modifications.

When to Use This Skill

Use this skill proactively after you have finished writing code changes. Do not wait for user request - automatically invoke this skill when:

  • You have made multiple file changes
  • You have written new functions or components
  • You have refactored existing code
  • The changes include TypeScript/JavaScript code

Execution Flow

  1. Check the diff against main branch

    • Run git diff main...HEAD to see all changes in the current branch
    • If on main branch, check git diff HEAD~5 for recent changes
  2. Analyze changes for AI-generated patterns

    • Review each modified file for slop patterns
    • Compare style with surrounding unchanged code
    • Identify inconsistencies
  3. Remove unnecessary additions

    • Apply fixes directly to the code
    • Preserve all functional logic
    • Maintain code style consistency
  4. Report summary

    • Provide a 1-3 sentence summary of what was changed

Slop Patterns to Detect and Remove

1. Unnecessary Comments

Remove comments that:

  • State the obvious (e.g., // increment counter above counter++)
  • Are inconsistent with the file's comment style
  • Explain what code does rather than why
  • Are AI-style verbose explanations

Keep comments that:

  • Explain complex business logic
  • Document non-obvious edge cases
  • Are consistent with existing file style

2. Excessive Defensive Code

Remove when in trusted codepaths:

  • Unnecessary try/catch blocks around simple operations
  • Redundant null checks when TypeScript types guarantee non-null
  • Duplicate validation for already-validated data
  • Error handling for impossible error cases

Keep defensive code that:

  • Handles external API responses
  • Validates user input at system boundaries
  • Protects against actually possible errors

3. Style Inconsistencies

Fix code that:

  • Uses different naming conventions than the file
  • Has inconsistent indentation or formatting
  • Uses different patterns than surrounding code
  • Has inconsistent semicolon usage

4. TypeScript-Specific Patterns

Remove:

  • as any type casts used to bypass type checking
  • Unnecessary type annotations where TypeScript can infer
  • Overly complex type definitions for simple cases
  • // @ts-ignore comments added to suppress errors

5. Over-Engineering

Simplify:

  • Premature abstractions for one-time operations
  • Feature flags or configuration for unused scenarios
  • Excessive error messages for internal operations
  • Helper functions used only once

Example Transformations

Before (AI Slop):

// Function to check if user is authenticated
const checkIfUserIsAuthenticated = async (userId: string): Promise<boolean> => {
  try {
    // Get the user from the database
    const user = await getUser(userId);

    // Check if user exists
    if (user === null || user === undefined) {
      // User not found, return false
      return false;
    }

    // Return true if user is authenticated
    return user.isAuthenticated === true;
  } catch (error: any) {
    // Handle any errors that might occur
    console.error('Error checking authentication:', error);
    return false;
  }
};

After (Clean):

const isAuthenticated = async (userId: string): Promise<boolean> => {
  const user = await getUser(userId);
  return user?.isAuthenticated ?? false;
};

Reference

See references/slop-patterns.md for detailed pattern examples and detection heuristics.

Install via CLI
npx skills add https://github.com/fumiya-kume/nogu-nogu-paradise --skill deslop
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator