📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

Cursor Crash Course: Vibe Coding on a Large Codebase

codebasics45:04

Transcription

In today's video, I will show you how you can write code 10x faster using Cursor 2.0. We are not only learning different features of Cursor as a tool. We are also learning some of the systematic principles of AI coding so that you can use them with any other tools as well, such as Anti-gravity, Claw Code, and so on.

We will start by building a website which has back-end, front-end, and database layer. And then we will jump into an enterprise-grade production application where we will fix some bugs and implement new features. This tutorial will be very different from hundreds of other Cursor tutorials that you find on YouTube because they mainly focus on the tool and its features. What I'm going to show you is a simulated experience of how some of the senior software engineers working for big tech companies use AI coding on big and complex projects.

Let's begin by Googling "install Cursor". Go to this link: cursor.com/download and install a version that is appropriate for your operating system. I already installed it. I have launched Cursor. This is how it looks like. Now, when you go to the settings icon, you can switch between different views. By default, what you get is an agentic view. What I like personally is the editor view because I'm more familiar with the traditional IDE look, but agentic view also has its own benefits. So let's switch it to editor view. And the view here looks more like VS Code. If you have used VS Code for coding, it is similar to that.

Okay. Now, for a free version, you will see something called "Auto". Okay? Or by default, you will generally get "Auto". "Auto" means when you are writing code, it will pick the correct model for a given task on its own. But let's say you have a preference and you want to select a specific model. In my case, I like Opus 4.5, which is Anthropic's model. So, usually I use that. In a free version, you won't be able to use it. But whatever you get in "Auto" should be good enough. Okay? But if you pay, I'm paying a $20 a month fee. And I'm getting this better model called Opus 4.5.

Now, let's assume you want to build a website for your gardening business. Okay. So, here I'm going to create a new folder called "website-growart". Let's say Growart is the name of my company, and I'm going to open that particular folder. So, "website-growart". Select a folder. And here, let's go to the editor view. So, I'm already in the editor view, and I'm going to use this tool called WhisperFlow. Okay. So, WhisperFlow is a free tool that you can download, and it lets me talk to Cursor using audio. So, here, watch. I'm pressing Control and Windows key to talk to Cursor. You can also use this icon for the voice input.

"Build me a website for my gardening business. I sell gardening equipment, flowers, pots, etc. Keep the theme green. Use any shade of green for the front end. Build the front end in Next.js. Back end in FastAPI. Database can be SQLite."

See, this is better than typing because otherwise, it's going to be too much typing. I don't like that. And here you can use a plan mode. So, you're planning a new feature or building an application from scratch. Uh, it's better to review the plan. Okay? And let's hit "Go". Now, this is an iterative approach. So, it's going to do the planning. It's going to think about the requirements. It may ask you questions.

"What type of website do you need? Shopping cart, checkout, order, browse product, contact order."

Okay, I need shopping cart, etc. So, select that.

"Do you need an admin dashboard to manage products?"

No, it can be hardcoded. Just hit "Continue". All these requirements, by the way, you can give in advance too. Okay? Let's say you are working with your business manager. You have prepared the PRD document. You can give that document to it, and it will take the document and start implementing the features.

Let's review what it has done so far. As you can see, it has built the architecture overview. Okay? Like, SQLite database will have these four tables: Product, Categories, Ordered Items. This is my tech stack: Next.js back-end, FastAPI back-end, Next.js front-end, SQLite, state management, React context. And then this is the design theme, also created database schema, and so on. Okay? So, I can view the plan here. Okay? See, this is the plan that I can review, and it has prepared this list of to-do items. Now, let's say I want to add a new to-do. So, I can click on it and I can add it. Okay? And you can also select this to-do and you can say, "Okay, only implement these two features," and it will do that. Okay?

So, [snorts] now I reviewed the plan. It looks good to me. I'm going to hit "Build". So, when I hit "Build", it will switch from plan mode to agent mode automatically. So, watch this. I'm clicking the "Build" button. And now it is in agent mode. So, agent mode is used to actively write code. Plan mode is just for planning. It will not write code. Okay? So, now it started writing code. See, it created my `requirements.txt`. It's creating `models.py`. It's writing code so fast, folks! Right? For building this kind of application, a developer would take probably one week. And here you can see it will be done in minutes or in hours.

Let me take a moment to thank today's sponsor, Ultralytics YOLOv26. On this channel, we have talked about YOLO before. It is the de facto approach for vision AI. YOLOv26, the latest release from Ultralytics, sets a new standard for real-time, edge-first computer vision. It is the fastest, simplest, and most deployable YOLO model Ultralytics has released so far. Unlike older YOLO versions that relied on non-max suppression as a post-processing [music] step, YOLOv26 uses native end-to-end detection. This reduces latency, simplifies deployment, and improves performance on both small and large objects in real-world systems. [music] You can access YOLOv26 on Ultralytics platform with downloads and documentation available to get started quickly. It supports multiple vision tasks: detection, segmentation, classification, pose estimation, tracking within a single, consistent framework. They offer two licensing options: AGPL 3.0 zero license if you would like to open-source your entire project. The second one is Ultralytics Enterprise license for commercial proprietary deployment and distribution without open-source requirements. [music] Please try it out. The link is in the video description below.

Now let's get back to our video. So, see, right now it is implementing this particular feature, two out of ten. Right? See, it has like to-do list, and you can see here it is checking out. So, as and when it is implementing these features, it is checking them out. See, I'm not doing anything, by the way. It is checking them out as if you have a Jira board, and you have different Jira stories. You have given it to different developers. They're implementing it, and they're marking those stories as done. Okay? So, here you see "Completed in order". You see here. So, it has completed these two. That's why you see this checkmark, and it is right now working on this particular thing. So, there are quite a bit of features that we have. So, it's going to take some time. So, let's wait.

It completed writing all the code. See, all the to-dos are complete. And now it is starting the servers. Okay? So, it will do everything on its own. So, let me click on "Run". If it finds an error, it will retry it. So, let's again click on "Run". And there you go, folks. Our website is ready. Look at it. How beautiful it is. Let me open it in a different browser. See, when I gave my prompt, I did not even tell it that my name of the company is Growmart. Probably it recognized it from the name of the folder, and it has a green theme. It is looking so professional. All the features are working. See, I can go to "Equipment". I can add these features. Okay? Let's say "Add to Cart". So, my cart is being updated. You see? And let's say I want to add some flowers. I like red roses. Click one. Click two. Here you see this. "Proceed to Checkout". "Place an Order". See, it's so professional. For software developers, it would have taken maybe a week or two weeks, right? If you give this project to an agency, they would have even charged you some money. But now, with a $20 a month subscription, you can build this thing on your own.

Here I forgot to record this part, but when it was done building the website, it actually tested everything. So, as if a bot is going through all the pages. I mean, if you try it on your computer, you will see it tested all the different pages. You know, like how as a developer I would test my website. It did all of that.

Now I'm reviewing the menu bar, and let's say I want to add a "Contact Us" button in the menu bar. So, I can select an element. So, I can click on this button and select this particular div element. And let me open a new chat. By the way, this is considered as a good practice because when you open a new chat, you will not have the past context. So, when you are fixing a bug, implementing a new feature, it's a good practice to open a new chat. So, I selected this, and it has selected this div element. I will say that here, "Add 'Contact Us' button. When someone clicks on this button, show 'Contact Us' page with required information." Whatever, or you can be specific and give your exact requirements here. So, it says that, "Create a 'Contact Us' page with a beautiful design matching the site's aesthetics." So, it will do a lot of work on your behalf, even if you don't give instructions.

Now, folks, if you have a free subscription, I don't know, there might be a limit on the quota, so use it carefully. Maybe build a simpler website with simple features. And also, the quality of the output will depend on the model that you're using. I'm using the best coding model by Anthropic. If you are using "Auto" free version, by the way, see, you see the "Contact Us" button now here. It's so amazing. It implemented the feature, and since my back-end and front-end are running in reload mode, it automatically refreshed this. See, I have the feature now. Okay? So, it's, I think, summarizing it. "Created a 'Contact Us' page with hero section." It gives you all the information. Now, as a software developer, it is your duty to review the output, and when I say output, the text outputs as well as the code. So, you'll click on the "Review" button. You will make sure that there is no mistake in the code, and when things look okay, you will say "Keep all," which means I'm accepting the changes which my AI has done for me.

Now let's test it. I click on the "Contact Us" button. Folks, isn't this amazing? This sounds like magic, almost. I just said, "Implement 'Contact Us' button using common sense," and see, it is showing me the call us. Of course, I can go to my website, the code, and change all this. I can also ask it to make it configurable. See here, whatever "Send Message". This looks so good. And check the database. See, in the back-end, now I have this database `growart.db`. It has these four tables. You can review this database and its schema, as the schema, the name of the columns, everything is so good, so professional. And see how much code it has written. This is all my back-end code in FastAPI. This is all my front-end code in Next.js.

All right, so that was the application. Now let's move to another application, which is an enterprise-grade production app. Before we move ahead, let's think about this mental model. Our role as a human is going to be that of an orchestrator role. So, we can orchestrate with Cloud Code, Cursor, all these different tools, and we can give them context, intent, business requirements, and these tools will give us an output. Okay? Then we validate it, and we just guide these tools. Okay? So, our role is going to be that of an orchestrator. And in the future, all these different roles that you see in the IT industry are going to consolidate. So, today we have software developer, product owner, AI engineer, UX engineer. In the future, there will be a single person builder. I don't know what they're going to call it, but that same person is using now different AI tools to do the work of all these different people. And AI engineering becomes essential because nowadays, all the software products have AI features. So, as a software engineer, you need to know at least some AI. And I have this self-paced bootcamp where many of our students have requested if we can have a live bootcamp because so many software engineers will appreciate live interaction, cohort-based format. And we are conducting a little survey. It will be great if you can fill out the form below in the video description. We are conducting some survey for a live bootcamp. We have not done a live bootcamp before. So, it will be amazing. It will be a huge favor if you can fill this out.

Now we will move to an enterprise-grade application. It is an e-commerce application, similar to Myntra.com or Ajio.com or Amazon.com. Here, a seller can create an account. They can upload their product. A buyer can create an account. They can buy their products there. Okay? So, I'm going to give you access to this repository. And as I said, it is a serious production-grade repository which has back-end code, front-end code. Uh, in the back-end, you have everything like Docker setup, database, README, everything that you will find in any enterprise application.

So, now let's open the README file and go through the setup steps. Okay? So, when you open README, you can click on this button to get the preview. Right? Here you see the markdown, the raw markdown, but here you can see the preview. Let me rather open it here in GitHub. Okay? So, this is the repository. See, it looks like a very production kind of app. And for buyers, these are the features. Sellers, these are the features. And this is your technology stack. It's quite involved. Okay? And this is the project structure. So, let's get started. If you prefer using Docker, by the way, you can choose option one and you can do it that way. Otherwise, if you want to keep things simple, this is the approach that you can use.

So, I will keep this aside. I will press Control / character, Control, I think, tilde, or you can just go here, "View", and say "Terminal". Okay? So, this way you get a terminal in Cursor. Now, I personally like a simple command prompt rather than a PowerShell. Okay? So, here you can say "Command Prompt". You can open it. So, I already have two command prompts. So, in one, I will run my back-end. In the other, I will run my front-end. So, let's start with the back-end. So, I'm going to go to back-end. [snorts] And here, uh, you need to, let's see, you need to install all the dependencies. But before you do that, you have to copy the environment file. So, whatever is `.env.example`, copy it as `.env` file. Okay? So, here you have this `.env.example`. So, Ctrl Ctrl + V. It will create a new file, and just rename, just rename that to `.env`. Okay? So, I have the `.env` file. Here you need to copy-paste your email, one email which you will use as your master email for creating this application. Okay? So, when you place an order, it is actually going to send an email to the seller and buyer both. So, I'm going to show you that entire use case. So, here, let's say you have one email, your `a@gmail.com`. Use an email, and then you need to get this app password. So, how do you get that? For this, go to Google, you know, type in "Google app password", and it will show you a link. This is the link: `myaccount.google.com/app-password`. So, when you click on it, you will be able to create an app. Okay? So, this is my Highub app. So, you create that, you copy-paste this particular app password here, and make sure you are removing the spaces. And that's [clears throat] it, folks. So, this is done for your back-end. For your front-end, you can just copy this file, `.env.local`. Okay? So, just say Ctrl + V. It will create a new file, and rename this file to `.env.local` and hit Enter. The front-end app is pointing to your back-end endpoint. So, we are going to run our back-end on port 8000 on the local machine. So, no changes required here. Our environment setup is done. Okay?

Now I'll follow all these instructions to start my back-end. Okay, folks, these are pretty straightforward. So, I'm going to just skip through it, and I will directly run it. I followed all those instructions, and my app is up and running here. In one terminal shell, I have my back-end. So, that is your Uvicorn Python back-end. Front-end is `npm run dev`. And look at this website. It's similar to Amazon, where you can create an account for a seller as well as a buyer. So, what we are going to do is click on "Create Account" and use your email ID to create both buyer account and seller account. Okay? So, you are creating two accounts. I have already created my accounts. For mobile number, just give 123. It will work. Okay? So, assuming you have created the accounts, let's sign in. So, here I'm going to sign in as a buyer. Okay? So, let's sign in. Right now, there are no products because our application is fresh and new. And here I have signed in as a seller. So, seller will upload their account, right? If you're buying something from Amazon or Flipkart, you will have some company seller. They will upload all their items. So, here I'm going to go to "Products". Okay? And then click on "Add Product" - "Single Upload" or "Bulk CSV". So, we are going to use "Bulk CSV". And there I have provided you a sample CSV in the same GitHub repo. So, just drag and drop here and say "Upload Products". See, 10 products are uploaded. So, when you go to "Products", see here, you will see the image of the product, the description, price, whatever. Okay? So, if you have a seller account on Amazon, you will know, you will have this kind of interface. So, now when I refresh this, I should see all these products. See, so this is now similar to Myntra, etc. So, I can go ahead and I can buy products, add them to cart, and, you know, do the usual process.

As a developer, now I'm, you know, working on this website, and see, I'm adding two quantity here, and when I say "Add to Cart", here it is showing only one. Looks like there is some bug. I want this badge to be such that it shows me two, not one, because I have two items in my cart. Okay? So, let's say I added that two, and let's say this three. Okay? Uh, in that case, it should be 3 + 2 = 5. So, this is a little bug. So, we are going to ask Cloud Code to fix this issue. So, what we will do is, we can even take a screenshot. See, "Capture Area Screenshot". So, you click on it, and you can capture the area. You can say that here, see, you're giving it a context. "The badge shows the wrong number of items in my cart. Fix it."

So, I open a new chat, and I am asking AI to now fix the bug. I hit the quota limit. So, I added $50 more. I think this happened because for the gardening website project, it used too many tokens, but anyways, it has made all the code changes. And when I go to my website, look at this, I see five. You see this, three and two, I have a total of five items. So, this badge issue is fixed. I can click on "Review". As a responsible programmer, you need to review the code changes. Now, if you want to use LLM as a judge, so here one LLM wrote the code. Okay? If you want to use another LLM to review this code changes, then you click here and just say "Review agent changes", and it will review it. Okay? And you can also commit. I already committed this change, by the way. You can commit and push it with a click of a button.

Now, let's say I want to implement a new feature, which is adding a wishlist. Okay? So, I can go here, I can click here, and I can say, "Add a button". So, see here, uh, maybe in this area. By the way, you see, you can see this, uh, inspect code as well. So, I don't want to use inspect. Basically, showing the console, but I can select this element here, and I can say, "Next to this button, add 'Add to Wishlist'." There will be only one default wishlist for a given user. And what else do we add? Um, "Implement this end to end." There you go. Our programmer is at work. Now, it took some time, but it is implementing this functionality. You see this wishlist button, this love icon, whatever you see in a popular website, it has already implemented it. Okay? And you can once again review the code changes. It made so many code changes, 10 files. So, now, let me go here. Let me remove the items from my cart and say I want to add this one in my wishlist. Okay? So, I just click on "Wishlist". "Add it to your wishlist." Okay. "Home". Click on this. Okay? So, these two items I added to my wishlist. So, now when I go here, see, I did not do any iteration. I just gave one prompt. That's it. It implemented everything as expected. Now, from my wishlist, if I want to add things to cart, see, it added it. So, this is working like a charm.

Next thing we will look at is how do you add structured logging because I'm an experienced, seasoned Python programmer, and I don't like the fact that we don't have logging here. So, I will open a new chat and I will say, "Add structured logging in." Now, let's say you want to add it in the cart service. So, here you can give a context by saying, "Add cart service." You see, this is how you give the context. So, "Add structured logging." You can even say, "Add cart service," and you can say, "Add structured logging. Add one log line at the start of every function, and then record necessary context." Okay? So, I'm doing this only for the cart service. And when you're working in a larger codebase, you will see this kind of pattern where you implement one code change in one file, and then later on, you want to implement similar changes in another file. Let's say I'm integrating Datadog for observability in one file or one class. I want to do it later on for other classes too. Okay? So, we will see how you can do it using good principles in AI coding.

So, here you can see it is doing good. If you want any changes here, again, you can tell it, and it will do it. But I like these changes. So, I will say, "Keep it," and then I will commit it. Okay? So, again, commit message, it is going to generate on its own. So, let's say it committed my change. Okay? So, this is done. Now, let's say I want to implement the same thing in the email service. What will I do? So, one option is, I give a similar prompt for the email service. Right? But rather than that, and by the way, if I'm doing it right now, I can say, "Okay, implement similar change in email service." But let's say I'm doing this change after one month, or let's say some other developer is doing this change after two months. In that case, uh, what, uh, they can do is, they can look at `git log`. Okay? So, when I run this command, `git log`, it will show me the commit ID. So, in this particular commit ID, I added a logging service. Okay? So, what I can say is, "Look at commit ID this, and implement similar change in email service." And it will check that Git commit, what changes it did, and it will implement. Now, say it is running some command because it doesn't know what kind of changes are there in that Git commit. So, you are saying `git show`. So, it is just analyzing, as if a programmer would analyze, right? A programmer would go to GitHub, look at this Git commit, you know, like think, okay, and observe what changes were done, and they will do similar changes in this file. So, it already detected that we need to implement logging here, and see, it is now doing its work. Isn't this amazing? Look at this email service. Like, when you say "Review", um, you see it has all these changes. Okay?

Now, let's say, uh, you are doing these changes again and again. You don't want to refer to this Git commit ID. This is also tedious. So, let's improve it further. And the way you improve it is by using Git commands. So, what you can do is, click on this, um, or rather, actually, I can just go here and type slash. So, when I say slash, I don't see any commands. There is this dummy command already, right? But I will click on "Create Command" and I will say, "Add structured logging." Okay? And here I can add the markdown file with all my instructions. Okay? So, this is nothing but a markdown file. It doesn't have any specific syntax as such. But as a programmer, I will give all the detailed instructions. So, now I want to change my instructions and I want to say, "Okay, here are the instructions. Okay, first, import logging. Then, create a logger. Then, create an object called `log_context`. Okay? Then, start the log. Also, when there is an exception, I want to add logging." So, I'm adding instructions for that. "Add log error log," and so on. Okay? And I will just give it some sample code snippet as well. And once this command is added, now let's say I want to add logging in order service. See, order service doesn't have logging, right? So, now, folks, it's so easy. See, you will say `/add structured logging`. Okay? And then `order service`. See, this is so easy. I'm not writing any big prompts. I'm not referring to any past commits. All I'm doing is, I have coded my instructions into this command file, which is a markdown file. And I'm just saying, "Okay, run this command on this file." Now, many organizations and many projects will have certain guidelines on how they want to add logging. So, you can put all those guidelines in this MD file. Folks, just like README, this is an MD file for your agent. It will read this MD file. Okay? It will understand your style of adding logging, and it will add it. See, I want to create this `log_context` object. Okay? That's what I want to do. And it will do it. See, so if you review the changes now, see, it added `log_context`. Isn't that beautiful? As per the instructions that I have given here, and it is doing my work. All right, folks. So, this way you can add more logs for anything that is repetitive, not just for you, but for your team, for your organization. You add a command, and see, it added the command in this `.cursor` repository, `.cursor` directory, actually. See, `.cursors/commands`. This, and you will actually check this into GitHub. So, if another developer pulls this in, they can just simply use this command to make similar code changes.

In addition to commands, you can add rules as well. So, if you go here, click on the Cursor settings. Okay? So, in Cursor settings, you will see a way to add rules and commands. So, we already added this one command, "Add structured logging," but let's say I want to add a rule. So, you click on it, and you can add a custom rule. Okay? And you can give your rule name. So, let's say my rule is "backend API patterns," and then it is adding this `skill.md` file in this skills directory. Cursor is changing these things very fast. So, it used to be Cursor rules first, then MDC, then rule, now skills. But anyway, the concept is the same. So, the difference between a command and a rule is that, uh, rule is more like traffic guidelines. "Always stop when there is a red light." "Drive below speed limits." Whereas command is more like the actual instructions. Okay? When you put it on your Google Maps, okay, "Turn left," "Stop," "Take this exit." Okay? So, that's the difference. Command is precise instructions, whereas rules is just general guidelines. So, if you look at that rules, right, there can be a project rule, there can be user rules, team rules, `agents.md` specifically for agents. Okay? So, if you look at, let's say, user rules, these are your personal choices. You don't want to check into Git. Okay? But these are the project rules, which are applicable to all the programmers. So, they, all the programmers will find it useful. And looks like they have recently changed the format. See, previously, you will have this kind of thing: "Always apply." Means this rule will always apply. When you want to manually apply it, uh, you will have to say "@". And if you want to intelligently apply it, then it will decide, you know, based on the description, etc. You can also give a wildcard. So, you can say `globs`, let's say `*.tsx`, or let's say `/backend/*.py`. In that case, it will apply that rule only for `.py` files. Okay? So, here, but looks like they have changed it recently. This is something new for me as well. It used to be "rule," now they're calling it "skill." Okay, fine. But the rules will look something like this. Okay? "API endpoint structure," "Use response model for type safety," "Service layer," "Use async session." So, whatever are the style guides, preferences, any legacy hacks, any architectural consideration that you want to make, right? See, "Database query," "Use select." It's like it's a junior programmer, you are giving the instructor, "Okay, this is what you should do. This is what you should not do." Okay? So, let's say if you don't want it to use sync calls, you will say, "Do not use sync, always use async calls," and so on. So, these are general guidelines that you will embed in the rules, and when Cursor is writing the code, it will always load these rules and it will use it.

Let me show you some other cool features of Cursor. When you type "@", you can refer to official documentation. So, let's say I want to refer to FastAPI documentation. So, I can click on "Docs" and type in "FastAPI", and I can say, "Okay, add a timeout or whatever feature in my back-end," and it will refer to that documentation. Now, this documentation is indexed in Cursor's environment, but often time what happens is, when you are working with AI to write code, it may use the version of API that is, let's say, outdated. It might use, let's say, a version which was released six months ago. Okay? So, if you don't want that to happen, let's say you want to use the latest version, you can use this documentation index, or you can use an MCP server called ContextX7. So, if I go here and if I search for "Context 7", here you will find all the API documentation, latest. See, Next.js documentation was updated only one day ago. Okay? So, if you go to "Install" here, and if you type in "Cursor install", in Cursor, the way you can do it is, you just need to add this JSON object along with the API key. So, you can create an API key, that's very easy, into your, go to Cursor settings, click on cog wheel, Cursor setting. And by the way, Cursor folks are releasing features very fast, so these menu options might change. Use your common sense tools and MCP, and you add it here. See, I have already added it here. So, you can see that, but Context 7. And now I can say, "Using Context 7, write code whatever," or you can add this instruction into your rules file. Remember, it will always respect those rules. So, in my rules file, which is here, I can say, "Always use Context 7 for API documentation," and it will use it.

In this new world of AI-first coding, humans are still relevant. We are the orchestrators because LLM, you can think about it as a genius engineer who joined the company five seconds ago. They know every programming language in the world, but they know nothing about your business logic, legacy hacks, folder structure, etc. And the cost of silence that you will pay is, without you providing enough context, it will default to the internet average, producing code that is syntactically correct but architecturally invalid. It may not work in production. So, you are trying to find a needle in a haystack. Think about LLM as this huge brain which has vast amount of information, vast amount of reasoning power, and you are targeting a specific area in that brain. And how do you target it? Well, by writing better prompts. And when I say prompt, it is a very comprehensive term. Actually, prompt is not what you type in the AI chat in Cursor. It is all the context. So, when you say "@documentation", what rules you are writing, the commands, the screenshot you're providing, see, all of those things are going to matter, and it will produce highly relevant output. Bigger context doesn't mean better answer. Relevance always beats the volume.

So, if you summarize our workflow, human versus LLM, or rather human with LLM trying to build an application, the workflow is: You give your business requirements, legacy hacks, architectural constraints, and so on to LLM, your style guide for your company. It will write the code. You will validate the output. When I say validate output, you will not only validate the code, you will also run the code. You will see it is doing the thing which you expect it to do. And at this point, folks, rigorous automated testing becomes very much necessary. You can also use AI to write your test cases. Okay? So, you need to have a huge or a proper test suite, integration test, unit test, you need to have all of that. Okay? And then you will just repeat this loop. So, your job is to give intent, context, constraint to LLM. It produces the output. You validate it. Code changes. You again validate it. Because when you ship the code to production, you can't say, "This code was written by LLM." Of course, it was written by LLM, but the responsibility is on your shoulders. Okay?

Thinking about the anatomy of a perfect prompt. We saw three layers, right? Rules. Rules is like governance. Basically, traffic rules. Okay. Traffic rules are general guidelines. They are always applicable. So, here, persistent global instructions that define how the AI should behave and write code in every single interaction. They run in the background. Examples are: "Always use TypeScript interface," "Prefer functional programming over OOP." Let's say for your project, for your organization, you might have this guideline. So, Cursor is not going to know, right? So, you have to give all these instructions in your rules file. And the way you can supply rules is by using Cursor rules. If you're using Claude, there is `claude.md` file, you can give it as a system prompt. `agents.md` if you are building agentic applications, and so on.

Then, command is the second layer. It is like action. It is your actual GPS direction. Okay? So, rules are general traffic rules. "Always stop when there is a red light." "Drive below speed limit." These are global rules which always apply. Command is a specific journey. So, I'm going from point A to B. My GPS is saying, "Turn right," "Stop," "Take the exit." So, those are commands. Okay? Specific immediate instructions telling what to do. Okay? And the examples are: "Refactor this code." We already generated that. "Add logging." "Structure logging command." So, you know, uh, the way you can supply a command is by saying slash, okay, in Cursor, or by using the chat box. So, even if you're not using the slash command, when you're typing something, giving a five-step instruction in the AI chat box, that is also a command. Okay?

And the context is like your map data, your coordinates, your road intersection information, exit information. You know, Google Maps will have all this data. So, that is your context. So, here, in terms of our AI coding, you will give relevant background. Okay? And how do you do it? Well, you attach screenshots. We have looked at all this matter, right? We attach screenshots, so that is the context you are giving. You can say "@output" and you can refer to that trace. You can refer to documentation, MCP servers. So, by the way, let me show you the output trace. So, here, see, I have these two terminals, right? U and Node. So, when I said Node, see, I can refer to this. So, it will go and it will read whatever, whatever you have here. Okay? Whatever you have here. And there used to be this Control L command where you can copy and take this context here. Again, it's gone with the new release. Okay? But you can give all these options. Okay? So, see, terminals, fast chats, folks, explore all these options. Okay? Files and folders, you can also give a specific folder. So, for example, I want to refer to only my back-end folder, and only that will be in my context. Okay?

So, this is the three-layer architecture, folks. AI-first coding. Okay? This is what the reality is. AI-assisted coding is one thing, but the world is moving to AI-first coding, where you talk to AI through the prompts. And this is validated by the godfather of coding, Linus Torvalds. He wrote the Linux kernel, Git version control system. He started using, he's the best programmer in the world, and he's saying that, and he started using Anti-gravity. "Is this much better than what I could do by hand? Sure is." So, he's validating that. Anthropic released Claude CodeWork in like, I think, one or two sprints, right? In a matter of two weeks, they wrote it. And somebody asked, "Okay, did you use Claude Code to write code?" And this guy, Boris Chenny, he's the main person behind this product, he said, "All of it. All of this code is written by Claude Code." Folks, AI-first development is the approach that many companies have already adopted. My friend is a staff engineer at one of the prominent fintech companies here in the US. They have a huge monolith with thousands of lines of code and complex business logic. And he told me that in the last one month, 95% of the pull requests that he has created are completely written by Claude Code. He has not written any code by hand. I know this sounds powerful but scary at the same time. And I have created another video on how to tackle this approach, how to evolve your career in this changing time, where you can become an orchestrator, a builder, and build things fast and contribute to the company's growth.

To conclude, if you are not using AI to write code, you are 100% missing out. And the question somebody might have is, "Is it going to make us dumb?" The answer is yes. If you rely on it too much, if you don't review its changes, it's going to make us dumb. So, we need to review what it is producing, use our brain to understand what it is doing. And I know when you do it again and again, it will be easy to miss out, and we will let it go. Uh, in which case, sometimes I think about this digital detox days, right? Like people who don't want to use their phone all the time, or who have mental issues due to overusage of phone, they have this digital detox day. Similarly, there can be AI detox days, where let's say every Friday, I'm not going to use AI. I will write code by hand. Okay? But we have to find the right balance. We can't completely ignore this wave. We have to change as the technology, as the world is changing.

I hope you found this video to be useful. If you have any questions, please post in the comment box below. Bye-bye.