refactor-code

Apply planned code improvements incrementally with test-driven validation.

Updated Mar 29, 2022
One-click install
npx skills add https://github.com/tangerine1202/cli-config --skill refactor-code-tangerine1202
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-code
Source: https://github.com/tangerine1202/cli-config/tree/main/claude/skills/refactor-code
Command: npx skills add https://github.com/tangerine1202/cli-config --skill refactor-code-tangerine1202

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Systematically applies code improvements based on analysis, ensuring changes preserve functionality while improving readability, maintainability, and performance.

Core Features & Use Cases

  • Incremental Refactoring: Applies improvements one focused change at a time with immediate verification.
  • Preserves Behavior: Changes are designed to keep external behavior unchanged.
  • Common Refactoring Patterns: Extract methods, replace magic numbers with constants, rename identifiers, and reduce nesting.
  • Test-driven Validation: Verifies changes with existing tests after each step.

Quick Start

Ensure an implementation_plan.md exists (produced by code-analysis or critic), then run refactor-code to apply the planned improvements. You can opt to refactor incrementally and verify after each change.