refactor

Automate safe code refactoring with GitHub Issues and pull requests.

11|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/pillip/claude-dev-kit --skill refactor-pillip
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/pillip/claude-dev-kit/tree/main/skills/refactor
Command: npx skills add https://github.com/pillip/claude-dev-kit --skill refactor-pillip

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates safe, non-destructive code refactoring by guiding the process, tracking changes, and ensuring behavior remains unchanged.

Core Features & Use Cases

  • Structured, non-destructive refactoring: identify code smells, extract methods, and improve organization without altering outcomes.
  • Automated governance: automatically generate a GitHub Issue and PR with a summary of changes, tests, and rationale.
  • Sprint-friendly workflow: uses worktrees, freeze markers, and checkpoint-driven steps to enable safe experimentation and rollback.

Quick Start

Provide the path to the file or module you want refactored and the kit will set up a dedicated worktree, propose changes, and open a GitHub Issue and PR.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I safely refactor code without changing runtime behavior?

Automated refactoring isolates structural improvements in a dedicated git worktree, using checkpoints to ensure changes remain non-destructive and runtime behavior stays completely unchanged throughout the process.

Can I automatically create a GitHub pull request after refactoring a module?

You can automatically create a GitHub pull request after refactoring a module. The workflow coordinates code analysis and changes, then auto-generates a GitHub PR complete with a summary of modifications, tests, and rationale.

What do I need to set up before automating a code refactoring workflow?

Before automating a code refactoring workflow, you need GitHub authentication, a configured repository, and support scripts for managing git worktrees, checkpoints, and pull request creation to ensure safe experimentation and rollback.

How do git worktrees help with sprint-friendly code structure improvements?

Git worktrees enable sprint-friendly code structure improvements by providing an isolated environment for targeted refactoring. They support freeze markers and checkpoint-driven steps to enable safe experimentation and easy rollback.

How do I extract methods and fix code smells without breaking my project?

You can extract methods and fix code smells without breaking your project by applying structured, non-destructive refactoring. This approach identifies code smells and improves organization while automatically verifying outcomes remain unchanged.