global-commenting
编写具有清晰名称和结构的自文档代码,仅在必要时添加最小化的、持久的注释来解释复杂逻辑。在编写或审查任何可能需要注释的代码时使用此技能。通过更好的命名和结构重构代码使其更具自解释性时。决定是否添加或删除现有代码中的注释时。确保注释解释为什么做某事而非正在做什么时。审查代码以删除过时的或与临时更改相关的注释时。此技能适用于所有编程语言和所有类型的代码文件。
📖 中文导读:编写具有清晰名称和结构的自文档代码,仅在必要时添加最小化的、持久的注释来解释复杂逻辑。在编写或审查任何可能需要注释的代码时使用此技能。通过更好的命名和结构重构代码使其更具自解释性时。决定是否添加或删除现有代码中的注释时。确保注释解释为什么做某事而非正在做什么时。审查代码以删除过时的或与临时更改相关的注释时。此技能适用于所有编程语言和所有类型的代码文件。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Global Commenting description: Write self-documenting code with clear naming and structure, adding minimal, evergreen comments only when necessary to explain complex logic. Use this skill when writing or reviewing any code that might need comments. When refactoring code to make it more self-explanatory through better naming and structure. When deciding whether to add or remove comments from existing code. When ensuring comments explain why something is done rather than what is being done. When reviewing code to remove outdated or temporary change-related comments. This skill applies to all programming languages and all types of code files.
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 any new code that might require comments or explanations
- When refactoring code to improve clarity through better naming and structure
- When deciding whether to add comments to complex logic or algorithms
- When removing outdated, temporary, or change-related comments from code
- When reviewing existing comments to ensure they remain relevant and evergreen
- When writing function or method documentation
- When explaining non-obvious business logic or architectural decisions
- When working with any code file in any programming language
- When ensuring code is self-documenting through clear variable and function names
- When avoiding comments that simply describe what the code does (prefer explaining why)
Instructions
For details, refer to the information provided in this file: global commenting