# Code simplification

> Code simplification is an open-source agent skill for developer tools. Guides an agent to simplify working code for clarity without changing behavior. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/addyosmani/agent-skills/tree/main/skills/code-simplification
- **Repository:** https://github.com/addyosmani/agent-skills
- **GitHub stars:** 122,283
- **License:** MIT
- **Skill name:** code-simplification
- **Collection:** https://github.com/addyosmani/agent-skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/code-simplification)
- [License: MIT](https://github.com/addyosmani/agent-skills/tree/HEAD/skills/code-simplification)

## Features

- **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

## Install

### Claude Code

This skill ships in the `agent-skills` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add chrisalehman/bionic
/plugin install agent-skills@bionic
```

Or copy only this skill to `~/.claude/skills/code-simplification`:

```sh
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.

### Codex

Copy the skill folder to `~/.agents/skills/code-simplification` to use it in every repository:

```sh
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.

### Cursor

Copy the skill folder to `~/.cursor/skills/code-simplification` to use it in every project:

```sh
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.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/addyosmani/agent-skills.git --path skills/code-simplification
```

Or copy the folder to `~/.gemini/skills/code-simplification` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/code-simplification`:

```sh
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.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/addyosmani/agent-skills.git
```

Then 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.

## 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.

## Alternatives

- [Code simplifier](https://ai-powered.com/skills/code-simplifier): Code simplifier is an open-source agent skill for developer tools.
- [Code simplification edho ferdian](https://ai-powered.com/skills/code-simplification-edho-ferdian): Code simplification edho ferdian is an open-source agent skill for developer tools.
- [Refactor](https://ai-powered.com/skills/refactor): Refactor is an open-source agent skill for developer tools.
- [Readable code](https://ai-powered.com/skills/readable-code): Readable code is an open-source agent skill for developer tools.
- [Refactor method complexity reduce](https://ai-powered.com/skills/refactor-method-complexity-reduce): Refactor method complexity reduce is an open-source agent skill for developer tools.
- [Axiom swift simplifier](https://ai-powered.com/skills/axiom-swift-simplifier): Axiom swift simplifier is an open-source agent skill for developer tools.
- [Simplify python](https://ai-powered.com/skills/simplify-python): Simplify python is an open-source agent skill for developer tools.
- [Coding standards](https://ai-powered.com/skills/coding-standards-smartworldarafath): Coding standards is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/code-simplification
