Video Information
- Title: How To Get The Most Out Of Vibe Coding | Startup School
- Author: Y Combinator
- URL: https://www.youtube.com/watch?v=BJjsfNO5JTo
Overview
This video focuses on “Vibe Coding”—using AI tools for programming—not as aimless “feeling-based” coding, but as a systematic set of best practices that can be learned and mastered. Y Combinator partner Tom combines practical skills from YC founders with his own 15 golden rules to provide developers with a detailed manual for “AI-assisted programming.” The conclusion is that by treating AI as a “junior programmer” that requires clear planning, detailed context, and rigorous testing, developers can significantly enhance their productivity, transforming AI from a simple code snippet generator into a versatile programming partner capable of handling complex functions, debugging, refactoring, and even DevOps and design tasks.
Section 1: Frontline Insights from YC Founders—Practical Tips for Vibe Coding
Tom shares valuable insights from Y Combinator (YC) founders based on their daily development experiences. These tips are practical wisdom distilled from real product development and entrepreneurial pressures, aimed at addressing common challenges when using AI programming tools.
-
1. Switch Tools to Resolve “Stalls”
- Problem: AI programming assistants (like Cursor, Windsurf) sometimes get stuck in a “thinking loop” or fail to solve a specific debugging issue.
- Solution: Don’t get stuck on one tool. A very effective tip is to copy and paste the stalled code snippet and problem into the native web interface of a large language model (LLM) (like ChatGPT, Claude) to ask questions. Sometimes, this “change of environment” can yield solutions that are not available directly in the IDE plugin.
-
2. Use in Parallel to Boost Efficiency
- Idea: Different AI tools have different strengths and weaknesses, such as thinking speed and code generation style. By using multiple tools simultaneously, you can maximize efficiency.
- Practice: One founder opens both Cursor and Windsurf on the same project. He finds that Cursor usually responds faster and is suitable for quick front-end changes, while Windsurf takes longer but may generate more thoughtful back-end logic. He switches to Cursor to complete other tasks while waiting for Windsurf, achieving “human-machine parallelism.” Interestingly, he sometimes gives both tools the same instructions and presses enter simultaneously to compare their different implementations and choose the best one.
-
3. View Vibe Coding as a “New Language”
- Mindset Shift: The essence of Vibe Coding is not coding with code, but coding with natural language. You need to learn how to communicate with AI in a precise and unambiguous manner, just like learning a new programming language (like Python or Java).
- Practice: This means providing extremely detailed context and information. You cannot assume that AI “should know” what you are thinking. The more specific the instructions and the richer the background information, the better the results.
-
4. Start with Test Cases
- Idea: This is a powerful technique that applies the classic “Test-Driven Development” (TDD) concept to AI programming. The core is to have humans define the “success criteria” (i.e., test cases) first, then let AI operate within this “fence”.
- Process:
- Step 1: Manually write high-level integration test cases, without letting AI do it. These tests should verify the end-to-end correctness of a feature.
- Step 2: Provide these test cases to AI and instruct it to write code with the goal of “passing all tests”.
- Advantage: This approach frees you from micromanaging every line of code generated by AI. As long as all tests turn green, it means the functionality has been implemented as expected, and you can confidently move to the next step, only needing to check the overall structure and modularity of the code.
-
5. Prioritize Architectural Planning
- Problem: Directly letting AI work in a complex codebase can easily lead it to generate code that does not conform to the overall architecture and is hard to maintain.
- Solution: Before starting any coding task, spend sufficient time in a pure LLM chat interface (rather than an IDE plugin) to plan and design the scope and technical architecture of the functionality you are going to build with AI. You need to “discuss” and determine module divisions, interface definitions, data flows, etc. Only when this blueprint is clear should you hand it over to the coding assistant in the IDE for implementation.
-
6. Identify and Avoid “Rabbit Holes”
- Warning Signs: You need to be keenly aware if AI is falling into a “rabbit hole,” which is a state of ineffective, repetitive work. Signs include AI continually regenerating similar but still ineffective code or you find yourself repeatedly pasting the same error message to it.
- Response Strategy: Once you identify such signs, pause immediately. Step back and reassess the problem. You can explicitly tell AI: “Let’s step back and analyze why this is failing?” This often means you haven’t provided enough context, or the current problem may be beyond AI’s capabilities.
Section 2: Tom’s Best Practices—Systematizing Your Vibe Coding Workflow
After sharing scattered tips from YC founders, Tom systematizes these ideas and combines his experience to propose a more comprehensive framework of 15 points for Vibe Coding best practices. This framework covers the entire process from tool selection, project planning to debugging and refactoring.
-
Planning and Setup
- 1. Choose the Right Tools: Beginners are advised to start with tools like Replit or Lovable that offer real-time visual interfaces; experienced developers can directly use more professional tools like Cursor, Windsurf, or Claude Code.
- 2. Create and Follow a Detailed Plan: Collaborate with AI to create a detailed, step-by-step Markdown plan document. Strictly follow the plan, implementing only a small part at a time, testing and committing to Git after each step, and letting AI update the status of the plan document.
- 3. Use Git Frequently: Treat Git as the ultimate, most reliable rollback mechanism. Before any major modifications by AI, ensure your workspace is clean. If AI messes up the code, don’t hesitate to use
git reset --hard HEADto roll back completely, then restart with a clearer instruction. - 4. Write High-Level Tests: Have AI write high-level integration tests that simulate real user behavior rather than low-level unit tests. This set of tests not only verifies functionality correctness but also captures any regression errors that AI may inadvertently introduce during subsequent modifications.
- 5. Write Detailed Instruction Files: Fully utilize the instruction files provided by tools (like Cursor’s rules file) to write hundreds of lines about your project architecture, coding standards, technology choices, etc. This greatly enhances AI’s efficiency and accuracy.
- 6. Provide Local Documentation: Don’t expect AI to perfectly read real-time API documentation from the web. The best practice is to download the documentation of the third-party libraries you are using locally, place it in a subdirectory of your project, and clearly instruct AI to read this local documentation before coding.
-
Execution and Interaction
- 7. Use LLM for Non-Coding Tasks: Broaden your imagination of what AI can do. It can help you configure DNS servers, set up Heroku hosting, create favicon icons, or even write a script to automatically adjust image sizes and formats.
- 8. Use LLM as a Teacher: When you use AI to implement a technology you are unfamiliar with, have it explain the implementation principles of the code line by line. This is a great opportunity for “learning by doing.”
- 9. Utilize Screenshots and Voice Input: Most modern AI tools support multimodal input. You can directly paste a screenshot of a UI bug to AI or use a screenshot of a design you like as a reference. Additionally, try using tools like Aqua for voice input, which is much faster than typing and AI is tolerant of minor grammatical errors.
-
Debugging and Handling Complex Functions
- 10. Effective Debugging: When encountering bugs, the first step is always to paste the complete error message (including stack traces) directly to AI. For complex bugs, first, have AI brainstorm several possible causes, then try them one by one. After each failed attempt, remember to roll back the code to avoid stacking new errors on top of the wrong code.
- 11. Handling Complex Functions: If you need to implement a very complex function, a good approach is to first have AI implement a minimal reference version in a brand new, clean independent project. Once this reference version works, use it as a model to instruct AI to mimic this reference implementation in your main codebase’s complex environment to build the complete functionality.
-
Architecture and Refactoring
- 12. Focus on Small Files and Modularity: AI performs much better when dealing with small, well-defined modular code than with large, coupled monolithic applications. Embracing microservices or modular architecture makes AI-assisted development much easier.
- 13. Choose the Right Tool Stack: AI’s performance heavily depends on the quality and consistency of its training data. Choosing mature frameworks like Ruby on Rails, which have 20 years of history and highly standardized community norms, will yield surprisingly good results for AI, as it has access to a wealth of high-quality, stylistically consistent code. Conversely, the success rate of AI may be lower on newer, niche languages (like Rust, Elixir).
- 14. Frequent Refactoring: When a function is working and has test coverage, it’s the best time to refactor. You can confidently let AI help you identify code smells (like duplicate code) and perform refactoring, as tests will ensure the safety of the refactoring.
-
Continuous Evolution
- 15. Continuous Experimentation: The technology behind Vibe Coding is rapidly evolving. You need to maintain an open mindset, continuously trying every new model version and new tools to find the best combinations for different tasks (planning, implementation, debugging, refactoring). For example, Tom found that Gemini excels in project planning, while Claude Sonnet 3.5 is superior in code implementation.
Framework & Mindset Model
To truly integrate Vibe Coding into daily development and unleash its full potential, you need a systematic framework that goes beyond scattered tips and undergo a profound mindset shift.
Maximizing Vibe Coding Output: The “P-T-G-T-R” Five-Step Cycle
- Step One: Plan
- Core Mindset: Adopt an “architect’s mindset” rather than a “coder’s mindset.”
- Action: Before writing any code, engage in high-level conversations with AI to collaboratively create a detailed, step-by-step Markdown plan document. Define scope, modules, and interfaces clearly.
- Step Two: Test
- Core Mindset: Embrace “Test-Driven Development” (TDD) thinking.
- Action: Before implementing any functionality, manually write high-level, end-to-end integration tests that define the standard of “done.”
- Step Three: Generate
- Core Mindset: Treat AI as a “junior programmer”; you need to provide clear instructions and complete context.
- Action: Hand over a small part of the plan along with relevant context (local documentation, instruction files) to AI for code generation. The goal is to pass the tests.
- Step Four: Validate and Commit
- Core Mindset: Adopt the mindset that “version control is the lifeline.”
- Action: Once tests pass, quickly review the AI-generated code manually, focusing mainly on its structure and readability. Then, immediately use Git to commit this small batch of working changes.
- Step Five: Refactor
- Core Mindset: Embrace the “Boy Scout Rule” (leave the camp cleaner than you found it).
- Action: After functionality is stable and has test coverage, actively let AI help you with code refactoring to maintain the health of the codebase. Then, return to Step One and start the next functionality cycle.
Required Core Mindset Shifts
-
1. From “AI is a Magician” to “AI is a Junior Programmer”
- Old Mindset: AI is a magical black box; I give it a vague idea, and it should perfectly implement it. When it fails, I feel disappointed and frustrated.
- New Mindset: AI is a very talented, fast, but inexperienced and naive “junior programmer.” It needs a “senior programmer” (that’s you) to provide clear requirement documents (plans), strict quality assurance (tests), complete project background (context), and conduct code reviews on its output. You need to manage it, not expect it to manage itself.
-
2. From “Pursuing One-Time Perfection” to “Embracing Rapid Iteration”
- Old Mindset: I want AI to generate all the code I want perfectly with one perfect prompt.
- New Mindset: Collaborating with AI is a highly iterative process. The core is “small steps, fast runs.” By rapidly cycling through “plan-test-generate-commit,” break a big problem into countless small problems to solve. Don’t be afraid to roll back; Git is your best friend. The perfect final product is composed of a series of imperfect but continually corrected iterative steps.
-
3. From “Code Creator” to “System Orchestrator”
- Old Mindset: My main value lies in writing code myself.
- New Mindset: My main value lies in thinking, planning, designing, and validating. AI is responsible for the specific code implementation (“How”), while I define what to do (“What”) and why to do it (“Why”). My role has elevated from a “craftsman” to an “architect” and “project manager”; I orchestrate various resources, including AI, to achieve goals most efficiently.
-
4. From “Isolated Developer” to “Open Experimenter”
- Old Mindset: I only use the tool I am most familiar with.
- New Mindset: The field of AI programming is rapidly changing, and there is no “silver bullet.” I must maintain an open, experimental mindset, constantly trying new tools, new models, and new workflows. I need to become a community member who is willing to share and learn, as today’s best practices may be replaced by new paradigms next week.
Comments
Discussion is powered by Giscus (GitHub Discussions). Add
repo,repoID,category, andcategoryIDunder[params.comments.giscus]inhugo.tomlusing the values from the Giscus setup tool.