clean-code
Installation
SKILL.md
Clean Code
Use this skill to make a targeted codebase easier to understand, test, and maintain without introducing unrelated rewrites.
Scope
- Remove unused imports, variables, parameters, unreachable branches, commented-out code, obsolete helpers, and duplicate constants.
- Find and reuse existing helpers, validation, formatting, mapping, and shared abstractions before adding equivalents.
- Replace deep nesting and long conditional trees with guard clauses, early returns, and small single-purpose functions.
- Improve data flow with descriptive names, clear signatures, typed structures where available, and minimal parameters.
- Review module boundaries so responsibilities are cohesive and cross-cutting concerns are shared deliberately.
Workflow
- Inspect the requested area and search the workspace for existing utilities and equivalent logic.
- Identify behavior-preserving cleanup opportunities; prioritize correctness and security over maintainability, performance, and style.
- Make focused changes only. Avoid speculative rewrites and architectural churn without a concrete benefit.
- Run the repository's relevant formatter, linter, type checks, and tests. Use the code-verification skill when a fuller verification pass is needed.
- Confirm that behavior is preserved, dead code is gone, control flow is clearer, duplication is reduced, and the result remains testable.