WEBVTT

00:00:00.080 --> 00:00:03.960
When it comes to configuring the behavior
of GitHub Copilot,

00:00:03.969 --> 00:00:07.800
another interesting feature
are chat instructions, which you can

00:00:07.840 --> 00:00:10.260
also generate right from inside here.

00:00:10.440 --> 00:00:14.340
Now, what is that all about?
The idea behind chat instructions,

00:00:14.380 --> 00:00:18.060
see,
you can use the AI for generating them,

00:00:18.100 --> 00:00:21.740
general instructions
which you know you want the

00:00:21.780 --> 00:00:25.610
AI to follow over and over again.
Now here, when you

00:00:25.680 --> 00:00:29.280
use generate instructions,
it generates an instructions file

00:00:29.340 --> 00:00:33.200
automatically based on your existing code
base, which can be useful if you're

00:00:33.260 --> 00:00:37.150
using GitHub Copilot in an existing code
base, and you wanna make sure that

00:00:37.180 --> 00:00:40.920
it uses the same coding style
and rules you are

00:00:41.060 --> 00:00:44.560
using in that code base. So for example,
here, it generated

00:00:44.620 --> 00:00:48.540
instructions that made it very clear
which tech stack we're using and

00:00:48.840 --> 00:00:52.600
which patterns we're using.
So it analyzes your code base to

00:00:52.660 --> 00:00:56.420
architecture, which patterns,
which approaches you're using so that

00:00:56.480 --> 00:00:59.860
future generations follow these patterns.

00:00:59.900 --> 00:01:03.000
Now,
you're not limited to automatically

00:01:03.020 --> 00:01:06.160
You can also do it manually, and there
are different ways of doing

00:01:06.220 --> 00:01:10.140
that. Locally in your workspace, there
is this .GitHub folder, which

00:01:10.200 --> 00:01:12.860
already stores my prompt file and so on.

00:01:12.880 --> 00:01:16.600
And if I click on chat instructions here,
I can add a new instruction

00:01:16.640 --> 00:01:20.300
file to that folder in the end,
or as we just did it, generate them

00:01:20.320 --> 00:01:22.760
automatically.
But now I'll do it manually.

00:01:22.840 --> 00:01:26.800
Store it locally or again globally
if you have instructions

00:01:26.840 --> 00:01:30.200
projects, and then here,
I could have my Python rules

00:01:30.920 --> 00:01:34.520
instruction file.
Now with those instructions, you can

00:01:34.560 --> 00:01:38.460
control to which prompts or which tasks

00:01:38.480 --> 00:01:42.440
they should apply to.
Apply_to simply takes a path

00:01:42.540 --> 00:01:46.320
pattern. So if I would, for example,
say to py, it would

00:01:46.420 --> 00:01:50.140
only apply to Python files,
but not to Markdown or other code files,

00:01:50.580 --> 00:01:53.860
and then you simply add your instructions
as normal text.

00:01:53.900 --> 00:01:57.590
In the end,
it will be dynamically injected into your

00:01:57.600 --> 00:02:00.290
scenes.
That's how you can think of these

00:02:00.320 --> 00:02:03.720
It's a prompt extension
that will automatically be loaded

00:02:04.120 --> 00:02:07.500
when the AI wants to edit a Python file,
for example.

00:02:07.540 --> 00:02:10.660
So here we could say prefix_all_my
functions with

00:02:11.320 --> 00:02:15.220
max. Obviously,
not necessarily something you wanna

00:02:15.260 --> 00:02:18.420
do,
but a good way of showing how instructions

00:02:18.500 --> 00:02:22.090
In reality,
you would use this to encode best

00:02:22.120 --> 00:02:25.700
approaches you want the AI to use
or certain rules you want it to

00:02:25.760 --> 00:02:28.700
follow. But with such an instruction file

00:02:28.800 --> 00:02:32.380
added, we could then say update main.py,

00:02:33.220 --> 00:02:37.160
and it will automatically load this
instructions file, as you see here

00:02:37.200 --> 00:02:40.900
under references. It loaded it because I'm

00:02:40.940 --> 00:02:44.900
working on a py file,
and it understands

00:02:44.940 --> 00:02:47.680
prefixed with max because that's in the
instruction file.

00:02:47.720 --> 00:02:50.480
Again, just an example,
but shows you how they work,

00:02:52.680 --> 00:02:56.080
and the great thing about these
instructions is, of course, not just

00:02:56.100 --> 00:03:00.060
set them up globally,
but you also commit them with your

00:03:00.070 --> 00:03:04.000
so all your colleagues have them too,
and you can also share them across

00:03:04.010 --> 00:03:07.790
So here it's now going ahead
and it prefixed all these functions with

00:03:07.840 --> 00:03:11.790
max. Good? I don't know, but it
was my instruction and it followed

00:03:11.820 --> 00:03:13.280
it.
