lauren· @poteto · X·· 2 小时前AI 评分48
AI 导读
注释是非结构化、无法强制执行的文本。智能体确实会读注释,但它们常常被忽略、会过时,还会给你的智能体留一条后路,让它用创可贴、hack 或变通方案来应付。 用这个提示词审计你的代码注释,找出通过更强的类型、更好的 API 设计来改进代码的机会,并创建 lint 规则,让注释变得不再必要! https://x.com/poteto/status/2110149626133438732?s=46&t=HFNOJ7P2JmfjDfKskFwLUw
正文
comments are unstructured and unenforceable text. agents do read them but they are often ignored, go out of date, and gives your agent an escape hatch to do a bandaid, hack or a workaround instead.
use this prompt to audit your code comments to find opportunities to improve your code through stronger types, better API design, and create lint rules so the comments aren’t necessary!
https://x.com/poteto/status/2110149626133438732?s=46&t=HFNOJ7P2JmfjDfKskFwLUw
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 https://x.ai/bot/plugin/9717366在 X 查看被引用的帖子
来源:lauren · x.com