SP

speckit-refactor

Automates the generation of refactoring specs, tracks metrics, and ensures behavioral preservation.

Install

mkdir -p .claude/skills/speckit-refactor && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10773" && unzip -o skill.zip -d .claude/skills/speckit-refactor && rm skill.zip

Installs to .claude/skills/speckit-refactor

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Create a refactoring workflow with metrics tracking and behavior preservation
77 charsno explicit “when” trigger
Advanced

Key capabilities

  • Generate unique refactor IDs and branch names
  • Identify testing gaps in code to be modified
  • Document behavioral snapshots for preservation
  • Initialize refactoring spec files from templates
  • Capture baseline metrics for refactoring

How it works

The skill executes a bash script to generate refactoring metadata and then populates a standardized markdown template. It enforces a test-first approach by requiring a gap assessment before baseline metrics are trusted.

Inputs & outputs

You give it
Refactoring description
You get back
Refactor spec file and testing gap assessment

When to use speckit-refactor

  • Create refactoring workflow
  • Track metrics for refactoring
  • Document code improvements

About speckit-refactor

Generates refactor IDs, identifies testing gaps, and uses standardized templates to document the motivation and approach for code refactoring.

Create a refactoring workflow with metrics tracking and behavior preservation

When not to use it

  • When existing tests do not pass
  • When the refactoring description is empty

Prerequisites

spec-kit project structure.specify/ directory

Limitations

  • Script must only be run once per refactor
  • Baseline metrics are only trusted after testing gaps are addressed

How it compares

It automates the documentation and metric tracking process rather than relying on manual notes and ad-hoc planning.

Compared to similar skills

speckit-refactor side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
speckit-refactor (this skill)04moNo flagsAdvanced
qlty-check57moReviewBeginner
solid56moNo flagsAdvanced
code-refactor37moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry