simplify-code

Reduces code complexity by removing dead code, flattening nesting, and eliminating unnecessary abstractions.

2|Updated May 30, 2026
One-click install
npx skills add https://github.com/virahitvin8/crafty-gis --skill simplify-code-virahitvin8
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simplify-code
Source: https://github.com/virahitvin8/crafty-gis/tree/main/GIT_STAR/.agent/skills/simplify-code
Command: npx skills add https://github.com/virahitvin8/crafty-gis --skill simplify-code-virahitvin8

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Over-engineered code with deep nesting, unused abstractions, and dead code is hard to read, test, and maintain. This Skill systematically identifies and removes unnecessary complexity while preserving existing behavior and passing tests. ## Core Features & Use Cases - Abstraction Removal: Detects wrapper classes, single-implementation interfaces, and one-strategy patterns that add indirection without value. - Dead Code Elimination: Removes unused imports, unreachable branches, commented-out code, and stale feature flags. - Nesting Flattening: Refactors deeply nested conditionals into early returns and functional pipelines. - Use Case: You inherit a legacy module with 5-level nested conditionals and a factory that only creates one type. Use this Skill to flatten the logic, inline the factory, and verify all tests still pass. ## Quick Start Simplify this over-engineered module by removing dead code and flattening the nested conditionals while keeping all tests passing.

Frequently Asked Questions about simplify-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I simplify deeply nested code?

Replace nested conditionals with early returns and guard clauses to reduce indentation levels. Combine this with array methods like filter and forEach to express logic declaratively, targeting three or fewer nesting levels.

How to remove dead code safely from a project?

Remove unused imports, unreachable branches, commented-out code, and stale feature flags first since these are the safest changes. Always run the existing test suite and build afterward to confirm behavior is preserved.

When should I not simplify code?

Avoid simplifying performance-critical hot paths, patterns required by frameworks, explicitly requested architectures, or abstractions preparing for known near-term growth. Ask the user before removing a pattern that may exist for a deliberate reason.

What are signs of over-engineered code?

Common signs include wrapper classes that only delegate, factories creating a single type, interfaces with one implementation, functions with more than four parameters, and custom caches for tiny datasets. These add cognitive load without delivering value.

Does simplifying code break existing tests?

It should not if done correctly. The simplification protocol requires running the full test suite and build after changes, and simplifying incrementally so any breakage is immediately isolated and reversible.