agentleFS
momentmakermomentmaker/kaijutsu/skills/core/polish/SKILL.md

polish

Skill3 starsChanged 6 months agoMITView on GitHub

Automated post-implementation review-and-fix loop. Use after completing a feature or implementation plan to find and fix issues across multiple passes until convergence. Invoke with /polish. Composes blunder-hunt for the review pass, convergence-detect for the stop condition, and deslop for any user-facing prose at the end.

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 8 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

30 rules. 0 are common, 22 are distinctive, and 8 are 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.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read any active implementation plan if it exists

    line 19
  2. Distinctive:

    Read each in full, not just the diff hunks

    line 33
  3. Distinctive:

    Look for: dead code from refactoring, leftover debug statements, missing error handling at system boundaries, security issues, race …

    line 34
  4. Distinctive:

    Look at how pieces fit together:

    line 39
  5. Distinctive:

    Verify: contracts honored, error paths handled by callers, no silent type narrowing, no swallowed errors

    line 42
  6. Very specific:

    Run blunder-hunt with the pass's lens on the in-scope files.

    line 47
  7. Distinctive:

    If the platform doesn't support parallel subagents, fall back to sequential — same lenses, same dedup, just slower.

    line 53
  8. Distinctive:

    After each pass, fix every finding (not just critical).

    line 57
  9. Very specific:

    After pass 3 — once you have at least three rounds of findings — invoke convergence-detect.

    line 61
  10. Very specific:

    Before declaring done, scan the diff for user-facing prose: README sections, commit messages, doc strings, error messages shown to humans, …

    line 65
  11. Very specific:

    After convergence + deslop, BEFORE emitting "polish complete", run verification-before-completion.

    line 71
  12. Distinctive:

    Run them ALL fresh, in this turn (not "I ran them earlier").

    line 75
  13. Distinctive:

    Read full output + exit codes.

    line 76
  14. Distinctive:

    If anything fails → state truth, fix, re-run from Step 1 (the convergence loop).

    line 77
  15. Distinctive:

    If all pass → emit the polish-complete claim WITH the evidence (commands ran + N/N pass).

    line 78
  16. Very specific:

    Never declare polish-complete on vibes.

    line 80
  17. Distinctive:

    If items remain after the cap, list them for the user.

    line 95
  18. Very specific:

    Before pass 1, create branch polish/<short-feature-name> off the current HEAD

    line 101
  19. Very specific:

    After each pass's fix phase, commit with message polish: pass N — <one-line summary>

    line 102
  20. Distinctive:

    If a later pass introduces a regression, git bisect over the polish commits identifies the culprit fix

    line 103
  21. Distinctive:

    DO fix issues immediately — don't just report them

    line 110
  22. Distinctive:

    DO run tests after each fix pass

    line 111
  23. Distinctive:

    DO stop when convergence-detect says converged, even before the cap

    line 112
  24. Very specific:

    DO refuse to declare done if tests are failing at any point in any pass — hard test gate (enforced by verification-before-completion's gate …

    line 113
  25. Distinctive:

    DO commit after polish (ask user first)

    line 114
  26. Distinctive:

    DON'T gold-plate. Real issues only, no style refactors

    line 115
  27. Distinctive:

    DON'T add features. Correctness only

    line 116
  28. Distinctive:

    DON'T count cosmetic preferences as issues unless they violate project conventions

    line 117
  29. Distinctive:

    DON'T silently revert decisions the author made — if you disagree, raise it as a finding for the user to weigh in

    line 118
  30. Distinctive:

    DON'T parallelize the *fix phase*.

    line 119

“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

Loops until clean. Each pass: review the diff, fix everything found, re-run tests/linters. Stop when convergence-detect says no new signal is appearing.

This skill composes:

  • blunder-hunt for the review (multi-pass adversarial critique)
  • convergence-detect for the stop condition (smarter than "ran N rounds")
  • verification-before-completion for the hard test/build/lint gate AFTER convergence (convergence ≠ correctness)
  • deslop for any user-facing prose touched in the diff

Step 0: Scope

Determine what was implemented:

  • Read any active implementation plan if it exists
  • git diff master...HEAD --stat (or --cached --stat / --stat if on master)
  • Identify all files in the change set

Step 1-N: Review-Fix Passes

Cap at 4 passes. Stop early when convergence-detect says converged.

For each pass, alternate two lenses:

Lens A — Random Code Exploration (odd passes: 1, 3)

Traverse the codebase semi-randomly:

  1. Pick 5 files in the diff at random
  2. Read each in full, not just the diff hunks
  3. Look for: dead code from refactoring, leftover debug statements, missing error handling at system boundaries, security issues, race conditions, missing tests for new paths
  4. For each finding: severity + file:line + description

Lens B — Cross-Agent Integration Review (even passes: 2, 4)

Look at how pieces fit together:

  1. List the public-API surface added or changed in the diff
  2. Find every call site of those APIs (in the diff and outside)
  3. Verify: contracts honored, error paths handled by callers, no silent type narrowing, no swallowed errors
  4. For each finding: severity + file:line + description

Apply blunder-hunt to each pass

Run blunder-hunt with the pass's lens on the in-scope files. The primitive handles the lie-to-them pressure and the dedup. Polish just consumes the output.

Parallel pass-runners (when supported)

For a single pass with K lenses, compose dispatch-parallel: spawn one subagent per lens, run all in parallel, collect findings. Wall-time savings are large on big diffs. Each subagent gets the same diff but a different lens prompt; synthesis dedupes findings that surface in 2+ subagents.

If the platform doesn't support parallel subagents, fall back to sequential — same lenses, same dedup, just slower.

Fix Phase

After each pass, fix every finding (not just critical). Run the project's test/lint commands. If a fix breaks something, fix that too — count as part of the same pass.

Convergence check

After pass 3 — once you have at least three rounds of findings — invoke convergence-detect. If it returns CONVERGED, stop. Otherwise continue to pass 4 (the cap).

Step F: Final deslop

Before declaring done, scan the diff for user-facing prose: README sections, commit messages, doc strings, error messages shown to humans, CLI help text. Run deslop on each.

Skip code comments unless the diff specifically reworked them.

Step V: Verification gate (HARD STOP)

After convergence + deslop, BEFORE emitting "polish complete", run verification-before-completion. The convergence-detect signal means "no new findings in the last pass". It does NOT mean "the code still compiles + tests still pass". Both can be true OR false independently.

The primitive enforces:

  1. Identify the verification commands for this codebase (test runner, linter, type-checker, build).
  2. Run them ALL fresh, in this turn (not "I ran them earlier").
  3. Read full output + exit codes.
  4. If anything fails → state truth, fix, re-run from Step 1 (the convergence loop).
  5. If all pass → emit the polish-complete claim WITH the evidence (commands ran + N/N pass).

Never declare polish-complete on vibes. The evidence template lives in verification-before-completion's SKILL.md.

Step Final: Summary

## Polish Summary
- Passes completed: <N>
- Stop reason: <converged | hit cap of 4 | clean from pass 1>
- Issues found: <X> (<Y> critical, <Z> issue, <W> minor)
- Issues fixed: <X>
- Tests: <passing | failing — listed below>
- Deslop edits: <count>
- Status: <Clean | <N> remaining items>

If items remain after the cap, list them for the user.

Optional: branch-protected mode

For long-running polish loops on critical code, optionally commit each pass as a separate commit on a polish/<feature> branch:

  1. Before pass 1, create branch polish/<short-feature-name> off the current HEAD
  2. After each pass's fix phase, commit with message polish: pass N — <one-line summary>
  3. If a later pass introduces a regression, git bisect over the polish commits identifies the culprit fix
  4. At the end, optionally squash before merging back to the working branch

This trades commit-history noise for an auditable trail. Useful for high-stakes refactors; overkill for small fixes.

Hard rules

  • DO fix issues immediately — don't just report them
  • DO run tests after each fix pass
  • DO stop when convergence-detect says converged, even before the cap
  • DO refuse to declare done if tests are failing at any point in any pass — hard test gate (enforced by verification-before-completion's gate at Step V)
  • DO commit after polish (ask user first)
  • DON'T gold-plate. Real issues only, no style refactors
  • DON'T add features. Correctness only
  • DON'T count cosmetic preferences as issues unless they violate project conventions
  • DON'T silently revert decisions the author made — if you disagree, raise it as a finding for the user to weigh in
  • DON'T parallelize the fix phase. Parallel review is fine; parallel writes to the same files = chaos.

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.