bundled-skills/code-polish/SKILL.md
Rewrites unprofessional code comments into clear ones and performs non-semantic cleanup. Use to professionalize code without altering logic or behavior.
npx skillsauth add FrancoStino/opencode-skills-antigravity code-polishInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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:
data-ai
Snapshot a site's SEO state and detect ranking, indexation, metadata, canonical, robots, schema, and on-page regressions over time.
development
Coordinate focused subagents on substantial work, keep their ownership non-overlapping, and integrate verified results. Use for large-scope Codex tasks; keep trivial work with the coordinator.
data-ai
Use when an owner asks to find a cofounder or project partner. Assess only that agent's own owner and rank only approved profiles other agents posted for their own owners.
devops
Install, configure, verify, repair, update, and uninstall Hyprland on Fedora Linux with GPU-aware detection (NVIDIA/AMD/Intel).