<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>工程规范 | 锤子前端</title><description>Now vibe coding, so learning hammer FE ?</description><link>https://channel.meo-ai.com</link><item><title>《十个防止 AI 代码泛滥的前端项目护栏》</title><link>https://channel.meo-ai.com/posts/705</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/705</guid><pubDate>Thu, 10 Sep 2026 23:23:08 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《十个防止 AI 代码泛滥的前端项目护栏》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;br /&gt;&lt;a href=&quot;/search/result?q=%23%E5%89%8D%E7%AB%AF&quot; title=&quot;#前端&quot;&gt;#前端&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23TypeScript&quot; title=&quot;#TypeScript&quot;&gt;#TypeScript&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23React&quot; title=&quot;#React&quot;&gt;#React&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23AI%E7%BC%96%E7%A8%8B&quot; title=&quot;#AI编程&quot;&gt;#AI编程&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BB%A3%E7%A0%81%E8%B4%A8%E9%87%8F&quot; title=&quot;#代码质量&quot;&gt;#代码质量&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23ESLint&quot; title=&quot;#ESLint&quot;&gt;#ESLint&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E6%B5%8B%E8%AF%95%E7%AD%96%E7%95%A5&quot; title=&quot;#测试策略&quot;&gt;#测试策略&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23CI_CD&quot; title=&quot;#CI_CD&quot;&gt;#CI_CD&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BB%A3%E7%A0%81%E5%AE%A1%E6%9F%A5&quot; title=&quot;#代码审查&quot;&gt;#代码审查&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%B7%A5%E7%A8%8B%E5%AE%9E%E8%B7%B5&quot; title=&quot;#工程实践&quot;&gt;#工程实践&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;&lt;br /&gt;本文针对 AI 生成代码速度远超人类审查能力的前端项目，提供了一套实用的十项防护清单。核心思路是通过自动化工具链（类型系统、Linter、变异测试、CI 门禁）在代码合并前拦截机械性错误，而非依赖人工逐行审查。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;用 OpenAPI 契约替代手写类型&lt;/b&gt;：通过 Hey API 等工具从 OpenAPI 规范直接生成 TypeScript 类型、客户端和 Zod 校验，避免 AI 臆造不存在的 API 字段（如 &lt;code&gt;user.fullName&lt;/code&gt;），让编译器在构建期就报错。&lt;br /&gt;&lt;br /&gt;2. &lt;b&gt;开启严格 TypeScript 配置&lt;/b&gt;：启用 &lt;code&gt;noUncheckedIndexedAccess&lt;/code&gt; 等严格标志，让数组索引访问返回 &lt;code&gt;T | undefined&lt;/code&gt;，迫使代码显式处理边界情况，减少 AI 常见的&quot;想当然&quot;代码。&lt;br /&gt;&lt;br /&gt;3. &lt;b&gt;把 Linter 当作行为过滤器&lt;/b&gt;：使用 SonarJS、react-you-might-not-need-an-effect、vitest/playwright 插件、jsx-a11y 等 ESLint 插件，自动拦截认知复杂度过高、不必要的 Effect、可访问性违规等问题。&lt;br /&gt;&lt;br /&gt;4. &lt;b&gt;设定架构层边界&lt;/b&gt;：使用 eslint-plugin-boundaries 或 dependency-cruiser 强制实施分层架构（如 UI 层不得直接访问 API 层），防止 AI 生成的代码逐渐退化为&quot;GitHub 平均水平&quot;的混乱结构。&lt;br /&gt;&lt;br /&gt;5. &lt;b&gt;将重复出现的错误转化为自定义 Linter 规则&lt;/b&gt;：当同一种 bug 第二次出现时，立即编写自定义 ESLint 规则禁止该模式。例如禁止在服务层函数中使用 &lt;code&gt;Math.round&lt;/code&gt; 和 &lt;code&gt;toFixed&lt;/code&gt;，避免双重取整导致的薪资计算错误。&lt;br /&gt;&lt;br /&gt;6. &lt;b&gt;把规则直接喂给 AI 模型&lt;/b&gt;：通过项目规则文件（如 &lt;code&gt;.cursor/rules&lt;/code&gt;、&lt;code&gt;CLAUDE.md&lt;/code&gt;）或技能文件（如 react-doctor），将项目约定、架构决策和禁止模式直接提供给 AI，让模型在生成代码时就遵循规范。&lt;br /&gt;&lt;br /&gt;7. &lt;b&gt;用变异测试验证测试有效性&lt;/b&gt;：使用 Stryker 故意破坏代码（翻转运算符、反转条件、交换返回值），检查现有测试是否能捕获这些变异。存活的变异体通常暴露&quot;只测形状不测内容&quot;的无效测试。一个项目约 4,700 个变异体在 6 分钟内完成扫描。&lt;br /&gt;&lt;br /&gt;8. &lt;b&gt;用 Knip 清理死代码&lt;/b&gt;：Knip 可以检测未使用的文件、导出和依赖，配合自定义可达性脚本填补其盲区，防止 AI 生成大量&quot;以防万一&quot;却无人调用的冗余代码。&lt;br /&gt;&lt;br /&gt;9. &lt;b&gt;用 jscpd 检测重复代码&lt;/b&gt;：AI 倾向于在不同地方生成几乎相同的逻辑，jscpd 能发现这些重复，提示抽象机会或错误的复制粘贴。&lt;br /&gt;&lt;br /&gt;10. &lt;b&gt;将所有检查强制设为 CI 门禁&lt;/b&gt;：上述所有工具（类型检查、Lint、测试、变异测试、重复检测）必须作为 CI 的强制通过项，而非可选建议，确保 AI 生成的代码无法绕过质量关卡。&lt;br /&gt;&lt;br /&gt;11. &lt;b&gt;成本与局限&lt;/b&gt;：这些护栏会产生噪音（误报）、规则过时和新人上手摩擦等成本，建议按&quot;类型 → Lint → 测试 → CI&quot;的顺序渐进式推行。同时需注意，这些检查只能捕获机械性错误，无法识别糟糕的品味或错误的抽象。&lt;br /&gt;&lt;br /&gt;URL：&lt;br /&gt;&lt;a href=&quot;https://evilmartians.com/chronicles/ten-anti-ai-slop-moves-for-frontend-projects-going-faster-than-humans-can-review&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://evilmartians.com/chronicles/ten-anti-ai-slop-moves-for-frontend-projects-going-faster-than-humans-can-review&quot;&gt;https://evilmartians.com/chronicles/ten-anti-ai-slop-moves-for-frontend-projects-going-faster-than-humans-can-review&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://evilmartians.com/chronicles/ten-anti-ai-slop-moves-for-frontend-projects-going-faster-than-humans-can-review&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Ten checks that catch what AI-written frontend code hides: contract codegen, boundary linting, mutation testing, and dead-code detectors.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;evilmartians.com&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;10 anti-AI slop moves for frontend projects going faster than humans can review—Martian Chronicles, Evil Martians’ team blog&quot; src=&quot;/static/https://cdn4.telesco.pe/file/M8U_Fe7M2gHOVcQM8XPpszalMyQIXRzmCokcCm_4dgcjkvIzQMlUYvsgmehUQC-NXCJGc3I8VY2eVIBkKPAVZkYiGTqLga5hRE0vlrIEN-NkyQMSO8-2Jvw2KDqQbQreg_haZqG_9bJF5WftGhdMmwjZOuCvSjmydEd5cT5fncbj22jwHNKyE0bKDJsBv9lYte-NCz1-Luv1TDht4195efFJApkQ1lPvOF_LBJz_mw8fvv9SPSbysOMKWZ8GCcH5JGEb56pCMV7ioa2QMiq3Xu84zYM95pDo-s18Pce77OetyKD2n7Yn8M6J_CVFGam6c__TEJncp_jGmxQsYu7KLQ.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;10 anti-AI slop moves for frontend projects going faster than humans can review—Martian Chronicles, Evil Martians’ team blog&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Ten checks that catch what AI-written frontend code hides: contract codegen, boundary linting, mutation testing, and dead-code detectors.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item><item><title>《现代工程价值观：AI 时代的效率与品味》</title><link>https://channel.meo-ai.com/posts/660</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/660</guid><pubDate>Fri, 12 Jun 2026 01:47:25 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《现代工程价值观：AI 时代的效率与品味》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;a href=&quot;/search/result?q=%23%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B&quot; title=&quot;#软件工程&quot;&gt;#软件工程&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23AI%E7%BC%96%E7%A8%8B&quot; title=&quot;#AI编程&quot;&gt;#AI编程&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BB%A3%E7%A0%81%E5%AE%A1%E6%9F%A5&quot; title=&quot;#代码审查&quot;&gt;#代码审查&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%9B%A2%E9%98%9F%E7%AE%A1%E7%90%86&quot; title=&quot;#团队管理&quot;&gt;#团队管理&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E6%8A%80%E6%9C%AF%E6%A0%88&quot; title=&quot;#技术栈&quot;&gt;#技术栈&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%BC%80%E5%8F%91%E8%80%85%E4%BD%93%E9%AA%8C&quot; title=&quot;#开发者体验&quot;&gt;#开发者体验&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%B7%A5%E7%A8%8B%E7%AE%A1%E7%90%86&quot; title=&quot;#工程管理&quot;&gt;#工程管理&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;作者 Christoph Nakazawa（cpojer）分享了他近半年完全依赖 AI 编码代理完成多个项目的实战经验，指出编程已从&quot;手写代码&quot;转向&quot;指挥系统生成代码&quot;。文章提炼了 AI 时代仍至关重要的五大工程价值观：强所有权、品味至上、严格约束与快速反馈、代码库即上下文、掌控技术栈，并强调管理需更技术化。作者用数据证明效率提升 3 倍，认为未来瓶颈不再是写代码，而是判断力与品味。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;1. **AI 编码已成常态**：作者过去数月多个项目（Vite+、fate、Codiff、Athena Crisis 等）90%-100% 由 AI 编写，代码质量甚至超越手写，且能在几分钟内完成过去数周的工作&lt;br /&gt;2. **Codex CLI 是最佳搭档**：使用 GPT 5.5 high 配合 Codex CLI，配合&quot;先写失败测试再修复&quot;的策略，能极大提高一次性正确率；多项目并行时建议每个项目独立窗口，利用空间记忆提升效率&lt;br /&gt;3. **强所有权比代码更重要**：AI 放大了&quot;懂行&quot;与&quot;不懂行&quot;的差距，小团队（2-3 人）+ 清晰边界 + 独立仓库比大团队协作更高效，审查应聚焦对齐而非代码细节争论&lt;br /&gt;4. **品味是防&quot;垃圾&quot;泛滥的护城河**：AI 能全天候生成大量平庸代码，工程师的核心价值转向判断&quot;什么值得做&quot;，团队应花更多时间思考方向而非盲目堆功能&lt;br /&gt;5. **严格约束 = 速度**：把代码规范、自动化测试、快速验证等&quot;护栏&quot;做得越严，AI 迭代越快（1 分钟 vs 60 分钟的差距）；工具必须支持增量检查，避免随代码量增长而变慢&lt;br /&gt;6. **代码库即唯一上下文**：将设计文档、产品行为、决策记录全部沉淀在仓库内，让 AI 和人类都能快速理解；代码越简洁、越易读，AI 修复和迭代越高效&lt;br /&gt;7. **自研技术栈重新划算**：过去依赖第三方库是因为手写代码慢，现在 AI 降低了自研成本，掌控核心依赖能避免被外部框架绑架，获得完全的产品体验控制权&lt;br /&gt;8. **保留选择权（Option Value）**：任何架构改动都应保留未来大幅调整的可能性，AI 虽让重构变快，但把自己逼进死胡同依然难以脱身&lt;br /&gt;9. **管理必须更技术化**：执行成本降低后，管理者不能只做方向把控，必须保持领域 expertise，能亲自改代码、做技术决策，&quot;技术型管理&quot;（Tech Lead Management）将成为主流&lt;br /&gt;10. **效率数据惊人**：近 30 天日均提交 770 次、修改 15k 行代码，是两年前的 3 倍；过去手写巅峰一天 1200 行，现在 AI 辅助可达 10 倍且质量更高&lt;br /&gt;&lt;br /&gt;URL：&lt;br /&gt;&lt;a href=&quot;https://cpojer.net/posts/modern-engineering-values&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://cpojer.net/posts/modern-engineering-values&quot;&gt;https://cpojer.net/posts/modern-engineering-values&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://cpojer.net/posts/modern-engineering-values&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Modern engineering values.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;cpojer.net&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;Modern Engineering Values&quot; src=&quot;/static/https://cdn4.telesco.pe/file/QweQSg_0hDrvvz2zXk-R-Ju-75cWc1HOdlKdeNp7Zb_GfqU6PR38V0YJ4u3jG6pGyyYo1fQxxQjKwDy47W5iTzD-tL1G16rw_JVFhjxmYQZ2meOFMRKxpxSADw8IvwtKcB8cVca2RXu9VvGQfbczjSRppl_NlJRt3WTmCAD6ejYmZyD8kmbxyshlGP35-xCATRJJdTsJtjExYXp7S6L_AkCKFBmmuLBSZAvmaCer349QQyD9RoJ1LawETQuW4n7tkbDEwv4xyCi5HbNP1fVJyp9aHNxIv1IHnnQkRoHosSIBqARiCMpk0CRGIpkxTkDZJKogKKkR7LiTcBimtujlEA.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;Modern Engineering Values&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Modern engineering values.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item><item><title>《AI编码代理生产级工程技能集》</title><link>https://channel.meo-ai.com/posts/612</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/612</guid><pubDate>Sun, 26 Apr 2026 09:39:26 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《AI编码代理生产级工程技能集》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;a href=&quot;/search/result?q=%23AI%E8%BE%85%E5%8A%A9%E7%BC%96%E7%A8%8B&quot; title=&quot;#AI辅助编程&quot;&gt;#AI辅助编程&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7&quot; title=&quot;#开发工具&quot;&gt;#开发工具&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23AI_Agent&quot; title=&quot;#AI_Agent&quot;&gt;#AI_Agent&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%B7%A5%E7%A8%8B%E8%A7%84%E8%8C%83&quot; title=&quot;#工程规范&quot;&gt;#工程规范&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23ClaudeCode&quot; title=&quot;#ClaudeCode&quot;&gt;#ClaudeCode&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Cursor&quot; title=&quot;#Cursor&quot;&gt;#Cursor&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BB%A3%E7%A0%81%E5%AE%A1%E6%9F%A5&quot; title=&quot;#代码审查&quot;&gt;#代码审查&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E6%B5%8B%E8%AF%95%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91&quot; title=&quot;#测试驱动开发&quot;&gt;#测试驱动开发&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23CI_CD&quot; title=&quot;#CI_CD&quot;&gt;#CI_CD&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;这是一个为AI编码代理（如Claude Code、Cursor、GitHub Copilot等）设计的生产级工程技能仓库，由Addy Osmani维护。它将资深工程师在真实项目中的工作流、质量门禁和最佳实践编码为20个结构化技能，覆盖从需求定义到上线发布的完整开发生命周期，让AI代理在每次编码时都能保持一致的专业水准，避免走&quot;最短路径&quot;而跳过测试、审查等关键环节。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;- 六阶段开发流水线：从Define（定义需求）→ Plan（拆解任务）→ Build（增量编码）→ Verify（验证测试）→ Review（质量门禁）→ Ship（安全发布），像工厂流水线一样规范AI的每一步动作&lt;br /&gt;- 7个斜杠命令即开即用：&lt;code&gt;/spec&lt;/code&gt;写需求文档、&lt;code&gt;/build&lt;/code&gt;增量开发、&lt;code&gt;/test&lt;/code&gt;跑测试、&lt;code&gt;/review&lt;/code&gt;代码审查……输入命令就能自动激活对应的技能组合，非常顺手&lt;br /&gt;- 20个实战技能全覆盖：从API设计、前端工程、TDD测试驱动，到性能优化、安全加固、Git工作流、CI/CD自动化，每个技能都自带步骤清单、验证标准和&quot;反找借口&quot;表格（比如AI想跳过测试时，会被技能里的反驳论据怼回去&lt;i class=&quot;emoji&quot;&gt;&lt;b&gt;😄&lt;/b&gt;&lt;/i&gt;）&lt;br /&gt;- 多工具无缝兼容：Claude Code一键插件安装，Cursor复制到rules目录，Gemini CLI、Windsurf、GitHub Copilot、Kiro等主流AI编程工具都能直接用，技能就是纯Markdown，通吃所有支持系统提示词的代理&lt;br /&gt;- Google工程文化落地：融入了Hyrum定律、Beyonce规则、测试金字塔、Chesterton围栏等Google实战智慧，不是泛泛而谈的理论，而是嵌入到每一步工作流中的可执行标准&lt;br /&gt;&lt;br /&gt;文章URL：&lt;a href=&quot;https://github.com/addyosmani/agent-skills&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://github.com/addyosmani/agent-skills&quot;&gt;https://github.com/addyosmani/agent-skills&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://github.com/addyosmani/agent-skills&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Production-grade engineering skills for AI coding agents. - addyosmani/agent-skills&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;GitHub&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;GitHub - addyosmani/agent-skills: Production-grade engineering skills for AI coding agents.&quot; src=&quot;/static/https://cdn4.telesco.pe/file/WHNfK72X7uIvl7HomZ1N3nJ3eC-hgi7SQJGFZSACWGt_T7b5NaLB3xeF4ysK3mRr7Y-xKHpIiEOTs4i_choatyBczlf8yAaU-0WLVirv-aSPwi7vv43bGlC3Rpbq8gmiEpCqqwNVf2v25zMlvAr-CfF8cry-_sSxsiRuyofQ5QtYw2hN-PZn5xZ71Bo1OyNcJdRhjsjeq5riOSV-16rYuYi9iay3xO4IqdEZwGhzk_dzQVwL1iHTE3vyExw12iuD-Bv2W6iVwjHHrq2vCdvqWOalJOfW5sxeh4aDNtBFgJn79d5JU9POVq3DCxzPg5RljayWYNpuw_xlblCg_5XGiA.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;GitHub - addyosmani/agent-skills: Production-grade engineering skills for AI coding agents.&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Production-grade engineering skills for AI coding agents. - addyosmani/agent-skills&lt;/div&gt;
&lt;/a&gt;</content:encoded></item></channel></rss>