AgentSkillsCN

Global Commenting

编写自文档化代码,通过清晰的结构和命名自我解释,仅添加少量有用的注释来解释大段代码逻辑,避免关于未来不再相关的更改或修复的注释。在决定是否为代码添加注释、为复杂逻辑部分编写注释、确保代码通过良好命名自我解释、重构代码减少注释需求或审查现有注释的相关性和清晰度时使用此技能。在处理任何需要平衡代码清晰度与适当文档的代码文件时适用。

SKILL.md
--- frontmatter
name: Global Commenting
description: Write self-documenting code that explains itself through clear structure and naming, add minimal helpful comments to explain large sections of code logic, and avoid comments about changes or fixes that won't be relevant in the future. Use this skill when deciding whether to add comments to code, writing comments for complex logic sections, ensuring code is self-explanatory through good naming, refactoring code to reduce the need for comments, or reviewing existing comments for relevance and clarity. This skill applies when working on any code files where you need to balance code clarity with appropriate documentation.

Global Commenting

When to use this skill

  • When deciding whether to add comments to your code
  • When writing comments for complex logic sections
  • When ensuring code is self-explanatory through good naming and structure
  • When refactoring code to reduce the need for explanatory comments
  • When reviewing existing comments for relevance and future utility
  • When removing outdated or temporary comments about changes/fixes
  • When adding concise, minimal comments to explain large code sections
  • When choosing between writing a comment vs. refactoring for clarity
  • When working on any code files (.php, .js, .ts, .vue, etc.)
  • When balancing code clarity with appropriate documentation
  • When ensuring comments remain evergreen and informational

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