global-commenting
编写自文档代码,使用最少、有帮助的注释来解释大段逻辑而不使代码库混乱。在编写代码注释、记录复杂逻辑、审查是否需要注释、编写函数文档、解释非显而易见的代码部分、通过命名和结构确保代码清晰度、避免临时或变更相关的注释、保持注释始终相关且对未来有用,或在添加注释与为清晰度重构之间做决定时使用此技能。在编写或审查任何代码文件时应用此技能,以确保注释增加价值而不产生噪音,并且代码主要通过清晰的命名和结构基本上是自解释的。
📖 中文导读:编写自文档代码,使用最少、有帮助的注释来解释大段逻辑而不使代码库混乱。在编写代码注释、记录复杂逻辑、审查是否需要注释、编写函数文档、解释非显而易见的代码部分、通过命名和结构确保代码清晰度、避免临时或变更相关的注释、保持注释始终相关且对未来有用,或在添加注释与为清晰度重构之间做决定时使用此技能。在编写或审查任何代码文件时应用此技能,以确保注释增加价值而不产生噪音,并且代码主要通过清晰的命名和结构基本上是自解释的。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: Global Commenting description: Write self-documenting code with minimal, helpful comments that explain large sections of logic without cluttering the codebase. Use this skill when writing code comments, documenting complex logic, reviewing whether comments are needed, writing function documentation, explaining non-obvious code sections, ensuring code clarity through naming and structure, avoiding temporary or change-related comments, keeping comments evergreen and future-relevant, or deciding between adding comments versus refactoring for clarity. Apply this skill when writing or reviewing any code file to ensure comments add value without creating noise, and that code is primarily self-explanatory through clear naming and structure.
Global Commenting
When to use this skill
- When writing or reviewing code comments in any file
- When documenting complex logic or algorithms that need explanation
- When deciding whether to add a comment or refactor for clarity
- When explaining non-obvious code sections or business logic
- When writing function or class documentation
- When ensuring code is self-documenting through clear naming and structure
- When removing outdated or unnecessary comments
- When avoiding comments that speak to recent changes or temporary fixes
- When keeping comments concise, minimal, and evergreen
- When reviewing code to ensure comments are helpful and relevant
- When balancing between commenting and writing self-explanatory code
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