
Code Simplifier
Run a focused pass on recently changed code to simplify structure and align with your repo’s CLAUDE.md standards without changing behavior.
Overview
Code Simplifier is an agent skill most often used in Ship review (also Build frontend/backend) that refines recently modified code for clarity and project standards while preserving all behavior.
Install
npx skills add https://github.com/simonwong/agent-skills --skill code-simplifierWhat is this skill?
- Preserves exact functionality—refactors how code reads, not what it outputs
- Applies project standards from CLAUDE.md: ES modules, import order, explicit return types, React Props patterns
- Targets recently modified code by default unless you widen scope
- Balances readability against over-compaction; favors explicit error handling over blanket try/catch
- Uses Opus-oriented depth for structural simplification and nesting reduction
- 5 refinement principles including preserve functionality and apply project standards
Adoption & trust: 1.7k installs on skills.sh; 4 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your last commit works but is nested, inconsistent with repo conventions, and painful for the next agent turn or human review.
Who is it for?
Solo devs with CLAUDE.md (or similar) house rules who want an automatic style-and-structure pass on fresh changes.
Skip if: Greenfield architecture decisions, intentional performance micro-optimizations that require dense code, or repos with no documented standards for the agent to follow.
When should I use this skill?
After modifying code and you want clarity and maintainability improvements without altering behavior; default scope is recently modified files.
What do I get? / Deliverables
Recent diffs read cleaner, match CLAUDE.md patterns, and stay behavior-identical—ready for PR or the next implementation task.
- Simplified source edits in changed files
- Behavior-preserving refactor diff
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Code simplification is canonically shelved under ship review as the polish step after implementation, though it also applies mid-build on touched files. Review is where clarity, consistency, and maintainability refinements belong before merge or release.
Where it fits
After implementing a React screen, run simplifier on the touched components to align Props types and import order with CLAUDE.md.
Pre-PR pass to flatten nesting and remove redundant helpers in the branch diff.
Tidy a production hotfix branch so the minimal change set stays readable for incident follow-up.
How it compares
Use for post-edit simplification instead of ad-hoc 'clean this up' chat that may silently change semantics.
Common Questions / FAQ
Who is code-simplifier for?
Indie builders and small teams using agentic IDEs who maintain explicit coding standards in CLAUDE.md and want disciplined refactors on recent edits.
When should I use code-simplifier?
After finishing a feature slice in build; before opening a PR in ship review; when operating on a hotfix branch and you need readable diffs without behavior changes.
Is code-simplifier safe to install?
It instructs the agent to preserve functionality but any refactor skill can mis-edit edge cases—run tests and check the Security Audits panel on this Prism page before wide rollout.
SKILL.md
READMESKILL.md - Code Simplifier
You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer. You will analyze recently modified code and apply refinements that: 1. **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact. 2. **Apply Project Standards**: Follow the established coding standards from CLAUDE.md including: - Use ES modules with proper import sorting and extensions - Use explicit return type annotations for top-level functions - Follow proper React component patterns with explicit Props types - Use proper error handling patterns (avoid try/catch when possible) - Maintain consistent naming conventions 3. **Enhance Clarity**: Simplify code structure by: - Reducing unnecessary complexity and nesting - Eliminating redundant code and abstractions - Improving readability through clear variable and function names - Consolidating related logic - Removing unnecessary comments that describe obvious code - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions - Choose clarity over brevity - explicit code is often better than overly compact code 4. **Maintain Balance**: Avoid over-simplification that could: - Reduce code clarity or maintainability - Create overly clever solutions that are hard to understand - Combine too many concerns into single functions or components - Remove helpful abstractions that improve code organization - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners) - Make the code harder to debug or extend 5. **Focus Scope**: Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope. Your refinement process: 1. Identify the recently modified code sections 2. Analyze for opportunities to improve elegance and consistency 3. Apply project-specific best practices and coding standards 4. Ensure all functionality remains unchanged 5. Verify the refined code is simpler and more maintainable 6. Document only significant changes that affect understanding You operate autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.