# code-simplifier

A skill for refactoring code after a coding session: drops nested ternaries, dense one-liners and restating comments without changing behaviour.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 365 installs · ★ 26
- Author: yamapan (https://github.com/aktsmm)
- License: LicenseRef-CC-BY-NC-SA-4.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/aktsmm/Agent-Skills/tree/HEAD/code-simplifier/SKILL.md
- Updated: 2026-10-26
- HTML: https://affpapa.org/en/nevibecode/skills/yamapan-httpsgithubcomaktsmm-code-simplifier

## What it does

The skill kicks in when you want to tidy code after a task, review a PR for readability, or apply the same refactoring moves across files. Functionality stays put: run the existing tests first, then change how the code reads.

Inside you get a set of principles plus a pattern table in `references/refactoring-patterns.md`, which also covers equivalence traps where a rewrite changes behaviour and a format for review feedback. The skill tells the agent to follow project standards (`CLAUDE.md`, `AGENTS.md`, `.editorconfig`, linters) over personal taste. Scope is limited on purpose: only recently modified code gets touched unless you ask for more. That matters on a large legacy file, where the skill will not start rewriting everything.

There is a catch. Simplification slides into clever code that is hard to debug, so the rules ban new unnecessary abstractions and cramming several concerns into one function. Completion is a checklist: tests pass, behaviour unchanged, standards met.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add aktsmm/Agent-Skills --skill code-simplifier -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/code-simplifier/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/code-simplifier/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add aktsmm/Agent-Skills --skill code-simplifier -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/code-simplifier/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add aktsmm/Agent-Skills --skill code-simplifier -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/code-simplifier/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install aktsmm/Agent-Skills code-simplifier
```

2. **Manually: put the files in place**
- File: `.github/skills/code-simplifier/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add aktsmm/Agent-Skills --skill code-simplifier -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/aktsmm/Agent-Skills --path code-simplifier
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/code-simplifier/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add aktsmm/Agent-Skills --skill code-simplifier -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/aktsmm/Agent-Skills/tree/HEAD/code-simplifier/SKILL.md

## When to use it
- tidy code after finishing a task
- review a PR for readability before handing it off
- strip nested ternaries and dense one-liners
- align edits with project standards instead of author taste
- confirm a refactor did not change behaviour

## Example prompts
- simplify the code in this file, tests must still pass
- go over my recent changes and remove unnecessary complexity
- review this PR for readability and suggest refactoring patterns

## Similar
- [gem-code-simplifier](https://affpapa.org/en/nevibecode/agents/gem-code-simplifier.md) — subagent · ★ 40418
- [thermo-nuclear-code-quality-review](https://affpapa.org/en/nevibecode/skills/thermo-nuclear-code-quality-review.md) — skill · 22200 installs
- [simplify](https://affpapa.org/en/nevibecode/skills/simplify.md) — skill · 20100 installs
- [clanker-discipline](https://affpapa.org/en/nevibecode/skills/clanker-discipline.md) — skill · 7500 installs
- [clean-code](https://affpapa.org/en/nevibecode/skills/clean-code.md) — skill · 7176 installs
- [deslop](https://affpapa.org/en/nevibecode/skills/brianlovin-deslop.md) — skill · 5500 installs

## Other versions with the same name
- [code-simplifier · rtk-ai](https://affpapa.org/en/nevibecode/skills/rtk-ai-code-simplifier.md) — 2100 installs
- [code-simplifier · pproenca](https://affpapa.org/en/nevibecode/skills/pproenca-code-simplifier.md) — 1600 installs
- [code-simplifier · simonwong](https://affpapa.org/en/nevibecode/skills/anthropics-code-simplifier.md) — 1800 installs

From the same set: [aktsmm/agent-skills](https://affpapa.org/en/nevibecode/by/aktsmm/agent-skills.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
