AI Informed Coding — “Vibe” Coding Best Practices

Recently, I’ve had the privilege of time to spend sharpening my AI skills, translating theory into pure practice as I cowork alongside…

AI Informed Coding — “Vibe” Coding Best Practices

Recently, I’ve had the privilege of time to spend sharpening my AI skills, translating theory into pure practice as I cowork alongside Claude as my AI coding companion to delve deep into creation. Each project I’ve undertaken targets a part of AI I’ve been seeking to explore hands-on along with a set of technologies as part of the stack that bolsters its implementation.

For example, there is a Model United Nations education company who runs an annual summer camp for children. They employ a proprietary pedagogical framework for giving speeches and requested my assistance in building a solution to help them scale, and provide first-level feedback to students, permitting their staff to shift their attention to individual needs. With my AI pedigree, I immediately thought of fine-tuning a Small Language Model (in this case Phi-3.5-mini-instruct) through Low Rank Adaptation to hone the model’s skills on this framework. I took example speeches and the curriculum as training data and performed the fine-tuning. Next, I constructed an interactive application that allows staff members to upload speeches and get immediate feedback, with the ability to refine the answers (Human-in-the-Loop). The system will store that feedback as learning and, after a critical mass of refinement, perform another training run, creating an iterative Reinforcement Learning through Human Feedback (RLHF) loop. This application will be used by over 50 staff and over 1500+ children this summer.

Why do I mention this project? I’ve seen vibe-coders build applications with AI and perform context engineering but few focus on the models themselves, sharpening the capabilitires of the AI through data to increase accuracy and output. Yes, I have a background in AI spanning 10 years as well as a solid Product Management background, which gives me an advantage, but I’ve also been self teaching myself for over a decade how to program.

Recently, I read a post by Nick Potkalitsky called The Five Roles Framework, which defines a students archetype with using AI in different scenarios, with the key point that archetypes shift based on both the student and its subject applicability. I find myself in the Architect role:

“The Architect orchestrates production. The student designs specifications that direct AI toward a particular output, encoding her disciplinary knowledge into prompts and constraints. This role requires the deepest understanding of all five, because a student who cannot specify what she wants cannot evaluate what she gets. Most students cannot do it well, and discovering that is part of the point.”

As a lifelong learner, I am always a student. In programming in particular, that case is true. I self-taught myself programming through Codecademy early in my career, but, with the advent of AI such as Claude Code, my ability to “program” grew near infinetly, but that does not prevent me from learning. What I developed over a few passion projects is a set of best practices for “vibe coding” that I wish to share with you today.

The underlying principal behind my methodology is that one must always be rooted in the foundational knowledge they are applying. What do I mean? In short, never truly feel the vibes, rather, have educated guidance for AI systems. A driver must obtain their liscense to drive even if what they are driving, the road conditions, or the location change. They may rely on a GPS or safety functionality of the car, but they ultimetly know how to drive a car. Same goes with vibe coding. In my example of the ModelUN app, I brought a foundational knowledge of tuning AI models, crafting exciting user experiences, and the technological know-how of a baseline architecture. AI simply performed the tasks I simply could not, such as writing 1000 lines of sophisticate python code or deployment architecture, but I am learning along the way.

Lets dive into the best practices (I reference Claude Code as its my coding agent of choice):

  1. Update Claude.md to explain bash commands: We’ve had programming agents prompt us when coding for permission to run a bash command on the terminal on our behalf. For many, they blindly accept and let the code run. First, that is how hackers perform library injections or an AI performs tasks on your machine that alter its functionality in unintended ways. Furthermore, its blind faith. Before every coding project, I prompt code to update its Claude.md file to always explain bash commands when asking for permission, and the explanations should be in non-technical terms. This allows me to verify what should be happening before I accept.
  2. Update Claude.md to verbosely comment on code and in the chat: We have two choices, as explained earlier, either blindly accept the code that a programming agent produces or learn. I chose the latter. With this instruction, Claude will create comments before each major code block and explain, in a stream of conciousness type of engagement through its thinking, exactly the code its writing and why. This helps me learn how to program and level up my skills so I can do some of these tasks on my own and/or sharpen my skills to read code better when using AI.
  3. Ask for divergent recommendations when trade-offs matter: I use Tree-of-Thought (ToT) prompting within the initial prompt (or update the Claude.md) for Claude to return multiple divergent paths (minimum of 5) for making significant decisions, such as architectural considerations or which models to use. I always have Claude provide its recommendation with an explination so I can learn from “best practices” (an assumption that the model is trained on such, after all, coding is the best use case for text-based AI). This allows me to then explore alternatives and make comprehensive tradeoffs as a Product Manager (its within my skillset). This would be exactly what an engineer would do and what I expect a team member, AI or not, to assist with. Tree of thought is simply an instruction pattern that has the AI explore different branches to its logical conclusion in divergent paths, as a more efficient way than simple plain English.
  4. Produce a notebook-style output at the conclusion of a project: This draws upon my interest into Data Science which uses Junyper notebooks (or any notebook-style format) to display work. These notebooks detail the technical process and include executable code in-line with explanation/analysis so it becomes a learning document on process. I then use this document to read through and tech myself techniques I have not yet mastered. For example, I had a notebook-style output for my fine-tuning LoRA job and had the system generate non-technical explanations of the charts it produced so I could learn and get educated, as I am not a researcher, just a fellow AI enthusiast, but it will help me converse with researchers in the future.

I’m confident that over time, these best practices will grow, in which case, I promise to update this blog and share an update. In the meantime, share your best practices and thoughts on my framework so we can improve together.