Skip to content
Development
Skill

/code-simplification

Simplify working code while preserving behavior—remove dead paths, flatten nesting, clarify names, reduce duplication. Use after features work but code feels over-engineered.

From plugin
awesome-agent-skill
26200 skills4 commands
Install
$ npx -y skills add charlieviettq/awesome-agent-skill --skill code-simplification --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/code-simplification

Context preview

The summary Claude sees to decide when to auto-load this skill.

Simplify working code while preserving behavior—remove dead paths, flatten nesting, clarify names, reduce duplication. Use after features work but code feels over-engineered.

SKILL.md

code-simplification.SKILL.md
name: code-simplification
description: "Simplify working code while preserving behavior—remove dead paths, flatten nesting, clarify names, reduce duplication. Use after features work but code feels over-engineered."
allowed-tools: Read, Glob, Grep

Code Simplification

Behavior-preserving simplification pass on code that already works. Distinct from `design-smell-review` (structural critique before change) and `refactor-legacy-python-pr` (scoped legacy cleanup PRs).

When to use

  • Feature is done and tested; complexity exceeds need
  • Review feedback says "over-engineered"
  • Preparing a focused hygiene PR

When not to use

  • Bug is still open (fix behavior first)
  • Large architectural rewrite (use `incremental-implementation`)
  • No tests and behavior is unclear (add tests or spike first)

Workflow

1. **Baseline** — confirm tests pass or define minimal manual checks 2. **Inventory** — list simplification targets (unused code, deep nesting, duplicate logic, premature abstraction) 3. **One change at a time** — small commits; run tests after each 4. **Stop** — when readability improves without expanding scope

Safe simplifications

  • Remove dead code and unused imports
  • Inline one-use helpers when they obscure flow
  • Replace cleverness with explicit steps
  • Consolidate duplicate validation or mapping
  • Narrow public API surface if callers allow

Avoid

  • Drive-by renames across unrelated files
  • Changing behavior "while you're here"
  • Removing abstractions that enable testing or extension without evidence

Verification

  • Same inputs → same outputs
  • No new linter/type errors
  • Diff stays reviewable (< ~300 lines unless agreed)
Read more
Ships withawesome-agent-skill

Curated skill pack for LLM agents in engineer and science workflow (Cursor & Claude ready).

Get the whole plugin

Other skills on awesome-agent-skill.