Creating Instruction Files in CoCo Desktop
1. Creating Instruction Files in CoCo Desktop
If you want to use rules to ensure that CoCo follows consistent conventions and coding styles, you have to write those rules into an instruction file. Fortunately, CoCo Desktop makes creating and editing instruction files easy. You can view and edit your instruction files directly within CoCo Desktop. Here, in the settings panel, you can find "Rules." Here is where you will be able to access any project-scoped instruction files. Notice that before we opened the Settings panel, we had a session from the "Data App" project opened. As a result, the Rules setting is only showing the Instruction files that will load when working within that project. It looks like there already is one Instruction File, called AGENTS.md. Let's open it up. This has opened the File panel. As you can see, the AGENTS.md file is located in the root of the Project's directory. The file itself contains rules for CoCo relating how to format any code that it writes, the architecture, and other guidelines. These rules are written in natural language. No special syntax is required. Whenever you start a new session within the Data App project, these rules will be inserted at the beginning of the conversation. Now, let's look at another project. Notice that the Rules page of the Settings panel no longer shows the instruction file that it did before. This is because we are now in a different Project and this project does not have an instruction file yet. Whenever you are working with this interface, be sure to check which project is currently active. You don't want to accidentally create an instruction file for the wrong project. Since this project does not have an instruction file yet, let's create one. This has created an AGENTS.md file in our project's root directory and filled out a template. Now, you can update it with whatever rules you like. So far, we have been looking at Project-scoped instruction files. But what if we want an instruction file that applies rules for all projects? Let's look here, under "Personalization." In the Personalization page, you can add user-scoped rules in this "Custom instructions" section. Any rules you add here are applied to EVERY CoCo session, no matter what project you are working on. As you can see, editing this field creates an AGENTS.md file within your user directory, not in a project directory. The instruction here applies to your user, not a specific project.2. Let's practice!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.