Agent Skills › overmind-core/overmind › code-comments

code-comments

GitHub

定义仓库注释与文档字符串规范,指导编写、审查及清理代码注释。明确删除冗余说明,保留关键设计决策与约束,提升代码可读性。

.agents/skills/code-comments/SKILL.md overmind-core/overmind

Trigger Scenarios

编写代码时添加注释 代码审查中检查注释质量 清理或重构旧代码中的注释

Install

npx skills add overmind-core/overmind --skill code-comments -g -y
More Options

Non-standard path

npx skills add https://github.com/overmind-core/overmind/tree/main/.agents/skills/code-comments -g -y

Use without installing

npx skills use overmind-core/overmind@code-comments

指定 Agent (Claude Code)

npx skills add overmind-core/overmind --skill code-comments -a claude-code -g -y

安装 repo 全部 skill

npx skills add overmind-core/overmind --all -g -y

预览 repo 内 skill

npx skills add overmind-core/overmind --list

SKILL.md

Frontmatter
{
    "name": "code-comments",
    "description": "Full comment and docstring policy for this repo — what to delete, what to keep compressed, what to never touch, and the two local traps. Use when writing, reviewing, or pruning comments and docstrings in any language."
}

Comments

A comment earns its place only by carrying information the code cannot. Apply this test to every comment you write or read:

If I delete this, does a competent engineer lose something they cannot readily infer from the code?

If no, delete it. Prefer fixing the name or the structure over explaining it.

Delete

  • Restatements of the next line or block.
  • The purpose of a clearly named variable, function, component, prop or state.
  • Straightforward control flow ("loop over rows", "bail out if empty").
  • Section banners: // ── Render ──, # ---- helpers ----, {/* Actions */}, # 1. fetch / # 2. transform.
  • Anything a type, name or signature already says.
  • Standard framework behaviour: what useEffect does, what a Radix primitive renders, how React Query caches, what a DRF ViewSet is, what @shared_task does.
  • History: what a change fixed, what used to be there, how many call sites there once were, PR numbers, incident dates. Gravestones for deleted code go with it.
  • Plan-phase labels — P0, Phase N, WS-H, Fork 3, Gap 2 — in code, comments, test names and filenames alike.
  • JSDoc or a docstring that only re-spells the export name.

Keep, compressed to one or two lines

  • A non-obvious design decision, and why.
  • A workaround for a framework, browser, API or third-party limitation.
  • An edge case, anomaly, or intentionally counterintuitive behaviour.
  • A performance, security, contrast, compatibility or correctness constraint.
  • An external invariant: a backend contract, a wire format, a required ordering, a provider limit, a token the design system pins.
  • A trap where the obvious simplification breaks something.
  • Why an empty catch {} / except: pass / no-op guard is deliberate.

Write WHY, not WHAT. Never grow a short useful comment into prose.

Large blocks

Multi-paragraph module headers and JSDoc essays are the main offender. Do not tidy them — delete them, and keep only the constraint they contained. A module named colors.ts exporting TONE_CHIP does not need six paragraphs saying it is about colour. Turning a 20-line essay into a 15-line essay is a failure: it collapses to a line or two, or it goes.

Python specifics

A docstring is not automatically safe — judge it like a comment. Delete one that only re-spells the name ("""Serializer for EvalRun."""), and delete Args/Returns blocks that restate typed parameters. Keep a parameter line only for a unit, a range, an ownership rule or a caller obligation the type cannot express.

Keep, compressed: idempotency and retry expectations on a Celery task, which queue a task must run on, transaction and locking order, and why a write uses .filter().update() — that pattern is deliberate here, it skips signals and leaves the in-memory object stale.

Never remove

biome-ignore, @ts-expect-error, # noqa, # type: ignore, # pragma: no cover, # fmt: off, eslint-*, @vitest-environment, "use client", shebangs, license headers and generated-file banners. Django verbose_name / help_text are UI strings, not comments.

Evaluate each TODO/FIXME on its merits. Keep one that names real outstanding work.

Prompt text inside a string literal is DATA, not commentary. Never edit inside a string, f-string or triple-quoted block that is assigned, returned or passed as an argument, however much it reads like prose.

Two local traps

  • frontend/scripts/check-design.sh greps source TEXT, comments included. A comment containing a banned literal (uppercase, page-title) fails the build. Reword it.
  • A DRF view docstring becomes the OpenAPI operation description. Deleting one changes the generated client, so prefer an explicit @extend_schema(summary=...).

End state

Very few comments. A well-written file may legitimately have none. Do not keep a comment because having some feels safer, and do not strip a load-bearing constraint to lower the count.

Version History

  • e146ecd Current 2026-10-18 15:42

Same Skill Collection

.agents/skills/api-endpoints/SKILL.md
.agents/skills/backend-architecture/SKILL.md
.agents/skills/data-workshop/SKILL.md
.agents/skills/engineering-taste/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/mcp/SKILL.md
.agents/skills/pr-etiquette/SKILL.md
.agents/skills/run-tests/SKILL.md
.agents/skills/seed-demo-data/SKILL.md
overmind/skills/model-training-engineering/SKILL.md
overmind/skills/overmind-agent/SKILL.md
overmind/skills/overmind-datasets/SKILL.md
overmind/skills/overmind-evaluations/SKILL.md
overmind/skills/overmind-inference/SKILL.md
overmind/skills/overmind-integrations/SKILL.md
overmind/skills/overmind-observability/SKILL.md
overmind/skills/overmind-optimiser/SKILL.md
overmind/skills/overmind-training/SKILL.md
overmind/skills/overmind/SKILL.md
.agents/skills/finetuning-model-onboarding/SKILL.md

Metadata

Files
0
Version
e146ecd
Hash
42ba5262
Indexed
2026-10-18 15:42

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-19 02:17
浙ICP备14020137号-1