---
name: code-simplification-0ed35d2f4d6e
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)


---
Source attribution: charlieviettq
Original project: https://github.com/charlieviettq/awesome-agent-skill/blob/c567ae426d55fa498e919fc0f5a37c582d5c7a2c/.claude/skills/code-simplification/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2026 charlieviettq

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: charlieviettq
Original project: https://github.com/charlieviettq/awesome-agent-skill/blob/c567ae426d55fa498e919fc0f5a37c582d5c7a2c/.claude/skills/code-simplification/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Frontend Developer, Backend Developer, Full-Stack Developer, QA / Test Engineer, DevOps / SRE
Specialties: Cross Platform
Tools: Read, Glob, Grep
Country applicability: Country not specified
Classification basis: Source category, role and specialization labels
Instruction SHA-256: 984a68f64fb71da58b4b02da02890c088f8a57b87d42ba04401426a71b9b6249
