Code Refactoring Patterns

Community

Refactor code with clarity and confidence.

Authorrandalmurphal
Version1.0.0
Installs0

System Documentation

What problem does it solve?

When and how to refactor complex functions including complexity thresholds (50+ statements, 12+ branches), extraction patterns, guard clauses, and testing strategies. Use when ruff/pylint complexity warnings appear or code becomes hard to maintain.

Core Features & Use Cases

  • Extraction & Guard Clauses: Break apart large functions with focused helpers.
  • Guard Clauses: Reduce nesting for readability.
  • Metadata Extraction: Improve testability and reuse.

Quick Start

Start by identifying a large function, extract a helper, and add guard clauses to reduce nesting.

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: Code Refactoring Patterns
Download link: https://github.com/randalmurphal/claude-config/archive/main.zip#code-refactoring-patterns

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