Skip to content

docs(skills): add comments rule to code-quality skill#6091

Open
pawelangelow wants to merge 1 commit into
mainfrom
docs/add-comments-rules
Open

docs(skills): add comments rule to code-quality skill#6091
pawelangelow wants to merge 1 commit into
mainfrom
docs/add-comments-rules

Conversation

@pawelangelow

@pawelangelow pawelangelow commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

The rule, in short:

  • Default to fewer comments. Clear names, small functions, and
    good tests should carry the meaning.
  • Write a comment only when the code genuinely can't explain itself,
    or when the user explicitly asks for more (e.g. complex logic).
  • When you do write one, keep it short, in plain words, and focused
    on what / why — not how, and not the story of the change
    (that belongs in the commit message or PR description).

Motivation

Personal preference, but one worth writing down: comments are often a
code smell. They signal that something isn't clear enough from the
code itself, and an extra mechanism is needed to explain it. There's
a lot of material on this already — the goal here isn't to re-litigate
the debate, it's to be explicit about how this codebase treats them.

We do have comments today, and we'll keep adding them where they earn
their keep. The rule just restricts the broad, reflexive usage and
sets a shape for the ones that do stay: short, plain words, focused
on what the code does or why it has to exist — not how it
works, and not the story of the change.


Note

Low Risk
Documentation-only change to agent skills; no application or runtime behavior is affected.

Overview
Documents comment policy in the code-quality agent skill so AI assistants and contributors follow the same bar.

The new Comments section says to default to fewer comments, use them only when code or tests can't carry the meaning (or when explicitly requested), and keep any comment short and focused on what/why—not implementation detail or change history. It includes good vs bad TypeScript examples and a short list of anti-patterns (restating names, duplicating tests, obvious block summaries).

The Pre-Commit Checklist gains an item to keep comments minimal and plain-language.

Reviewed by Cursor Bugbot for commit 539143a. Bugbot is set up for automated code reviews on this repo. Configure here.

@pawelangelow pawelangelow self-assigned this Jun 18, 2026
@pawelangelow pawelangelow requested a review from a team as a code owner June 18, 2026 14:49
@jit-ci

jit-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant