agentleFS
sabirmgdsabirmgd/terminal-first-goal-loop/skills/polish/SKILL.md

polish

Skill2 starsChanged 2 months agoMITView on GitHub

Run a fail-closed polish gate on the current branch diff: freeze scope, prove the baseline, simplify only changed files, run an independent review, verify fixes, and allow commit or push only after the reviewed candidate is still fresh and clean.

70 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use layout, shape and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • owshq-mecSkill

    layout

    Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

    Also in 8 projects that use this

  • HAR5HA-7663Skill

    shape

    Plan the UX and UI for a feature before writing code. Runs a structured discovery interview, then produces a design brief that guides implementation. Use during the planning phase to establish design direction, constraints, and strategy before any code is written.

    Also in 13 projects that use this

  • PeterCangSkill

    tokens

    Count all historical Claude Code token usage across all local projects, broken down by model, project, date, and week. Includes cost estimation based on official Anthropic pricing.

    Also in 3 projects that use this

  • arjunkshahSkill

    redesign

    Redesign existing interfaces to premium quality while preserving product goals and functional behavior.

    Also in 3 projects that use this

  • leonaaardobSkill

    motion

    Complete Motion.dev documentation - modern animation library for React, JavaScript, and Vue (formerly Framer Motion)

    Also in 3 projects that use this

  • MicrosoftSkill

    review-loop

    Iterative review loop using any lens agent against any target (plan, code, design). Use when you want to run a focused review cycle: spawn a fresh reviewer subagent with a specific lens, present findings and remediation to the user, apply fixes with user guidance, and repeat until clean.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. 0 are common, 22 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 62 edited versions we read keep these.

  • 22

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before doing anything else, verify:

    line 44
  2. Distinctive:

    Not allowed outside that list:

    line 73
  3. Distinctive:

    If production scope expands, stop.

    line 79
  4. Distinctive:

    Before simplifying or fixing anything, run the smallest proof that matters for this branch:

    line 83
  5. Distinctive:

    If the baseline is already broken and the reason is unclear, stop.

    line 91
  6. Distinctive:

    delete dead code and debug leftovers

    line 103
  7. Distinctive:

    keep behavior the same

    line 104
  8. Distinctive:

    If no meaningful simplification exists, that is fine.

    line 106
  9. Distinctive:

    After simplification, rerun the relevant baseline proof.

    line 108
  10. Distinctive:

    Run a fresh independent review against the current frozen diff.

    line 112
  11. Distinctive:

    If no independent review surface is available, stop.

    line 121
  12. Distinctive:

    if the same root cause survives two verified rounds, stop and escalate

    line 136
  13. Distinctive:

    if a later round changes the diff, rerun review on the fresh candidate

    line 137
  14. Distinctive:

    keep production edits inside the frozen file list

    line 146
  15. Distinctive:

    add or update regression tests only when needed to prove the fix

    line 147
  16. Distinctive:

    If there is no progress, or the round cap is reached, stop.

    line 151
  17. Distinctive:

    Before commit or push, confirm the reviewed candidate is still fresh.

    line 155
  18. Distinctive:

    If freshness fails, return to the review step.

    line 168
  19. Distinctive:

    Commit and push are separate permissions.

    line 172
  20. Distinctive:

    Commit is allowed only when:

    line 174
  21. Distinctive:

    If commit or push authority is missing, stop with the verified tree and report what remains.

    line 189
  22. Very specific:

    Stop with clean when:

    line 194
  23. Distinctive:

    commit or push would exceed authority

    line 211

“Common” is measured: kept by at least 6 in 10 of the 62 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Polish

This skill is the final cleanup and ship gate for a branch you already changed. It is strict on purpose. The cost of a false green is higher than the cost of one more review loop.

What This Skill Does

  • checks that the branch is a safe place to polish
  • freezes the production scope to the current branch diff
  • records baseline proof before changing anything
  • simplifies only the changed files
  • runs an independent review
  • fixes only confirmed findings
  • re-verifies the result
  • allows commit or push only if the reviewed candidate is still the one being shipped

Inputs

$polish
$polish --review-only
$polish --no-commit
$polish --no-push
$polish --message "<commit subject>"
$polish --max-fix-rounds <n>

Rules:

  • --review-only: read-only. Review and report only.
  • --no-commit: finish the polish loop but do not commit or push.
  • --no-push: commit if clean and allowed, but do not push.
  • --max-fix-rounds: default 2, hard cap 3.

Step 0: Preflight

Before doing anything else, verify:

  • you are inside a git repo
  • HEAD is on a branch, not detached
  • the branch is not the default branch
  • the branch has a real diff against its base
  • the base branch is known

Collect and freeze:

  • repo root
  • branch name
  • base branch or base commit
  • changed production files
  • current diff bytes
  • current tree hash or diff hash

Why freeze it now: if the allowed production scope drifts mid-run, the review you trusted is no longer reviewing the thing you ship.

Scope Freeze

Production edits are limited to the original changed files.

Allowed outside that list:

  • directly related regression tests
  • proof helpers used only for verification

Not allowed outside that list:

  • product code
  • drive-by cleanup
  • opportunistic refactors in untouched areas

If production scope expands, stop.

Step 1: Baseline Proof

Before simplifying or fixing anything, run the smallest proof that matters for this branch:

  • relevant tests
  • lint or typecheck
  • build if needed
  • focused runtime or browser proof when required

If the baseline is already broken and the reason is unclear, stop. Otherwise you cannot tell whether polish made things better or worse.

Step 2: Simplify Changed Files

Simplify only the frozen changed files.

Goals:

  • remove obvious clutter
  • reduce nesting
  • improve naming
  • delete dead code and debug leftovers
  • keep behavior the same

If no meaningful simplification exists, that is fine. Say so and move on.

After simplification, rerun the relevant baseline proof. If it fails, stop.

Step 3: Independent Review

Run a fresh independent review against the current frozen diff.

Requirements:

  • the reviewer must be separate from the writer of the code
  • the review must read the real diff, not a summary
  • findings need stable ids so you can track them across rounds
  • unconfirmed or malformed findings do not count as clean

If no independent review surface is available, stop. This skill is fail-closed.

Finding Lifecycle

Track findings through these states:

  • open
  • fixed
  • rechecked
  • closed

Rules:

  • fix only confirmed findings
  • deduplicate by root cause
  • if the same root cause survives two verified rounds, stop and escalate
  • if a later round changes the diff, rerun review on the fresh candidate

Step 4: Fix Only What The Review Proved

Work one round at a time. Do not keep patching forever.

For each round:

  1. fix the confirmed findings
  2. keep production edits inside the frozen file list
  3. add or update regression tests only when needed to prove the fix
  4. rerun the relevant proof
  5. rerun the independent review on the fresh diff

If there is no progress, or the round cap is reached, stop.

Step 5: Freshness Gate

Before commit or push, confirm the reviewed candidate is still fresh.

At minimum, recheck:

  • repo root is unchanged
  • branch is unchanged
  • base is unchanged
  • production file list is unchanged
  • current diff hash matches the last reviewed diff hash

Why this matters: a commit, rebase, extra edit, or auto-format step can change the candidate after review. If the hash changed, the review is stale.

If freshness fails, return to the review step. Do not ship stale review.

Step 6: Commit And Push Authority

Commit and push are separate permissions.

Commit is allowed only when:

  • the latest proof passed
  • the latest independent review is clean
  • confirmed findings are 0
  • the freshness gate passed
  • the tree stayed inside the frozen production scope

Push is allowed only when:

  • commit is allowed
  • the task explicitly allows push
  • there is something real to push
  • the freshness gate still passes right before push

If commit or push authority is missing, stop with the verified tree and report what remains.

Stop Conditions

Stop with clean when:

  • proof passes
  • review is clean
  • confirmed findings are 0
  • freshness passes
  • requested commit or push action, if authorized, is complete

Stop with blocked when:

  • preflight fails
  • baseline proof fails unexpectedly
  • production scope expands
  • independent review is unavailable
  • review output is malformed or stale
  • the same root cause survives two verified rounds
  • the fix-round cap is reached
  • commit or push would exceed authority

Output Contract

POLISH | branch=<name> | state=<clean|blocked|review-only>
SCOPE | files=<count> | expanded=<yes|no>
BASELINE | result=<pass|fail> | proof=<short-summary>
REVIEW | findings=<count> | round=<n> | fresh=<yes|no>
VERIFY | result=<pass|fail> | evidence=<short-summary>
SHIP | commit=<done|skipped|blocked> | push=<done|skipped|blocked>
NEXT | <none or exact blocker>

Final Rule

This skill is not "make the branch look nicer." It is "prove the branch is safe to ship, or stop before it ships."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.