Slop

From jellydn/my-ai-tools · View interactive version

Slop is an AI agent skill from the GitHub repository jellydn/my-ai-tools. Remove AI-generated code slop from git diffs to maintain code quality

How to use this skill

Skill file

Remove AI Code Slop

Check the diff against a branch and remove all AI-generated slop introduced in this branch. Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality.

Usage

/slop [branch-name]

What is AI Code Slop?

This includes:

Core Principles

1. Preserve Functionality

Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.

2. Apply Project Standards

Follow the established coding standards from @CLAUDE.md or conventions:

3. Enhance Clarity

Simplify code structure by:

4. Maintain Balance

Preserve necessary complexity — over-simplification can:

Process

1. Get the diff

# Compare against main branch
git diff main...HEAD --stat

# Or against specific branch
git diff $1 --stat

2. Review each changed file

For each changed file:

3. Remove slop and refine

4. Verify

# Show remaining changes
git diff --stat

# Check tests still pass
npm test

Common Slop Patterns

  1. Over-commenting: Comments explaining obvious code
  2. Verbose error handling: Try/catch blocks where not needed
  3. Unnecessary type casts: x as any to bypass TypeScript
  4. Defensive programming: Checks for already-validated inputs
  5. Redundant validation: Duplicate null/undefined checks
  6. Nested ternaries: Complex nested ternary operators
  7. Overly compact code: Dense one-liners that sacrifice readability

Refinement Guidelines

When refining code:

  1. Identify the modified sections - Only refine code that changed in the diff
  2. Analyze for improvement opportunities - Look for ways to enhance elegance and consistency
  3. Apply project standards - Follow established conventions and patterns
  4. Preserve functionality - Ensure behavior remains unchanged
  5. Verify improvements - The refined code should be simpler and more maintainable
  6. Document significant changes - Only document changes that affect understanding

Code Style Preferences

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.