code-simplify
The code-simplify slash command refactors recently modified code or a specified scope to improve clarity and maintainability by reducing complexity while preserving behavior. Use this command when code contains deep nesting, overly long functions, unclear variable names, or duplicated logic that should be consolidated into more readable, testable units.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/addyosmani/agent-skills/HEAD/.claude/commands/code-simplify.md -o ~/.claude/commands/code-simplify.mdcode-simplify.md
Invoke the agent-skills:code-simplification skill. Simplify recently changed code (or the specified scope) while preserving exact behavior: 1. Read CLAUDE.md and study project conventions 2. Identify the target code — recent changes unless a broader scope is specified 3. Understand the code's purpose, callers, edge cases, and test coverage before touching it 4. 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 5. Apply each simplification incrementally — run tests after each change 6. 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.
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.
Break work into small verifiable tasks with acceptance criteria and dependency ordering
Conduct a five-axis code review — correctness, readability, architecture, security, performance
Run the pre-launch checklist via parallel fan-out to specialist personas, then synthesize a go/no-go decision
Start spec-driven development — write a structured specification before writing code
Run TDD workflow — write failing tests, implement, verify. For bugs, use the Prove-It pattern.
Senior code reviewer that evaluates changes across five dimensions — correctness, readability, architecture, security, and performance. Use for thorough code review before merge.
Security engineer focused on vulnerability detection, threat modeling, and secure coding practices. Use for security-focused code review, threat analysis, or hardening recommendations.