Imported from LL782/laurence-lord (
.cursor/skills/code-simplify/SKILL.md). Install upstream withnpx skills add LL782/laurence-lord --skill code-simplify. Copyright stays with the author.
/code-simplify
Read and follow .cursor/skills/code-simplification/SKILL.md.
Simplify recently changed code (or the specified scope) while preserving exact behavior:
- Read project rules and study project conventions
- Identify the target code — recent changes unless a broader scope is specified
- Understand the code's purpose, callers, edge cases, and test coverage before touching it
- Scan for simplification opportunities:
- Deep nesting → guard clauses or extracted helpers
- Long functions → split by responsibility
- Nested ternaries → if/else or switch
- Generic names → descriptive names
- Duplicated logic → shared functions
- Dead code → remove after confirming
- Apply each simplification incrementally — run tests after each change
- Verify all tests pass, the build succeeds, and the diff is clean
If tests fail after a simplification, revert that change and reconsider. Use .cursor/skills/code-review-and-quality/SKILL.md to review the result.