global-commenting
编写清晰且长期有效的代码注释
团队经常添加会过时或重复显而易见代码内容的注释。此技能指导 AI 助手编写精简注释,用于解释不易看出的决策。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "global-commenting" from https://skillstore.io/skills/devanb-global-commenting.md and its manifest at https://skillstore.io/api/skills/devanb-global-commenting/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“global-commenting”。 一个服务方法包含多条重复说明每个赋值和条件的注释。
预期结果:
审查会移除冗余注释,并保留一条简短说明,用于解释该条件背后的业务规则。
正在使用“global-commenting”。 一个 TypeScript 函数包含复杂日期逻辑,但没有上下文。
预期结果:
结果会添加一条简洁的 TSDoc 摘要,并添加一条内联注释来解释日历规则。
正在使用“global-commenting”。 一个 pull request 添加了关于临时迁移变通方案的注释。
预期结果:
审查建议移除带有时间限制的措辞,并记录兼容性检查的稳定原因。
安全审计
安全The static path traversal alert is a fixed Markdown link to a project standards document, not executable code or user-controlled file access. No prompt injection, data exfiltration, or malicious intent was found in SKILL.md.
风险因素
📁 文件系统访问 (1)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/devanb-global-commenting/audits/10?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/devanb-global-commenting?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/devanb-global-commenting?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/devanb-global-commenting/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/devanb-global-commenting.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
DevanB. (2026). global-commenting security audit report (audit version 10) [Author version unspecified]. Skillstore. https://skillstore.io/skills/devanb-global-commenting/audits/10BibTeX 引用
@techreport{devanb-devanb-global-commenting-2026,
author = {DevanB},
title = {global-commenting security audit report (audit version 10)},
institution = {Skillstore},
year = {2026},
number = {10},
url = {https://skillstore.io/skills/devanb-global-commenting/audits/10},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "global-commenting security audit report (audit version 10)"
version: "unspecified"
type: report
authors:
- name: "DevanB"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/devanb-global-commenting/audits/10"
identifiers:
- type: other
value: "skillstore:devanb-global-commenting:audit:10"
description: "Skillstore immutable audit report identifier"
比较变体
2 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
改进现有代码注释
审查代码库中的注释,并只保留那些解释持久上下文的注释。
标准化 Docblocks
创建符合精简注释风格的 PHPDoc、JSDoc 或 TSDoc 注释。
减少注释噪音
识别重复代码行为的注释,并建议更清晰的命名或结构。
试试这些提示
审查这段代码,只添加解释不易看出决策的注释。避免重复代码本身已经表达的内容。
在有助于未来维护者的地方添加 PHPDoc、JSDoc 或 TSDoc 注释。保持每条注释简洁,并聚焦于意图。
审查此变更中的现有注释。标记过时、冗余或临时性的注释,并仅在需要时建议持久有效的替代注释。
找出可以通过更清晰的命名或结构来消除注释需求的位置。只为仍然不易看出的业务规则或算法添加注释。
最佳实践
- 当原因无法从命名和结构中看清时,解释代码存在的理由。
- 在添加注释之前,优先让代码本身更清晰。
- 避免发布日期、临时说明和近期变更历史,使注释保持持久有效。
避免
- 不要为每一行添加注释,也不要重复显而易见的控制流。
- 不要在逻辑变更后保留过时注释。
- 不要用注释来掩盖不清晰的命名或过于复杂的结构。