polish-code

polish-code is a skill for Claude Code, Codex from tobihagemann/turbo. It costs 67 tokens per session (2,369 once invoked), scanned A, original, MIT.

A repeatable code-cleanup process that stages changes, formats and checks code, runs tests, reviews findings, and repeats after changes until the project is stable.

In plain words
What is it for?
Use it to clean up a codebase, review changes, run the project's checks, and perform a final smoke test—a quick check that the main behavior still works.
Why use it?
It reduces the manual work of running many quality checks and helps catch problems introduced while fixing earlier findings.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents; names the AskUserQuestion tool.

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 skills/tobihagemann/turbo/polish-code
Any agent
npx skills add tobihagemann/turbo --skill polish-code
Clone the repo
git clone --depth 1 https://github.com/tobihagemann/turbo

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for polish-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/tobihagemann/turbo/polish-code.svg)](https://agentmods.dev/skills/tobihagemann/turbo/polish-code)
Your own site
<a href="https://agentmods.dev/skills/tobihagemann/turbo/polish-code"><img src="https://agentmods.dev/badge/skills/tobihagemann/turbo/polish-code.svg" alt="Measured on agentmods" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,369 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.1 $0.00067 $0.02369
Opus 5 $0.00034 $0.01184
Sonnet 5 $0.00013 $0.00474
Haiku 4.5 $0.00007 $0.00237

Measured yesterday against content hash 41c9cdff3294, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

polish-code 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/skills/polish-code/SKILL.md · 108 lines

How it starts

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

Polish Code

Task Tracking

At the start of every invocation (including re-runs from Step 7), use TaskCreate to create a task for each step:

  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

Step 1: Run /stage Skill

Run the /stage skill.

Step 2: Run /run-checks Skill

Run the /run-checks skill.

Stage all changes made in this step before continuing.

Step 3: Run /review-code Skill

Run the /review-code skill on the staged changes. The diff command is git diff --cached.

Step 4: Run /evaluate-findings Skill

Run the /evaluate-findings skill on the results from Step 3.

Step 5: Run /apply-findings Skill

Run the /apply-findings skill on the evaluated results.

When a fix ships with a regression test, confirm the test fails with the fix reverted, then restore the fix.

Stage the fix immediately before mutating it (git add <file>), so git checkout -- <file> restores it exactly from the index. A file staged in an earlier step has an index copy older than the current edits, and restoring reverts them. Stage only the files about to be mutated, and reach for git add -p <file> when one also carries unrelated changes: a broader restore point sweeps in working-tree changes the project may require stay uncommitted. Each mutation edits the shared working tree in place, so hold anything that reads or builds that tree until the mutation is restored.

When the fixed code combines several signals, also apply the plausible rewrites a maintainer might reach for — reordering the signals, substituting a fallback chain for a conjunction, dropping a term that looks redundant — and confirm each fails at least one test, then restore the fixed code. A rewrite that passes every test while changing behavior on some input means the tests pin the examples rather than the invariant; add the test that distinguishes it. When the fix guards against an unbounded loop or wait, bound the test itself so that reverting the fix fails rather than hangs: cap the iteration count for a loop; enforce a deadline for a wait.

Read the full file on GitHub · 108 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 Changed · +10 lines 41c9cdff3294
  2. 2d ago Changed · -7 lines bad8691b8802
  3. 6d ago First seen · 105 lines · 67 tokens per session scan A a62d84e94579

Subscribe to this mod's changes

polish-code is a skill published in the GitHub repository tobihagemann/turbo (402 stars, last pushed yesterday), licensed MIT. It adds 67 tokens to every session and 2,369 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

serena

Semantic code understanding with IDE-like symbol operations. Use when: (1) Large codebase analysis (>50 files), (2) Symbol-level operations (find, rename, refactor), (3) Cross-file reference tracking, (4) Project memory and session persistence, (5) Multi-language semantic navigation. Triggers: "find symbol", "rename…

Dianel555/DSkills · 105 tokens

triage-issue

Verify an issue, persisted audit finding, or unresolved review finding against current code, classify it, and write only the contracted forge/ledger outcome. Supports independent batches and an immediate-fix review-finding route. Triggers: "triage-issue", "triage issue N", "triage this finding", "is this trigger met".

gtrabanco/agentic-workflow · 74 tokens

debug-helper

Systematic debugging approach for identifying and fixing issues.

athola/skrills · 12 tokens

network-troubleshooting

Use when diagnosing network failures: connection refused, timeouts, TLS errors, DNS problems, and intermittent failures. Covers layer-by-layer isolation and the tools that answer each question.

nimadorostkar/Claude-Skills-collection · 40 tokens

observability

Use when instrumenting a system or when an incident cannot be diagnosed from existing telemetry. Covers structured logging, metrics, distributed tracing, SLOs, and alerts that are worth waking someone for.

nimadorostkar/Claude-Skills-collection · 42 tokens

bug-fix-protocol

Use when fixing a reported bug end to end. Enforces a disciplined sequence — reproduce, write a failing test, fix minimally, verify, prevent recurrence — and blocks the common failure mode of patching symptoms.

nimadorostkar/Claude-Skills-collection · 48 tokens