AgentSkillsCN

Global Commenting

编写自文档化的代码,以极少但常青的注释来阐释复杂的逻辑,而非仅仅记录显而易见的实现细节或近期的改动。在使用任何编程语言编写代码时;在决定是否添加注释以解释逻辑时;在撰写能够阐明复杂算法或非直观推理的注释时;在为代码的较大段落进行文档化时;在避免记录近期或临时性的改动与修复时;在通过清晰的结构与命名优先考虑代码的自文档化时;在编写 JSDoc、TSDoc、Python docstrings,或类似文档注释时;在重构代码以使其更具自明性时;或在维护整个代码库的注释质量时,均可运用此技能。

SKILL.md
--- frontmatter
name: Global Commenting
description: Write self-documenting code with minimal, evergreen comments that explain complex logic rather than obvious implementations or recent changes. Use this skill when writing code in any programming language; when deciding whether to add comments to explain logic; when writing comments that clarify complex algorithms or non-obvious reasoning; when documenting large sections of code; when avoiding comments that speak to recent or temporary changes or fixes; when prioritizing self-documenting code through clear structure and naming; when writing JSDoc, TSDoc, Python docstrings, or similar documentation comments; when refactoring code to be more self-explanatory; or when maintaining comment quality across the codebase.

Global Commenting

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle global commenting.

When to use this skill

  • When writing self-documenting code through clear structure and naming
  • When adding concise, minimal comments to explain large sections of logic
  • When avoiding comments about recent or temporary changes or fixes
  • When ensuring comments are evergreen and relevant far into the future
  • When documenting complex algorithms or non-obvious reasoning
  • When writing function documentation (JSDoc, TSDoc, docstrings)
  • When refactoring code to be more self-explanatory
  • When maintaining comment quality across TypeScript, JavaScript, Python, Ruby, or any codebase

Instructions

For details, refer to the information provided in this file: global commenting