deslop
Scannednpx machina-cli add skill recrsn/agent-skills/deslop --openclawCheck the diff against origin/main, and remove all unnecessary changes
introduced in this branch. Run git fetch origin to make sure git context is
up-to-date.
Here is the list of files changed in this branch:
!git diff --stat origin/main
Focus on removing unnecessary ADDITIONS, not reverting improvements:
Things to remove
- Comments that merely describe obvious operations ("Fetch product settings" for a fetch call)
- Comments that narrate code flow ("Update review state with product settings")
- Extra defensive checks or try-catch blocks abnormal for that codebase area ( especially if called by trusted/validated codepaths)
- Casts to any to get around type issues
- Unnecessary implementation details in docstrings
- Commented-out code (e.g., // this.model = config.model)
- Any other style inconsistent with the file
- Verbose logging or debug statements that are not needed for normal operation
Things to keep
- Anything not included in the "diff", even if it matches the above criteria, since it is not an addition in this branch
- Code simplifications
- Refactoring
- Removing redundant code/comments from main
- Docstrings on exported functions/classes including @param, @return, @throws etc
Report at the end with only a 1-3 sentence summary of what you changed
Source
git clone https://github.com/recrsn/agent-skills/blob/main/skills/deslop/SKILL.mdView on GitHub Overview
Deslop automates pruning of cosmetic additions in a feature branch. It targets non-functional changes such as descriptive comments, narration of code flow, extra defensive checks, casts to any, and commented-out code, while preserving substantive refactors and improvements. This helps keep the branch clean and aligned with origin/main.
How This Skill Works
Deslop compares the feature branch to origin/main, identifies additions that are cosmetic or non-functional, and removes them according to a defined rule set. It preserves real improvements and refactors while stripping away unnecessary noise like verbose logs and bloated docstrings.
When to Use It
- When your branch contains noisy diffs with comments that describe obvious operations or narrate code flow
- When you want the branch to reflect only substantive changes relative to origin/main
- When there are commented-out blocks, verbose logs, or production-irrelevant diffs that do not affect functionality
- When there are unnecessary casts to any or extra defensive checks in trusted codepaths
- When preparing a merge request and aiming for a lean, review-friendly diff
Quick Start
- Step 1: Run git fetch origin and review the diff against origin/main (e.g., git diff --stat origin/main)
- Step 2: Prune non-functional additions following the deslop criteria, keeping substantive changes
- Step 3: Run tests/lint and commit with a clear message like 'deslop: remove unnecessary additions'
Best Practices
- Run git fetch origin and inspect the diff vs origin/main to identify additions
- Apply deslop criteria strictly: remove only non-functional additions, preserve real improvements
- Keep code stylistically consistent and avoid removing important docstrings on exported functions/classes
- Run automated tests and linters after cleanup to ensure behavior remains unchanged
- Commit with a concise message describing what was removed and why
Example Use Cases
- Remove descriptive comments like 'Fetch product settings' that don't affect behavior
- Eliminate narrations of code flow such as 'Update review state with product settings'
- Strip verbose logging or debug statements not needed in normal operation
- Delete commented-out code and superfluous defensive checks in trusted paths
- Remove casts to any used to workaround type issues where not needed