code-simplify
This skill should be used when the user asks to "simplify code", "clean up code", "refactor for clarity", "reduce complexity", "improve readability", "make this easier to maintain", or asks to simplify recently modified code.
Security Assessment
About code-simplify
The code-simplify skill is designed to simplify existing code while preserving its runtime behavior, public interfaces, side effects, and operational intent. It helps developers reduce complexity, improve readability, and make code easier to maintain without introducing functional changes. The skill focuses on safe, targeted refactoring rather than broad rewrites, ensuring that inputs, outputs, error behavior, and externally relied-upon contracts remain stable. It is intended for situations where code has become difficult to understand, overly nested, duplicated, or unnecessarily complex.
The skill determines an appropriate scope based on user-provided targets, recently modified files, or repository changes. It analyzes surrounding context to establish a behavioral baseline before making changes. Simplification is performed through a structured process that includes flattening control flow, improving naming clarity, reducing duplication, restructuring dense data transformations into clearer steps, and improving type or contract clarity where appropriate. The workflow emphasizes small, reversible edits and follows existing project conventions, linters, formatters, and tests. Safety rules prevent behavior-altering changes such as converting synchronous APIs to asynchronous ones, removing operational safeguards, or changing external interfaces without explicit instruction.
This skill is useful for developers, maintainers, and teams working on evolving codebases who want to improve code quality without changing functionality. Common use cases include cleaning up recently modified code, refactoring for readability, reducing cognitive load in complex functions, simplifying nested logic, and preparing code for long-term maintenance. It is particularly valuable in repository-based development workflows where verification and behavioral stability are important requirements.
FAQ
When should I use this skill?
Use it when you want to simplify code, improve readability, reduce complexity, clean up recently modified code, or make code easier to maintain without changing its behavior.
Does the skill change application behavior or public APIs?
No. The skill is designed to preserve runtime behavior, public contracts, side effects, inputs, outputs, and externally relied-upon error semantics.
Does this skill require a Git repository?
Yes. The workflow begins by verifying repository context. If the current directory is not a Git repository, the process stops and requests that it be run from one.
How does the skill decide which files to modify?
It uses user-provided targets when available. Otherwise, it focuses on session-modified files and may fall back to uncommitted tracked and untracked files if no session-modified files exist.
Are there any limitations on the types of refactoring performed?
Yes. The skill avoids behavior-changing modifications, broad rewrites, unnecessary abstractions, changes to sync versus async APIs, and removal of logging, telemetry, guards, retries, or other operationally significant code.
Install code-simplify
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
paulrberg/agent-skills