code-refactor

Plan and execute safe code refactors with a structured multi-agent approach.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/sirn/dotfiles --skill code-refactor-sirn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactor
Source: https://github.com/sirn/dotfiles/tree/main/var/agents/skills/code-refactor
Command: npx skills add https://github.com/sirn/dotfiles --skill code-refactor-sirn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactoring is risky and time-consuming; this skill provides a structured plan to safely refactor code with step-by-step guidance.

Core Features & Use Cases

  • Identify safe refactoring opportunities (function extraction, variable renaming, dead code removal, complexity reduction) and outline concrete steps.
  • Coordinate three specialized agents (code-architect, simplicity-reviewer, code-researcher) to generate a comprehensive refactoring plan.
  • Provide a step-by-step plan with file/line references, dependencies, and verification steps to ensure safe deployment.

Quick Start

Describe the codebase and target files to refactor, and I will generate a safe, step-by-step refactoring plan.

Frequently Asked Questions about code-refactor

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

FAQPage Schema
How do I plan a safe code refactor across multiple files?

Plan a safe code refactor by generating a structured, step-by-step plan with file and line references, dependency mapping, and verification steps to ensure safe deployment across multiple files.

What is the best way to reduce code complexity through function extraction?

The best way to reduce code complexity through function extraction is to identify safe refactoring opportunities and outline concrete steps using a coordinated, multi-agent approach to guide the restructuring.

Can I use this refactoring approach for dead code removal and variable renaming?

Yes, you can use this refactoring approach for dead code removal and variable renaming, as it identifies these specific safe refactoring opportunities and outlines concrete steps to execute them safely.

How does a multi-agent approach help with code maintenance and restructuring?

A multi-agent approach helps code maintenance by coordinating specialized agents to generate a comprehensive refactoring plan, ensuring targeted code restructuring is planned and verified for safe execution.

What do I need to provide to generate a step-by-step refactoring plan?

To generate a step-by-step refactoring plan, you need to provide a description of your codebase and the target files you want to refactor, which initiates the guided restructuring process.

When should I not use an automated step-by-step refactoring plan?

You should not use a structured refactoring plan when your codebase lacks adequate testing or verification steps, as safe deployment relies on dependency mapping and guided execution to mitigate refactoring risks.