back to indexThe Agent Awakens: Collaborative Development with Copilot - Christopher Harrison, GitHub

00:00:00.000 |
All right. Well, let's get started here. I did see a couple people walk in at kind of last minute. 00:00:21.340 |
If you haven't already read the slide there, you'll notice the slide has the first bit of 00:00:26.020 |
instructions. Send an e-mail. That e-mail address that you see right up there. And then just 00:00:33.840 |
as the subject, just put in your GitHub handle. One quick note about the GitHub handle, if you 00:00:38.920 |
are using enterprise managed users, this is going to need to be a personal GitHub handle. 00:00:45.780 |
So that e-mail address and then your GitHub handle as the subject, again, not -- but you 00:00:53.600 |
know what to do. So go ahead and do that. And while everybody is getting settled in, let's 00:01:00.600 |
go ahead and get rocking and rolling. So my name is Christopher Harrison. The gentleman 00:01:05.400 |
over there is John Peck. And we are both enterprise advocates at GitHub. Obviously doing a whole 00:01:12.900 |
lot of developer relations stuff. So basically talking to customers and doing events like 00:01:18.020 |
this, primarily focused in on developer experience. And this little thing called GitHub Copilot. 00:01:23.340 |
So this is going to hopefully be a hands-on lab. Now I am going to put out a couple of real 00:01:30.320 |
quick caveats. Because we had the exact same lab this morning. And we ran into a couple of 00:01:35.580 |
challenges, the biggest of which with the WiFi network. Because what we are going to be doing 00:01:41.200 |
is going to rely quite heavily on the network, we are going to try. I am going to repeat that 00:01:47.580 |
one more time. We are going to try. We are going to give it our best effort. If it works, wonderful. 00:01:52.700 |
And if it doesn't work, here is what we are going to do instead. You will still have a day or two to be able to complete the lab. 00:02:00.220 |
And you can go ahead and complete that on your own time. And what I will do instead is I will start doing some demos, I will answer a whole bunch of questions. 00:02:10.220 |
The morning group had a whole bunch of questions. And something tells me that this group will also have a whole bunch of questions. 00:02:16.040 |
Been doing enough Copilot talks. There always seems to be an awful lot of questions. More than happy to talk through all of that. 00:02:22.220 |
So, we are going to try our absolute best. Hopefully everything will work. And if it doesn't work, we have a nice little fallback. 00:02:29.220 |
And I want to make sure again that I highlight that you will have access to the lab for a couple of days after this event. 00:02:36.220 |
So that way you can go out and do it on your own time from there. 00:02:40.220 |
So, one last time because I did see a couple of people that just walked in. Notice the instructions on the slide. 00:02:51.220 |
Just put in your GitHub handle again. Make sure that it is your personal or a non-enterprise-managed user account. 00:02:57.220 |
If you don't know what enterprise-managed users are, don't worry about it because then you probably don't have one. 00:03:01.220 |
If you have one, you'll know it. See a couple of knowing nods there. 00:03:06.220 |
Okay. Without any further delay, let's go ahead and talk a little bit about GitHub Copilot. 00:03:11.220 |
So, John's going to be working in the background here. Once he is done working, I'm then going to go ahead and make an introduction 00:03:18.220 |
and get everybody pointed at the lab. But I want to get started by talking about something that's very, very important 00:03:25.220 |
when we're working with GitHub Copilot and that is context. That you'll notice that we have a tagline for GitHub Copilot 00:03:35.220 |
called your AI Pair Programmer. Now, not only is it wonderful marketing, it kind of is, but it's also a fantastic description 00:03:43.220 |
of how best to think about GitHub Copilot. That you want to think about it as an AI Pair Programmer. 00:03:51.220 |
And the example that I always give, the analogy that I always give is my partner and I woke up the other day 00:03:56.220 |
and she says to me, "Hey, I want to go to brunch." Fantastic. Who doesn't love brunch? 00:04:00.220 |
And so I recommended a spot and she looks at me and says, "You know, here's the thing. Been there an awful lot lately. 00:04:05.220 |
I want to go somewhere new." Okay. Fantastic. And then I recommended another spot. 00:04:10.220 |
And then she says, "You know, now that I'm thinking about it, really kind of craving waffles." Spectacular. Who doesn't love waffles? 00:04:16.220 |
And then I recommended another spot. Now that's a very normal back and forth. 00:04:21.220 |
That what happened was, is a request was made. I had some level of context and I gave back a perfectly valid response. 00:04:27.220 |
And then some more context was provided. And then I gave yet another response. And that's a very common back and forth. 00:04:33.220 |
And that may have been context that she had at the very beginning and maybe just hadn't yet shared. 00:04:38.220 |
And it might also have been context that she sort of discovered as we were talking. 00:04:43.220 |
Again, all of this is very, very normal. And it's how we think about when we're talking about with other people, 00:04:48.220 |
when we're talking with human pair programmers, and then also in turn with that AI pair programmer. 00:04:54.220 |
That context is key. Now, when we're talking about context, a lot of times we really focus in on the prompt when we're talking about context and AI. 00:05:07.220 |
That I see an awful lot, especially with new developers to co-pilot, is they're really worried about, like, okay, well, how do I craft a prompt? 00:05:16.220 |
And don't get me wrong. Prompt crafting is an important skill. But context goes beyond prompt crafting. 00:05:24.220 |
Because unlike a lot of other tools, which are maybe going to run all of your code through different parsers, or maybe even build your code, or potentially even, like, run your code. 00:05:34.220 |
Co-pilot, again, behaves like an AI pair programmer. It's going to be reading your code. 00:05:40.220 |
Just as if I brought somebody else new onto the team, and they're going to start reading your code. 00:05:45.220 |
So making sure that that code is readable becomes very important. 00:05:51.220 |
So if you have good function names, good variable names, if your code is well-structured, co-pilot's going to be able to navigate that pretty well. 00:06:00.220 |
And if you're using a lot of single-letter variables, if you're using a lot of abbreviations, co-pilot's going to come along and it's going to struggle with that, just again, as another pair programmer would. 00:06:13.220 |
In addition, comments. Now, we all know the importance of commenting code. And there is a strong part of me that has this feeling that good code doesn't need comments. 00:06:26.220 |
But here's the thing, is having a line or two of comments does help you make your code that much more readable. 00:06:35.220 |
And so even if it might be superfluous, if it's going to make life easier, maybe just go ahead and add that in. 00:06:42.220 |
Because it's not going to, say, slow down your application. 00:06:45.220 |
So having comments, describing what it is that you're going to be doing, how it is that you're going to be doing it, is really going to help things out. 00:06:52.220 |
And then finally, last but not least, is your project structure. 00:06:56.220 |
That having a good, navigable project structure is also going to help co-pilot. 00:07:02.220 |
Now, the real takeaway that I want you to get out of all of this, is this is sort of like just good code 101. 00:07:08.220 |
That having good code is really going to help out an awful lot with context. 00:07:13.220 |
I'm going to come back to questions a little bit later. 00:07:20.220 |
And so number one, context, we talked about that. 00:07:23.220 |
Make sure that you're clear about the intent. 00:07:32.220 |
Now, one of the things that I see an awful lot of developers do, especially if they've maybe worked with like older chatbots, 00:07:37.220 |
is when they start sending those initial prompts, that they're very terse. 00:07:42.220 |
Because they're used to dealing with older chatbots that maybe weren't really good at processing natural language. 00:07:49.220 |
And so it basically became like using command lines. 00:07:57.220 |
If you want something to be done a particular way, and kind of getting into the specificity aspect here, tell co-pilot. 00:08:03.220 |
Or as I like to say, don't be passive aggressive with co-pilot. 00:08:08.220 |
That sometimes they'll see a new developer, they'll go in, they'll give like a very short prompt. 00:08:12.220 |
And then they'll go, well, wait a minute, why didn't co-pilot figure this part out? 00:08:23.220 |
Like if there's an important piece of information that you need co-pilot to consider, go ahead and make sure that you tell co-pilot that. 00:08:32.220 |
Now, co-pilot supports a handful of different workloads. 00:08:36.220 |
You'll notice the one on the far end, co-pilot coding agent. 00:08:42.220 |
That's not because that one's necessarily best. 00:08:47.220 |
And as we all know, we need to just highlight and sparkles the newest item. 00:08:52.220 |
So first up, let's talk about code completions. 00:08:56.220 |
So code completion is sort of the original version, if you will, of GitHub co-pilot. 00:09:01.220 |
This is where I'm going in, I'm writing code, and then co-pilot will suggest the next line. 00:09:05.220 |
It will suggest the next function, and it will suggest the next class. 00:09:09.220 |
If you're in the zone, you know what you're doing, you're typing away, fantastic. 00:09:12.220 |
And co-pilot will be able to support you right there. 00:09:18.220 |
That I go in, I ask a question, and I get a response back. 00:09:21.220 |
So maybe you can generate a single file for me. 00:09:24.220 |
But the problem with that is we think about even the simplest of updates. 00:09:28.220 |
Like if I go to update a web page, I'm going to be updating an HTML, JavaScript, and a CSS file. 00:09:38.220 |
And with edits, co-pilot is now able to edit across multiple files. 00:09:43.220 |
And then we take that to the next level with agent mode. 00:09:46.220 |
And with agent mode, now again, still inside my IDE, what co-pilot is going to be able to do is navigate your project, figure out what needs to be done, and then start building code. 00:10:01.220 |
And it's able to run external tasks like, for example, running your unit tests. 00:10:06.220 |
And if it detects, hey, there's an error, it's even able to self-heal. 00:10:28.220 |
And coding agent is different because this is going to be done inside of GitHub.com. 00:10:35.220 |
So I'll have an issue on GitHub.com, and I can then assign that to coding agent. 00:10:40.220 |
And coding agent will then work in the background, figure out what needs to be done, be able to, again, run scripts, be able to self-heal, 00:10:49.220 |
and then eventually create a pull request that you can then review and eventually merge into your code base. 00:10:58.220 |
And so this is what we're going to be exploring. 00:11:01.220 |
I'm not going to worry too much about these two slides here. 00:11:04.220 |
This is what we're going to be exploring in this lab. 00:11:08.220 |
I will need about three minutes to add them all to co-pilot. 00:11:18.220 |
But we can at least go in and start accepting invitations. 00:11:20.220 |
You can go in and start accepting invitations. 00:11:23.220 |
One quick note, Michael Pope, I don't believe I have your correct handle. 00:11:27.220 |
So if you could send me a new one, that would be great. 00:11:31.220 |
And there was one person who walked in just a minute ago. 00:11:39.220 |
Navigate to the URL that you see right there. 00:11:54.220 |
And then at the very top, and by the way, I'm assuming that you're logged into github with 00:12:02.220 |
And then up towards the very top, you should see accept invitation. 00:12:06.220 |
And then go ahead and select accept invitation. 00:12:10.220 |
Now, here's the most important part about today. 00:12:18.220 |
So if you're not seeing it, please let me know. 00:12:31.220 |
And then accept invitation right over the very top. 00:12:48.220 |
I am just going through the process right now of adding those in. 00:13:02.220 |
Now, for anybody who did not send the email address, please go ahead and send an email to that address. 00:13:10.220 |
And then with your GitHub handle, I'm going to leave that up for about another 15 seconds here because I'm trying to keep things moving for everybody as quick as I best can here. 00:13:44.220 |
My handle is geek trainer and you can basically find me on everywhere with that, including GitHub. 00:14:12.220 |
So, after you have accepted the invitation, who has not yet accepted the invitation? 00:14:24.220 |
And then what happened when you went to Octahol? 00:14:26.220 |
By the way, I want to make sure that I highlight something. 00:14:34.220 |
So, if something is not working, please let me know. 00:14:37.220 |
Now, for people who everything is working fantastic, then here's what you can do is go to that URL. 00:14:45.220 |
Actually, I'm actually going to modify this slide real quick. 00:14:57.220 |
And if we could get phones to a silent or a vibrate, that would be wonderful. 00:15:15.220 |
So, to get started with the lab, what you're going to do, navigate to that URL that you see 00:15:29.220 |
When you get to the part to create your repository, the owner is going to be Octohol. 00:15:37.220 |
And then the name is going to be your handle. 00:15:44.220 |
And go ahead and start working on exercises 0 and exercises 1. 00:15:53.220 |
And then I'm going to start going around and helping people get unstuck. 00:16:13.220 |
We'll go ahead and get John over to help you out in a minute. 00:16:58.220 |
We'll go ahead and get John over here in just a minute. 00:17:13.220 |
So if something is not working, please raise your hand. 00:17:34.220 |
And then the repository name is going to be your handle. 00:18:01.220 |
And then now we're going to follow the instructions from here. 00:18:02.220 |
So you'll notice that you're going to want to open up the -- that URL in a new tab. 00:18:06.220 |
And then you're going to select use a template and then create from there. 00:18:20.220 |
I know there's a couple of people that John's going around to. 00:18:25.220 |
I know there's a couple of people that John's going around to. 00:18:42.220 |
I know there's a couple of people that John's going around to. 00:19:22.220 |
Here's what you're going to do is, so go to, okay, so go to docs. 00:19:37.220 |
And then just scroll on down and go to step zero. 00:19:42.220 |
And then now go ahead and follow right along with what this says here. 00:20:06.220 |
So, real quick, as people are getting started, I want everybody to kind of notice the steps 00:20:18.220 |
What you're going to find there is a set of instructions for the hands-on lab. 00:20:22.220 |
And then, in step zero, it's going to have you then create your repository. 00:20:27.220 |
When you get to that step, you're going to set the owner to OctoHOL and then the name to 00:20:37.220 |
And then, you're going to go in and set that up. 00:20:45.220 |
And then, now you'll notice it's going to have you open that up in a new tab. 00:22:13.220 |
And then, now it's going to have you create your repository. 00:22:27.220 |
So, if we read through, we'll notice step one. 00:22:28.220 |
And then, follow the instructions from there. 00:22:49.220 |
Put it into, right as it says up on the slide. 00:22:51.220 |
And then, the repository name will be your handle. 00:23:03.220 |
Put it into, right as it says up on the slide. 00:23:10.220 |
And then, the repository name will be your handle. 00:23:55.220 |
And then you can actually just copy and paste it. 00:24:01.220 |
There's no explicit instructions that you merge with. 00:24:14.220 |
And you're going to, you can actually just copy and paste it. 00:24:28.220 |
We're just going in and kind of exploring it. 00:24:35.220 |
So, ask me that question again in five minutes. 00:24:42.220 |
I don't want to interrupt everybody, but it's, there's an important thing there. 00:24:46.220 |
So, ask me that question again in five minutes. 00:25:02.220 |
And just kind of keep on following on with the, with the layer from there. 00:25:17.220 |
And just kind of keep on following on with the, with the layer from there. 00:25:29.220 |
What this is going to have you do in a minute here is it's going to have you open up the, 00:25:33.220 |
your repository again, and then you're going to create a couple of issues and start planning 00:25:38.220 |
There might be some code spaces where the actual get connection hasn't established yet, 00:25:44.220 |
because that happens later after the initial load. 00:25:48.220 |
Well, that's, the, the lab actually says to send a, a hello to like, kind of wake it up. 00:26:15.220 |
I made a full request against your instruction results. 00:26:18.220 |
I don't think I type accurately, but I type really fast. 00:26:19.220 |
I don't think I type accurately, but I type really fast. 00:26:19.220 |
I don't think I type accurately, but I type really fast. 00:26:21.220 |
See, here's the thing about being a developer. 00:26:46.220 |
I don't type accurately, but I type really, really fast. 00:26:48.220 |
See, here's the thing about being a developer. 00:27:13.220 |
Actually, if you're in a zone and you already finished out step one and want to start getting 00:27:23.220 |
You'll also notice that all of the steps actually include little optional exercises. 00:27:28.220 |
So, if you are somebody who just moves really, really fast, there's other stuff to do in that lab. 00:27:37.220 |
Go ahead and keep working through exercise one. 00:27:39.220 |
I'm going to do an overview of exercise one in just a couple of minutes here. 00:28:48.220 |
is it's effectively a container in the cloud, 00:28:52.220 |
It's wonderful for just development in general, 00:29:11.220 |
which is going to be like everything that we're using, 00:29:17.220 |
There's a few different features that it doesn't include, 00:29:22.220 |
but one of the biggest is going to be access to a coding agent, 00:29:48.220 |
Periodically, I'm just going to come up here, I'm going to kind of talk and highlight a little 00:29:54.220 |
So, this is basically a real quick overview of what it is that you're doing in exercise one. 00:30:11.220 |
Periodically, I'm just going to come up here. 00:30:12.220 |
I'm going to kind of talk and highlight a little bit about a feature. 00:30:14.220 |
So, this is basically a real quick overview of what it is that you're doing in exercise one. 00:30:28.220 |
Proof that you work with somebody for way too long. 00:30:34.220 |
So, let's talk a little bit about kind of Copilot Coding Agent. 00:30:41.220 |
So, the whole goal of Coding Agent is to have an AI peer programmer. 00:30:48.220 |
That what I can do is I can assign it a Github issue and let Copilot begin work on it. 00:30:56.220 |
Now, the first big thing about assigning an issue to Copilot. 00:31:02.220 |
Remember that whole speech we did about context, waffles, all that good stuff? 00:31:08.220 |
And so, if we take a look at the issue that we created, we went ahead and gave it a pretty decent amount of detail about what it was that we wanted to have accomplished. 00:31:19.220 |
So, you'll notice that we're going to be creating a functionality to allow for submission of games. 00:31:24.220 |
So, here's all of our requirements and kind of list them all out. 00:31:27.220 |
And if this was going to be something more robust, I might have even dropped a potential workflow that I wanted it to kind of step through as it was building out all of the project. 00:31:38.220 |
Again, don't be passive aggressive at Copilot. 00:31:41.220 |
That if there's some piece of information you wanted to see and understand, absolutely 100% tell it about it. 00:31:48.220 |
Now, the next thing is after you assign it, it needs an environment in which to work. 00:31:55.220 |
And there is a workflow that you can create and it's called, he said, speaking slowly to stall, Copilot setup steps. 00:32:09.220 |
And so, when Copilot goes to do its work, it's going to be running inside of GitHub Actions. 00:32:16.220 |
And it's going to, step zero, run everything that it sees inside this workflow. 00:32:23.220 |
And if you look through this workflow, what you're going to notice is a whole bunch of steps to install different services and packages and so forth. 00:32:29.220 |
And that's now going to be the environment in which it's able to do its thing. 00:32:34.220 |
Now, that also leads me to another very big point, which is about security. 00:32:39.220 |
Because here's what I'm going to do, is I'm going to take an AI agent, I'm going to assign it a task, and it's now able to go off and start doing things. 00:32:50.220 |
And I want to make sure that everything it's going to be doing is going to be completely contained. 00:32:55.220 |
So the first big thing about working with coding agent is that it does not have access to the internet. 00:33:07.220 |
That by default, it is a firewall that's going to block it from any external resource. 00:33:14.220 |
Now, you do have an ability to open up the firewall if you do want it to be able to access external resources, but by default it won't. 00:33:23.220 |
And that includes, by the way, installing frameworks and libraries. 00:33:28.220 |
So the only way it's going to have access to frameworks and libraries is either A, you open up holes in the firewall, or B, you set this up to install all the necessary libraries. 00:33:37.220 |
Number two, this is running inside of GitHub Actions. 00:33:41.220 |
And if you're not already familiar with GitHub Actions, one great thing about it is that it's going to launch an ephemeral space. 00:33:48.220 |
So it's going to set up a space, it's going to do its work inside of there, and then it's going to collapse down from there. 00:33:56.220 |
So it will not have access to any other resources besides what's inside of there. 00:34:00.220 |
Number three, it does not have write access to your repository, save for the branch that it creates. 00:34:07.220 |
So it cannot modify anything inside your code base. 00:34:11.220 |
The only thing it's able to modify is just its branch. 00:34:14.220 |
Number four, that branch, you're going to notice, will not actually create a full pull request. 00:34:20.220 |
It's going to leave that in draft form, not become an actual pull request unless you come along and say, yes, I approve this. 00:34:28.220 |
Number five, along those lines, if you are a good developer shop and you have different requirements, things like security checks, 00:34:37.220 |
things like unit tests, end-to-end tests, regression tests, all of which need to pass, 00:34:43.220 |
what you're also going to notice is that on this pull request, none of that can actually run-- 00:34:53.220 |
Until you click that button that says, approve workflow runs. 00:34:56.220 |
So again, trying to keep it completely self-contained. 00:34:58.220 |
And then finally, last but not least, and this is a question that was asked earlier about reviewing it and then merging it in. 00:35:05.220 |
When it comes to the current version of coding agent, there is a restriction, and this is by design. 00:35:14.220 |
Remember, again, coding agent is brand new, so this can always change. 00:35:17.220 |
But this is by design, that if you assign an issue to coding agent, you are not allowed to then review its work. 00:35:26.220 |
So you need somebody else to review its work. 00:35:28.220 |
So basically, it's sort of like in most organizations, you're not allowed to review your own work. 00:35:34.220 |
Sort of the same thing is that I assign the peer programmer, and then I need somebody else to come along and say, 00:35:49.220 |
So let's say you are the only programmer, right? 00:35:57.220 |
And I'm just going to say that that is a fantastic question. 00:36:02.220 |
And I'm going to say that's a fantastic question. 00:36:10.220 |
So the question is-- that was also a great question. 00:36:13.220 |
Is what I can do-- let me zoom out a little bit. 00:36:16.220 |
So if I go in and I add a comment, and I say, hey, what would I potentially want it to do? 00:36:38.220 |
Also, add in an endpoint to search for games by name. 00:36:51.220 |
And if I scroll back up, give it just a second here. 00:36:55.220 |
And then we'll notice the cute little eyeballs again. 00:36:57.220 |
So now what's happening is that co-pilot has started work again. 00:37:02.220 |
And if I hit view session-- hopefully I've stalled just long enough here-- you'll notice that 00:37:08.220 |
it's actually started up a brand new session. 00:37:10.220 |
So it's going to take the work that it did, and then it's going to start back up again and 00:37:31.220 |
I always feel like a press secretary whenever I'm doing this. 00:37:35.220 |
Can you run co-pilots on behalf of other organizations? 00:37:40.220 |
If you have a GitHub app and you have other companies that integrate with it, 00:37:43.220 |
can you run a GitHub co-pilot on behalf of them, or do you have to just run that yourself? 00:37:49.220 |
So give me a little bit more about what you're asking there. 00:37:59.220 |
It generates rich prompts that we want to use with basically GitHub co-pilot to run something 00:38:08.220 |
So what you could do is you could stand up an MCP server. 00:38:11.220 |
So that way they could use co-pilot, talk to your code, and then start to interact that 00:38:17.220 |
But you're not going to be able to have co-pilot like do something to somebody else's code base. 00:38:23.220 |
So it's not like an open API that you can just have a co-pilot stick in a code base and do 00:38:30.220 |
So what you can do is if you have a pull request, you can assign that to co-pilot at that point. 00:38:45.220 |
But again, it needs to be on a repository that you own. 00:38:50.220 |
So if we installed our app, so it's of course in there, we can technically assign the co-pilot 00:39:08.220 |
I don't know the answer to -- because I don't know necessarily what an app is able to do 00:39:45.220 |
So just shoot me an email, and I can try and dig up a more robust answer for you. 00:40:20.220 |
I'm actually going to up-level this a little bit. 00:40:23.220 |
So when we're talking specifically about coding agent, if it doesn't do something that I wanted 00:40:30.220 |
it to, if it does get something completely wrong, and keep in mind that AI, just like human developers, 00:40:35.220 |
is going to periodically get things wrong, and it's sometimes going to get things spectacularly 00:40:41.220 |
Again, just like humans are going to sometimes get things spectacularly wrong. 00:40:45.220 |
So if that's the case, there's a few different approaches that I could take. 00:40:49.220 |
So one of them would be is, just like I did here a minute ago, or three minutes 57 seconds 00:40:56.220 |
ago, but who's counting, is just add in a comment and just clarify, hey, this is really 00:41:04.220 |
If it's like completely wrong, if it's just completely out of left field, then the next 00:41:09.220 |
option is you can just go back all the way up to the very top here, and under assignees, 00:41:15.220 |
and I'm not going to remove this because I want to let it keep doing its thing, but just 00:41:20.220 |
unassign copilot, change your issue, and then reassign copilot. 00:41:27.220 |
And then that way it will just completely start from scratch. 00:41:31.220 |
Number three, and I think this is always very important when we're working with AI, is if we 00:41:38.220 |
see it get something wrong, one of the first questions that we really want to be asking 00:41:45.220 |
And nine times out of ten, and I'm going to come right back to this word yet again, is context. 00:41:51.220 |
Is that it didn't fully understand, not only just your request, but the environment in which 00:41:58.220 |
So one of my absolute favorite features is copilot instructions. 00:42:09.220 |
So on copilot instructions, what you're going to notice, and this is read in coding agent, and it's also read on every single chat request. 00:42:38.220 |
What you're going to notice here is I have copilot-instructions.md. 00:42:49.220 |
This is looked at by coding agent, and it's also looked at by every single chat request that I make inside the IDE. 00:42:56.220 |
And what you're going to notice in here is I have a really nice high-level overview of what I'm doing and how it is that I'm doing it. 00:43:03.220 |
So I've given it a little bit of introduction about the app itself and how it is that I'm building it. 00:43:08.220 |
I've told that everything that's required before commit. 00:43:10.220 |
I gave it some global language guidance, and then I gave it some specifics on what it is that I'm building and how it is that I want it to be built. 00:43:19.220 |
And then if I scroll all the way down, you'll even notice that I highlighted that repository structure. 00:43:24.220 |
So that's why I'm clearly spelling out this is where to go find things. 00:43:29.220 |
So this is a big place to go in and look if you want copilot to have some additional context, some additional information. 00:43:36.220 |
Another big thing that you can do, again, speaking to things that both coding agent and copilot chat are able to use, is to stand up an MCP server. 00:43:45.220 |
So this is actually one of the other exercises in the lab, is model context protocol. 00:43:51.220 |
And basically what an MCP server allows you to do, and I have a slide right here that shows you the diagram. 00:44:07.220 |
If somebody goes in, they make a request to copilot. 00:44:09.220 |
Copilot can then look through the list of commands that have been exposed out through different MCP servers. 00:44:15.220 |
And then from there, go access external data. 00:44:18.220 |
Because this is always one of the challenges whenever I'm working with copilot, really anything that's built on top of an LLM, 00:44:24.220 |
is that typically it's going to be limited to just that training set and that's it. 00:44:28.220 |
This allows it to access external information and even perform operations on your behalf as well. 00:44:35.220 |
So if you see copilot coding agent doing things in a way that you weren't quite expecting, take a look at its context. 00:44:46.220 |
So if you've got like a really large repo, a really large code base, and you want copilot to be able to like better search and better reason over that, 00:44:53.220 |
this is a place where like standing up an MCP server would come into play. 00:45:02.220 |
Because Harold is in the room and he would be very disappointed in me if I didn't highlight this. 00:45:11.220 |
And I am not saying this just because Harold is in the room. 00:45:14.220 |
This is one of the things that Harold works on. 00:45:20.220 |
This is one of my absolute favorite little features. 00:45:22.220 |
Where when we think about what we're doing in coding is we're doing a lot of the same thing over and over again. 00:45:31.220 |
Like I'm going in and I'm creating yet another react component. 00:45:34.220 |
Or in this case here, I'm creating yet another flask endpoint. 00:45:38.220 |
But I probably want all of those to follow a particular pattern. 00:45:42.220 |
And so what I can do is I can create a .instructions file. 00:45:49.220 |
And this .instructions file can then have information about how it is that I want it to be created. 00:45:58.220 |
That basically say, hey, you see that games file over there? 00:46:07.220 |
And I can even have this happen automatically. 00:46:10.220 |
That you'll notice that I have applied to header info. 00:46:16.220 |
So if it's inside the server test folder and starts with test underscore. 00:46:21.220 |
So let's say again going to react components. 00:46:25.220 |
So anything that ends with a JSX, TSX extension. 00:46:38.220 |
Then I can go ahead and set up a pattern so that anything that ends with dots felt is going 00:46:48.220 |
Now again, this part here right now only available inside of Copilot chat. 00:46:52.220 |
But again, other ways that I can start to provide context. 00:46:59.220 |
How often do you update this as part of your . 00:47:07.220 |
Keep in mind that this is an artifact of your repository. 00:47:14.220 |
So I sort of give this an analogy to those little scripts that you spend like three days writing. 00:47:22.220 |
But it's going to save you five minutes a day. 00:47:25.220 |
So basically what these are is that you're going to spend some time, and you really should, 00:47:29.220 |
create your instructions file, create your .instructions file. 00:47:32.220 |
Like really make these robust because what you're going to wind up with then on the back end is increased productivity. 00:47:40.220 |
But you're also then going to help ensure that the code that's being generated is generated the way that you want it to be generated. 00:47:51.220 |
One of the things is basically any time you have mistakes, you want to correct it. 00:47:57.220 |
And you start minimal, and then you keep adding, and you see it here and the option to it. 00:48:06.220 |
And I would even add to that that one of the things that's relatively unique about being in DevRel is I do an awful lot of demos. 00:48:17.220 |
And one of the things about doing a demo is you need that to work. 00:48:22.220 |
And doing that with a probabilistic tool like GitHub Copilot does become a little bit of an adventure. 00:48:32.220 |
And instructions files have been probably the number one thing that I have leaned on to help ensure that I get some level of consistency. 00:48:41.220 |
So I really can't overstate the importance of instructions file. 00:48:44.220 |
And again, I'm not just saying that because Harold's in the room. 00:48:52.220 |
Like, yes, you have the person who's actually operating on the problem. 00:48:59.220 |
And as much as, like, your team makes a decision about what set of dependencies we're going to use. 00:49:03.220 |
Your team's making decisions about what a pattern could be, etc. 00:49:14.220 |
So, um, so the question is, is that, um, hey, inside your issue, you told it something that it probably should have been able to find elsewhere. 00:49:38.220 |
That it was inside the instruction file, um, and, um, and you still typed it out. 00:49:42.220 |
Like, you know, do you really need to do that? 00:49:47.220 |
But then I'm also going to up level that, um, uh, as well. 00:49:50.220 |
So to answer the question directly, I really didn't need to. 00:49:53.220 |
Um, but this really, again, kind of falls under that category of, like, not being passive aggressive with co-pilot. 00:49:57.220 |
Like, if there's something that I know, typing it out isn't going to hurt anything. 00:50:02.220 |
So adding that to that, if anything, it's just going to help it because now I'm just like further reinforcing the fact that, hey, this does need to, to, to actually work. 00:50:12.220 |
Um, now I am going to up level real quick because I think this also then brings up another question, which is, hey, now we've got the issue here. 00:50:20.220 |
Um, and especially like if I'm working with, um, with co-pilot chat, where now I could have like a dot instructions file. 00:50:26.220 |
And we've already seen that I can have those call other files and then now I've got my co-pilot instructions. 00:50:31.220 |
And so that then kind of begs the next question, which is, well, is there a hierarchy here? 00:50:35.220 |
And the answer is no, that there isn't any form of a last right that it's going to consider all of that context and then make its best decision from there. 00:50:43.220 |
Which also then kind of leads to another thing, which we should really be focused in on, like John was highlighting with like our team leads is let's try to be consistent. 00:50:52.220 |
So let's not start sending mixed messages because just like if we start sending mixed messages to our team and they're going to get confused, the exact same thing is going to happen with, uh, with co-pilot. 00:51:13.220 |
So, um, if I'm using MCP locally from inside VS code, good to go. 00:51:24.220 |
If, um, I'm getting coding agent to do that, then, um, when I add in the MCP server, I also need to open up the firewall. 00:51:31.220 |
All of it's actually really well documented, um, um, uh, to, to highlight all of that, but yes, the straight answer is yes. 00:51:38.220 |
So, um, so when you go in and, and configure that you can, um, do that at the repo level, I believe you can do that at the org level as well. 00:51:46.220 |
And then what you do is you then set variables, um, and you can do that again at the repo level or you can do that at the organization level. 00:51:56.220 |
Can you review the code that fits not and then start a whole new session versus, like, limited, like, just review this file and make sure you use this file? 00:52:04.220 |
Um, so, I'm going to, I'm going to, I'm going to start a whole new session versus, like, limited, like, just review this file and make sure you use this file. 00:52:18.220 |
Um, so, I'm going to, I, I, I'm going to inject my own question into that first and then I'm going to come back and answer that question. 00:52:30.220 |
So the first question is, can you review the code? 00:52:32.220 |
And I, I want to make sure that I, I mention this because it's so incredibly important. 00:52:42.220 |
That if I think about how I wrote code before AI, um, I would write code off my own memory. 00:52:47.220 |
I would be, um, writing code based on code that I'm seeing elsewhere. 00:52:51.220 |
I would write code by copying and pasting from Stack Overflow, making a couple of changes, and then just crossing my fingers and hoping and praying that it works. 00:53:01.220 |
Maybe I'm just the only one willing to admit it. 00:53:03.220 |
Um, so, in, in that situation, what do I have? 00:53:09.220 |
I have a DevOps flow where I'm going to get John to come along and, and review it. 00:53:13.220 |
I'm going to have linters that are going to come in and check to make sure that I'm following all my standards. 00:53:17.220 |
I'm going to have security scans that are going to look for any potential vulnerabilities. 00:53:22.220 |
All of these, these, these, these safeguards to help ensure that the code that gets into my code base is secure and is written the exact way that we want it to be written. 00:53:40.220 |
Now, to get specific to, um, the, the second half of your question there, which is, hey, it's just this one file that I want you to look at. 00:53:49.220 |
Um, when I'm working with coding agent, um, or really copilot in general, there's always a non-zero chance that it's not going to follow what you want it to do exactly. 00:54:00.220 |
So if I say, hey, go in and update this file, it, it might work specifically on that file. 00:54:07.220 |
And really in particular, when I'm working about with, with agent mode, it might work with that one file, but it also might do a couple of other things as well. 00:54:14.220 |
And there's not necessarily a way to guarantee that it's only going to do just that. 00:54:18.220 |
If you want it to only ever do just like that one particular file, this is where like edit mode comes into play. 00:54:24.220 |
This is where ask mode comes into play inside my IDE, because in those situations, I'm steering rather than letting, um, um, uh, then, uh, then, then letting copilot steer. 00:54:37.220 |
So when you review the code, it's going to start a whole session, and then you might get a different code with your comments . 00:54:46.220 |
So there's always a chance that, um, when, again, copilot is probabilistic. 00:54:53.220 |
So there's always a chance it's not going to give me the code exactly the way that I want it to. 00:54:58.220 |
But remember that at the end of the day, what this has done is this has created, just open this up inside of a brand new tab. 00:55:09.220 |
And so I could go in and add in a comment and tell copilot, hey, I want you to fix this. 00:55:17.220 |
So I could then just go in and say, hey, let me create a brand new branch on that space. 00:55:23.220 |
Or I could go in and, um, uh, and then just clone that and then just check out that branch and then go in and manually make the changes as well. 00:55:32.220 |
And so like in the situation that you're describing where, hey, maybe everything looks good, but it's just this one file that I need to modify. 00:55:38.220 |
Honestly, in that situation, I think what I would do is I would just go ahead and, um, I would just do this is, um, get checkout. 00:55:52.220 |
And copilot's great at generating get commands. 00:56:02.220 |
Um, so, uh, yeah, so I could just go in and do that now. 00:56:06.220 |
I can just modify it manually or like I could just work with copilot here then on whatever it was that I, uh, that I was wanting to do. 00:56:16.220 |
So can you go back to the diagram of the MCP? 00:56:20.220 |
That has the big kind of your computer section to that. 00:56:23.220 |
So if you're using one of these remote agents and it's connecting to MCP, how can it do that, number one, with the remote session? 00:56:33.220 |
How long does that session look like on your behalf? 00:56:35.220 |
So, um, so the, I, I'm going to kind of up level all of this. 00:56:40.220 |
So the question is, is can it go to a remote server? 00:56:45.220 |
And the, the short answer to can it access the remote server? 00:56:54.220 |
Um, that, um, when you go to set up that connection to that remote server, you're going to provide 00:57:02.220 |
So in the case of say like the GitHub, um, um, MCP server, then I can go in and I can provide 00:57:07.580 |
a token for that, but then I can set an expiration on that token. 00:57:12.220 |
So it's, all that's really going to depend, there isn't anything in co-pilot that's, um, 00:57:19.220 |
going to, um, automatically like sign you out or anything like that. 00:57:24.220 |
And so this MCP server, it can basically kick off, you know, this is something that the 00:57:31.220 |
actual, the agent that's running remotely has to decide to pull from. 00:57:34.220 |
It can't basically kick off, um, the agent itself. 00:57:38.220 |
So it's, uh, the MCP server is not just automatically going to be able to do something on my behalf. 00:57:43.220 |
I'm going to have to indicate, hey, I want to do this. 00:57:46.220 |
And then on top of that, um, and I don't think I've got it set up, um, on here and it would 00:57:52.220 |
Um, but if I go in and I make a request that's going to kick off an MCP server, I actually 00:57:57.220 |
have a button that says, hey, do you want to do this? 00:57:59.220 |
Which actually leads me right into my next point, which is, um, that my, I, I want to 00:58:06.220 |
make sure that I'm vetting my MCP servers just like I would anything else that's going 00:58:11.220 |
to access external information, just like anything else that's going to be able to act 00:58:18.220 |
Is it possible to create a GitHub issue on behalf of another company, and then have that be assigned 00:58:32.220 |
Do you have visibility as to what model the coding is used, or visibility as to how 00:58:36.220 |
it's making the decision so we can further profit in the future? 00:58:39.220 |
So for coding agent, and again, I'm, I'm just to make sure that we're clear. 00:58:47.220 |
Right now we're not exposing out the model that's being used internally. 00:58:53.220 |
Um, because we have a very specific type of workload, a very specific set of scenarios that 00:59:03.220 |
And so the model that we're choosing is the model that's specifically like that, that we've 00:59:10.220 |
There might come a time where that starts to get exposed out. 00:59:15.220 |
But as of right now, it's, it's specifically because it works with this. 00:59:24.220 |
Is it possible to have more than one coding agent? 00:59:29.220 |
Like a pair of them, like can you make, assign them to two. 00:59:34.220 |
Like I, I could create a hundred issues and assign all 100 of them to, uh, to, to, to coding 00:59:43.220 |
So remember that each time that you assign an issue to a coding agent, it's going to 00:59:47.220 |
create an environment specifically for that issue. 00:59:59.220 |
Can I do it as opposite, like in that folder, my own instructions instead? 01:00:02.220 |
Kind of like a chain and a hierarchy and stuff like everyone's again defined. 01:00:03.220 |
Um, so, um, what you're doing is, you're doing a lot of things. 01:00:15.220 |
Um, so, um, what you can do, and I actually have an example of that right here. 01:00:27.220 |
So, you'll notice that right here, um, I'm actually, um, inside this .instructions file, I'm actually 01:00:34.360 |
referencing out to another .instructions file. 01:00:40.360 |
And then on the apply to, you could go in and start setting folders as well. 01:00:43.840 |
So, however it is that you want that to be set up. 01:00:54.840 |
So, is that possible to really use the compiler to access some . 01:01:01.840 |
So, is that possible to really use the compiler to access some . 01:01:07.840 |
So, if you're working with coding agent, you can configure your list of MCP servers at the 01:01:22.840 |
organization level or on individual repos for, um, um, for anything that's going to be inside 01:01:27.840 |
of, uh, VS code and I'm not sure how others would, um, would necessarily be, um, have that 01:01:34.840 |
Um, you can actually just set up inside of a repository or inside your repository, your MCP JSON file, 01:01:45.840 |
That now becomes part of the, uh, the repository. 01:01:47.840 |
Um, the user will then still need to set up their own credentials because again, it's going 01:02:04.840 |
So, you know, I'm actually going to, to kind of up level this, um, one of the things about 01:02:33.840 |
using MCP servers all up with Agent Mode is that Copilot does need to figure out which MCP 01:02:44.840 |
And generally speaking, it's going to be able to do that on its own. 01:02:47.840 |
But again, and, and, and let this maybe be the number one lesson that we pick up from, 01:02:54.840 |
That if I ever see Copilot not doing something the way that I expect it to do, what am I going 01:03:01.840 |
I mean, well, or, or even, even more generically. 01:03:04.840 |
I, I, you know, back, I used to be a tech trainer. 01:03:06.840 |
Um, um, so I would like literally just like go around different companies to teach classes. 01:03:10.840 |
And one of the things that I would do is I would have little, um, little bits of candy, 01:03:14.840 |
um, and just like toss them out to like the little baby Reese's, um, and toss those out. 01:03:19.840 |
Like update your instructions file or again, like improve your context. 01:03:22.840 |
And so like one of the things that you could do is if you know for this specific type of 01:03:27.840 |
scenario, this is the MCP server I want you to talk to, put it inside your instructions file. 01:03:31.840 |
And in fact, Azure, um, their MCP server, when you register it, VS Code will actually prompt 01:03:35.840 |
you and go, hey, do you want to add that into your, um, there you go. 01:03:41.840 |
Um, but, um, uh, but if you install the Azure MCP server, it will actually say, hey, you should