AgentSkillsCN

Global Commenting

编写自文档化代码,注释尽量简短且长期有效,用于解释复杂逻辑,无需记录变更或临时修复。在向任何代码文件添加注释时使用此技能。在决定代码是否需要注释或应使其更易理解时使用。在为复杂算法或业务逻辑编写注释时使用。当想添加有关最近变更、修复或待办事项的注释时使用。在审查现有注释的相关性和准确性时使用。

SKILL.md
--- frontmatter
name: Global Commenting
description: Write self-documenting code with minimal, evergreen comments that explain complex logic without documenting changes or temporary fixes. Use this skill when adding comments to any code file. When deciding whether code needs a comment or should be made more self-explanatory. When writing comments for complex algorithms or business logic. When tempted to add comments about recent changes, fixes, or TODOs. When reviewing existing comments for relevance and accuracy.

When to use this skill:

  • When deciding whether to add a comment to code
  • When writing comments for complex logic or algorithms
  • When commenting large sections of business logic
  • When tempted to write a comment about a recent change or fix
  • When considering adding TODO or FIXME comments
  • When the code could be made self-documenting through better naming
  • When reviewing existing comments for accuracy
  • When removing outdated or misleading comments
  • When ensuring comments are evergreen and future-relevant
  • When documenting why code exists, not what it does
  • When working on any file that may need explanatory comments

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.

Instructions

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