cf-refactor

Detect code smells in branch changes and apply Fowler-style refactorings.

2|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/fimmtiu/code-factory --skill cf-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cf-refactor
Source: https://github.com/fimmtiu/code-factory/tree/main/skills/cf-refactor
Command: npx skills add https://github.com/fimmtiu/code-factory --skill cf-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Aggressively refactors code on the current branch to identify and remove code smells using Martin Fowler-style techniques, automating the cleanup of evolving codebases.

Core Features & Use Cases

  • Aggressive detection of code smells on branch changes and application of Fowler-inspired refactorings.
  • Scoped workflow that supports reviewing changes, planning, and validating improvements across multiple files.
  • Generates a commit-ready summary and can verify build and lint steps to ensure maintainability.

Quick Start

Trigger the refactor loop by issuing /cf-refactor in Claude on your feature branch and follow the prompts to review and apply changes.

Frequently Asked Questions about cf-refactor

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

FAQPage Schema
How do I automatically detect and refactor code smells on a git feature branch?

You can automatically detect and refactor code smells by scanning branch changes and applying Fowler-style transformations to remove them across multiple files. The workflow discovers changes, detects smells from a 23-smell catalog, and applies staged refactoring.

What is Martin Fowler style code smell removal and when should I use it?

Martin Fowler style code smell removal identifies structural issues in evolving codebases and applies targeted refactoring transformations to improve maintainability. Use it when your feature branch accumulates technical debt and needs automated cleanup before merging.

Can I scope automated refactoring to only uncommitted changes instead of the whole branch?

Yes, you can scope automated refactoring using configurable options including all, branch, or uncommitted changes. This allows you to target specific subsets of your work and limit transformations to the exact changes you want to clean up.

Does the git refactoring workflow verify build and lint steps after applying changes?

Yes, the git refactoring workflow includes optional build and lint verification after applying transformations. It performs detection, transformation, and reporting, ensuring your refactored code maintains build integrity and passes linting checks.

What's the best way to review staged refactoring changes before committing them to my branch?

The best way to review staged refactoring changes is to use the workflow's built-in reporting and commit-ready summary generation. It stages changes across multiple files and produces a summary so you can validate improvements before committing.