Simplify code for clarity and maintainability — reduce complexity without changing behavior
Sign in to save downloads to your library and vote.
Preview
Metadata (frontmatter)
description: Simplify code for clarity and maintainability — reduce complexity without changing behavior
Invoke the agent-skills:code-simplification skill.
Simplify recently changed code (or the specified scope) while preserving exact behavior:
- Read CLAUDE.md 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 code-review-and-quality to review the result.
Ingestion metadata
- Source catalog
- agent-skills
- Repository
- addyosmani/agent-skills · main
- File path
- .claude/commands/code-simplify.md
- Last refreshed
- 10/24/2026, 3:00:12 AM (5h ago)
- Refresh schedule
- Daily · 03:00 UTC
- Dedupe status
- Unique · deduped by (source, url)