Vibe Code to codebykarun.com: Your Guide to Vibe Coding (Part 7)

7 min read
best practicestemplatesaivibe coding

Part 2 of 5 in Evolution & Growth • Previously: What I Learned

In Part 1 of this series, we covered the core lessons. Now let's make it practical: best practices that work, pitfalls to avoid, and templates you can use today.

Best Practices That Emerged

1. Start with Structure

Define the architecture before diving into features.

Example Prompt:

Before we build features, let's establish the project structure. I want:
- Separate directories for components, utilities, types, and content
- Path aliases for cleaner imports
- A consistent naming convention (PascalCase for components, camelCase for utilities)
- TypeScript strict mode enabled

Show me the directory structure and tsconfig setup.

2. One Feature, One Conversation

Keep conversations focused on single features or components.

Why? Easier to review, test, and understand. Less overwhelming.

3. Review, Don't Just Accept

Read the code. Ask questions. Suggest improvements.

Example Follow-up:

This looks good, but I see we're using 'any' types in a few places. Can we 
make these more specific? Also, should we add error boundaries for the MDX 
rendering in case something goes wrong?

4. Test Immediately

After each feature, test it in the browser.

Testing Prompt:

I'm getting an error when I load the article page: [paste error]. The article 
exists in the file system. What could be causing this?

5. Commit Frequently

Each completed feature gets a commit. This makes it easy to:

  • Roll back specific changes
  • Track progress
  • Review history

6. Document as You Go

Documentation Prompt:

Create a BLOG_AUTHORING.md file that explains how to add new articles to this 
blog. Include the frontmatter format, where to place files, and how the slug 
is generated. Make it clear enough that I could hand it to a non-technical 
writer.

7. Refactor with Context

When you see patterns that can be improved, address them immediately.

Refactoring Prompt:

I notice we're formatting dates in three different places with slightly 
different logic. Can we extract this into a utility function and use it 
consistently everywhere?

Common Pitfalls to Avoid

1. Accepting Code Without Understanding

  • Problem: You can't maintain what you don't understand
  • Solution: Always ask for explanations

2. Trying to Build Everything at Once

  • Problem: Hard to debug, overwhelming to review
  • Solution: Iterate in small, testable steps

3. Not Testing Frequently

  • Problem: Compound errors that are hard to isolate
  • Solution: Test after each feature

4. Ignoring Code Patterns

  • Problem: Inconsistent codebase
  • Solution: Establish patterns early

5. Forgetting You're the Architect

  • Problem: AI makes tactical decisions without strategic direction
  • Solution: You own the vision and architecture

Prompt Templates You Can Use

Here are copy-paste-ready prompts for common scenarios:

Starting a New Project

I want to build a [type of site] using [tech stack]. I'm comfortable with 
[your skills] but new to [what you're learning]. The site needs to:
- [Feature 1]
- [Feature 2]
- [Feature 3]

What's the best architecture and folder structure for this? I prefer 
[your preferences like TypeScript, specific libraries, etc.].

Adding a Feature

I need to add [feature name] to my [type of app]. The feature should:
- [Requirement 1]
- [Requirement 2]
- [Edge case to handle]

It should integrate with my existing [related component/system]. Use 
[specific libraries/patterns] if possible. Make sure it's properly typed 
with TypeScript.

Debugging

I'm getting this error: [paste full error]

Here's the code causing it: [paste relevant code]

Context: [what you were trying to do, what you expected, what actually happened]

What's wrong and how do I fix it?

Refactoring

I have this code that works but isn't great: [paste code]

The issues I see:
- [Issue 1]
- [Issue 2]

Can you refactor this to be more [maintainable/performant/readable]? 
Use [patterns or conventions you prefer].

Understanding Code

I have this code that works, but I don't fully understand it: [paste code]

Specifically:
- Why [specific line or pattern]?
- What happens if [edge case]?
- Are there better alternatives to [specific approach]?

Explain it like I'm new to [framework/pattern].

Design/Styling

I need to style [component/page]. I want it to feel [adjectives like 
"modern", "minimal", "professional"]. Think [reference like "GitHub" 
or "Linear"] but [difference].

Requirements:
- Responsive design
- Dark mode support
- [Specific visual elements]

Use [Tailwind/CSS-in-JS/etc.] and make it accessible.

Performance Optimization

My [page/component] is slow. Specifically, [describe the slowness].

Current implementation: [paste code or describe approach]

What's causing the performance issue and how can I optimize it? I'm using 
[framework] with [relevant libraries].

The Results

After three weeks of vibe coding:

  • 10 complete articles with proper formatting
  • Fully responsive design that works on all devices
  • Dark mode with a polished theme system
  • SEO optimized with metadata and proper semantic HTML
  • Type-safe throughout with zero TypeScript errors
  • Fast performance with Next.js 15 Server Components
  • Production ready and deployed

Total lines of code: ~2,500 Total AI conversations: ~50 Bugs in production: 0 (so far!)

Would I Do It Again?

Absolutely. But with the lessons learned:

  • ✅ Stay engaged and think critically
  • ✅ Be specific in my requests
  • ✅ Iterate in small steps
  • ✅ Test constantly
  • ✅ Understand everything
  • ✅ Own the architecture

The Future of Development

Vibe coding isn't the future—it's the present. The developers who will thrive are those who learn to:

  1. Collaborate with AI effectively
  2. Architect systems thoughtfully
  3. Review code critically
  4. Learn continuously from the process

Your Vibe Coding Checklist

Ready to start? Use this checklist:

Before You Start:

  • Define your vision and requirements
  • Identify what you know vs. need to learn
  • Set up your development environment

During Development:

  • Start with project structure
  • Build one feature at a time
  • Test after each feature
  • Ask "why?" frequently
  • Commit completed features
  • Document as you go

After Each Feature:

  • Understand the code
  • Test in the browser
  • Check for consistency
  • Refactor if needed

Before Deploying:

  • Review the entire codebase
  • Test all features
  • Check accessibility
  • Optimize performance
  • Document for future you

Final Thoughts

Building this site taught me that vibe coding is less about AI replacing developers and more about augmenting developer capabilities.

I wrote every line of this site—I just had an incredibly smart assistant helping me:

  • Suggesting patterns
  • Writing boilerplate
  • Offering alternatives
  • Teaching me new techniques

The result is a production site I'm proud of, built in a fraction of the time, with code I fully understand and can maintain.

That's the promise of vibe coding: Not replacing developer skills, but multiplying them.

Start Your Vibe Coding Journey

The key is to:

  1. Be specific in your prompts
  2. Stay engaged and ask questions
  3. Test frequently and iterate
  4. Understand the code you're given
  5. Own the architecture and decisions

The future of development is collaborative, fast, and incredibly exciting.

Welcome to vibe coding.


More in this series: Part 1: What is Vibe Coding?Part 2: Tech StackPart 3: First HourPart 4: MDX PipelinePart 5: Design SystemPart 6: Lessons Learned


Thank you for following this journey. If you build something with vibe coding, I'd love to hear about it!