code-simplify

Improves code readability through renames, guard clauses, and dead-code removal without changing behavior.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/hanh-nd/agent-kit --skill code-simplify-hanh-nd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-simplify
Source: https://github.com/hanh-nd/agent-kit/tree/main/plugins/agent-kit/.gemini/skills/code-simplify
Command: npx skills add https://github.com/hanh-nd/agent-kit --skill code-simplify-hanh-nd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code that works but is hard to read slows down every future change. This Skill cleans up existing code — misleading names, nested conditionals, dead code, redundant comments — while strictly preserving signatures, side effects, and behavior, so reviewers can approve the diff with confidence. ## Core Features & Use Cases - Behavior-preserving cleanup: Renames misleading variables, flattens nested conditionals into guard clauses, removes dead code and restating comments, and reuses existing constants — all without touching types, signatures, or call sites. - Four-phase disciplined workflow: Orients by reading full files, triages changes into in-scope/out-of-scope/skip, applies only changes that pass a "rent check", then self-reviews and reverts anything that fails. - Scope boundary with code-refactor: Detects problems that require signature or structural changes and routes them to the code-refactor skill instead of applying risky half-measures. - Use Case: After merging a feature branch, run this Skill on the diff to clean up rushed naming, leftover debug logs, and commented-out blocks before requesting final review. ## Quick Start Ask the AI to simplify the code in your current git diff while keeping all function signatures and behavior unchanged.

Frequently Asked Questions about code-simplify

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

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

Apply only within-signature changes: rename misleading variables, flatten nested conditionals into guard clauses, remove dead code, and reuse existing constants. Never alter parameter types, return types, side effects, thrown errors, or public exports, and run adjacent tests afterward to confirm behavior held.

What is the difference between code simplification and refactoring?▼

Simplification works within the existing structure — signatures, arity, side effects, and call sites stay untouched. Refactoring works on the structure itself, changing signatures, merging functions across files, or reversing design decisions. If the real improvement needs signature changes, route to refactoring instead.

When should I not rename a variable during code cleanup?▼

Skip renames when the name is generic but correct in context, like data in a data-handling function or item in a small loop. Also avoid renaming parameters when call sites use named arguments or destructuring, since that becomes a call-site change requiring refactoring.

Why does a readability cleanup sometimes get reverted?▼

Changes get reverted when they fail the rent check — the file is not actually easier to read afterward. Common cases include one-use explaining variables, constants for single literals, and extractions with only one caller, which add indirection without clarity.

Can code simplification fix bugs or improve performance?▼

No. Bugs and performance issues are logged but left untouched, because the contract is that behavior is preserved. Hiding a behavior change inside a readability diff makes it invisible to reviewers who assume simplify diffs are safe to approve quickly.