mcpField
R
refactor-code

refactor-code

github.com/cowork-osDevelopment51851 installsUpdated today
Repository

About refactor-code

A skill for restructuring code to improve maintainability, readability, modularity, or error handling while preserving behavior. It provides refactoring changes, rationale, and a brief review checklist.

Key features

  1. 01Improve code structure and readability
  2. 02Focus on maintainability or modularity
  3. 03Preserve existing behavior
  4. 04Provide rationale and review checklist

Use cases

  1. 01Refactoring code that is difficult to maintain
  2. 02Improving modularity or error handling without changing behavior

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/cowork-os/cowork-os --skill refactor-code

After installing, type/refactor-codein Claude Code to confirm it loaded.

Details

From the project README

Refactor Code

Purpose

Improve code structure and readability

Routing

  • Use when: Use when user asks to improve maintainability, readability, modularity, or error handling in code.
  • Do not use when: Don't use for behavior-only fixes where refactor risk is unnecessary.
  • Outputs: Refactor changes, rationale, and minimal review checklist for behavior-sensitive sections.
  • Success criteria: Preserves behavior while improving structure and readability.

Trigger Examples

Positive
  • Use the refactor-code skill for this request.
  • Help me with refactor code.
  • Use when user asks to improve maintainability, readability, modularity, or error handling in code.
  • Refactor Code: provide an actionable result.
Negative
  • Don't use for behavior-only fixes where refactor risk is unnecessary.
  • Do not use refactor-code for unrelated requests.
  • This request is outside refactor code scope.
  • This is conceptual discussion only; no tool workflow is needed.

Parameters

NameTypeRequiredDescription
pathstringYesPath to the file to refactor
focusselectYesWhat to focus on

Runtime Prompt

  • Current runtime prompt length: 235 characters.
  • Runtime prompt is defined directly in ../refactor-code.json.

Comments

Markdown supported