refactor-method-complexity-reduce

Community

Simplify complex code with helper methods.

AuthorGabeujin
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the challenge of overly complex methods that are difficult to read, understand, and maintain by automatically refactoring them to reduce cognitive complexity.

Core Features & Use Cases

  • Cognitive Complexity Reduction: Analyzes methods and extracts logic into smaller, focused helper methods to meet a specified complexity threshold.
  • Improved Readability: Makes code easier to follow by breaking down long, convoluted functions.
  • Use Case: Refactor a deeply nested process_order method with multiple conditional branches into a series of smaller, well-named helper methods like validate_order_items, calculate_shipping_cost, and apply_discounts.

Quick Start

Refactor the method calculate_total_price to reduce its cognitive complexity to 10 or below.

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: refactor-method-complexity-reduce
Download link: https://github.com/Gabeujin/workspace-init-mcp/archive/main.zip#refactor-method-complexity-reduce

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

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.