Skip to content

/code-simplify

Simplify code for clarity and maintainability — reduce complexity without changing behavior

From plugin
addyosmani-agent-skills
94k9 skills4 agents9 commands1 hook
Install
> /plugin marketplace add addyosmani/agent-skills
> /plugin install agent-skills@addy-agent-skills

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/code-simplify

Context preview

What this command does when you run it.

Simplify code for clarity and maintainability — reduce complexity without changing behavior

Command definition

code-simplify.md
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:

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.

Ships withaddyosmani-agent-skills

Production-grade engineering skills for AI coding agents. Skills encode the workflows, quality gates, and best practices that senior engineers use when building software.

Get the whole plugin, auto-invoked

Other commands on addyosmani-agent-skills.