YC Vibe Coding 指南(中英对照版)

规划流程(Planning process)

  • Create a comprehensive plan: Start by working with the AI to write a detailed implementation plan in a markdown file (创建详尽计划:首先与人工智能协作,在 markdown 文件中撰写详细的实施计划)
  • Review and refine: Delete unnecessary items, mark features as won't do if too complex (审查与完善:删除不必要的条目,若功能过于复杂则标记为“暂不开发”)
  • Maintain scope control: Keep a separate section for ideas for later to stay focused (保持范围控制:单独开辟一个区域记录后续想法,以保持专注)
  • Implement incrementally: Work section by section rather than attempting to build everything at once (增量实施:逐段开展工作,而非试图一次性构建所有内容)
  • Track progress: Have the AI mark sections as complete after successful implementation (跟踪进度:在成功实施后,让人工智能将对应部分标记为完成)
  • Commit regularly: Ensure each working section is committed to Git before moving to the next (定期提交:在推进到下一部分之前,确保每个工作段都提交到 Git)

版本控制策略(Version control strategies)

  • Use Git religiously: Don't rely solely on the AI tools' revert functionality (严格使用 Git:不要仅依赖人工智能工具的回退功能)
  • Start clean: Begin each new feature with a clean Git slate (全新启动:每个新功能都从干净的 Git 状态开始)
  • Reset when stuck: Use git reset --hard HEAD if the AI goes on a vision quest (陷入瓶颈时重置:若人工智能偏离方向,使用 git reset --hard HEAD 命令)
  • Avoid cumulative problems: Multiple attempts create layers and layers of bad code (避免累积问题:多次尝试会产生层层糟糕的代码)
  • Clean implementation: When you finally find a solution, reset and implement it cleanly (干净实施:当最终找到解决方案时,重置并干净地实施)

测试框架(Testing framework)

  • Prioritize high-level tests: Focus on end-to-end integration tests over unit tests (优先高层测试:相较于单元测试,更关注端到端的集成测试)
  • Simulate user behavior: Test features by simulating someone clicking through the site/app (模拟用户行为:通过模拟用户点击网站/应用来测试功能)
  • Catch regressions: LLMs often make unnecessary changes to unrelated logic (捕捉回归问题:大型语言模型常对不相关逻辑进行不必要的修改)
  • Test before proceeding: Ensure tests pass before moving to the next feature (测试后推进:在开展下一个功能前,确保测试通过)
  • Use tests as guardrails: Some founders recommend starting with test cases to provide clear boundaries (将测试用作护栏:一些创始人建议从测试用例入手,以明确边界)

有效调试(Effective bug fixing)

  • Leverage error messages: Simply copy-pasting error messages is often enough for the AI (利用错误信息:简单复制粘贴错误信息通常足以让人工智能处理)
  • Analyze before coding: Ask the AI to consider multiple possible causes (编码前分析:让人工智能考虑多种可能的原因)
  • Reset after failures: Start with a clean slate after each unsuccessful fix attempt (失败后重置:每次修复尝试失败后,从干净状态重新开始)
  • Implement logging: Add strategic logging to better understand what's happening (实施日志记录:添加战略性日志,以更好地了解情况)
  • Switch models: Try different AI models when one gets stuck (切换模型:当一个模型陷入瓶颈时,尝试不同的人工智能模型)
  • Clean implementation: Once you identify the fix, reset and implement it on a clean codebase (干净实施:一旦确定修复方案,在干净的代码库上重置并实施)

AI 工具优化(AI tool optimization)

  • Create instructions files: Write detailed instructions for your AI in appropriate files (cursor.rules, windsurf.rules, claude.md) (创建指令文件:在合适的文件(如 cursor.rules、windsurf.rules、claude.md)中为人工智能编写详细指令)
  • Local documentation: Download API documentation to your project folder for accuracy (本地文档:将 API 文档下载到项目文件夹以确保准确性)
  • Use multiple tools: Some founders run both Cursor and Windsurf simultaneously on the same project (使用多种工具:一些创始人在同一个项目中同时运行 Cursor 和 Windsurf)
  • Tool specialization: Cursor is a bit faster for frontend work, while Windsurf think longer (工具专业化:Cursor 在前端工作上稍快,而 Windsurf 思考时间更长)
  • Compare outputs: Generate multiple solutions and pick the best one (比较输出:生成多种解决方案并挑选最佳的一个)

复杂功能开发(Complex feature development)

  • Create standalone prototypes: Build complex features in a clean codebase first (创建独立原型:首先在干净的代码库中构建复杂功能)
  • Use reference implementations: Point the AI to working examples to follow (使用参考实现:将人工智能指向可遵循的工作示例)
  • Clear boundaries: Maintain consistent external APIs while allowing internal changes (清晰边界:在允许内部变更的同时,保持一致的外部 API)
  • Modular architecture: Service-based architectures with clear boundaries work better than monorepos (模块化架构:具有清晰边界的基于服务的架构比单体代码库更有效)

技术栈考量(Tech stack considerations)

  • Established frameworks excel: Ruby on Rails works well due to 20 years of consistent conventions (成熟框架表现出色:Ruby on Rails 因其 20 年的一致惯例而表现良好)
  • Training data matters: Newer languages like Rust or Elixir may have less training data (训练数据很重要:像 Rust 或 Elixir 这样的较新语言可能训练数据较少)
  • Modularity is key: Small, modular files are easier for both humans and AIs to work with (模块化是关键:小型、模块化的文件对人类和人工智能来说都更容易处理)
  • Avoid large files: Don't have files that are thousands of lines long (避免大文件:不要有数千行的文件)

编码之外(Beyond coding)

  • DevOps automation: Use AI for configuring servers, DNS, and hosting (DevOps 自动化:使用人工智能配置服务器、DNS 和托管服务)
  • Design assistance: Generate favicons and other design elements (设计辅助:生成网站图标和其他设计元素)
  • Content creation: Draft documentation and marketing materials (内容创作:起草文档和营销材料)
  • Educational tool: Ask the AI to explain implementations line by line (教育工具:让人工智能逐行解释实现)
  • Use screenshots: Share UI bugs or design inspiration visually (使用截图:直观地分享 UI 漏洞或设计灵感)
  • Voice input: Tools like Aqua enable 140 words per minute input (语音输入:像 Aqua 这样的工具支持每分钟 140 词的输入)

持续改进(Continuous improvement)

  • Regular refactoring: Once tests are in place, refactor frequently (定期重构:一旦测试到位,频繁进行重构)
  • Identify opportunities: Ask the AI to find refactoring candidates (识别机会:让人工智能找出可重构的候选对象)
  • Stay current: Try every new model release (保持前沿:尝试每个新发布的模型)
  • Recognize strengths: Different models excel at different tasks (认识优势:不同的模型在不同任务上表现出色)