Vibe Coding with AI: Best Practices for Human-AI Collaboration in Software Development

-

— collaborating with an agentic AI-powered IDE to construct software — is rapidly becoming a mainstream development approach. Tasks that after required weeks of engineering effort can now often be accomplished in hours or days. Modern AI-assisted development environments can generate structured, modular code across multiple languages, design architectures, write tests, and even debug issues with minimal human input.

A growing ecosystem of such tools has emerged, many built on top of familiar development environments comparable to VS Code. While these platforms offer similar capabilities, they’re evolving so rapidly that any differentiating feature in a single tool typically appears in competing tools inside a brief time frame. In consequence, the particular tool a corporation chooses is commonly less essential than how effectively developers learn to work with these AI systems to maximise productivity while controlling cost and complexity.

So the pertinent query is that if AI can generate high-quality code faster than most developers can write it manually, what role stays for the developer?

The challenge is not any longer simply writing code. As an alternative, developers must learn the best way to collaborate effectively with AI coding agents:

  • How should developers structure instructions and prompts to guide the system toward the specified end result?
  • Where should humans intervene in the event process?
  • How can teams validate AI-generated code to make sure it’s reliable, maintainable, and production-ready?

In this text, we explore practical principles for working with AI-enhanced development environments. We’ll outline key risks related to Vibe coding tools and take a look at ways to mitigate them. Quite than specializing in any specific tool, we’ll examine the broader human-AI collaboration model that allows teams to extract probably the most value from these systems.

As an example these ideas, we’ll walk through a straightforward but realistic use case: constructing an intelligent search system using Retrieval Augmented Generation (RAG) on a dataset of reports articles. While the issue may appear straightforward, it reveals several subtle ways during which AI-generated architectures and code can drift toward unnecessary complexity without careful human oversight.

Through this instance, we’ll examine each the strengths and limitations of AI-assisted development, and highlight the role that developers still play in guiding, validating, and refining the output of those powerful tools.

The Use Case

While the principles discussed here apply to any form of software development, let’s illustrate them with a practical example: constructing an intelligent AI-powered search system (RAG) over a dataset of news articles (CC0). The dataset incorporates business and sports news articles published over 2015 and 2016, together with the title.

The vibe coder used here is Google Antigravity but as mentioned earlier, this is just not essential as other tools also function in a really similar way.

Risks related to Vibe Coding

As with every powerful technology, vibe coding introduces a brand new set of risks which are easy to overlook—precisely due to how briskly and capable the system appears.

In this instance, as I worked through constructing a straightforward RAG system over news articles, three patterns became immediately apparent.

First, the classic garbage-in-garbage-out principle still applies. The AI generates code quickly and confidently—but when the prompts were even barely ambiguous, the output drifts away from what is definitely needed. Speed doesn’t guarantee correctness.

Second, prompting stays a core skill, despite the fact that the interface has modified. As an alternative of writing LLM system prompts directly, we at the moment are prompting the IDE. However the responsibility stays the identical: clear, precise instructions. Actually, poor prompting has a really tangible cost — developers quickly burn through Pro model limits without getting closer to a usable solution.

Third, and more subtly, over-engineering is an actual risk. Since the system can generate complex architectures effortlessly and at little cost, it often does. Left unchecked, this could result in designs which are way more complex than the issue requires —introducing unnecessary components that might be difficult to keep up later.

These risks are usually not theoretical—they directly influence how the system evolves. The query then becomes: how will we control them?

What can teams do about them

To deal with these risks, listed below are a number of core principles that ought to form the inspiration of AI-powered SDLC:

Start With Clear Requirements

Before asking the AI to generate architecture or code, it will be significant to ascertain not less than a minimal definition of the issue. In ideal scenarios, this may occasionally come from an existing business requirements document. Nevertheless, in lots of AI projects the one requirement the shopper may provide is to point to a document repository and specify a loosely defined goal comparable to “Users should find a way to ask questions on the news articles and receive contextual responses.” While this may occasionally seem to be an affordable place to begin to a human, it is definitely an especially open-ended scope for an AI system to interpret and code and qualifies as a garbage-in prompt. It is analogous to operating an LLM with none guardrails — there’s an excellent probability the output is not going to be what you expect. A practical method to constrain the scope is to define a set of representative test queries that users are more likely to ask. These queries provide the AI with an initial scope boundary and reduce the chance of unnecessary complexity within the resulting system.

Generate the Architecture Before Writing Code

Unless you might be constructing a trivially easy prototype, it’s prudent to all the time ask to create an architecture document first and optionally, a tasks plan to see the sequence during which it’ll execute the important thing steps comparable to data ingestion, agent construct, test case execution and results validation. Use a big pondering model (comparable to Gemini-3-Pro in Planning mode) for this step. Even when you might have an architecture in mind, somewhat than providing that upfront and making a bias, ask the AI to design the architecture from a clean slate. After which use your personal design to challenge, refine and ensure the design. The developer’s role then becomes considered one of critical evaluation — asking questions comparable to — or . Through this iterative dialogue, the architecture step by step converges toward a design that balances capability, cost, and maintainability.

As an example the above ideas for our news articles use case, I began with the next initial prompt to set basic boundaries for the Vibe coder. I specifically asked it to supply an architecture document only without starting to code.

We'll begin on a brand new project within the C:antigravityVibeCode folder. All artifacts comparable to source code, outputs, architecture docs ought to be stored in appropriate folders inside this. The Dataset folder has a file called Articles.xlsx. Which contain many news articles in business and sports together with heading and date published. Have a look into it when you want. There have to be a RAG built which might answer a various range of user questions from specific, easy to retrieve ones to broad ones that will require scanning all of the articles, which is perhaps impractical. I would like a technique and architecture the way you will do it. Some test queries might be:
What do the articles say about oil prices in 2015 ?
Tell me business highlights in 2016
What sport are a lot of the articles about ?
In sports, are there mention of records being created ?
The LLM used will likely be gemini 2.5 flash, but for now lets have the architecture doc only

An in depth architecture document RAG_Architecture.md was produced and a rationale was provided as to why an agentic dual-engine RAG is required.

To successfully answer your mixture of specific questions and broad domain queries (like counting topics) without scanning all articles each time, a normal vector search RAG is just not going to work. As an alternative, you wish an Agentic dual-engine RAG architecture.

I actually have drafted an in depth strategy and architecture document that addresses this and saves to the project folder as requested: 

…VibeCodeArchitectureRAG_Architecture.md
.

Here is the high-level summary of the strategy:

1. The Challenges with Your Dataset
Your dataset has limited structured columns (Date, Heading, NewsType). Which means that questions like "What sport are a lot of the articles about?" are nearly inconceivable to reply natively using either pure SQL or pure Vector Search without extracting the particular "sport" entity first.

2. Dual-Engine RAG Setup
Our architecture relies on a Data Enrichment Pipeline during ingestion and an Intelligent Routing Agent at query time:

Ingestion (LLM Pre-processing): In the course of the ingestion phase, we pass the text of every article to Gemini 2.5 Flash to mechanically extract topics (e.g., cricket, football, oil) and entities, and optionally summarize the text. These recent metadata fields are stored in a daily relational database (or Pandas dataframe) and attached as metadata tags to the text embeddings in your vector database.
Intelligent Router Agent (Gemini 2.5 Flash): An agent sits in front of the user's queries to find out what tool to make use of to retrieve the data:
The SQL/Data Analytics Engine Tool: If the query is aggregational or broad (e.g., "Tell me business highlights in 2016" or "What sport are a lot of the articles about?"), the LLM generates a SQL/Pandas query, counts/filters the extracted metadata, and synthesizes the precise answers without touching the vector engine.
The Vector Semantic Search Tool: If the query is very qualitative and specific (e.g., "What do the articles say about oil prices in 2015?" or "In sports, are there mention of records being created?"), the Router uses vector search, but strictly utilizes the structured fields (like Date=2015 or NewsType='sports') to filter the embeddings prior to searching.

Validate the Design

It is worth it spending time to read the reasons provided for the architectural selections made, and the responses to your suggestions and challenges. The AI will provide detailed explanations of the professionals and cons of every aspect of the design, but understanding and assuring oneself that it’s the best balance between functionality, complexity and maintainability continues to be the role of the developer, or architect within the team, because the case could also be.

Strengthen the Design through Edge Cases

Once we understand the architecture and rationale, its time to take into consideration Edge test cases which may break the architecture. For example, here I asked "How about if the user asks to summarize the negative articles in all the database. Which could also be tens of hundreds of articles, How will you respond"

In response, an amendment to the architecture is proposed. Which is so as to add a sentiment extraction during ingestion, hierarchical summarization (generate one sentence summary of articles to stop context window overflow of the LLM), and a strategic sampling with SQL fallback. This refinement step could also be done iteratively for other edge cases that come to mind.

Have the AI challenge itself

Try asking the AI to think about edge cases that break its own architecture. You too can select a special model, comparable to Claude Opus for this step. A caveat: AI models often are inclined to be overly critical of one other model’s work, so the human’s judgment is important in deciding which suggestions are worthwhile.

Once I asked for this to be done, the model generated several sophisticated test queries, which the architecture may not find a way to handle. Similar to complex cross document comparison, exact phrase/keyword matching, deep relational and network queries, contradiction and claim verification etc. For every, the reasoning was provided, and the suggested addition to the architecture, from

Listed below are the queries it generated and suggested amendments:

1. Complex Cross-Document Comparison (The "Map-Reduce" Problem)
    • Query: "Compare the first reasons given for oil price drops in 2015 versus the explanations given in 2016. What are the important thing differences?"
    • Potential Addition: A Map-Reduce or Multi-Agent workflow where one agent summarizes 2015, one other summarizes 2016, and a final agent compares the 2 summaries.
2. Exact Phrase / Lexical Keyword Matching (The "BM25" Problem)
    • Query: "Find the particular article that used the precise phrase 'unprecedented fiscal cliff' or mentions the obscure ticker symbol 'ZYXW'."
    • Potential Addition: Hybrid Search. Adding a conventional lexical search engine (like TF-IDF or BM25) and mixing its scores with the vector search scores (Alpha mixing or Reciprocal Rank Fusion).
3. Deep Relational & Network Queries (The "Knowledge Graph" Problem)
    • Query: "Which corporations are most regularly mentioned in the identical articles together when discussing the tech sector?"
    • Potential Addition: A Knowledge Graph database (like Neo4j) built during ingestion that maps Entity -> Co-occurs_with -> Entity.
4. Sequential and Causal Timelines (The "Temporal Reasoning" Problem)
    • Query: "Trace the chronological sequence of events that led to the resignation of the cricket team captain, week by week."
    • Potential Addition: A dedicated Timeline Synthesizer Tool that forces strict chronological retrieval and chains the narrative sequentially.
5. Contradiction and Claim Verification (The "Fact-Checking" Problem)
    • Query: "Are there any articles that contradict one another regarding the success of the recent business merger between Company A and Company B?"
    • Potential Addition: A Claim Evaluation Module that specifically evaluates retrieved chunks for arguing viewpoints before passing them to the user.

Detect Over-Engineering

Review critically if the extra complexity is warranted for the extra functionality it’d enable. On this case, for a straightforward problem like querying news articles, these changes seemed excessive. Let’s query the reasoning for the complexity. ““. Perhaps, a named entity extraction (NER) for metadata will likely be sufficient. ““

Challenge the Complexity

It’s perfectly reasonable (and ought to be a best practice), to beat back on AI generated architecture or code, when it seems overly complex. In such a case, ask for reasoning, workarounds and simpler alternatives. Here, I switched the model to Claude and asked to supply a Self-Critique. The result, as attached here, is an acknowledgment that the sting queries are unlikely or may be handled with simpler modifications comparable to higher tool usage by the agent. And on this case, the AI concluded that .

Here I’m noting the outcomes of the self-critique:

1. Cross-Document Comparison (oil 2015 vs 2016): Yes, very likely. Comparative temporal questions are natural for a news corpus. But truthfully, the prevailing architecture can handle this — the agent just calls the vector tool twice with different date filters and compares. It doesn't need a brand new "Map-Reduce module." I over-complicated it.
2. Exact Phrase / BM25: Unlikely. Users of a news Q&A system rarely seek for exact phrases or ticker symbols. That is more of a search engine use case. I'd drop this as a priority.
3. Knowledge Graph / Co-occurrence: **Unlikely at this scale.** With 2,700 articles, co-occurrence evaluation is a distinct segment analytical query. A straightforward SQL JOIN on the `Key_Entities` column could handle the rare case. A Neo4j graph is huge overkill here.
4. Temporal/Causal Timelines: **Moderately likely.** "What happened leading as much as X?" is a natural query for news. But the prevailing architecture can handle it: vector search to search out the subject + SQL sort by date. No recent module needed — just good agent prompting.
5. Contradiction Detection: **Unlikely.** Users rarely ask "do articles contradict one another?" That is an instructional NLP task, not a typical user query.

The architecture is now ready for code generation, with the required checks and balances incorporated. The resulting code will likely be accurate and explainable.

Key Insight

The above narrative is supposed to ascertain a pattern of collaboration between human and AI. At every phase, the due diligence and oversight provided by an authority ensures the standard of the subsequent stage’s end result. As an example further, I instructed the vibe coder to publish detailed execution logs of test queries (including the sting cases) showing the tool calls and sequence, besides the ultimate output. I reviewed the code and results manually to grasp the logic, even when the AI assisted in generating explanations for parts of it. This challenge-and-refine pattern is repeated across phases. These principles ensured that the generated application is maintainable, traceable, and aligned with standards.

Here is an example of considered one of the query execution logs:

USER QUERY: Compare the first reasons given for oil price drops in 2015 versus the explanations given in 2016. What are the important thing differences?
[TOOL PATH] -> search_articles_vector called with query='reasons for oil price drops', news_type='', specific_topic='Oil', yr=2015
[TOOL PATH] -> search_articles_vector called with query='reasons for oil price drops', news_type='', specific_topic='Oil', yr=2016

FINAL AGENT OUTPUT:
In 2015, the first reasons for oil price drops included a **surging dollar**, **plentiful global crude supplies/oversupply**, **rising US crude inventories**, and **weak demand**. The International Energy Agency also issued a bearish report contributing to the decline.

In 2016, while **rising stockpiles**, **huge storage overhangs**, **near-record production**, and **slowing demand** continued to be aspects, recent and significant reasons emerged. The **row between Saudi Arabia and Iran** made cooperation amongst major exporters to chop output highly unlikely, directly impacting supply-side expectations. Moreover, **concerns over China's economy** and its **devaluation of the yuan** were explicitly cited as contributing to the value drops.

The important thing differences lie within the emergence of **geopolitical tensions between Saudi Arabia and Iran** directly affecting OPEC's ability to administer supply, and the more pronounced impact of **China's economic policies** on global demand and market sentiment in 2016 in comparison with 2015.

Takeaways and Conclusion

The aim of this text is not to function a tutorial on vibe coding — quite a few resources already cover that. As an alternative, the main focus is on how humans should interact with AI-powered coding agents, which have the potential to overwhelm even experienced developers with the speed and complexity of the solutions they generate.

The central principle is obvious: AI is a tool, not a substitute. Across every stage of development — from design and coding to unit testing, integration, and security validation — the advisable workflow is:

Prompt (Human) -> Generate (AI) -> Review (Human + AI) -> Feedback Prompt (Human) -> Iterate.

On this loop, the human stays the ultimate arbiter. While the AI has visibility into requirements, architecture, code, and tests, only humans can assess the broader context: user expectations, business priorities, cost and latency constraints, reliability, maintainability, and explainability. These aspects ultimately determine whether a system succeeds in production and is widely adopted by users.

Key Takeaways:

  • AI accelerates, humans validate: Speed doesn’t replace judgment.
  • Start with architecture and clear requirements: Define boundaries and test cases before coding.
  • Watch out for over-engineering: Not every AI suggestion is vital; simplicity is a strategic selection.
  • Iterate through review and feedback: Maintain a human-in-the-loop approach at every stage.
  • Final responsibility lies with humans: Only humans can weigh trade-offs, ensure maintainability, and judge if the answer is fit for production.

By following these principles, developers can harness the total potential of vibe coding while maintaining control, ensuring systems are effective, comprehensible, and ultimately adopted by the users they’re built for.

Reference

News Articles — Dataset (CC0: Public Domain)

Images utilized in this text are generated using Google Gemini. Code created by me.

ASK ANA

What are your thoughts on this topic?
Let us know in the comments below.

0 0 votes
Article Rating
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Share this article

Recent posts

0
Would love your thoughts, please comment.x
()
x