Mental Models for AI Coding: How to Think Like a 10x Developer

Mehdi shares a workflow for building AI apps with coding agents like Claude and Gemini. He starts with idea validation through LLM conversations, writes a detailed PRD, then feeds it to the agent for implementation. You need real programming knowledge to evaluate and refine the generated code, not just prompt it.
Chapters
Hey everyone, welcome back to two side AI. What if you could go from idea to a working app in just a few hours? So today we're breaking down our design syncing framework for building AI native applications with coding agents, the same process we use to ship features every time. So let that be. So Mehdi, how do you go about and do it like when you're designing an application to build, what's your syncing process?
Sure, yes, that's actually a very good question. I have created a diagram that I typically use to build an app using some of these AI tools. And as there are so many AI tools, lovable, bold, and there are many coding agents like cloud code, Gemini, CLI, ChatGPT, like a codecs like OpenAI codec and depending of the level of expertise, people go towards different tools. And for me personally, cloud code is really very good and I use it on a daily basis to boost my productivity, to add a feature to an existing application or to build a new app completely new from scratch. And this term vibe coding has become very popular and there are so many videos online, people saying, oh just even if you don't know how to write code, you can use any of these tools and build an application. That's to some extent true and it works. But in my opinion it only works if you are going to build an application for yourself or if you want to do it at a demo or prototype level. But if you're thinking of building an application that works in production, then I don't think that if you don't know coding, you can really pull that off. And I haven't really seen any successful use case that they have done this without really knowing any knowledge of coding. And the reason is, and that's that has been my experience when I am working with cloud code, for instance, I give it a task or I ask it to do something and then it generates some code, it updates my code and things like that. But whatever cloud code has done is not necessarily the most optimized way or the approach that I was thinking about. And the reason that I know that because I have this knowledge of programming, right? I have been doing coding for decades. So when it does something and I look at it, I say, oh, it's good or it's bad. Now think about it. When someone doesn't know programming and they ask cloud code or any other tool to build something, how they are going to verify that code, right? To make sure that this is exactly what they want, I would just accept.
It, try it out, run it and see what happens?
Yes, true, you can do it, you can just try it out and see what happens. But still it may not be necessarily just the best way that you want.
Exactly, exactly. That's the thing with AI, right? It's easier for me to learn new things. That's not my domain. But I don't have the judgment because I don't have the training to know if this is good or bad.
Right. That's why I think when you have the knowledge of programming or when you know how to code and then you use any of these tools, you really have the Swiss army you like, your productivity will be 10 to 100x. Sometimes when I actually code with cloud code or just use it, then I can myself see how performant I become because it just does the thing. Sometimes it thinks about like more smart way that I've never thought about it and they say, oh, why did you do that? And it gives me even more ideas.
Okay, so you are using cloud code, right?
Yeah, I am actually using some tools but on a daily basis in terminal or in my versus code, going with cloud code most of the time.
Sounds good. Why don't you walk me through the workflow? Like how do you think about it? Building it?
Yes. Here, this diagram which even I asked cloud code to generate it. So you can see cloud code is not necessarily just good for coding. You can use it for any task. Here I gave it some context and I asked it, okay, now just generate a document that shows my workflow. So I explained the workflow and then it put it into this diagram. Something to mention here. This is showing my kind of mental model designing system when I am going to make an application or do some kind of project. Okay. If you're thinking of an idea where you perhaps make a business out of IT or micro SaaS so called, then before you jump into writing some code and all that, you need to do some research. You need to analyze your idea, validate your idea if possible. Right. You don't need necessarily to just think that oh this idea is great, let me just go and do it. You need to do some homework. Right. For me there are quite a few sources that I usually go with. Forum online, niche communities, anything like that. Then I would go to ChatGPT or Cloud or Gemini. I find ChatGPT better in terms of brainstorming, giving me the ideas and all that. I have tried Gemini, I have tried quad and even open source models, but GPT tend to be working much better for me. So I go to ChatGPT and I just either Simply ask it to give me some idea, this general idea or I even start talking to it and I tell it that okay, I am thinking of this and that ideas and then what do you think? And the conversation begins from there. Sometimes I have some personal ideas that I have found, maybe someone told me or I have some kind of pain point and all that. And sometimes I also just go and read online forums and most importantly Reddit and if I see that someone or more than a person is talking about some kind of pain point, then that's like an indicator that maybe it's worth building or solving. So these are the three main sources for me to find ideas. And after that, when I come up with the initial idea, I discuss it again with ChatGPT and I tried like brutally to if I like the idea, but I want to look at it from a critic point of view, right? I want to just say oh, this is a such a bad idea. And I try to see what ChatGPT says or even I asked ChatGPT to criticize that and I tried to defend the idea. But essentially I do a lot of back and forth with ChatGPT to have a conversation. If for instance it tells me that go and build an idea like a rag application for particular thing, then I challenge it. Why would I have to do that? There are a hundred different apps already built, which is not a problem having competitor on the market. But then you need to have some kind of differentiator, otherwise there is no point. So I challenge why is it a good idea? I even just go find some of these competitors and share them with ChatGPT and say here is this one, here's that one. And then it tries to convince me that this is a good idea or this is a bad idea.
I do notice ChatGPT has a positive attitude or quad tend to look unless you explicitly ask for where is the chance of failure, Otherwise it's generally positive.
Exactly. They tend to agree with you whatever you say. They say oh yes, you are things like that. That's why to make it like more honest and disagree and all that what I would do, I just ask it. You have to be brutal, have to criticize it. Then I find some counter example. Oh, there is this company that is doing exactly that. What's the point if I do exactly the same thing? So it tries to come up with a comparison that if you can do this better or if you can do this feature or add that feature, then there is a chance. And there is this loop here you can see that I discuss it with chat GPT, try to evaluate the idea, if the idea is viable, if there is market out there, there are competitions, right. And all that, then I try to refine it. And if I see that it seems like the market is saturated with these types of ideas, then I try to pivot from that idea, maybe just make it a niche in for a particular vertical. But this loop continues until I am convinced that this is a good idea and I am going to do it Initially for any ideas, my motivation is quite high. But after some time when I see that oh, there is this and that for some reason I may lose my interest and move on to a new idea.
Yeah, yeah. Go to market is the hardest for everybody.
Go to market is really the hardest, right. And then I would ask ChatGPT to give me a PRD document. PRD stands for product requirement document or definition. And typically it's a document that has specifications about the functional functionality of the app, what kind of features, user stories, things like that, and what tech stack you are going to use. Even coming up with different APIs and all that. It just like a blueprint that explains the entire application, how it is going to be built. And this is, in my opinion is the most important thing when you want to start really just doing any coding with these coding agents. Because if you simply go to chatgpt or Lovable or any of these tools and ask it, I want to build an app to do this, they this is a very vague question and there are like a million different ways of doing that thing. Even technologies are different. They can just stick to a particular tech stack and all that. The more specific you are and the more kind of formalized, right, your document or your problem is, then the better they can help. So I always come up with this blueprint or PRD and this PRD, when you take it and give it to ChatGPT or Cloud, then they know exactly what is a tech stack. For front end, you want to use this for backend. These are all the functionalities of the system that you expect them. They exactly have the entire picture and then they can do a great job. Even with that. When you have that PRD ready and you give it to Claude, for instance, don't ask it, just go and implement it, right? What I would do is I ask cloud code to come up with a plan, exactly telling me what steps it's going to take for implementing each phase of the project. And then when I am happy with the plan, I ask it to start building. Otherwise I refine the plan, I Tell it. Oh, I don't like this part. Or maybe you didn't get this part. This is what I mean, things like that. This cycle over here, did you notice?
Did you notice what you've just done is the first loop you're playing the role of product manager, and then the second loop you start to play the role of a supervisor to the engineer team. Basically, here's the prd. You guys have to work on this and then you're asking for a plan. So you're playing the manager role. So you're treating AI as your employee, basically.
Exactly. When you are going to build an application, you have to put on so many different hats, right?
Yeah, you have so many.
It has a role of the. Right, yeah. Product manager. Right. Product owner, being a supervisor and all sorts of roles. Even just be like the code reviewer and all that.
Code reviewer, yeah.
And here I share the prd, for example, with cloud code and then it's going to come up with a plan. And I look at the plan and if I am happy with it, then we'll go to the next step. Otherwise we just talk and try to make sure that both of us are on the same page. After that, I ask it to start building and again, I don't simply tell it to just go and build the app, you just go step by step. I even ask it to come up with a series of tasks for each phase. For example, if the first step or phase is to create like a login page, then I ask it to come up with all the tasks that it needs to accomplish to make sure that to do, to make sure that the goal is accomplished. And then after that I ask it to just go and do it. Then again it starts developing, writing code. By the way, I will show an example of my cloud code, the conversation that I had with ChatGPT and the application that I built and then we can discuss it further. It just builds, testing and debugging. That's usually, almost always I ask it to test to make sure that feature actually works. And then if there is an issue, we can easily find it. If there is no issue, then we can go to the next step, which is deployment and deploying the app. I think from thinking of the idea and idea generation all the way to building an application and testing it is what we are going to cover in this video. And this is, I guess a lot of people need that. Yes. After you build the application, you need to think about how to deploy it, where do you want to deploy it and all that, which is a Different topic. And again, cloud code and other coding agents, they can help with that one as well. They can just write all the scripts that you need. The docker file, if you want to know, run it on cloud run or AWS or whatever for monitoring the same thing. And then after that if you need to improve it or add a new feature, then you can easily do that. Any questions about this diagram?
Yeah, I have a question about how you feed in context. For instance, you're, you're feeding some context from Reddit. So how do you Give Claude or ChatGPT Reddit information? Are you doing like copy pasting partial of the post or how are you.
Doing this for Reddit? Typically the idea is there is a post, someone is talking about something and there are comments and all that. And what I would do, I just either copy paste the context from Reddit and then I add my own thought into that and then I give it to ChatGPT to just to have a conversation. Not necessarily copy pasting. I try to give it as much context as it needs because I simply copy paste that. It doesn't know what to do, but I just tell tell it that, oh, what I'm going to do is I want to build an application. And here is a post from Reddit, you're talking about this. And here is the comments and original post and all that. What do you think? And I always something that I do and I think a lot of people may not necessarily do is that when you give some context to ChatGPT and or any other model and ask it to do something, I always add at the end before you do it, okay, if you have questions, ask me. And then because otherwise if you just give the context and hit enter, then it starts doing something and you say oh, I didn't mean this or I didn't mean that. But if you just ask this sentence, if you need or if you have any questions, ask me before you proceed, something like that, then it would. Sometimes it says okay, I exactly know what you want. And then it will just go trying to do it. Sometimes it says oh, do you mean this and that? Or I have these questions, can you answer them? I try to answer the questions and then after that it says now I'm clear. And when I do this, almost always the results are much better than like giving the context like one shot. Right? Then we, when it asks me a few questions to clarify stuff, the results are really good.
Yeah, I see. Okay, so we have a demo that we can show of how to build one and then build a test product. Potentially, yes.
So I had this idea for a while, and.
So let me ask the question. What did we build?
All right.
Great product. We'll see you next time.
Yeah, see you. All right, I'll see you next time, Eddie. Yeah, see you.
More from Angelina

The MrBeast Rule That Quietly Decides Who Wins on YouTube | Rox Codes, CEO @ Flightcast

Ask Any C-Suite This One Question About Their AI Agents | Hector Hernandez, COO @ Speakeasy








