agentleFS
EternallLightEternallLight/tgc-skills/skills/polish/SKILL.md

polish

Skill11 starsChanged 4 months agoMITView on GitHub

Use only when the user explicitly asks for a combined quality pass over changed code, or when the active ship workflow invokes it — "polish the diff", "polish my changes", "clean up my changes", "run all the reviewers". Diff-scoped by default; accepts an optional path or commit range and a subset of lenses.

We split this skill into the rules it gives an agent

11 rules. 0 are common, 11 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 63 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If there is nothing to review, say so and stop.

    line 42
  2. Distinctive:

    Keep a real non-obvious why (a workaround, an edge case, a business rule).

    line 85
  3. Distinctive:

    Write the findings JSON to your output path — do not edit source files."

    line 86
  4. Distinctive:

    Read each lens output file.

    line 102
  5. Distinctive:

    Do not hardcode a command.

    line 127
  6. Distinctive:

    If a check fails, identify the offending edit, revert just that edit, and move that finding to REVIEW with a note.

    line 135
  7. Distinctive:

    If any edit was reverted in Step 6, list it and why.

    line 145
  8. Distinctive:

    Keep it terminal-friendly.

    line 147
  9. Distinctive:

    Only report/fix within the resolved scope — don't wander into unrelated files.

    line 151
  10. Distinctive:

    Never git add, commit, or push.

    line 152
  11. Distinctive:

    If a lens output is malformed JSON, ask that lens once to rewrite it.

    line 153

“Common” is measured: kept by at least 6 in 10 of the 63 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

One combined quality pass over changed code. Fan out three review lenses as findings-only subagents (they read, they do not edit), merge and dedupe the results, auto-apply only the safe high-confidence findings, verify the result with the repo's own tooling, and hand back the riskier findings 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.

Why findings-only subagents

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.

Step 1 — Resolve scope

  • No argument: the current work — union of 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.
  • Path argument (src/components): review that file/directory.
  • Range argument (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,overeng): run only the named lenses — correctness, simplify, overeng. The rest of the flow is unchanged. An unknown name → stop and list the valid ones.
  • Skip files a review can't help: lockfiles, generated code, snapshots, binaries, vendored dirs.

If there is nothing to review, say so and stop.

Step 2 — Fan out the lenses (parallel, findings-only)

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 and over-engineering lenses 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 | over-engineering",
  "confidence": "high | medium | low",
  "behaviorChanging": true,
  "issue": "one-line description of the problem",
  "fix": "concrete, specific proposed change"
}]

The three lens prompts:

  1. 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."
  2. simplification — "Review these changed files for clarity and simplification: duplicated logic that could reuse existing helpers, dead flexibility, awkward control flow, wrong altitude, needless intermediate variables. Preserve behavior exactly — every fix must be behaviorChanging: false. 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."

  3. over-engineering — "Review these changed files for over-engineering: reinvented standard-library/framework functionality, unnecessary dependencies, speculative abstractions, config for things with one caller, YAGNI violations. For each, say what to delete and what replaces it. Prefer behavior-preserving deletions. 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.

Step 3 — Merge & dedupe

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.

Step 4 — Classify each merged finding

  • AUTO (apply automatically) when either:
    • confidence: high AND behaviorChanging: false (mechanical, safe), OR
    • agreement count ≥ 2 AND behaviorChanging: false (independent corroboration).
  • REVIEW (list, do not apply) for everything else — anything behaviorChanging: true (including correct bug fixes), uncorroborated low/medium confidence, anything ambiguous or touching public API/types.

The auto/review line is a risk gate, not a quality gate: a correct bug fix still goes to REVIEW because auto-changing runtime behavior unseen is the dangerous case.

Step 5 — Apply the AUTO set

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.

Step 6 — Verify with the repo's own tooling

Do not hardcode a command. Discover it, in this order, and run the narrowest one that applies to the changed files:

  1. The repo's CLAUDE.md / AGENTS.md — a stated lint/typecheck/test command.
  2. The pre-push hook and project scripts — prefer the narrowest documented command that covers the files, using the repo's package/build tool.
  3. Language defaults otherwise (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.

Step 7 — Report

  • Applied (N): each as file:line — issue → fix, grouped by lens, plus which verification command passed.
  • Needs your call (M): the REVIEW findings, most important first. Offer to apply any the user picks.
  • If any edit was reverted in Step 6, list it and why.

Keep it terminal-friendly. Do not re-print unchanged code.

Scope guardrails

  • Only report/fix within the resolved scope — don't wander into unrelated files.
  • Never git add, commit, or push. Leave the working tree for the user to review.
  • If a lens output is malformed JSON, ask that lens once to rewrite it; if still broken, mark that lens as failed in the report rather than guessing.

Download now (ZIP)

  • Other versions69 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 69

    1. talesofai/cohub★ 583same name
    2. nexmoe/DayBee★ 424same name
    3. nexmoe/eve★ 424same name
    4. educlopez/ui-craft★ 398same name
    5. Southclaws/storyden★ 346same name
    6. 10xChengTu/Mux0★ 337same name
    7. theexperiencecompany/gaia★ 324same name
    8. AkaraChen/aghub★ 271same name
    9. zacharyfmarion/openscad-studio★ 238same name
    10. jagrat7/linux-wallpaper-engine★ 222same name

    59 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects 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 12 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

    • studio-lgtmSkill

      make-interfaces-feel-better

      Apply design engineering best practices to polish UI components - use when reviewing or improving interfaces, animations, typography, or interaction details.

      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

  • In this repository12 other files it gives its agents.

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.