simplify-complex-code

Community

Refactor complex code, boost maintainability.

Authorfoolishimp
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Highly complex functions are difficult to understand, test, and maintain, leading to bugs and violating the "Modular & Maintainable" principle. This skill automates simplification.

Core Features & Use Cases

  • Automated Refactoring: Applies proven techniques like "Extract Functions" and "Early Returns" to reduce cyclomatic complexity and nesting.
  • Safety-First Approach: Runs tests after each refactoring step, with automatic rollback on failure, ensuring code remains functional.
  • Targeted Simplification: Addresses functions with high cyclomatic complexity, deep nesting, and excessive length.
  • Use Case: If detect-complexity flags a login() function with a complexity of 18, this skill can automatically refactor it by extracting helper functions, reducing its complexity to a manageable level (e.g., 6).

Quick Start

Simplify the complex 'login()' function in 'auth_service.py' by extracting helper functions, ensuring all tests pass.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: simplify-complex-code
Download link: https://github.com/foolishimp/ai_sdlc_method/archive/main.zip#simplify-complex-code

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository