deslop-simplify-ai-code

Remove redundant code patterns from diffs while preserving exact behavior.

2|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/adibfirman/dotfiles --skill deslop-simplify-ai-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deslop-simplify-ai-code
Source: https://github.com/adibfirman/dotfiles/tree/main/claude/.claude/skills/code-review/deslop-simplify-ai-code
Command: npx skills add https://github.com/adibfirman/dotfiles --skill deslop-simplify-ai-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you remove noisy, over-engineered, or needlessly verbose code from a diff or review so the result is clearer and easier to maintain without changing what the program actually does.

Core Features & Use Cases

  • Diff-first simplification: Reviews only what’s relevant by focusing on the provided changes, whether from git diff, a PR, a branch, or pasted code.
  • Targeted slop detection: Finds and removes common sources of clutter such as redundant comments, unnecessary null/error handling, pointless abstractions, overly verbose logic, weak naming, and noisy logging.
  • Behavior-preserving refactors: Simplifies expressions and structure while explicitly preserving exact functionality and matching the existing codebase style and idioms.

Quick Start

Ask the AI to review the provided diff and simplify it by removing slop while preserving exact functionality, matching the project’s existing patterns, and then summarize what changed and why.

Frequently Asked Questions about deslop-simplify-ai-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I simplify verbose code in a pull request without changing its behavior?

Code simplification in a pull request removes redundant comments, unnecessary null checks, and pointless abstractions while preserving exact functionality. This process targets diff-specific changes to reduce verbosity and improve maintainability without altering program behavior.

What is code slop and how does it affect codebase maintainability?

Code slop consists of noisy patterns like redundant comments, over-engineered abstractions, and excessive logging that reduce clarity without providing functional value. Removing it during diff analysis or refactoring improves maintainability while ensuring the program's exact behavior remains unchanged.

How do I clean up noisy logging and redundant error handling from a git diff?

Cleaning up noisy logging and redundant error handling from a git diff involves targeted slop detection across the provided changes. This behavior-preserving refactor removes unnecessary verbosity and clutter while matching existing codebase style and verifying functionality through careful diff reasoning.

Can I refactor over-engineered abstractions in a branch without breaking existing tests?

Refactoring over-engineered abstractions in a branch requires behavior-preserving simplification that explicitly maintains exact functionality. The process verifies changes via tests or careful diff reasoning, ensuring the simplified code matches existing idioms without breaking current test coverage.

Does diff-based code review work for cleaning up inconsistent naming and structure?

Diff-based code review works for cleaning up inconsistent naming and structure by focusing only on provided changes from a branch or PR. It identifies slop across naming, structure, and verbosity, applying behavior-preserving refactors to match existing codebase patterns.

When should I avoid using automated simplification on my codebase?

Automated simplification should be avoided when changes cannot be verified via tests or careful diff reasoning. If a diff lacks clear context or the codebase lacks existing test coverage, preserving exact behavior during verbosity reduction and refactoring becomes risky.