Skip to main content
skill CX Codex

code-simplifier · simonwong — Claude Code skill: what it does, how to install

Rewrites code you just touched so it reads cleaner, without changing what it does. Handy right after a messy edit.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add simonwong/skills --skill code-simplifier -a claude-code
Open on GitHub

What code-simplifier does

code-simplifier acts as a simplification specialist. It picks up the sections you modified in the current session and makes them more explicit, leaving behaviour untouched.

It follows the standards laid out in CLAUDE.md: sorted imports with extensions, explicit return types on top-level functions, typed Props in React components, consistent naming. Nested ternaries are called out specifically — the skill prefers switch or if/else chains instead. It also strips duplicated code, needless abstractions and comments that restate the obvious.

There is a deliberate ceiling on how far it goes. If a change would hurt debugging or fold several concerns into one function, it stays out. Scope is narrow by default: only recently modified code, unless you ask for more. One thing to check first — if your project has no CLAUDE.md, the skill has no project rules to lean on and will fall back on general judgement.

What it helps with

  • clean up a fresh edit and flatten deep nesting
  • align imports and names with project conventions
  • swap nested ternaries for readable branches
  • drop comments that just repeat the code
  • cut duplication left over from a refactor

Example prompts for the agent

  • simplify the code I just changed
  • bring this file in line with CLAUDE.md, keep behaviour the same
  • go over my recent edits and remove unnecessary abstractions

How to install code-simplifier

1Skills CLI (Vercel)

npx skills add simonwong/skills --skill code-simplifier -a claude-code

2Manually: put the files in place

~/.claude/skills/code-simplifier/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/code-simplifier/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about code-simplifier

How do I install code-simplifier in Claude?

Run npx skills add simonwong/skills --skill code-simplifier -a claude-code. The skill lands in ~/.claude/skills/code-simplifier/SKILL.md.

What does code-simplifier do?

It rewrites recently modified code for clarity and consistency while keeping every original feature and output intact.

Does it review the whole project or just my recent edits?

By default only code touched in the current session. Ask explicitly if you want a wider pass.

Source text

SKILL.md · MIT
---
name: code-simplifier
description: Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
license: MIT
disable-model-invocation: true
metadata:
  author: anthropics
  version: "1.0.0"
---

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.

© anthropics · MIT · simonwong/skills

Similar skills

Everything for Code review and refactoring →

code-simplifier by other authors comes first.

code-simplifier rtk-ai Reviews Rust code in RTK to remove over-engineering and needless allocations. It applies idiomatic simplifications without altering runtime behavior. CX Codex +1 2,100installs code-simplifier pproenca A skill that gives AI agents 47 rules for cleaning up recently changed code without altering what it does. CX Codex +1 1,600installs code-simplifier yamapan (https://github.com/aktsmm) A skill for refactoring code after a coding session: drops nested ternaries, dense one-liners and restating comments without changing behaviour. CX Codex +1 365installs principal-engineering riekelt Enforces core engineering discipline for AI agents: mandates pre-change checkpoints, bans silent error suppression, and requires evidence from real code. CX Codex +1 18,000installs antislop-code miqdadbadjuber This skill filters out comments that look AI-generated: ones that repeat what the code shows, chop the flow into steps, or decorate section headers. It keeps comments with real information and never touches executable code. CX Codex +1 5,800installs gem-code-simplifier official github A refactoring subagent that removes dead code and drops complexity. Handy when cleaning up messy logic without altering existing behavior. ★ 40,418repo stars improve-code-quality wondelai Guides untested prototypes toward production code with tests, clean boundaries, and system resilience. Useful when code works but feels too fragile to touch. CX Codex +1 2,300installs clean-code-principles AsyrafHussin A skill for architecture review and code quality: SOLID, DRY, KISS, design patterns. Useful when refactoring or weighing design decisions. CX Codex +1 1,800installs architecture-optimization wondelai Walks a working codebase through eight phases toward something measurably faster and easier to change. Every decision lands in docs/, so you can stop and resume later. CX Codex +1 1,300installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor