Command Palette

Search for a command to run...

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

polish-code

БесплатноЗапускает вложенные скриптыНе проверен

Stage, format, lint, test, review, smoke test, and re-run until stable. Use when the user asks to "polish code", "refine code", "iterate on code quality"…

tobihagemannот tobihagemann★ 428 звёзд на GitHub

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

Polish Code

Open or continue this chat’s workflow checkpoint.

Task Tracking

At the start of every invocation (including re-runs from Step 7), use update_plan to track each step, restating any remaining steps of a parent workflow alongside them:

  1. Run $stage skill
  2. Run $run-checks skill
  3. Run $review-code skill
  4. Run $evaluate-findings skill
  5. Run $apply-findings skill
  6. Run $smoke-test skill
  7. Re-run $polish-code skill if changed

Loop State

Resolve the absolute path of this skill's directory, the directory of the SKILL.md loaded for this run, and use it as <this skill's directory> below.

Loop state lives in a ledger at .turbo/loops/polish-code-<label>-<tag>.md. The label is the governing plan's slug when one is in context, otherwise the current branch name with non-alphanumerics replaced by hyphens. The tag is the output of head -c 4 /dev/urandom | xxd -p, minted once when the loop starts. The ledger records Branch: (the unmodified branch name, or (detached)), Plan: when a plan governs, a one-line purpose, and per iteration its verdicts and Step 7's classification. A ledger that exists belongs to an active loop.

At the start of every invocation, before $stage runs in Step 1, resolve the ledger:

  • Carried path: this invocation was handed a ledger path, by the re-run Step 7 starts, or by a Loop ledger: line for this loop and scope in the active checkpoint. Continue that ledger. A carried path whose file no longer exists falls through to discovery.
  • Discovery: with nothing carried, list the untracked ledgers in .turbo/loops/ whose name starts with polish-code- and whose Branch: is the current branch. Also list every untracked polish-code- ledger there that holds a Pending smoke-test baseline, on any branch. Show each one's purpose, last classified iteration, and file modification time. For a pending baseline, add its differing paths, found by items 1-3 of the pending-baseline reconciliation. When any are listed, use request_user_input to offer resuming a ledger, discarding a ledger, or starting fresh, naming the ledger in each resume and discard option; when more ledgers are listed than options fit, first ask which ledger to act on, offering the most recently modified ones and leaving the rest to the free-text answer. Starting fresh mints a new path and deletes nothing. Delete a ledger named for discarding once any pending baseline in it is reconciled, then run discovery again. Reconciling a pending baseline right after discovery reuses the capture and differences discovery produced. When request_user_input cannot reach the user, start fresh and delete nothing; when a listed ledger holds a pending baseline, halt instead and report its differing paths, so Step 1 does not stage what the interrupted sub-agent left behind.
  • Fresh: mint a new path and write the ledger.

Record Loop ledger: <absolute ledger path> in the workflow checkpoint. On recovery, honor the recorded verdicts and resume the interrupted step of the current iteration.

When continuing a ledger, resume an unfinished iteration at its next action. If the last iteration records a stop, finish reporting it and close the ledger. If it calls for a re-run, start the next iteration. Use the most recent $review-code diff command the ledger records, when it records one, in place of Step 3's default.

Pending smoke-test baseline. This entry means an iteration was interrupted between delegating the smoke test and verifying the tree. Reconcile it before Step 1 whenever a resumed or discarded ledger holds one, so Step 1 does not stage what the interrupted sub-agent left behind. The entry holds a state from <this skill's directory>/scripts/checkout-snapshot.sh:

  1. Run checkout-snapshot.sh check with that state. When it prints LOST, git gc has pruned the snapshot; when it prints INVALID, the state names a HEAD ref outside the local branches or paths git never checks out. Either way, report it, write nothing, and clear the entry.
  2. Run checkout-snapshot.sh capture for the current state.
  3. List what differs between the two: the paths git diff --name-only --no-renames reports between their index trees and between their raw trees, and any difference in REF or COMMIT.
  4. When nothing differs, clear the entry and continue.
  5. Otherwise output the differences, then use request_user_input to offer restoring the pending baseline or keeping the current state. Restoring runs checkout-snapshot.sh restore with the pending state; record the UNDO line and any MOVED lines it prints in the ledger as Post-run state, as Step 6 does. Then run verify and handle its result as Step 6's tree verification does. Keeping clears the entry. When the user cannot be reached, halt with the ledger in place and report the differing paths.

During each iteration: have the ledger path in context when Steps 3 and 4 run so recorded ver

Полный SKILL.md на GitHub

Установить polish-code в Claude Code и Claude Desktop

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

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

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

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

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

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

Вложенные файлы

scripts/checkout-snapshot.sh

FAQ

Что делает скилл polish-code?

Stage, format, lint, test, review, smoke test, and re-run until stable. Use when the user asks to "polish code", "refine code", "iterate on code quality", "review loop", or "run the polish loop".

Как установить скилл polish-code?

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

Скилл polish-code запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить polish-code с