mcpField
R
refactor

refactor

github.com/owainlewisDevelopment425362 installsUpdated 4d ago
Repository

About refactor

A skill for making small, behavior-preserving code refactors. It helps developers and agents simplify or deduplicate targeted code while protecting public interfaces and user-visible behavior, then run relevant checks and report the outcome.

Key features

  1. 01Identify a target from arguments or recent changes
  2. 02Review code, tests, and behavior constraints
  3. 03Make focused behavior-preserving edits
  4. 04Avoid unrelated feature work
  5. 05Run checks and report what changed

Use cases

  1. 01Remove duplication in recently changed code
  2. 02Simplify a targeted implementation
  3. 03Refactor shared code while preserving behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/owainlewis/blueprint --skill refactor

After installing, type/refactorin Claude Code to confirm it loaded.

Details

From the project README

Refactor

  1. Identify the target from $ARGUMENTS, the current diff, latest commit, or recently touched files.
  2. Read the code and tests. Understand what behavior must not change. For risky refactors, run focused tests first.
  3. Make small behavior-preserving edits: delete, deduplicate, rename, simplify, extract or inline.
  4. Don't change public interfaces, data shapes, errors, or user-visible output unless the user asks.
  5. Run relevant checks, wider ones when shared behavior was touched.
  6. Report what changed, what stayed the same, and checks run.

Rules

  • Refactoring is not feature work. Don't expand into unrelated cleanup.
  • Don't change behavior to make the refactor easier.
  • Keep an abstraction only when it reduces complexity or duplication.

Comments

Markdown supported