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
Baseline — confirm tests pass or define minimal manual checks
Inventory — list simplification targets (unused code, deep nesting, duplicate logic, premature abstraction)
One change at a time — small commits; run tests after each
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
1---2name: code-simplification-23description: Code Simplification4---56# Code Simplification78Behavior-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).910## When to use1112- Feature is done and tested; complexity exceeds need13- Review feedback says "over-engineered"14- Preparing a focused hygiene PR1516## When not to use1718- Bug is still open (fix behavior first)19- Large architectural rewrite (use `incremental-implementation`)20- No tests and behavior is unclear (add tests or spike first)2122## Workflow23241. **Baseline** — confirm tests pass or define minimal manual checks252. **Inventory** — list simplification targets (unused code, deep nesting, duplicate logic, premature abstraction)263. **One change at a time** — small commits; run tests after each274. **Stop** — when readability improves without expanding scope2829## Safe simplifications3031- Remove dead code and unused imports32- Inline one-use helpers when they obscure flow33- Replace cleverness with explicit steps34- Consolidate duplicate validation or mapping35- Narrow public API surface if callers allow3637## Avoid3839- Drive-by renames across unrelated files40- Changing behavior "while you're here"41- Removing abstractions that enable testing or extension without evidence4243## Verification4445- Same inputs → same outputs46- No new linter/type errors47- Diff stays reviewable (< ~300 lines unless agreed)4849## Related skills5051- `design-smell-review` — before deciding what to simplify52- `test-first-development` — lock behavior before deleting code53- `verify-before-done` — evidence before claiming complete5455*Adapted from [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills) (MIT).*
Run npx skillmds@latest add charlieviettq/code-simplification-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Code Simplification It is listed under Productivity on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
charlieviettq (@charlieviettq) published this skill. Their other Agent Skills are listed on their SkillMD profile.