Vibe coding is everywhere lately—mostly as a meme or criticism aimed at people trying to build software without really knowing how to code, or at replacing developers with AI.
But… what happens when it's used by an experienced engineer solving a real problem?
Spoiler: the problem wasn’t the AI. It was me, thinking in TypeScript while coding in Python.
In this post, I want to share how I went from a vibe-coded AI-generated PoC full of forced ideas to a robust, clean and 20x faster solution. Not to convince you to use AI, but to show how you can actually benefit from it without forgetting good design principles.
From a Proof of Concept to a working idea (with GitHub Copilot)
Before I sit down and start writing code for hours straight, I prefer to plan what I want to build using Design Docs (if you want me to write about that, let me know in the comments). So I started thinking about the architecture I’d need to solve my problem: a way to parse semantic chunks from large documents to improve context and accuracy in RAGs.
Once I had the architecture, I started asking Copilot to write different parts of it. And here’s where I made my first conceptual mistake: I was thinking in TypeScript, not in a “pythonic” way.
I’ve been using Nest.js for years, and it got me used to a specific and powerful way of building apps, where it’s common to define logic and metadata using decorators. My plan, described in the Design Doc, followed that philosophy:
Node definitions with class and property decorators:
I imagined classes for each node type (like Rule, Article, Paragraph) and decorators like@TokenType('RULE')
or@IsRequired()
on properties.A centralized and smart TreeBuilder:
It would introspect the classes, read the decorators and metadata, and build the tree.Inheritance only for nesting, not behavior:
The main logic lived inside the TreeBuilder, not in the nodes themselves.
With this TypeScript-style mindset, the AI was the perfect coding buddy. Like a junior developer with a lot of knowledge but no judgment, it did exactly what I asked: metaclasses, introspection, magic.
And yeah, the code worked. It met all the requirements from the Design Doc. The PoC was a success. But the code felt messy and overengineered. It looked like a TypeScript project wearing Python syntax.
Refactoring with real software engineering: from “what” to idiomatic “how”
This is where the real engineering starts. With the PoC validated, I went back to the Design Doc—not to change the goal, but to rethink the implementation.
The code was the result of asking for a “translation” of a pattern, instead of asking for a “pythonic” solution. So I decided to refactor it. This time, I was the architect, and the AI was just my assistant.
Key decisions:
- Replace decorators and metaclasses with basic inheritance.
-
Use
dataclasses
for data-only structures. - Remove the central builder logic and let each class build itself.
I still used the AI, but now with more precise instructions:
“Convert this to a dataclass
,” “Suggest a method for the base class,” and so on.
The measurable impact of simplicity
After refactoring, I wrote performance tests using a big and complex document to compare both versions. And the results were clear:
Metric | PoC (initial AI version) | Refactored (Human-AI guided) | Improvement |
---|---|---|---|
Avg. execution time | ~10 s | < 0.5 s | 🚀 ~2000% faster |
Reconstruction accuracy | 100% | 100% | Same |
Node coverage | N | N + 10 | 👍 Improved |
The new version wasn’t just faster—it was also smarter, more readable, and easier to maintain. All because I chose simplicity and good design.
Final thoughts: our role in the vibe coding era
This project taught me something important: vibe coding with AI is amazing for quick prototyping. It lets us explore ideas fast.
But when the code “works,” that’s where our real job starts.
AI is not a threat for devs who understand software engineering principles. It’s a tool. The best assistant we’ve ever had. Our future is not about being replaced, but about becoming better architects, better guides, and better software crafters.
Have you been through something similar using AI to code? Want me to write more about Design Docs or Python project structures? I’d love to hear from you in the comments.
Top comments (0)