slop

Clean up AI-generated code redundancy in git diffs to help maintain code quality.

Last repository push
GitHub Stars
130
Forks
13
Issues / PRs
15

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "slop" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-bffd4c70bffcc02b5240a855dec08e1daf413f0f463f607ebe67280ab9820eb8. Verify the upstream source and version against https://github.com/jellydn/my-ai-tools before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Clean up AI-generated code redundancy in git diffs to help maintain code quality.

0 Downloads

Introduction source: third_party · jellydn · 0.0.1 Reference

SkillPi interpretation

Tasks
Remove AI-generated code slop from git diffs to maintain code quality
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: slop
description: "Remove AI-generated code slop from git diffs to maintain code quality"
license: MIT
compatibility: cline, claude, opencode, amp, codex, gemini, cursor, pi
hint: Use when cleaning up AI-generated code slop in git diffs
user-invocable: true
metadata:
  audience: all
  workflow: code-quality

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

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 针对 AI 生成代码中的冗余问题提供具体清理方案,实用性强
  • 适用于开发者维护代码质量的明确场景,受众清晰
Trigger Precision92/100

Highlights

  • 触发描述清晰明确,边界清晰,覆盖主要使用场景
Structure and Standards95/100

Areas to improve

  • 缺少显式 When to Use 章节 Reported severity: Minor

    文档中已有 Usage 和 hint,但未单独设立 When to Use 章节

    Recommendation: 建议增加显式的 When to Use 章节以提升可读性

Highlights

  • 文档结构清晰,步骤划分明确,包含完整的使用指南和原则
  • 提供了具体的操作示例和命令,便于用户理解和执行
Execution Reliability88/100

Highlights

  • 提供了具体的 git 命令和操作流程,工具来源明确
  • 强调了功能不变性验证,确保修改安全可靠
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.