dev-toolbelt/dev-team-agents/comments-policy

Claude Code and agent skill by dev-toolbelt/dev-team-agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Code comments — none by default; type annotations and AAA markers.

Install

npx vskill@latest install dev-toolbelt/dev-team-agents/comments-policy

SKILL.md

The same SKILL.md was published earlier as dev-toolbelt/dev-team-agents/comments-policy.

Comments Policy

The guiding principle: code should be self-documenting through clear naming. Comments are the exception, not the rule.


Core Principle — Default: No Comments

Code communicates intent through clear naming, small focused functions, and proper structure. Comments become outdated, double the maintenance burden, and often signal unclear code.

Before adding a comment, ask:

  • Can I make the code clearer with a better name or extracted method?
  • Is this explaining WHAT (fix the code) or WHY (only valid reason)?
  • Is this a required type/exception annotation?
  • Will this comment become outdated?

When NOT to Comment

Anti-patternRule
Explaining what code doesImprove the code instead
Commenting bad codeFix the code instead
Noise / obvious annotationsRemove them
Commented-out dead codeDelete it — Git history exists
Version-control commentsUse Git commits
TODO / FIXMECreate an issue tracker ticket
Dividers (// === Section ===)Use proper class/method structure
Journal / attributionUse Git blame
Closing brace markers (} // end if)Refactor to smaller functions

See references/anti-patterns.md for full before/after code examples.


When to Comment

CaseRequired?Format
Business rule or regulatory constraintYes — explains WHYInline comment citing the rule
Non-obvious algorithm with external referenceYes — explains WHYInline comment with URL
Workaround for a known external bugYes — explains WHYInline comment with ticket reference
Typed collections / genericsYes — type annotationNative language syntax
Exceptions / errors thrownYes — type annotationNative language syntax
ORM/dynamic property typesYes — type annotationNative language syntax
Complex return shapesYes — type annotationNative language syntax
Test structureYes — AAA markers// Arrange, // Act, // Assert
Spec scenario a test coversYes — traceability token[spec:<feature>#S<n>] in the test's description string; a one-line comment only when the framework has no description string (skills/shared/spec-gate/SKILL.md § Traceability)

See references/type-annotations.md and references/aaa-pattern.md for full examples.


Length Rule — Brief and Direct, Never a Block

When a comment is warranted (WHY, not WHAT), it must be short: 1 line as the default, 2–3 only when the constraint genuinely cannot be stated in one. State the rule/workaround/reference and stop — no restating of the surrounding code, no walkthrough of alternatives considered, no multi-paragraph rationale.

Hard limit: max 3 lines per comment, max 3 comments per contiguous block (e.g. per config section, per function). A comment that needs more than 3 lines to justify itself belongs in an ADR (docs/development/adrs/) or a commit message, referenced by a single short line — not inlined. This applies everywhere, not only source code: config files (nginx, YAML, Dockerfiles), infra scripts, and templates follow the same limit.

Anti-patternFix
Multi-line header block above a config section explaining history/contextOne line stating the constraint; move the rest to an ADR or commit message
Walking through what was tried before landing on this lineDelete — Git history already has this
Repeating the same WHY across several adjacent linesState it once, near the first line it applies to

Quick Reference

Need to add a comment?
├─ Explaining WHAT code does? → ❌ Improve the code instead
├─ Explaining WHY (rule/workaround)? → ✅ Add it with context
├─ Type info the language can't express? → ✅ Required — use native syntax
├─ Exceptions / error conditions? → ✅ Required — use native syntax
└─ Test structure? → ✅ Required — use AAA markers

Language-Specific Style

Detect the project's primary language and load the corresponding section:

LanguageLoad
JavaScript / TypeScriptsections/javascript-typescript.md
Pythonsections/python.md
Gosections/go.md
PHP, Ruby, Java, C#, Rust, or othersections/generic.md

If multiple languages are present, load the section for the dominant one (most source files).


Conditional Section Loading

Load relevant sections based on context — don't load all sections eagerly:

ContextLoad
Python files in scopeskills/shared/comments-policy/references/type-annotations.md
Test files in scope (*.test.*, *_test.*, spec/)skills/shared/comments-policy/references/aaa-pattern.md
Legacy code review or refactor taskskills/shared/comments-policy/references/anti-patterns.md
Greenfield developmentNone — core SKILL.md is sufficient

Reference Material (load on demand)

  • references/aaa-pattern.md — AAA test pattern with examples
  • references/type-annotations.md — type annotation rules by language
  • references/anti-patterns.md — anti-pattern examples (what NOT to do)

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dev-toolbelt/dev-team-agents/comments-policy/badge)](https://verified-skill.com/skills/dev-toolbelt/dev-team-agents/comments-policy)

Something wrong with this skill or its page? Tell us.