code-comments

仓库创建 2026年1月20日最近提交 22 天前SkillHot 收录 21 天前
▸ 精选理由

聚焦可读性与知识传递,帮助团队保持有意义的注释习惯。

这个 Skill 做什么

判定何时添加、保留或删除代码注释并给出高价值注释建议。

帮你判断什么时候该加注释、保留注释或删掉注释,并给出高价值注释的写法与示例。用于写新代码或做 code review 时,把有用的“为什么”信息和纯粹复述代码的噪声区分开。特点是强调注释要传递代码里看不到的知识(比如部署/重启影响、边界条件和潜在陷阱)。

▸ 展开 SKILL.md 英文原文

Use when writing new code or reviewing existing code to decide which comments to add, keep, or remove. Defines what makes a comment valuable vs. noise.

开发编程注释规范代码文档最佳实践通用
3
Stars
0
Forks
14
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ton-anywhere/my-favorite-prompts/main/skills/code-comments/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ton-anywhere/my-favorite-prompts/main/skills/code-comments/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Code Comments Standard

Comments exist to transfer knowledge that cannot be read from the code itself. A comment that restates what the code does is noise. A comment that explains *why* it does it — or warns of a non-obvious consequence — is essential.

---

## Add or Keep Comments When

**A restart or deployment action is required.**
Initializers and certain config files require a server restart to take effect. Always include the restart warning at the top of those files:
```ruby
# Be sure to restart your server when you modify this file.
```

**The "why" is not derivable from the code.**
If a future developer would ask "why is this here?", the comment belongs. Examples:
- A migration col
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有