
Code simplification
Guides an agent to simplify working code for clarity without changing behavior
Code simplification is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 122K
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Code simplification
This skill walks an AI coding agent through refactoring code that already works so it is easier to read, maintain and extend. It sets out five guiding principles, including preserving behavior exactly, matching project conventions, preferring explicit code over clever code, and keeping changes scoped to what was recently modified. Before touching anything, the agent is directed to understand the code's responsibilities, callers, edge cases and git history, following the Chesterton's Fence idea.
The workflow has the agent scan for concrete signals such as deep nesting, long functions, nested ternaries, generic or abbreviated names, duplicated logic and dead code, then apply one change at a time and run tests after each. It also warns against over-simplification, such as inlining helpful names or merging unrelated logic, and lists rationalizations and red flags to watch for. A closing checklist covers test results, linting, diff cleanliness and whether error handling was preserved.
The guidance includes before-and-after examples for TypeScript, JavaScript, Python and React. It is written as instructions with no bundled scripts, so it relies on the agent's own tools and the project's existing test suite and linter.
When your agent uses it
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity. Use when asked to simplify, clean up, or reduce the nesting of a function or module that already works, even when the code is pasted inline and nothing else needs to change.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (13 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the agent-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add chrisalehman/bionic
/plugin install agent-skills@bionicOr copy only this skill to ~/.claude/skills/code-simplification:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/code-simplification &&
cp -R "$tmp/skills/code-simplification" ~/.claude/skills/code-simplification &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/code-simplification inside it instead.
Copy the skill folder to ~/.agents/skills/code-simplification to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/code-simplification &&
cp -R "$tmp/skills/code-simplification" ~/.agents/skills/code-simplification &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/code-simplification inside it instead.
Copy the skill folder to ~/.cursor/skills/code-simplification to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/code-simplification &&
cp -R "$tmp/skills/code-simplification" ~/.cursor/skills/code-simplification &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/code-simplification inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/addyosmani/agent-skills.git --path skills/code-simplificationOr copy the folder to ~/.gemini/skills/code-simplification yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/code-simplification:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/addyosmani/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/code-simplification &&
cp -R "$tmp/skills/code-simplification" ~/.copilot/skills/code-simplification &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/code-simplification inside it instead.
Get the folder:
git clone --depth 1 https://github.com/addyosmani/agent-skills.gitThen copy agent-skills/skills/code-simplification into your agent's skills folder as code-simplification. Agents that support SKILL.md read one folder per skill.
What it does
- Behavior-preserving refactoring
- Rules for changing how code is expressed while keeping inputs, outputs, side effects and errors identical.
- Complexity signal checklist
- A table of structural and naming patterns, such as deep nesting or generic names, with suggested fixes.
- Incremental change process
- Steps for making one simplification at a time, running tests after each and reverting failures.
- Chesterton's Fence check
- Questions to answer about a piece of code's purpose and history before removing or rewriting it.
- Language examples
- Before-and-after patterns for TypeScript, JavaScript, Python and React components.
- Review verification checklist
- A final checklist covering tests, linting, diff scope, conventions and retained error handling.
Good for
- Flatten a deeply nested function that already passes its tests
- Replace a chain of nested ternaries with a readable mapping
- Clean up a long module by removing dead code and duplicated logic
- Rename vague variables like data or temp to describe their contents
- Review a pull request for unnecessary complexity without changing behavior
Code simplification FAQ
Does Code simplification change what my code does?
The skill instructs the agent to preserve exact behavior, including outputs, side effects, error handling and edge cases, and to leave tests unmodified. It says to revert any simplification that breaks tests or is harder to follow.
What does the agent need before using Code simplification?
The guidance expects a working codebase with tests, a way to run them, and access to project conventions such as CLAUDE.md. It also mentions git blame to check the history of code before changing it.
Does Code simplification include scripts or extra files?
No. The skill is a single SKILL.md file with no bundled scripts or reference files.
Which languages are covered?
The examples cover TypeScript, JavaScript, Python and React/JSX. The general principles are described as applicable to any language.
How do I install Code simplification in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/code-simplification to use it in all your projects, or to .claude/skills/code-simplification in one project. Or install the agent-skills plugin, which includes it: /plugin marketplace add chrisalehman/bionic, then /plugin install agent-skills@bionic.
Does Code simplification run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Code simplification?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Code simplification?
The closest alternatives to Code simplification are Code simplifier, Code simplification edho ferdian, Refactor, Readable code and Refactor method complexity reduce.
Where this comes from
- Description: from the skill's own SKILL.md.
More from addyosmani/agent-skills

Audits interfaces against WCAG 2.2 AA and guides fixing the violations found
- Open source
- 122K GitHub stars
- Developer tools

Guides designing stable, hard-to-misuse APIs, REST endpoints and module contracts
- Open source
- 122K GitHub stars
- Design and media

Lets your coding agent inspect and test live browser pages through Chrome DevTools
- Open source
- 122K GitHub stars
- Browser automation

Sets up CI/CD quality gates, deployment strategies and rollback plans for agents
- Open source
- 122K GitHub stars
- Developer tools

Guides an agent through multi-axis code review before changes are merged
- Open source
- 122K GitHub stars
- Developer tools

Turns a project's quality bar into a written, checkable contract for coding agents
- Open source
- 122K GitHub stars
- Developer tools





