Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

refactor

БесплатноБез исполняемых скриптовНе проверен

Discover architectural friction and propose structural refactors with competing interface options. Focuses on deepening shallow modules, extracting grouped…

howellsот howells★ 25 звёзд на GitHub

Об этом скилле

`EnterPlanMode` and `ExitPlanMode` are banned. This skill is Arc's own structured process. Requires the full Arc bundle. Arc-owned paths (`agents/`, `references/`, `disciplines/`, `templates/`, `scripts/`, `rules/`, `skills/`) resolve from the plugin root — the directory containing `agents/` and `skills/`. Everything else is the user's repository. Before starting, read these references:
  1. references/architecture-patterns.md — import depth rules, boundary violations
  2. references/maintainability-review.md — strict god-file, duplication, and structural simplification bar
  3. references/complexity-optimization.md — safe optimization patterns and behavior-preservation checks

Also read, when present in the target project:

  • CONTEXT.md or the relevant context from CONTEXT-MAP.md
  • docs/adr/*.md or area-specific ADRs
  • the most recent docs/arc/audits/*-audit.md — prior classifications and dismissed findings

Load when relevant:

  • references/component-design.md — compound vs simple component patterns, when the candidate is a god-component and the split will produce a new component API.
  • references/index.md — the full reference catalogue, when the refactor needs background you can't name a file for.

Architectural Refactoring

Discover structural friction, propose deep-module refactors, and create project-local RFCs.

This workflow reviews existing code with the explicit goal of creating a refactoring plan or RFC.
  • If the primary issue is reusable UI component cataloguing, missed shared UI package usage, or design-system component extraction, say so and stop: that work is out of scope for /arc:refactor and belongs with the project's own design-system tooling.
  • If the primary issue is an overgrown component, script, module, or duplicated implementation logic, keep it in /arc:refactor.
  • If the primary issue is broad codebase health, security, performance, or test coverage, recommend /arc:audit.
  • If the user wants implementation, stop at a clear plan unless they explicitly ask to start implementing.
  • Do not create external tracker issues unless the user explicitly asks.

Architecture Language

Use these terms consistently:

  • Module — anything with an interface and an implementation: a function, class, package, app slice, or tier-spanning feature.
  • Interface — everything a caller must know to use the module correctly: types, invariants, ordering, error modes, config, and performance characteristics.
  • Implementation — the code inside a module.
  • Depth — leverage at the interface. A deep module gives callers a lot of behavior through a small interface; a shallow module exposes nearly as much complexity as it hides.
  • Seam — where an interface lives; a place behavior can be altered without editing in place. A module can carry internal seams — private to its implementation, exercised by its own tests — as well as the external seam its interface exposes. Never promote an internal seam into the public interface merely because a test wants to reach it; keep it behind the interface and test through the boundary instead.
  • Adapter — a concrete thing satisfying an interface at a seam.
  • Leverage — what callers get from depth.
  • Locality — what maintainers get from depth: change, bugs, knowledge, and verification concentrated in one place.

From John Ousterhout's A Philosophy of Software Design:

A deep module has a small interface hiding a large implementation. Deep modules are:

  • More testable (test at the boundary, not inside)
  • More navigable (fewer files to understand a concept)
  • More maintainable (changes stay internal)

A shallow module has an interface nearly as complex as its implementation. Shallow modules:

  • Force callers to understand implementation details
  • Create coupling between files that should be independent
  • Make testing harder (you test internals, not behaviour)

Apply the deletion test to suspected shallow modules: if deleting the module makes complexity vanish, it was pass-through indirection; if deleting it spreads complexity across callers, it was earning its keep.

Restraint

This workflow adds structure — extracting, deepening, creating packages. Its native failure mode is proposing structure for its own sake. Every candidate and every interface option must clear these gates before you propose it:

  • Does the new structure earn its name? Extracting a helper or module only pays off if it gives a concept a name a reader will reach for. An extraction that just relocates code without making either side easier to understand is churn — drop it.
  • Fewer files and fewer lines are not the goal; faster comprehension is. If a proposed split would be harder to follow than the original, or would scatter one concept across more files, it is over-decomposition. Reject it th
Полный SKILL.md на GitHub

Установить refactor в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл refactor?

Discover architectural friction and propose structural refactors with competing interface options. Focuses on deepening shallow modules, extracting grouped concerns into packages/modules, breaking up god files, reducing duplication, and improving testability. Use when asked to "improve the architecture", "find refactoring opportunities", "deepen modules", "consolidate coupling", "break up god components", "extract this into a package", "make this more testable", or "find architectural friction".

Как установить скилл refactor?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл refactor запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить refactor с