Guide

Vibe Coding Do's and Don'ts — A Practical Guide

Back to all posts

Vibe coding is not going away. AI-assisted development is now a core part of how modern software gets built. But like any powerful tool, it can produce incredible results or spectacular disasters depending on how you use it. After working with dozens of startup teams who use AI coding tools daily, I have compiled the practical guide I wish existed when this wave started.

These are not theoretical rules. Every single one of these comes from a real mistake I have either made myself or watched a team make. Consider this your field guide to vibe coding without wrecking your codebase.

The Do's

1. DO Start With a Clear Architecture Before Prompting

This is the single most important rule. Before you type a single prompt, draw your system on paper. Sketch out your data models, your API boundaries, your service dependencies. Know what you are building before you ask AI to build it.

AI is excellent at implementing a well-defined plan. It is terrible at creating that plan from scratch. If you start prompting without architecture, you will end up with a working prototype that is structurally unsound — and restructuring AI-generated code is harder than writing it from scratch.

The best vibe coders spend more time thinking before they prompt than they spend prompting. Architecture first, always.

2. DO Use Context Files to Give AI Your Project Conventions

Tools like CLAUDE.md, .cursorrules, and similar context files exist for a reason. They let you tell the AI how your project works: your naming conventions, your folder structure, your preferred patterns, your tech stack specifics.

Without context files, every prompt starts from zero and the AI will make assumptions that may conflict with your existing codebase. With them, you get consistent, project-aware output that actually fits into your system.

3. DO Review Every Line Like It Came From a Junior Developer

This mental model has saved me countless times. Treat AI-generated code exactly like a pull request from a talented but inexperienced developer. It will be syntactically correct. It will probably work for the happy path. But it might have subtle bugs, missing edge cases, inefficient queries, or security gaps.

Read every line. Question every decision. Do not merge code you cannot explain.

4. DO Write Tests Alongside AI-Generated Code

Here is the beautiful irony: AI is fantastic at writing tests. Use this to your advantage. After AI generates a feature, have it write tests for that feature too. Then review the tests carefully to make sure they actually cover the important cases.

Tests serve as documentation of what the code should do. If the AI wrote code you do not fully understand, well-written tests will tell you the intended behavior and catch regressions when you modify things later.

5. DO Commit Frequently

Create checkpoints before every major AI-driven change. Vibe coding sessions can go sideways fast. One bad prompt can cascade into a mess of changes across multiple files. If you have a clean commit to roll back to, you lose minutes instead of hours.

My rule: commit before every significant prompt. If the AI produces something you do not like, git checkout . and try again from a known good state.

6. DO Keep Prompts Atomic and Focused

One task per prompt. Do not ask the AI to "build the entire user management system." Ask it to "create the user registration endpoint with email validation." Then ask it to "add password hashing using bcrypt." Then "create the login endpoint with JWT tokens."

Small, focused prompts produce better code, are easier to review, and are simpler to roll back when something goes wrong. Big, sweeping prompts produce tangled code that is hard to understand and harder to debug.

7. DO Use AI for Boilerplate, Then Customize the Important Parts

Let AI generate the scaffolding — the CRUD endpoints, the component structure, the form layouts, the API clients. Then manually refine the parts that matter: the business logic, the validation rules, the error handling, the edge cases. This is where your engineering judgment adds the most value.

The Don'ts

1. DON'T Let AI Write Database Migrations Without Careful Review

This is where I have seen the most damage. AI will happily generate a migration that adds an index on a 50-million-row table without CONCURRENTLY. It will create foreign key constraints that lock tables. It will alter columns in ways that cause downtime.

Every database migration deserves manual, line-by-line review. Run them on staging first. Check for table locks. Understand what happens at scale. Migrations are permanent — once they run in production, there is no "undo prompt."

2. DON'T Skip Understanding the Code

If you cannot explain what a piece of code does, do not ship it. Period.

This is the cardinal sin of vibe coding. Shipping code you do not understand is planting a time bomb in your codebase. When it breaks — and it will — you will have no idea where to start debugging. Read the code. Trace the logic. Understand the dependencies. If something confuses you, ask the AI to explain it or rewrite it in a way you can follow.

3. DON'T Prompt in Circles

If the AI gives you bad output three times in a row, stop prompting and start thinking. Repeating the same prompt with minor variations is the vibe coding equivalent of banging your head against a wall. Step back. Rethink your approach. Maybe the problem is your prompt. Maybe the task is too complex for a single prompt. Maybe you need to break it down differently or provide more context.

4. DON'T Ignore Security

AI does not think about attack vectors by default. It will generate code that is vulnerable to SQL injection, XSS, CSRF, insecure direct object references, and a dozen other common exploits. It will store secrets in plain text. It will skip input validation. It will use outdated libraries with known CVEs.

Security review is non-negotiable for AI-generated code. If you are handling user data, payments, or authentication, assume the AI got the security wrong until you have verified otherwise.

5. DON'T Use AI-Generated Code in Production Without Testing

This should be obvious but it happens constantly. Code that works in development might fail under concurrent load, with unexpected input, or in edge cases the AI did not consider. Test it. Load test it. Break it intentionally. Find the failure modes before your users do.

6. DON'T Rely on a Single AI Tool

Different AI tools excel at different tasks. One might be great at frontend components but weak at backend architecture. Another might produce excellent tests but mediocre implementations. Build a toolkit, not a dependency. Know which tool to reach for based on the task at hand, and do not lock yourself into one ecosystem.

7. DON'T Vibe Code Your Infrastructure

DevOps needs human oversight. Terraform configs, Kubernetes manifests, CI/CD pipelines, IAM policies — these are areas where a single misconfiguration can take down your entire system or expose it to attackers. AI can help you draft infrastructure code, but a human with operational experience must review and approve every change. There is no "move fast and break things" with infrastructure. You just break things.

The Golden Rule

The best vibe coders are not the ones who write the most prompts — they are the ones who know when to prompt and when to think.

Vibe coding at its best is a multiplier on your existing skills. It takes a good engineer and makes them faster. It takes a clear thinker and lets them build more. But it does not replace the thinking. It does not replace the judgment. And it definitely does not replace the responsibility of understanding what you ship.

Use these rules as your guardrails. Vibe code with confidence, but vibe code with discipline. Your future self — and your production systems — will thank you.