AgentSkillsCN

global-commenting

编写简洁而富有帮助性的代码注释,着重阐明“为什么”,而非“是什么”。在决定是否添加注释、通过清晰的命名与结构实现自文档化代码、为复杂逻辑段落添加注释,或避免使用临时性或仅用于说明变更的注释时,均可运用此技能。适用于任何可能受益于解释性注释的代码编写或审查过程。

SKILL.md
--- frontmatter
name: global-commenting
description: Write minimal, helpful code comments that explain the why, not the what. Use this skill when deciding whether to add comments, writing self-documenting code through clear naming and structure, adding comments for complex logic sections, or avoiding temporary or change-related comments. Applies when writing or reviewing any code that might benefit from explanatory comments.

When to use this skill

  • When deciding whether code needs a comment
  • When writing self-documenting code through clear naming
  • When adding comments to explain complex business logic
  • When documenting non-obvious algorithms or decisions
  • When avoiding comments that describe what the code does (let code speak)
  • When removing outdated or misleading comments
  • When avoiding temporary comments about recent changes or fixes
  • When writing comments that will remain relevant over time
  • When documenting public APIs or interfaces
  • Applies to all source code files across the project

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