speaker 1: I was looking over the release notes for the August 2024 versus code release 1.93. And this word stood out to me right here. This word is like catnip for me. Experimental. This is neat. Custom Copilot instructions. What are these things? Well, if we come over here, what you can read is that you can have user settings, global settings for your installation, or workspace settings where you can hijack Copilot you and hijack the chat and prepend instructions. So here you can see two examples of text, but you can also prepend files. Now, this right away, this is experimental. As you can see by this word right here, this is experimental. But I want na show you what's possible. And if you have any ideas, it's all about the feedback right now. So leave some comments with your ideas. All right, let's see what we can do with this thing. I have a little sample project to open. And what I'm going to do now is I am going to add these experimental bits, and so I'm going to go to preferences and workspace and open the settings right here. And I'm going to flip back, I'm going to copy this, and I'm going to just drop it right in there. Good. Okay. Well, as you can see, I have created a code style md file, and I don't need these text plurbs right here. One thing I want to point out is this file can change as you move along. Maybe you're going to have specs in here. Maybe you'll have other files as you're about to see for right now. I'm just going to start with code style and my code styles, markdown document, as you can see, name of the project and the directory structure that we like to work with. All right, let's see if everything worked. And here I'm going to say what is the best structure for my application? And good. As you can see, it used a reference up here. It pulled in costyled out mv and it's going to do that for every single chat. And there we go. Config lib models, repository services. Very good. Tess. Okay, this looks pretty good. Here's what I'm gonna do. Why not let's do this. Generate a bash script. I like to work with bash scripts to generate code and do other things. The reason why is I can then review what is going on before I actually do it. So let's do that now. In fact, let's go back over here and I am gonna to do nit sh. I want to paste that in there and straight away I can see my underscore application, etc. I don't really want all that. So what I'm gonna to do, change all occurrences. Backed that out. Good. All right, so let's run this. I'm gonna hit shift command backslash and then I'm am going to say, source a knit sh directory structure created. Boom, I've got my project. So that's pretty neat. All of this, this structure right here, all of this was set up right here in our costyle md file. And so Copilot knew what's going on. It's pretty fun to PaaS in files, especially markdown files with specifications for style and other things. But what else can we send in? What if we sent in sql file? So here I have the chinook test database and it is just the table definition in here. I don't have any inserts because if I had the inserts it would be too big. So if you want na play along, make sure this file is just the table definition. So now that I've put that in here, let's go back to setting stop json. I'm gonna to hit shift command d to copy that file down. And then I'm gonna to say, okay, let's see what we get up to now. We'll go back over to chat and I'm gonna to say generate models using salize. See what Copilot does good? It's lled in, it's pulled in. There we go. As you can see, Copilot, if it has a reference to the sql file, can generate these models really well. In fact, I didn't spend enough time on this when I was recording this live, and I really should have, now that I'm editing and looking back at it, look at what Copilot created. Just from using a sql file as a reference, it was able to create the associations to other models, noability composite primary keys. Take a look at the track model and all of the many to many associations that are involved here. It's pretty mind blowing. In fact, let's change this. In fact, if I wanted to come in here, what if I said using drizzle? Drizzle is a popular one, and there we go. So depending on what data access tool you're using, Copilot can use this sql file and it can do all kinds of things if it knows about your database. I could add full text indexing here if I wanted to, and so on. All right, so here's what I'm gonna to do. Let's go back and say generate a bash script for the sel is models. All right. Wow, look at that. This is interesting. It is generating the models using the si cli. Okay. Wow. All right. I'm am going to copy this and I'm going to come back over here and double click and go to models donsh. I like having shell scripts. Let's collapse this so we can have a read. Let's see. Initialize that. We don't need to make move the models into lib don't need to do that all let's see if this works so I'm going to say source models that is each creating a model and a migration. Well that is a lot of work done for us. That's that's that's pretty neat. Okay, let's close up everything and I'm gonna to do one last deal here. Let's do some housekeeping because what I want na do now is I'm gonna to create a folder and I'm gonna to call it docs and I'm gonna to move code style in there and move that. And then also I want create a folder called scripts and let's move our init and our models in here. And the nice thing about this is, this is sort of tracking what we've been doing with Copilot, because if we ever go through a code review, it's a good idea to have the output here so we can review it. So it's not magical. All right, so let's go into docs and what I'm gonna to do now is I'm gonna to put cart md inside of here. I'm going to say the shopping cart. Okay, so now we have a specification here and we are building out our documentation and we can also now hand this off to Copilot. So let's go into settings and this needs to be docs code style and we are going to duplicate this line down. And now we're going to do cart md. This is pretty neat. So now what I can do is I can say generate generate the cart service. And so logic is going to go into a cart service as dictated in my style guide. And it's also creating a cart test for me. Oh my goodness, look at this. Okay, so it is great. It is using a uuid, which is what I expect, creating a cart, setting the customer, customer required. Very nice. Add the item. We have some checks up there. Now again, the idea here is I want some shopping cart code. This will get me off the ground. This isn't supposed to be final copilots, not here to write your application for you. It's just here to get you started. And then here we go, the cart service. And then we have tests for it. And it's good. It's good. Except I don't like the test to have more than one expectation redo the tests to have just one assertion. And there we go. That's much better. We just have now one assertion per test. I like this. Okay, let's copy this. And this is going to go into lib and then services and we're going to do cart dujai'm going to drop this in here. Let's check the references. I don't know if I have uuid installed, I might have to install that. And then we're gonna to go down to tests and drop that in there. And I know that lib cart services, there we are. That's where that's gonna to live. Okay, what do you think the chances are that this is gonna to work? Well, I know I need to install a few things. So let's do that really quickly. I'm going to do npm install. Npm install, just dash d pm euid. Cool. And then let's set this to npm rentis. Going to be just just, all right. Well, I'm pretty sure this isn't going to work, but I'm going to try it. Npm rentit is no doubt going to fail. Seven past. What is this? Your test suite must contain at least one test. Interesting. Oh, do I have more tests in here? I do. Oh, wow. Oh, I have all of these that were generated for me. You've got to be kidding me. There is no way that this is going to work straight away. I'm gonna to delete these all right, let's rerun everything. There's no way that's gonna to work. Oh my goodness. 1:7 failed. Oh looks like I have a config test Dutch I asked that is because well that's okay we're not using this anyway I'm going to delete this. Very good. Okay, let's run this. Oh my goodness. I have to tell you this this this is a complete surprise which is fine. Well, in the span of about 15 minutes, I have a pretty serviceable application. Of course, there's a lot more to do. There's a lot of refactor and refinement. But the idea here of being able to set these instructions using documents, copile is now aware of my project. And it's able to go in, generate models, as you've seen, generate service classes, know exactly where to put them based on my preferences. And if I start building out my documentation, telling Copilot about the documentation of my application, it can then keep ongoing and generating the starter code for me. All right, well, that's it for me. Thank you so much for watching. This has been fun, happy coding.