/mthines-agent-skills:polish [review|simplify [dry-run|<path>]|quick|debt [--marker <word>]] [--no-commit] [--critical]from mthines-agent-skills
Re-runnable pre-PR quality gate that reviews via open PR, simplifies changed code, and prunes comments. Supports review, simplify, quick, and debt modes with optional commit control.
Ships in mthines-agent-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.
Read when SKILL.md points to them; scripts run unread.
Get a branch into reviewable shape, and re-run any time after a batch of changes.
Polish composes the pr-reviewer agent (read-only review via the branch's open PR) with its own simplify engine, rules/simplify.md, over the branch diff.
How review-loop and /create-pr call polish: references/callers.md.
Contents: Modes · Step 0 · Step 1 · Step 2 · Step 3 · Step 4 · Hard rules
Parse the first token of $ARGUMENTS. Everything else is a flag.
| Mode | Trigger | What runs |
|---|---|---|
| full (default) | No mode token | Pass A (review), then Pass B (simplify) — this order is fixed. |
review | First token review | Pass A only. |
simplify | First token simplify | Pass B only. simplify dry-run reports without writing; simplify <path> scopes to a path. |
quick | First token quick | Pass C only — light mechanical pass (comments, docstrings, else after return, local names); no pr-reviewer pass, no structural refactors. |
debt | First token debt | Run node "${CLAUDE_SKILL_DIR}/scripts/shortcut-ledger.mjs" per rules/debt.md, then stop: it scans the whole repo, not the branch diff, so Steps 0–4 do not run, and it works on main. Read-only. |
| Flag | Effect |
|---|---|
--no-commit | Leave all changes in the working tree instead of committing each pass. |
--critical | Pass --critical through to pr-reviewer. Ignored by simplify / quick. |
--no-optimize | Accepted and ignored — the reviewer's optimality lens was removed. Never pass it through. |
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || { echo "polish: not a git repo"; exit 1; }
BRANCH=$(git rev-parse --abbrev-ref HEAD)
git fetch origin main --quiet 2>/dev/null || git fetch origin --quiet 2>/dev/null
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "master" ]; then
echo "polish: on $BRANCH — check out a feature branch first."
exit 1
fi
git diff --name-only origin/main...HEAD # files changed on this branch
git diff --stat origin/main...HEAD
polish: no changes vs origin/main — nothing to do. and exit.polish: branch diff is non-code only — skipping. and exit.Run git status --porcelain.
If the tree is dirty and you will commit (no --no-commit), print polish: working tree is dirty; pass commits will include your uncommitted changes. Commit or stash first to keep them separate. and continue.
Never stash, discard, or reset the user's uncommitted work.
Run only the passes the resolved mode selects.
review (modes: full, review)Resolve the PR with PR_URL=$(gh pr view --json url -q .url 2>/dev/null).
If no PR is open, skip Pass A and tell the user to open a draft PR (via /create-pr) and re-run polish — pr-reviewer has no PR-less mode.
Otherwise dispatch the agent with the Task tool — pr-reviewer is an agent, and Skill("pr-reviewer") errors with Unknown skill:
Task(subagent_type="pr-reviewer", prompt="<PR-URL-or-number> [--critical if user passed it]")
It posts one visible COMMENT review and returns a verdict and findings.
Capture the verdict and findings and surface all of them — polish never applies them.
For applied findings, point the user to review-loop rather than polish review.
simplify (modes: full, simplify)Read and follow rules/simplify.md with items 1–9.
It applies mechanical cleanups to the branch diff one at a time — restating and ticket comments, docstring trimming, dead code, else after return, nesting, repeated literals, duplicate helpers, and cryptic locals — each behind the project's fast check, reverting any change that turns it red.
API changes, cross-file restructuring, and anything that needs a test edit come back as surfaced items.
Capture the applied, reverted, and surfaced lists.
quick (mode: quick only)Read rules/quick-pass.md when the mode is quick: it runs rules/simplify.md with items 1, 2, 3, 5, and 9 only.
Unless --no-commit, commit each pass that produced edits as its own commit; skip a pass with no edits.
Pass A is read-only, so it normally has nothing to commit.
git add -u && git commit -m "chore: review pass (findings from pr-reviewer)" # Pass A, only if polish made edits
git add -u && git commit -m "chore: simplify pass (mechanical refactors)" # Pass B
git add -u && git commit -m "chore: quick pass (comments, naming)" # Pass C
With --no-commit, stage nothing.
Polish (<mode>) on <branch>
Review pass (pr-reviewer):
Verdict: <PASS | FAIL | n/a (not run)>
Findings surfaced: <N findings; apply via review-loop, or "none">
Needs your judgment: <one line per blocking item, or "none">
Simplify pass:
Applied: <file:line [item n] + one line each, or "none">
Reverted (check failed): <one line each, or "none">
Surfaced (not applied): <one line each, or "none">
Quick pass: # only if mode == quick
Applied: <one line per mechanical fix, or "none">
Commits: <SHA + message per pass, or "none (--no-commit)">
Surface the review findings and the simplify pass's surfaced items prominently; never drop them.
--no-verify.rules/simplify.md lists, one change at a time, each behind the fast check. When unsure whether a change is mechanical, surface it./create-pr.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (mthines/agent-skills) — no native marketplace selected
npx claudepluginhub p/mthines-mthines-agent-skills54 skills in this plugin
/ai-engineeringReviews and guides LLM/AI application engineering — prompts, caching, RAG, agent loops and tools, resilience, model migration, evals, prompt-injection defence, and observability. Invoke with /ai-engineering for "review my prompt", "set up RAG", or "write evals".
/animationsAuthors performant CSS-first web animations and picks the right feedback for an interaction — transitions, View Transitions, scroll-driven motion, Motion for React, reduced motion, and perceived performance. Triggers on "animate this", "hover effect", "feel faster", "skeleton loader", "/animations".
/animations-nativeAuthors performant React Native / Expo animations and gestures with Reanimated and react-native-gesture-handler on the UI thread; web animations go to `animations`. Triggers on "reanimated", "react native animation", "gesture handler", "swipe gesture", "/animations-native".
/atelierTakes one change from request to merged PR by sequencing existing skills — aw builds the draft PR, prepare gets it green, a deterministic gate allows the squash-merge only when a user-visible diff that needs a rollout ships behind a deployment-verify flag contract, or a small one carries a classed no-flag marker (and, in a repo with a hosted service, every diff carries a contract or an opt-out) — then reads the default-branch pipeline, fixes a red one once, verifies a no-flag change on the deploy with deployment-verify, and says what a human does next. Resumable from a sticky PR comment; invoke with /atelier.
/attach-mediaUploads local screenshots and recordings to GitHub and embeds them in a PR or issue body or comment as inline-rendering user-attachments URLs, via `gh --attach` with a curl fallback; never writes placeholders. Triggers on "attach screenshots to the PR", "upload this recording to the PR", "/attach-media".
/autonomous-workflowThe phase machinery (0–7) behind the `aw` dispatcher: task intake through a tested draft PR in an isolated worktree, gated by the plan.md brief and the run-checks.mjs sentinel, with companions that never block. Not the entry point — natural-language requests for autonomous work go to the `aw` skill; invoke /autonomous-workflow only to run the phases directly.
Other plugins' skills for the same job