polish

A command that applies six existing code-quality checks to the current Git changes. It reviews and, where allowed, simplifies code, reduces nesting, removes unreachable code, checks accessibility, handles loading and error states, and audits the README.

In plain words
What is it for?
Use it after making changes in a Git working tree. It is intended for reviewing only the current diff and does not add new features.
Why use it?
It gives developers one repeatable review pass for unfinished changes. This can catch readability, accessibility, interface-state, dead-code, and documentation issues before the work is complete.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/archive228/loopkit/polish
Clone the repo
git clone --depth 1 https://github.com/Archive228/loopkit

Made for: Claude Code.

Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 712 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.00712
Opus 5 $0.00018 $0.00356
Sonnet 5 $0.00007 $0.00142
Haiku 4.5 $0.00004 $0.00071

Measured yesterday against content hash 4d1e52e7b3c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

polish scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/polish.md · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/polish — one-shot quality pass over the current diff

Apply six existing quality skills to the changes already in the working tree, in a fixed order, with a single summary at the end. No new features. No behavior changes beyond what each skill authorises.

Scope

This command applies to the CURRENT git diff only. Run git diff first if you're unsure of scope. If the working tree is clean, stop and tell the user there is nothing to polish.

Steps

  1. Load the diff: git diff HEAD and git status --short. Fix on this set of changed files for the whole session; do not wander into untouched code.

  2. Apply each skill below in order. For each: read the skill file from skills/<name>/SKILL.md (repo layout) or .claude/skills/<name>/SKILL.md (installed layout), walk its checklist against the diff, and apply the fixes it authorises. If the skill does not apply to this diff (e.g. a11y-pass on a backend-only change), record skipped with a one-line reason and move on.

    1. simplify — collapse indirection you don't need.
    2. reduce-nesting — early returns, guard clauses.
    3. kill-dead-code — prove unreachable, then delete.
    4. a11y-pass — semantics + keyboard + contrast (UI diffs only).
    5. loading-empty-error-states — all four states, not just happy path (async views only).
    6. readme-audit — cold-onboarding check (only if README or public interface changed).
  3. Emit exactly ONE summary at the end, as a table:

    | skill                      | action_taken                          | verdict           |
    |----------------------------|---------------------------------------|-------------------|
    | simplify                   | <one line>                            | applied / skipped |
    | reduce-nesting             | <one line>                            | applied / skipped |
    | kill-dead-code             | <one line>                            | applied / skipped |
    | a11y-pass                  | <one line>                            | applied / skipped |
    | loading-empty-error-states | <one line>                            | applied / skipped |
    | readme-audit               | <one line>                            | applied / skipped |
    

Read the full file on GitHub · 50 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 50 lines · 37 tokens per session scan A 4d1e52e7b3c6

Subscribe to this mod's changes

polish is a command published in the GitHub repository Archive228/loopkit (753 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 712 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.