code-simplifier

Simplifies recently modified code for readability without changing behavior.

Updated Jan 5, 2025
One-click install
npx skills add https://github.com/ValorVie/settingZsh --skill code-simplifier-valorvie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-simplifier
Source: https://github.com/ValorVie/settingZsh/tree/main/.codex/skills/code-simplifier
Command: npx skills add https://github.com/ValorVie/settingZsh --skill code-simplifier-valorvie

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? After implementing a feature, code often ends up with duplication, deep nesting, noisy comments, and inconsistent naming. This Skill performs a focused cleanup pass on recently changed code, improving readability and maintainability while strictly preserving existing behavior. ## Core Features & Use Cases - Scoped Simplification: Limits changes to files or sections identified via git diff, git status, or user-specified paths, avoiding repo-wide rewrites. - Behavior-Preserving Refactoring: Reduces nesting, removes local duplication, replaces nested ternaries with clear branches, and renames identifiers only when clarity improves. - Convention Awareness: Reads project instructions such as AGENTS.md and follows existing naming, formatting, and structure before making edits. - Verification Step: Runs targeted tests or lint/build checks after edits and explicitly reports residual risk when no automated verification exists. - Use Case: After finishing a feature branch, ask for a cleanup pass on the changed files so the code is easier to review before opening a pull request. ## Quick Start Ask the assistant to simplify and clean up the code you just modified without changing its behavior.

Frequently Asked Questions about code-simplifier

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

FAQPage Schema
How do I refactor code without changing its behavior?▼

Scope the refactor to recently changed files using git diff, then reduce nesting, remove local duplication, and clarify names while preserving control flow semantics. Always run targeted tests or lint checks afterward to confirm behavior is unchanged.

How to clean up code after implementing a feature?▼

Run a focused simplification pass on only the files you touched: flatten deep nesting, replace nested ternaries with if/else branches, delete comments that restate the code, and align naming with existing project conventions.

When should I not use a code simplification pass?▼

Avoid it for behavior changes, bug fixes, large architectural redesigns across untouched modules, or security and performance reviews. It is meant for a single maintainability pass on recently modified code, not multi-reviewer workflows.

Does code simplification follow my project's style conventions?▼

Yes. The workflow checks project instructions such as AGENTS.md and existing repo conventions first, and local naming, formatting, and structure take priority over generic cleanup preferences.

Why is verification needed after a safe-looking refactor?▼

Even mechanical edits can alter semantics through subtle scoping or evaluation-order changes. Running the narrowest meaningful tests or lint checks confirms behavior is preserved instead of assuming the refactor is safe.