技巧

AI 写代码会滚雪球式堆积无用注释,用 /no-comments skill 清理

精选理由

vikingmute 分享了一个很实际的问题:Agent 写代码会把旧注释当模板疯狂复制。用 /no-comments skill 能自动清理垃圾注释,留着架构说明这类有用的。

Lauren(@poteto)指出 AI Agent 倾向于复制代码库中已有的注释,一条解释临时 workaround 的注释会被后续 Agent 反复模仿扩散,导致 TODO、复述代码的英文注释越积越多。

图片来源 · Viking
正文

她建议删除大部分注释,只保留浏览器兼容性说明、公共 API 接口文档等必要内容。pstack 提供 /no-comments skill,专门清理无用注释并保留有价值的部分,还能从第一性原理出发判断 workaround 是否应通过重构解决。

原文 · Viking

非常实用,让 AI 写代码的过程中,实际上可以产生非常多的无用注释,因为 Agent 很喜欢复制已有代码和注释,比如一个临时无害的 workround 类型的注释,会影响之后的 agent 的代码生成,滚雪球一样越来越多。 虽然现在根本不怎么代码了,之前抽查,会发现记录代码修改历史记录的注释,TODO的注释,还有把代码用英文重复一遍的注释,而且其他 agent 发现以后,会毫不犹豫的加进去。 所以大部分的注释应该删除,留下好注释,比如一些宏观层次的架构 公共 API/接口说明等等。 OP 的 /no-comment 的这个 skill 做这个工作很不错,而且他还抽象出了他平时的工作流 skill,他自己的用来让 AI coding agent 的工作流,大家可以看看 github.com/backnotprop/ps… lauren @poteto ban and delete most if not all code comments! agents love copying what already exists. a seemingly harmless comment explaining some temporary workaround is one of the worst viruses you can have in your codebase. like a weed it'll spread quickly as a tool for agents to quickly get their job done. before you know it, your codebase is overrun with hacks and stale comments. just one more workaround bro you can use pstack's /no-comments skill as a weedkiller. it'll seek out useless comments while keeping the ones that actually should exist (like explaining a browser quirk), and figure out how to solve them on a first principles basis here's a prompt you can try asking @bot : create a project agent that uses /poteto-mode to spawn a /swarm to use /no-comments and identify useless code comments we can prune in my repo. come back with a high level plan of which of these workarounds would be best solved by refactoring and which we can straight up delete x.ai/bot/plugin/971… 🔗 View Quoted Tweet

产业坐标与信源核验

本条情报归属 AITOP「技巧」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:AI编程、代码注释、Agent、claude,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。

信源核验说明:本文原始线索采编自「Viking」(@vikingmute),经 AITOP 多维评分管线结构化提炼。截至目前,全网已有 2 家独立信源对该事件进行交叉印证与跟进报道(含 shao__meng 等),属于近期高关注度行业信号。

发现摘要或翻译有误? 告诉我们