agentleFS
jellydnjellydn/my-ai-tools/skills/slop/SKILL.md

slop

Skill127 starsChanged 27 days agoMITView on GitHub

Remove AI-generated code slop from git diffs to maintain code quality

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. About 0 are common, 20 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the diff against a branch and remove all AI-generated slop introduced in this branch.

    line 15
  2. Very specific:

    If no branch is provided, compare against main: /slop main

    line 21
  3. Distinctive:

    Never change what the code does - only how it does it.

    line 36
  4. Very specific:

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

    line 40
  5. Distinctive:

    Use proper import sorting and file organization

    line 42
  6. Distinctive:

    Follow language-specific patterns (ES modules, proper TypeScript types, etc.)

    line 43
  7. Distinctive:

    Use proper error handling patterns

    line 45
  8. Distinctive:

    IMPORTANT: Use switch statements or if/else chains over nested ternary operators

    line 56
  9. Distinctive:

    Create overly clever solutions that are hard to understand

    line 64
  10. Distinctive:

    Remove helpful abstractions that improve code organization

    line 66
  11. Distinctive:

    Read the current content

    line 85
  12. Distinctive:

    Check for opportunities to improve elegance and consistency

    line 88
  13. Very specific:

    Remove any casts where possible

    line 94
  14. Distinctive:

    Ensure all functionality remains unchanged

    line 97
  15. Distinctive:

    Identify the modified sections: - Only refine code that changed in the diff

    line 123
  16. Distinctive:

    Analyze for improvement opportunities: - Look for ways to enhance elegance and consistency

    line 124
  17. Distinctive:

    Apply project standards: - Follow established conventions and patterns

    line 125
  18. Distinctive:

    Preserve functionality: - Ensure behavior remains unchanged

    line 126
  19. Distinctive:

    Document significant changes: - Only document changes that affect understanding

    line 128
  20. Distinctive:

    Prefer explicit over compact - readable code beats clever code

    line 132
  21. Distinctive:

    Use descriptive names - clarity over brevity

    line 133
  22. Distinctive:

    Remove redundant code - eliminate duplicates

    line 135
  23. Distinctive:

    Use language-appropriate patterns - follow idiomatic practices

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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]

  • If no branch is provided, compare against main: /slop main

What is AI Code Slop?

This includes:

  • Extra comments that a human wouldn't add or is inconsistent with the rest of the file
  • Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase
  • Casts to any to get around type issues
  • Any other style that is inconsistent with the file

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:

  • Use proper import sorting and file organization
  • Follow language-specific patterns (ES modules, proper TypeScript types, etc.)
  • Maintain consistent naming conventions
  • Use proper error handling patterns

3. Enhance Clarity

Simplify code structure by:

  • Reducing unnecessary complexity and nesting
  • Eliminating redundant code and abstractions
  • Improving readability through clear variable and function names
  • Consolidating related logic
  • Removing unnecessary comments that describe obvious code
  • IMPORTANT: Use switch statements or if/else chains over nested ternary operators
  • Choose clarity over brevity - explicit code is often better than overly compact code

4. Maintain Balance

Preserve necessary complexity — over-simplification can:

  • Reduce code clarity or maintainability
  • Create overly clever solutions that are hard to understand
  • Combine too many concerns into single functions
  • Remove helpful abstractions that improve code organization
  • Prioritize "fewer lines" over readability

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:

  • Read the current content
  • Compare with original (before changes)
  • Identify AI-generated slop patterns
  • Check for opportunities to improve elegance and consistency

3. Remove slop and refine

  • Remove unnecessary comments
  • Simplify overly defensive code
  • Remove any casts where possible
  • Restore natural code style
  • Apply project-specific best practices
  • Ensure all functionality remains unchanged

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

  • Prefer explicit over compact - readable code beats clever code
  • Use descriptive names - clarity over brevity
  • Flatten deep nesting with early returns and guard clauses
  • Remove redundant code - eliminate duplicates
  • Use language-appropriate patterns - follow idiomatic practices

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.