展示HN:AI Lint – 教会编码助手你的团队标准,而不仅仅是语法
经过三年多的深度代理编码,我注意到一个模式:Claude、Cursor 和 Copilot 生成的代码虽然能运行,但并不合适。
它通过了测试,能够运行,但却与语言的本质相悖。它在平台提供状态时自行发明状态,使用巧妙的单行代码隐藏因果关系。在同一个文件中为同一个问题创造了三种不同的解决方案。架构在技术上是有效的,但在认知上却很昂贵。
请求“干净代码”并没有帮助。这些代理需要我会给有才华的初级开发者的东西:一本关于品味的手册。
因此,我编写了教义文件——用 Markdown 编写的约束,教导代理区分可编译的代码和可维护的代码。内容包括:
- “文件中有超过 20 个可变状态变量?你有多个模块假装成一个。”
- “三种解决同一问题的方法共存?选择一种,删除其他的。”
- “如果你不能用一句话解释条件,就将其提取为一个命名的布尔值。”
AI Lint 是这一理念的产品化。它不是命令行工具或软件即服务,而是优化后的文本文件,你可以将其放入 .cursorrules、AGENTS.md 或你的系统提示中。代理会阅读这些文件并实际遵循它们。
这里有教义(什么是合适的)和拒绝(什么是要拒绝的)。当规则冲突时,有一个覆盖协议。它是为上下文注入设计的,而不是为了人类阅读。
商业模式:为不同的技术栈(应用、系统等)提供付费包。但我已在 GitHub 上发布了一个免费的预览,包含核心理念和 JavaScript/Node.js 的教义,以便你测试其影响。
- 网站: [https://ai-lint.dosaygo.com](https://ai-lint.dosaygo.com)
- 免费预览: [https://github.com/DO-SAY-GO/AI-Lint](https://github.com/DO-SAY-GO/AI-Lint)
我对 AI 不断注入到你的代码库中的反模式感到好奇。目前我正在扩展 Go 和 Rust 的拒绝规则,并计划接下来推出 iOS/Swift 和基础设施(Docker、k8s)包。
查看原文
After 3+ years of heavy agentic coding, I noticed a pattern: Claude/Cursor/Copilot generate code that works but doesn't belong.<p>It passes tests. It runs. But it fights the grain of the language. It invents state when the platform provides it. It hides causality behind clever one-liners. It creates three different solutions to the same problem in the same file. The architecture is technically valid but cognitively expensive.<p>Prompting for "clean code" didn't help. The agents needed what I'd give a talented junior: a handbook on taste.<p>So I wrote doctrine files—markdown constraints that teach agents the difference between code that compiles and code that's maintainable. Things like:<p>- "More than 20 mutable state variables in a file? You have multiple modules pretending to be one."<p>- "Three approaches to the same problem coexisting? Pick one, delete the others."<p>- "If you can't explain the condition in one sentence, extract it to a named boolean."<p>AI Lint is the productization of this. It's not a CLI or SaaS—just optimized text files you drop into .cursorrules, AGENTS.md, or your system prompt. The agents read them and actually follow them.<p>There's doctrine (what belongs) and rejects (what to refuse). When rules conflict, there's an override protocol. It's designed for context injection, not human reading.<p>Business model: Paid packs for different stacks (Apps, Systems, etc). But I've released a free preview on GitHub with the core philosophy and JavaScript/Node.js doctrine so you can test the impact.<p>- Website: <a href="https://ai-lint.dosaygo.com" rel="nofollow">https://ai-lint.dosaygo.com</a><p>- Free Preview: <a href="https://github.com/DO-SAY-GO/AI-Lint" rel="nofollow">https://github.com/DO-SAY-GO/AI-Lint</a><p>Curious what anti-patterns AI keeps injecting into your codebases. I'm expanding the Go and Rust rejects right now, and planning iOS/Swift and infra (Docker, k8s) packs next.