code-simplifier

Use this skill after writing or modifying code to simplify it — reduces complexity, eliminates redundancy, and improves naming while preserving exact behavior. Trigger after implementing a feature, after a refactor, or when asked to "clean up this code", "simplify this", "make this more readable", or "reduce complexity". Also use when code feels too nested, verbose, or hard to follow. For removing dead code and unused dependencies with detection tools (knip, ts-prune, deadcode), use refactor-cleaner instead.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "code-simplifier" with this command: npx skills add carvalab/k-skills/carvalab-k-skills-code-simplifier

Code Simplifier

Enhance code clarity, consistency, and maintainability while preserving exact functionality. Apply project-specific best practices without altering behavior. Prioritize readable, explicit code over compact solutions.

Related Skills:

  • kavak-documentation - Query for Kavak coding standards and patterns before simplifying
  • Use kavak-platform/platform_docs_search MCP tool to verify Kavak-specific idioms

Workflow

1. Discover Project Standards

Locate project configuration files (in priority order):

  1. .claude/CLAUDE.md, CLAUDE.md (root)
  2. .cursor/rules/*.md, .cursor/rules/*.mdc, .cursorrules
  3. AGENTS.md, .github/copilot-instructions.md
  4. .editorconfig, .prettierrc, .eslintrc.*

Extract coding standards and patterns. If none exist, apply general best practices.

2. Identify Target Code

  • Default: Recently modified files (git diff, git status)
  • Explicit: Files or directories specified by user
  • Broad: When instructed to review entire modules

3. Apply Refinements

Preserve Functionality

  • Never change what the code does, only how
  • Run existing tests to verify no regressions

Apply Project Standards

  • Follow discovered conventions
  • Match existing code style
  • Respect established patterns

Enhance Clarity

  • Reduce complexity and nesting
  • Eliminate redundant code
  • Use clear variable/function names
  • Avoid nested ternaries - use switch or if/else
  • Choose clarity over brevity

Maintain Balance

  • Don't create overly clever solutions
  • Don't combine too many concerns
  • Don't remove helpful abstractions
  • Three similar lines > premature abstraction

4. Verify

  1. Functionality unchanged
  2. Code is simpler and maintainable
  3. Run linters/formatters if configured

Guidelines

  • Operate autonomously after code is written/modified
  • Don't add features or make "improvements" beyond simplification
  • Don't add docstrings/comments to unchanged code
  • Trust internal code and framework guarantees

References

ReferencePurpose
references/patterns.mdCommon simplification patterns
references/anti-patterns.mdCode smells to refactor
references/examples.mdBefore/after examples

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

code-review

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

frontend-development

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

backend-development

No summary provided by upstream source.

Repository SourceNeeds Review