refactor — for Claude Code refactor, psc-comet, community, for Claude Code, ide skills, Behavior-preserving, restructuring, different, structure, produces

v0.1.0

Об этом навыке

Подходящий сценарий: Ideal for AI agents that need behavior-preserving restructuring. the goal is a different structure that produces identical. Локализованное описание: # Refactor Skill Behavior-preserving restructuring. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Возможности

Behavior-preserving restructuring. The goal is a different structure that produces identical
What Claude Gets Wrong Without This Skill
The Behavior Contract
The One-Change Rule
One structural change at a time:

# Core Topics

andrem-sec andrem-sec
[1]
[0]
Updated: 4/2/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for operators, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
8/11
Quality Score
44
Canonical Locale
en
Detected Body Locale
en

Подходящий сценарий: Ideal for AI agents that need behavior-preserving restructuring. the goal is a different structure that produces identical. Локализованное описание: # Refactor Skill Behavior-preserving restructuring. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

Зачем использовать этот навык

Рекомендация: refactor helps agents behavior-preserving restructuring. the goal is a different structure that produces identical. Refactor Skill Behavior-preserving restructuring. This AI agent skill supports Claude

Подходит лучше всего

Подходящий сценарий: Ideal for AI agents that need behavior-preserving restructuring. the goal is a different structure that produces identical.

Реализуемые кейсы использования for refactor

Сценарий использования: Applying Behavior-preserving restructuring. The goal is a different structure that produces identical
Сценарий использования: Applying What Claude Gets Wrong Without This Skill
Сценарий использования: Applying The Behavior Contract

! Безопасность и ограничения

  • Ограничение: Do not batch. Do not "while I'm in here" add improvements. Do not rename AND restructure in one change.
  • Ограничение: Remove duplication Same logic in 3+ places — but only if the logic is genuinely identical, not just similar
  • Ограничение: Do not refactor code you do not understand. Read it until you can state its behavior contract before touching it.

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

After The Review

Decide The Next Action Before You Keep Reading Repository Material

Killer-Skills should not stop at opening repository instructions. It should help you decide whether to install this skill, when to cross-check against trusted collections, and when to move into workflow rollout.

Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is refactor?

Подходящий сценарий: Ideal for AI agents that need behavior-preserving restructuring. the goal is a different structure that produces identical. Локализованное описание: # Refactor Skill Behavior-preserving restructuring. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

How do I install refactor?

Run the command: npx killer-skills add andrem-sec/psc-comet/refactor. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for refactor?

Key use cases include: Сценарий использования: Applying Behavior-preserving restructuring. The goal is a different structure that produces identical, Сценарий использования: Applying What Claude Gets Wrong Without This Skill, Сценарий использования: Applying The Behavior Contract.

Which IDEs are compatible with refactor?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for refactor?

Ограничение: Do not batch. Do not "while I'm in here" add improvements. Do not rename AND restructure in one change.. Ограничение: Remove duplication Same logic in 3+ places — but only if the logic is genuinely identical, not just similar. Ограничение: Do not refactor code you do not understand. Read it until you can state its behavior contract before touching it..

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add andrem-sec/psc-comet/refactor. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use refactor immediately in the current project.

! Reference-Only Mode

This page remains useful for installation and reference, but Killer-Skills no longer treats it as a primary indexable landing page. Read the review above before relying on the upstream repository instructions.

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

refactor

# Refactor Skill Behavior-preserving restructuring. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows. Behavior-preserving

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Refactor Skill

Behavior-preserving restructuring. The goal is a different structure that produces identical observable behavior.

What Claude Gets Wrong Without This Skill

Without refactor discipline, "refactoring" becomes a mix of restructuring, behavior changes, and new features in one pass. When something breaks, there is no way to know which change caused it. Tests that fail mid-refactor mean the scope was too large, but without the discipline to go one change at a time, the error is impossible to isolate.

The Behavior Contract

Before touching any code, state what it currently does in terms of observable behavior — inputs, outputs, side effects. This is the contract.

If the refactor changes any of these, it is not a refactor — it is a feature change or a bug fix. Handle those separately.

The One-Change Rule

One structural change at a time:

  • Extract a function
  • Rename a variable
  • Remove duplication
  • Flatten nesting
  • Extract a class
  • Move a module

Run tests after each. If they pass, continue. If they fail, the change broke something — revert it and understand why before proceeding.

Do not batch. Do not "while I'm in here" add improvements. Do not rename AND restructure in one change.

The Coverage Gate

Refactoring without tests is rearranging furniture in the dark. Before the first structural change:

  • Run the test suite
  • Check coverage
  • If coverage is below 80% on the code being refactored, stop and write tests first

This is not optional. Skipping it means the refactor cannot be verified.

Common Refactor Operations

OperationWhen to Use
Extract functionBlock of code used in 2+ places, or a block that has a single clear responsibility
RenameName does not reflect current purpose (this happens after behavior is understood, not before)
Remove duplicationSame logic in 3+ places — but only if the logic is genuinely identical, not just similar
Flatten nestingMore than 3 levels of nesting in a single function
Extract classA function or module has grown to handle 2+ distinct concerns
InlineAn abstraction that adds complexity without clarity — sometimes the direct version is better

Anti-Patterns

Do not refactor code you do not understand. Read it until you can state its behavior contract before touching it.

Do not refactor and fix bugs in the same pass. Fix first, then refactor.

Do not refactor code with no tests. Write tests first.

Do not "improve" variable names speculatively — rename only when you understand the current name is wrong.

Mandatory Checklist

  1. Verify test coverage was checked before any changes
  2. Verify the behavior contract was stated before any structural changes
  3. Verify only one structural change was made per test run
  4. Verify no test failures occurred without a full stop and reassessment
  5. Verify the full test suite passes after all changes
  6. Verify coverage did not regress
  7. Verify the behavior contract is still satisfied after all changes

Связанные навыки

Looking for an alternative to refactor or another community skill for your workflow? Explore these related open-source skills.

Показать все

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

widget-generator

Logo of f
f

Создание настраиваемых плагинов виджетов для системы ленты новостей prompts.chat

flags

Logo of vercel
vercel

Фреймворк React

138.4k
0
Браузер

pr-review

Logo of pytorch
pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

98.6k
0
Разработчик