skills/code-polish/SKILL.md
Polish changed code when the user explicitly asks, or when an active workflow requests post-implementation simplification and risk-profiled review over a fixed file scope.
npx skillsauth add paulrberg/dot-agents code-polishInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Resolve scope once, make only high-confidence simplifications, fix evidenced defects by risk, and verify the final state.
--simplify: simplify only.--review: review and fix only.--with-profile <name> / --skip-profile <name>: add or suppress review profiles; skip wins.resolved-scope block when present.
Otherwise use only files modified in this session; if session history is unavailable, use all uncommitted tracked and
untracked files.resolved-scope block and optional excluded-scope block. Do not broaden or recompute scope
later. Stop if it is empty.Preserve public contracts, inputs, outputs, side effects, error behavior, performance-sensitive characteristics, telemetry, and operational guards. Apply only changes with a concrete comprehension or defect-risk benefit:
Do not split by line count, perform architecture cleanup, convert sync/async APIs, add speculative configurability, or replace readable duplication with a one-use abstraction. A no-op is a valid result.
Judge the diff against the user's request. Prioritize CRITICAL → HIGH → MEDIUM → LOW:
Every finding must cite a verified location, triggering input/state, failure mode, blast radius, and evidence in the changed code. Merge duplicates and apply the smallest defensible fix. When intent is ambiguous, stop or record the assumption instead of guessing.
Select every applicable profile and read it once:
| Surface | Profile |
| ------------------------------------------------------------- | ----------------------- |
| auth, secrets, crypto, external input/network, unsafe parsing | security |
| env, config, timeouts, retries, pools, limits | configuration |
| Go behavior, concurrency, context, errors | go |
| TypeScript types, modules, packages, async behavior | typescript |
| Python services, scripts, async, packaging, data IO | python |
| shell, CI, deploy, installers, quoting | shell |
| CSV/JSON/YAML/binary, schemas, migrations, generated data | data-formats |
| naming and intent clarity | naming unless skipped |
Profiles live at references/profiles/<name>.md. Missing selected profiles are a stop condition.
Run the narrowest formatter/lint, targeted tests, typecheck, and invariant checks that prove the final touched behavior. Broaden only for shared contracts. Name skipped checks and why.
Report Scope, Simplifications when run, Review Findings and Fixes when run, Verification, and Residual Risks.
Findings include severity, location, impact, evidence, fix, and confidence. A residual risk states the assumption,
consequence if wrong, and how to check it. Completion requires fixed scope, traceable edits/findings, and validation
evidence.
Render a successful report as ### ✨ Code polish — ✅ complete, a small summary-count table, the exact
resolved-scope block, ### ✨ Simplifications, ### 🔎 Review findings and fixes, ### 🧪 Verification, and
### ⚠️ Residual risks, omitting inapplicable sections. When review is clean, state ✅ No verified review findings.
If a stop condition below prevents completion, lead with ### ✨ Code polish — ⛔ blocked and report the evidence and
required decision. Keep severity tokens, profile IDs, scope block names, commands, locations, reproduction inputs, and
security evidence exact and undecorated.
Stop when behavior parity or required high-risk validation cannot be established, or a fix requires an unrequested public-contract change or larger redesign.
development
Refactor naming and repository structure exhaustively while preserving behavior and external contracts.
tools
Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).
testing
Audit an entire repository with fresh eyes for correctness errors, bugs, omissions, duplication, inconsistencies, and other evidenced mistakes; fix every safe issue and verify the result.
development
Autonomous overnight codebase improvement with bounded runtime, evidence-gated changes, and verification.