deslop

Simplifies and refines recently modified code while preserving exact functionality.

4|Updated Jul 13, 2024
One-click install
npx skills add https://github.com/PunGrumpy/og-tester --skill deslop-pungrumpy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deslop
Source: https://github.com/PunGrumpy/og-tester/tree/main/.agents/skills/deslop
Command: npx skills add https://github.com/PunGrumpy/og-tester --skill deslop-pungrumpy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @rayhanadev/truffler.

What problem does it solve? Code written quickly during development often accumulates unnecessary complexity, redundant abstractions, dead code, and duplicated helpers. This Skill reviews recently modified code and refines it for clarity and maintainability without changing any behavior. ## Core Features & Use Cases - Functionality-Preserving Refinement: Simplifies code structure, reduces nesting, removes dead branches and unused exports, and consolidates single-use helpers while keeping all outputs and behaviors identical. - Project Standards Enforcement: Applies codebase conventions such as ES modules, explicit return types, proper error handling, and consistent naming. - Duplicate Consolidation with truffler: Uses the find-similar-functions capability via bunx @rayhanadev/truffler to detect near-duplicate functions across modules and merge them into shared utilities. - Use Case: After implementing a new feature across several files, invoke this Skill to collapse pass-through wrappers, inline single-use functions, remove leftover scaffolding, and unify duplicated helpers before committing. ## Quick Start Ask the AI to deslop and simplify the code you just modified while keeping its behavior unchanged.

Frequently Asked Questions about deslop

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

FAQPage Schema
How do I clean up code without changing its behavior?

Use the deslop skill to refine recently modified code while preserving exact functionality. It reduces nesting, removes dead branches and unused exports, and consolidates redundant abstractions without altering any outputs or side effects.

How to find and merge duplicate functions in a codebase?

Run truffler via `bunx @rayhanadev/truffler` with a behavior-based query to find similar functions across modules. Merge only symbols sharing the same input shape, side effects, error behavior, and return shape into one shared utility, then repoint all call sites.

Does code simplification work on the entire codebase at once?

No, the skill focuses only on code recently modified in the current session unless you explicitly request a broader scope. This keeps reviews targeted and avoids unintended changes to stable code.

When should I avoid aggressive code simplification?

Avoid over-simplification when it reduces clarity, creates overly clever one-liners, combines too many concerns into single functions, or removes helpful abstractions. Explicit, readable code is preferred over fewer lines, such as avoiding nested ternaries.

What coding standards does automated code cleanup follow?

It applies project conventions including ES modules with sorted imports, explicit return type annotations on top-level functions, explicit Props types for components, and error handling patterns that avoid unnecessary try/catch blocks.