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.
npx skills add simonwong/skills --skill code-simplifier -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/code-simplifier/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/code-simplifier/
1Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a codex2Manually: put the files in place
.agents/skills/code-simplifier/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a cursor2Manually: put the files in place
.cursor/skills/code-simplifier/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install simonwong/skills code-simplifier2Manually: put the files in place
.github/skills/code-simplifier/SKILL.md1Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a gemini-cli2Platform CLI
gemini skills install https://github.com/simonwong/skills --path skills/engineering/code-simplifierManually: put the files in place
.devin/skills/code-simplifier/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add simonwong/skills --skill code-simplifier -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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.