polish
Autonomous design + style pass over recently changed code — rewrites files and commits the result. Invoke only on an explicit polish request (/polish) or from…
от Positronic-Robotics★ 92 звезды на GitHub
Установить polish в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Polish: Autonomous Design Review + Style Rewriter
Make the changed code PR-ready without consuming the user's attention. You detect, you fix, you re-check, you commit, you report. The user reviews the resulting diff — not a list of questions.
Operating rules:
- Autonomous by default. Implement every finding, including multi-file refactors (merging classes, moving ownership, renaming + migrating). Do NOT present findings and wait.
- Ask only when (a) an action is irreversible beyond the working tree — dataset/data migrations, deleting files you didn't create whose purpose is unclear, anything touching remote state; or (b) two designs are defensible and externally visible — then ask with a recommendation. Everything else: decide, fix, report.
- Review code as a whole, never as a diff. The diff only tells you which files to look at. Read each touched file (and the immediate neighbors it interacts with) in its entirety and judge the resulting state. A patch that looks fine as a hunk can leave the file incoherent.
- Iterate to a fixed point. Fixes create new smells: unify two serializers and two classes become structural twins; delete a field and a helper goes dead; move ownership and a parameter loses its reason to exist. After each round of fixes, re-run detection on the resulting state of the touched code. Stop only when a round produces no findings.
- Sweep for siblings. Every time you fix an instance of a smell, search the rest of the changed code (and its neighborhood) for the same pattern before moving on.
- Commit the result. When the pass finishes clean, commit its changes following the repo's commit conventions (no AI attribution). The user reviews the result on GitHub and comments on anything they dislike.
Step 1: Scope
BASE=HEAD # uncommitted changes (staged + unstaged)
git diff $BASE --stat
If empty, set BASE=$(git merge-base HEAD main) (the branch diff), or BASE=HEAD~1 outside
a feature branch. If the user named files, restrict to those. $BASE is the scope for the
whole run — detection here and the lint in Step 6 must use the same one.
The output is a list of touched files. From here on, work with whole files: read each touched file fully, plus the modules it tightly interacts with (callers/callees of changed interfaces).
For large scopes (roughly >400 changed lines or >6 files), fan the detection out to parallel
subagents — one each for design integrity, duplication, comments/naming, and one per rule in
CODE_RULES.md — each returning a findings list with file:line and a one-line rationale. Apply
all fixes yourself.
Step 2: Design integrity
The expensive smells. Judge the resulting state of each touched module against these:
Invariants & ownership
- Half-committed invariant. The change has a design thesis ("X owns Y", "Z is name-free") but old pathways survive: a constructor still accepts what is now owned internally, a base class exposes a mutator only one orchestrator should call, a flag coexists with the parameter it replaced, a component still drives state that the thesis moved elsewhere. Enumerate the thesis's consequences for every touched interface and kill each leftover pathway.
- Two owners for one value. The same value threads through two layers (a config plumbs
task.timeoutinto a driver while the consumer also holds theTask). Move ownership to the right layer and delete the redundant path — don't feed the new source into the old parameter. - Silent bridge. A field, alias, or indirection added to avoid confronting a rename or
migration (a
record_namefield instead of renaming the signal and migrating data). Resolve it now, or keep the bridge with a loud HACK/TODO stating what resolves it. Never bridge silently with structure.
Structures that don't earn their place
- Concept reification. A class/file/field minted for a design-doc concept that existing structure already encodes (which dict an entry lives in, an enum, the calling context). Delete it; let the structure carry the distinction.
- Structural twins (run this check explicitly every round): compare the field lists of the dataclasses/classes in touched modules. Two that are identical — or one a strict subset of the other — get merged, even if they started the session with different signatures. This is the canonical emergent smell: it often appears only after another fix.
- Always-paired classes. Two classes always instantiated together and composed — one class.
- Parallel hierarchies. Two class trees mirroring each other 1:1, always composed — collapse.
- Dead composition points. An ABC method or config parameter with exactly one implementation/value codebase-wide is not an extension point.
- Post-construction mutation. A factory creates an object then pokes its attributes
(
result.meta['key'] = value) — the object s
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл polish?
Autonomous design + style pass over recently changed code — rewrites files and commits the result. Invoke only on an explicit polish request (/polish) or from the push-pr flow; NOT for read-only review or analysis asks, which must not modify the worktree. Reviews touched files as a whole (not diff hunks), fixes everything it finds including the named rules in CODE_RULES.md and refactors, iterates until clean, and reports — design changes first.
Как установить скилл polish?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл polish запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…