📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

AGENTS.md Just Launched! 99% of AI Tools Will Use It Now

Code With Nathan8:35

Transcription

Hey everyone, welcome back to Minaden. In this video, I want to show you how to create and use agents.mmd file to provide context and instructions for coding agents, including Kilo Code.

So, if you've been using AI to help you build apps for a while, you've probably noticed that every coding agent has its own setup. For example, if you want to add rules in Kilo, you need to create a Kilo Code folder. For Cursor, then you need to create a dot Cursor folder with its own rules in MDC format. And for Cloud Code, you will have to create a Cloud folder. And once you throw in MCP configs into the mix, your project ends up drowning in folders and JSON files for configurations. The funny thing is, most of these files will probably have identical content. They're just scattered in different places depending on which agent you're using.

To fix this mess, developers have come up with a simple standard, and that is the agents.md format. Basically, agents.md is a dedicated place where AI can find context and instructions on how to interact with your project. Think of it as a README, but for AI agents. It's already supported by the most popular coding agents today, including Kilo Code. So instead of repeating yourself in every prompt or creating new configuration folders and files when you switch coding agents, you will be able to just write the instructions and context once and let the AI agent start from there.

On this website, you'll find the core idea behind the standard, why it was created, which IDEs support it, a simple example, how it's used in popular repositories, and how you can get started yourself. You can check out the website to learn more, but for now, let me show you how you can use Kilo Code to help you write your agents.mmd file.

All right, so here I have Kilo Code installed in VS Code. And on the left side, I have a CRM dashboard project created using React and Tailwind CSS. Let's view the project on the browser just a bit. So here's the application. It provides valuable insights on the dashboard using cards and charts for metrics. There is a navigation menu on the sidebar here with some menus are still in development.

Now if we go back to VS Code, notice that here we have Cloud, Cursor, and Kilo Code folders. All these folders contain the rules for AI coding assistance when interacting with this project. You can see here in Kilo Code, it has rules for restricted files as well as for adding simple documentation in JSDoc format when creating new components. Open the Cursor folder, and here we have the same rule, but we need it for applying the rules to Cursor. The same goes for the Cloud folder. There is the rules.md file that will be followed by the Cloud Code agent. Also, there is a cloud.md file that was generated by Cloud Code over here, which has project description, build commands, and other important information.

So now we're going to use the agents.md file in order to reduce the amount of folders and files just for configuration. To do so, just create a markdown file called agents.mmd. And then inside this file, write down all the rules for the coding agents. First, let's add a title here. I will just write "Guidelines for AI Coding Agents." And now we can start adding some instructions and context to this file. For example, I will copy the restricted files rule from Kilo Code over here and then paste it into the agents file. And just like that, we can now delete the restricted files rules from Kilo Code.

And then let's test it out. So I will ask Kilo Code to print the content of the .env file. Press enter to send the request and let Kilo Code process it for a moment. As you can see here, Kilo Code was unable to complete the request, as the operation is not allowed by the agents.md file. Now, if we try to remove the rule from the markdown file and then run the same prompt again, uh, write the prompt in this new chat and then press enter to send the prompt to Kilo Code and give it some time for the process. And now we can see that the content of the .env file can be printed by Kilo Code. So that's how the agents.md file works in a nutshell. Once you add it to your project, AI agents that support the format will automatically follow it. You don't have to perform additional setup beyond creating the file itself.

Next, we can copy the rules for component creation as well. Paste the rule in the agents.mmd file and then adjust the heading a bit here, just to tidy it up. And then delete the folders for Kilo Code, and then the dot Cursor folder, and then the Cloud folder.

Now let's test it from another coding agent. So let's open Cursor here, and here we already have the same dashboard project open in Cursor. Uh, we can view the agent.md file here. So we will test if Cursor scans the project and follows this markdown file. In the chat box here, I will ask the agent to print the .env file, just like in Kilo Code. Let Cursor process the request for a moment. All right. Now you can see here that Cursor can't print the content of the file as well, because of the agents.md file. Here it says it's marked as a restricted file containing sensitive data, and you can try to view it locally.

Okay. So back in VS Code, uh, we can see here that I also have some guidance which is generated by Cloud Code in the cloud.md file. This file contains information important to the project, such as the project overview, the build and test commands, the coding style, and so on. Obviously, you can just copy this description to the agents.md file. But let's say you don't have a cloud.md file with you. In that case, you can use Kilo Code to help you write the important information in the agents.md file.

Here in the Kilo Code chat window, write the prompt to analyze this codebase and improve the agents.md file. Add the sections you want to add to the file, as well as the usage notes here, saying that the file you create will be given to agent coding agents, such as yourself, that operate in this project. If you need inspiration on what sections to add, you can go back to the agents.md website. And here you can see that I'm just using some of the recommended sections here. And next, make sure that you're using the architect mode. And for the agent, I'm currently using Grow Code Fast 1 over here. So, submit the prompt and let Kilo Code work on the request. It will then create a to-do list to analyze the codebase and then it will revise the agents.md file to add the sections we asked for it. I will fast forward the video a bit to when this request is finished.

So, here's the freshly updated agents.md file. And we can see that it now has project overview, build and task commands, code style guidelines, including imports, formatting, TypeScript best practices, naming conventions, error handling, and a few others. You can review and adjust the instructions and context as needed, but by default, they should already line up pretty well with what you expect. With the agents.md file in place, we can delete the cloud.md file, and the project is now much cleaner, since we no longer need separate folder-based rules for each IDE.

So that's it for this video. As you can see, agents.md is an open and simple format that you can use as an alternative to IDE-based rules. This format is perfect for projects that need simple, readable instructions without the complexity of structured IDE rules. And you don't have to copy the same rules and context for different coding agents. By using agents.md, the coding agents will have a clear, predictable place to get instructions and context. And you can update the file anytime you want as your project grows.

And that brings us to the end of this tutorial. Now you know how to use the agents.md file to provide context and instructions for coding agents, including Kilo Code. I hope you all enjoy today's video and get some value out of it. Let me know your thoughts in the comments below. I will join the conversation and reply as often as I can. If you're new to the channel, Coen Nathan is a channel dedicated to simplifying complex tech topics so that you can master them easily. Make sure you subscribe if that's something you find interesting. Make sure you like this video, turn on the notification bell, all the good stuff, as it helps this channel to grow. With that being said, thanks again for watching until the end. I hope you have a wonderful day and I'll see you in other videos. Bye-bye. [Music]