/tgc-skills:polish [path|commit-range] [lenses=correctness|simplify]from tgc-skills
Runs a combined quality pass over changed code using parallel correctness and simplification review lenses, auto-applies safe fixes, and returns remaining findings for user approval.
Ships in tgc-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One combined quality pass over changed code. Fan out two review lenses as findings-only subagents (they read, they do not edit), merge and dedupe the results, auto-apply the safe findings and the bug fixes a failing test proves, verify the result with the repo's own tooling, and hand back the rest for the user to approve.
Proceed only when the surrounding user request explicitly asks for polishing (including
direct /tgc-skills:polish invocation) or tgc-skills:ship invokes it. Do not load this
skill from unrelated requests because polishing can edit files.
This is quality plus safe bug fixes, not a deep security audit.
Parallel agents that edit race each other on the same files. So the subagents only report structured findings, and a single orchestrator (you) applies edits sequentially. Fan-out read, fan-in write.
git diff --name-only,
git diff --cached --name-only, and untracked files from
git ls-files --others --exclude-standard. If all are empty, fall back to
git diff --name-only HEAD~1 and say you did.src/components): review that file/directory.abc123..HEAD): review the files from
git diff --name-only <range> and the changes in that range. Use it for work that is
already committed, such as commits a review loop made.lenses= (lenses=simplify): run only the named lens — correctness or
simplify. The rest of the flow is unchanged. overeng is an old name for
simplify, which now covers over-engineering. Any other name → stop and list the
valid ones.If there is nothing to review, say so and stop.
Dispatch one general-purpose subagent per lens in a single message so they run
concurrently. Run the correctness lens on the session model and the simplification lens
with model: sonnet. Give each the file list, the scope, and its
own output path from mktemp "${TMPDIR:-/tmp}/polish-<lens>.XXXXXX". Each lens writes
only a JSON array against this schema to that path and replies with the path alone,
because long replies arrive truncated:
[{
"file": "relative/path.ts",
"line": 42,
"lens": "correctness | simplification",
"confidence": "high | medium",
"behaviorChanging": true,
"issue": "one-line description of the problem",
"fix": "concrete, specific proposed change"
}]
Add this to both prompts: "Report only findings you would act on yourself. If you would call a finding low confidence, a maybe, or a matter of taste, leave it out. An empty array is a good answer."
The two lens prompts:
correctness — "Review these changed files for correctness bugs only: logic
errors, off-by-one, null/undefined handling, wrong conditionals, race conditions,
incorrect error handling, broken edge cases. Do NOT report style or simplification.
Set behaviorChanging: true for any fix that alters runtime behavior (most bug
fixes do). Write the findings JSON to your output path — do not edit source files."
simplification — "Review these changed files for clarity, simplification and
over-engineering: duplicated logic that could reuse existing helpers, reinvented
standard-library or framework functionality, unnecessary dependencies, speculative
abstractions, dead flexibility, config for things with one caller, exports and
wrappers with one use, awkward control flow, wrong altitude, needless intermediate
variables. For each, say what to delete and what replaces it. Preserve behavior
exactly — every fix must be behaviorChanging: false; leave out anything that
cannot be done that way. Follow the repo's existing idioms and CLAUDE.md conventions.
Comments are part of this lens. The repo's CLAUDE.md/AGENTS.md comment rules
win. Where the repo states none, report every comment that restates what the code
does, narrates the change ('now we handle X'), refers to a plan, phase, or review
round, or annotates a config, schema, constant, or enum entry. Propose deleting it,
or compacting a multi-line comment to the one-line non-obvious why it carries. These
are behaviorChanging: false, and confidence: high when the rule clearly applies.
Keep a real non-obvious why (a workaround, an edge case, a business rule).
Write the findings JSON to your output path — do not edit source files."
Each subagent should read the repo's CLAUDE.md/AGENTS.md for local conventions
before judging.
While the lenses run, wait for their completion notifications. Reading the diff or running the gate yourself in the meantime duplicates their work.
Read each lens output file. Group findings that target the same file and nearby lines with the same intent into one merged finding. Record an agreement count = how many distinct lenses flagged it. Keep the clearest wording and the highest confidence in the group. Then delete the lens output files.
confidence: high AND behaviorChanging: false (mechanical, safe), ORbehaviorChanging: false (independent corroboration).behaviorChanging: true, whatever its confidence. See Step 5.confidence: medium finding, a PROVE finding no test can reach or whose fix needs a
product decision, anything ambiguous or touching public API/types.The line is a risk gate: runtime behavior changes only when a test shows the bug is real and the fix removes it.
Apply AUTO findings yourself with Edit, sequentially, one file at a time. Never delegate the writes to parallel agents. If two AUTO findings conflict on the same lines, apply the higher-confidence one and demote the other to REVIEW.
Then take each PROVE finding in turn:
Do not hardcode a command. Discover it, in this order, and run the narrowest one that applies to the changed files:
CLAUDE.md / AGENTS.md — a stated lint/typecheck/test command.go vet ./..., tsc --noEmit, cargo check, …).If a check fails, identify the offending edit, revert just that edit, and move that finding to REVIEW with a note. Re-run until clean. If no check can be found, say so explicitly — do not claim the code is verified.
file:line — issue → fix, grouped by lens, plus which
verification command passed. For a bug fix, name the test that failed before it.Keep it terminal-friendly. Do not re-print unchanged code.
git add, commit, or push. Leave the working tree for the user to review.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
14 skills in this plugin
/checkpointUse when the user wants current work saved to the branch mid-flow without ending the task — "checkpoint", "commit and push", "save and push", "push what we have", optionally with a review ask ("checkpoint and review")./cmux-orchestrateUse when orchestrating cmux terminal panes, splits, tabs, worker sessions, or agents in other cmux panes, including reading screens, sending commands, answering prompts, jumping to unread activity, or setting AFK check-ins. Do not use for tmux, IDE/browser tabs, deployment replicas, or plain command execution./explain-prUse before shipping, when the user wants to understand their own branch — "explain what we did", "walk me through this branch", "what am I about to ship", "why did we change that", or any ask to account for the current diff before running tgc-skills:ship. Explains the change back to the user and flags anything it cannot justify. Read-only; not a PR description writer, not a code review.npx claudepluginhub eternalllight/tgc-skills --plugin tgc-skillsOther plugins' skills for the same job