refactor
БесплатноБез исполняемых скриптовНе проверенDiscover architectural friction and propose structural refactors with competing interface options. Focuses on deepening shallow modules, extracting grouped…
от howells★ 25 звёзд на GitHubОб этом скилле
references/architecture-patterns.md— import depth rules, boundary violationsreferences/maintainability-review.md— strict god-file, duplication, and structural simplification barreferences/complexity-optimization.md— safe optimization patterns and behavior-preservation checks
Also read, when present in the target project:
CONTEXT.mdor the relevant context fromCONTEXT-MAP.mddocs/adr/*.mdor 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.
- 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:refactorand 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
Установить 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic