Переписывает непрофессиональные комментарии в коде на понятные и выполняет несемантическую чистку. Используйте, чтобы привести код в порядок без изменения логики и поведения.

Звёзды49 917
Авторsickn33
Установок5

Установка

SKILL.md

Code Polish

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.

Prime Directive

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.


When to Use

Apply this skill when:

  • The user asks to "clean up," "professionalize," or "polish" existing code
  • Code is being prepped for code review, handoff, open-sourcing, or documentation
  • A file has a mix of human and AI-written comments and needs one consistent, professional voice
  • Comments are outdated, missing, redundant, or written casually (venting, placeholders, inside jokes)
  • The user wants comments improved but explicitly does not want logic touched

Do not apply this skill when:

  • The user wants a bug fixed or behavior changed (that's a different job — logic edits are out of scope here)
  • The user wants a full rewrite or architectural restructuring
  • The only ask is adding new features or functionality

Phase 0 — Full Read

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:

  • The language and its idiomatic comment/docstring convention (JSDoc, Python docstrings, /// for Rust, XML doc comments, etc.)
  • Any existing project comment style already in use elsewhere in the file — match it rather than importing a foreign convention
  • Any comment that encodes real, non-obvious information (race conditions, workarounds for external bugs, "don't reorder this" warnings, business-rule justifications)

Phase 1 — Comment Audit

Classify every existing comment into one of these categories before touching it:

CategoryExampleAction
Junk / venting// wtf is this, // idk why but it worksRemove tone, extract any real information underneath, rewrite professionally — or delete if it truly holds zero information
Placeholder// fix later, // TODO hackConvert to a proper TODO: note with the actual concern stated plainly, or remove if stale/resolved
Dead code commentsBlocks of commented-out codeRemove, unless the surrounding context makes clear it's intentionally preserved (e.g., a documented fallback) — flag these to the user rather than silently deleting
Redundanti++ // increment iDelete — the code already says this
Outdated / wrongComment describes behavior the code no longer hasRewrite 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 wayPreserve the information, rewrite the tone. Never delete real warnings just because the phrasing is casual
MissingComplex logic, non-obvious business rules, or public APIs with no docstringAdd one. Don't over-comment simple, self-explanatory lines

Phase 2 — Non-Semantic Cleanup

Scope is strictly limited to changes that cannot alter behavior:

  • Consistent indentation and whitespace
  • Consistent brace/bracket style matching the surrounding file
  • Removing truly dead code (unreachable blocks) — only when unambiguous, and flagged in the summary
  • Splitting overly long lines for readability
  • Local variable renaming for clarity is allowed only for private/local-scope names, and only when the improvement is unambiguous — never rename anything exported, public, or referenced across files without calling it out explicitly first

Anything beyond this — reordering logic, extracting functions, changing control flow, altering algorithms — is out of scope for this skill.


Phase 3 — Comment Rewrite / Addition

Apply these standards to every comment touched or added:

  • Explain why, not what. The code already shows what it does; a comment earns its place by explaining intent, tradeoffs, or non-obvious constraints.
  • Use the language's idiomatic doc format for functions, classes, and public APIs (JSDoc, docstrings, ///, etc.) — match the convention already used elsewhere in the file if one exists.
  • Be concise. No padding, no restating the obvious, no filler sentences.
  • No informal register. No jokes, no venting, no first-person asides ("I think this works because...").
  • No AI-tell phrasing. Avoid generic filler like "This function is responsible for..." or "Note that..." padding, and avoid em-dashes. Write plainly and directly, the way a careful senior engineer would.
  • Don't invent behavior. If you're not certain why something is done a certain way, say what the code does, not a fabricated justification for why.

Phase 4 — Verification

Before presenting the result:

  • Confirm the edited file's logic is behaviorally identical to the original — comments and whitespace are the only permitted diffs, plus whatever narrow Phase 2 cleanup was done.
  • Re-read the diff end to end, not just the changed lines in isolation, to catch anything that accidentally shifted meaning.
  • If a rewritten comment removes information that was present in the original (even informally stated), that's a failure — go back and preserve it.

Phase 5 — Report Back

Summarize for the user, don't just hand back a silent diff:

  • How many comments were rewritten, added, or removed, and why
  • Any comments flagged as "informal but contained a real warning" — confirm the information was preserved
  • Any dead code or stale comments removed, listed explicitly
  • Anything you were unsure about and left alone rather than guessing

Examples

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)

Security & Safety Notes

This skill never:

  • Changes program logic, control flow, or algorithmic behavior
  • Restructures code (extracting/inlining functions, reordering execution, changing architecture)
  • Renames anything public, exported, or cross-referenced without explicit confirmation
  • Deletes a comment solely because its tone is casual, without checking whether it carries real information first
  • Fabricates a rationale for a comment when the actual reason isn't knowable from context — state what's certain only

Limitations

  • Cannot verify runtime behavior — Phase 4 is a read-through diff check, not a test run. For anything beyond trivial files, the user should still run the actual test suite after applying this skill.
  • Judgment calls on ambiguous cases (e.g., "is this dead code intentional or forgotten?") default to flagging rather than guessing — this means some cleanup will need a quick human yes/no rather than happening silently.
  • Not a substitute for a linter or formatter — Phase 2 cleanup is deliberately conservative and won't enforce a full style guide (e.g., max line length rules, import ordering) unless that's trivially inferable from the surrounding file.
  • Comment quality is bounded by how well the code's actual intent can be inferred from context. If the "why" genuinely isn't recoverable from the file (no domain knowledge, no commit history, no ticket references available), the honest output is a comment describing what, not a confident but invented why.
  • Large files or unfamiliar codebases increase the risk of Phase 0 missing context that would have changed a comment's wording — flag uncertainty in the Phase 5 report rather than presenting low-confidence rewrites as settled.

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: code-polish](https://darkplay.ru/ai/skills/sickn33-agentic-awesome-skills-code-polish)

Описание

Переписывает непрофессиональные комментарии в коде на понятные и выполняет несемантическую чистку. Используй, чтобы привести код к профессиональному виду, не меняя логику или поведение.

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

mattpocock-skillsmattpocock · Агентские навыки Matt Pocock для настоящей инженерии: разбор задач, потоки спецификаций и…
41 комп.
superpowersobra · Базовая библиотека навыков для Claude Code: TDD, отладка, паттерны совместной работы и…
16 комп.
eccaffaan-m · Нативный для harness операторский слой ECC: 67 агентов, 278 навыков, 94 шима устаревших…
441 комп.
A11y Architectaffaan-m · Архитектор доступности, специализирующийся на соответствии WCAG 2.2 для веба и нативных…
225 587 ★
Add Language Rulesaffaan-m · Каркас команды workflow для add-language-rules в everything-claude-code.
225 587 ★
Code Architectaffaan-m · Проектирует архитектуру функций, анализируя существующие паттерны и соглашения кодовой…
225 587 ★
Code Exploreraffaan-m · Глубоко анализирует существующие функции кодовой базы, прослеживая пути выполнения…
225 587 ★
Code Revieweraffaan-m · Эксперт по ревью кода. Проактивно проверяет код на качество, безопасность и…
225 587 ★
Code Simplifieraffaan-m · Упрощение и очистка кода без изменения поведения.
225 587 ★
Comment Analyzeraffaan-m · Анализ комментариев в коде на точность, полноту и риск устаревания.
225 587 ★

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8