安装方式
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add sickn33/antigravity-awesome-skills --skill code-polish Rewrites unprofessional code comments into clear ones and performs non-semantic cleanup. Use to professionalize code without altering logic or behavior.
2
下载量
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add sickn33/antigravity-awesome-skills --skill code-polish name: code-polish
description: Rewrites unprofessional code comments into clear ones and performs non-semantic cleanup. Use to professionalize code without altering logic or behavior.
risk: critical
source: community
date_added: "2026-07-02"A constraint-based protocol for normalizing code comments and performing safe, non-semantic cleanup. This skill exists because human-written code tends to carry casual, outdated, or missing comments, while the goal is professional-grade documentation without touching behavior.
This file is self-contained. Do not require any other skill file to execute this protocol.
Comments and non-semantic cleanup are the job. Logic is never the job. If a change would alter what the code *does* — not just what it *says* or how it's *arranged* — it is out of scope, no matter how obviously "correct" the fix seems.
---
Apply this skill when:
Do not apply this skill when:
---
Before editing anything, read the entire file (or the entire relevant module if the codebase is large — not just the function in question). Do not comment or clean incrementally while still reading. A comment written without full context is a guess, and guesses are how "professional" comments end up wrong.
Identify:
/// for Rust, XML doc comments, etc.)---
Classify every existing comment into one of these categories before touching it:
| Category | Example | Action |
|---|---|---|
| Junk / venting | // wtf is this, // idk why but it works | Remove tone, extract any real information underneath, rewrite professionally — or delete if it truly holds zero information |
| Placeholder | // fix later, // TODO hack | Convert to a proper TODO: note with the actual concern stated plainly, or remove if stale/resolved |
| Dead code comments | Blocks of commented-out code | Remove, unless the surrounding context makes clear it's intentionally preserved (e.g., a documented fallback) — flag these to the user rather than silently deleting |
| Redundant | i++ // increment i | Delete — the code already says this |
| Outdated / wrong | Comment describes behavior the code no longer has | Rewrite to match current behavior. Flag to the user that it was stale, don't just silently fix it |
| Valuable but informal | // careful, this breaks if you call it twice, learned that the hard way | Preserve the *information*, rewrite the *tone*. Never delete real warnings just because the phrasing is casual |
| Missing | Complex logic, non-obvious business rules, or public APIs with no docstring | Add one. Don't over-comment simple, self-explanatory lines |
---
Scope is strictly limited to changes that cannot alter behavior:
Anything beyond this — reordering logic, extracting functions, changing control flow, altering algorithms — is out of scope for this skill.
---
Apply these standards to every comment touched or added:
///, etc.) — match the convention already used elsewhere in the file if one exists.---
Before presenting the result:
---
Summarize for the user, don't just hand back a silent diff:
---
Junk / venting → professional
// before
// ugh this took forever to figure out. api rate limits us super hard in prod so we have to do exponential backoff here. just leave it alone
function retryFetch(url, attempts) { ... }
// after
// Uses exponential backoff to handle aggressive API rate-limiting in production.
function retryFetch(url, attempts) { ... }
Redundant → removed
# before
count += 1 # increment count by 1
# after
count += 1
Valuable but informal → tone rewritten, information preserved
# before
# careful, this breaks if you call it twice, learned that the hard way
# after
# Not idempotent: calling this more than once per session corrupts the
# cache index. Callers must guard against duplicate invocation.
Missing → added
// before
public double calculate(double base, int tier) {
return base * (tier > 2 ? 0.85 : 1.0);
}
// after
/**
* Applies the loyalty discount. Tiers above 2 qualify for a 15% discount;
* this threshold matches the current pricing policy, not a technical limit.
*/
public double calculate(double base, int tier) {
return base * (tier > 2 ? 0.85 : 1.0);
}
Outdated / wrong → corrected and flagged
// before
// returns nil if user not found
func GetUser(id string) (*User, error) { ... } // now returns ErrNotFound instead
// after
// Returns ErrNotFound if the user does not exist.
func GetUser(id string) (*User, error) { ... }
// (flagged to user: original comment was stale — function used to return nil,
// now returns a named error)
---
This skill never:
---