Skip to content
Back to skills

Simplify

ASecurity

Use when code works but is hard to read or change, after a feature is complete and green, or when asked to refactor or clean up. Reduces complexity without changing behavior.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentscode-reviewgit

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 6, 2026

npx -y skills add PeanutGT/NutsSkills --skill simplify --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Simplify?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Simplify
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/peanutgt-simplify/badge)](https://www.skillsdirectory.com/skills/peanutgt-simplify)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: simplify
description: "Use when code works but is hard to read or change, after a feature is complete and green, or when asked to refactor or clean up. Reduces complexity without changing behavior."
license: Apache-2.0
metadata:
  version: "1.0.0"
  author: PeanutGT
  suite: nuts-engineering
  repository: https://github.com/PeanutGT/NutsSkills
---

# Simplify

**Iron law:** Behavior does not change. Tests are green before you start and after every step.

## When to use
- After `tdd` gets a feature green (the refactor step at a larger scale)
- Code review flagged complexity
- You need to change code that is too tangled to change safely

Do not mix simplification with feature work in the same commit.

## Process
1. **Safety net.** Confirm tests cover the code. If not, add characterization tests first.
2. **Find the biggest simplification**, in this order:
   1. Delete: dead code, unused params, stale flags, commented-out code
   2. Inline: one-use helpers and abstractions that hide nothing
   3. Merge: true duplication (same reason to change, not just similar text)
   4. Rename: unclear names to domain words
   5. Restructure: long functions into steps, nested conditionals into guard clauses
3. **One small step at a time.** Run tests after each.
4. **Commit** each coherent step separately.

## Smells to look for
- Function longer than a screen or with more than ~3 levels of nesting
- Boolean parameters that switch behavior
- Abstractions with exactly one implementation and no test seam need
- Comments explaining *what* the code does (rename instead)
- Wrappers that only pass arguments through

## Rationalizations to reject
| Excuse | Answer |
|---|---|
| "While I'm here, I'll also fix this bug" | Separate commit, with its own test (`debug`). |
| "Big rewrite is faster than small steps" | Until it breaks and you can't tell which step did it. |
| "DRY says merge these" | Only if they change for the same reason. Similar is not the same. |

## Done when
- [ ] Tests green, output seen (`verify`)
- [ ] Net lines of code went down, or clarity clearly went up
- [ ] No behavior change in the diff

Related: `design`, `code-review`.

Files in this skill

  • CHANGELOG.md83 B
  • SKILL.md2.1 KB
  • evals/behavior/case.yaml182 B
  • evals/behavior/graders/01-expected-behavior.md233 B
  • evals/behavior/prompt.md145 B
  • evals/triggers.json295 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.