You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/copilot/concepts/code-review/code-review.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,10 @@ When you reach your monthly quota you will not be able to get a code review from
57
57
* Premium feature. Uses one premium request from your monthly quota per review.
58
58
* Supports custom instructions and custom coding guidelines.
59
59
60
+
## Providing instructions for {% data variables.product.prodname_copilot_short %} code reviews
61
+
62
+
You can tailor the reviews that {% data variables.product.prodname_copilot_short %} generates by providing custom instructions. This helps {% data variables.product.prodname_copilot_short %} to review the code in a way that matches your team's coding standards, tools, and practices. See [AUTOTITLE](/copilot/how-tos/configure-custom-instructions/add-repository-instructions?tool=webui) and [AUTOTITLE](/copilot/how-tos/configure-custom-instructions/add-organization-instructions).
63
+
60
64
## Validating {% data variables.product.prodname_copilot_short %} code reviews
61
65
62
66
{% data variables.product.prodname_copilot_short %} isn't guaranteed to spot all problems or issues in a pull request, and sometimes it will make mistakes. Always validate {% data variables.product.prodname_copilot_short %}'s feedback carefully, and supplement {% data variables.product.prodname_copilot_short %}'s feedback with a human review.
Copy file name to clipboardExpand all lines: content/copilot/concepts/response-customization.md
+8-20Lines changed: 8 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,13 +59,9 @@ contentType: concepts
59
59
60
60
### About repository custom instructions
61
61
62
-
Repository custom instructions consist of a single file, `.github/copilot-instructions.md`, that you create in a repository.
62
+
You can create two types of repository custom instructions for {% data variables.copilot.copilot_chat_short %} on {% data variables.product.prodname_dotcom_the_website %}:
63
63
64
-
Repository custom instructions files are used for chat responses, for code review, and also by {% data variables.product.prodname_copilot_short %} when you assign it to an issue or ask it to create a pull request. Instructions included in this file can help {% data variables.product.prodname_copilot_short %} to work on files in a way that matches your team's working practices and conforms to coding standards for your project. See [AUTOTITLE](/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot).
65
-
66
-
{% data reusables.copilot.repository-custom-instructions-example %}
67
-
68
-
{% data reusables.copilot.repository-cust-instr-code-review %}
64
+
{% data reusables.copilot.custom-instructions-about %}
69
65
70
66
{% endwebui %}
71
67
@@ -75,7 +71,7 @@ Repository custom instructions files are used for chat responses, for code revie
75
71
76
72
There are two types of files you can use to provide context and instructions to {% data variables.copilot.copilot_chat %} in {% data variables.product.prodname_vscode_shortname %}:
77
73
78
-
***Repository custom instructions** allow you to specify repository-wide instructions and preferences, in a single file, that apply to any conversation held in the context of the repository.
74
+
***Repository custom instructions** allow you to specify instructions and preferences that {% data variables.product.prodname_copilot_short %} will consider when working in the context of the repository.
79
75
***Prompt files** (public preview) allow you to save common prompt instructions and relevant context in Markdown files (`*.prompt.md`) that you can then reuse in your chat prompts. Prompt files are only available in {% data variables.product.prodname_vscode_shortname %}.
80
76
81
77
While custom instructions help to add codebase-wide context to each AI workflow, prompt files let you add instructions to a specific chat interaction.
@@ -117,7 +113,9 @@ There are two types of repository custom instructions you can use to provide con
117
113
118
114
Custom instructions consist of natural language instructions and are most effective when they are short, self-contained statements. Consider the scope over which you want the instruction to apply when choosing whether to add an instruction on the personal, repository, or (if available) organization level.
119
115
120
-
{% data reusables.copilot.custom-instructions-interactions-note %}
116
+
> [!NOTE]
117
+
> * {% data reusables.copilot.custom-instructions-chat-precedence %}
118
+
> * {% data reusables.copilot.custom-instructions-conflict %}
121
119
122
120
Here are some common use cases and examples for each type of custom instructions:
123
121
***Personal custom instructions:**
@@ -138,19 +136,9 @@ Here are some common use cases and examples for each type of custom instructions
138
136
139
137
## About repository custom instructions
140
138
141
-
Repository custom instructions consist of a single file, `.github/copilot-instructions.md`, that you create in a repository. The instructions you add to the file should be short, self-contained statements that add context or relevant information to supplement chat questions.
142
-
143
-
Common use cases include:
144
-
145
-
***Test generation.** Create instructions for test generation, such as specifying the use of a certain test framework.
146
-
***Code review.** Specify instructions for reviewing code, such as telling a reviewer to look for a specific error in the code.
147
-
***Commit message generation.** Write instructions for generating commit messages, such as format or the type of information to include.
148
-
149
-
### Example
150
-
151
-
{% data reusables.copilot.repository-custom-instructions-example %}
139
+
You can create two types of repository custom instructions for use in {% data variables.product.prodname_vscode_shortname %}:
152
140
153
-
{% data reusables.copilot.repository-cust-instr-code-review %}
141
+
{% data reusables.copilot.custom-instructions-about %}
Copy file name to clipboardExpand all lines: content/copilot/how-tos/configure-custom-instructions/add-organization-instructions.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Adding organization custom instructions for GitHub Copilot
3
3
shortTitle: Add organization instructions
4
-
intro: 'Customize {% data variables.copilot.copilot_chat %} responses for members of your organization.'
4
+
intro: 'Customize {% data variables.product.prodname_copilot_short %} responses for members of your organization.'
5
5
permissions: Organization owners
6
6
product: 'Organizations with a {% data variables.copilot.copilot_for_business %} or {% data variables.copilot.copilot_enterprise %} plan'
7
7
versions:
@@ -15,18 +15,28 @@ redirect_from:
15
15
contentType: how-tos
16
16
---
17
17
18
-
{% data reusables.copilot.organization-instructions-note %}
18
+
> [!NOTE]
19
+
> This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
20
+
>
21
+
> Organization custom instructions are currently only supported for {% data variables.copilot.copilot_chat_short %} on {% data variables.product.prodname_dotcom_the_website %} and {% data variables.copilot.copilot_code-review_short %}.
19
22
20
23
For an overview of the methods you can use to customize {% data variables.copilot.copilot_chat %} responses, see [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses?tool=webui).
21
24
22
-
## About organization custom instructions for {% data variables.copilot.copilot_chat %}
25
+
## About organization custom instructions for {% data variables.product.prodname_copilot_short %}
23
26
24
-
Organization owners can add instructions for {% data variables.copilot.copilot_chat %} in order to tailor chat responses to the needs and preferences of your organization. For example, you can choose to always have {% data variables.copilot.copilot_chat_short %} respond in your company's language of choice or with a particular style. Some examples of instructions you could add are:
27
+
Organization owners can add instructions for {% data variables.product.prodname_copilot_short %}, to tailor responses to the needs and preferences of your organization. For example, you can choose to always have {% data variables.copilot.copilot_chat_short %} respond in your company's language of choice or with a particular style.
28
+
29
+
Custom instructions defined in an organization's {% data variables.product.prodname_copilot_short %} settings are used for all members of the organization, irrespective of whether they receive their {% data variables.product.prodname_copilot_short %} subscription from that organization.
30
+
31
+
Some examples of instructions you could add are:
25
32
*`Always respond in Spanish.`
26
33
*`Do not generate code blocks in responses.`
27
34
*`For questions related to security, use the Security Docs Knowledge Base.`
28
35
29
-
{% data reusables.copilot.custom-instructions-interactions-note %}
36
+
> [!NOTE]
37
+
> * {% data reusables.copilot.custom-instructions-chat-precedence %}
38
+
> * For {% data variables.copilot.copilot_code-review_short %}, the order of precedence is: instructions in any applicable `.github/instructions/NAME.instructions.md` file, then the instructions in the `.github/copilot-instructions.md` file, then the organization-level custom instructions.
39
+
> * {% data reusables.copilot.custom-instructions-conflict %}
Copy file name to clipboardExpand all lines: content/copilot/how-tos/configure-custom-instructions/add-repository-instructions.md
+52-52Lines changed: 52 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,11 @@ This version of this article is for using repository custom instructions in Ecli
56
56
57
57
Repository custom instructions let you provide {% data variables.product.prodname_copilot_short %} with repository-specific guidance and preferences.
58
58
59
-
{% data reusables.copilot.repository-custom-instructions-support %}
59
+
Repository custom instructions are currently supported for:
60
+
***{% data variables.copilot.copilot_chat_short %}** in {% data variables.product.prodname_vscode_shortname %}
61
+
***{% data variables.copilot.copilot_chat_short %}** in {% data variables.product.prodname_vs %}, JetBrains IDEs, Xcode, Eclipse, and on the {% data variables.product.github %} website (`copilot-instructions.md` file only)
62
+
***{% data variables.copilot.copilot_coding_agent %}**
63
+
***{% data variables.copilot.copilot_code-review_short %}**
60
64
61
65
## Prerequisites for repository custom instructions
62
66
@@ -98,13 +102,13 @@ Repository custom instructions let you provide {% data variables.product.prodnam
98
102
99
103
{% endeclipse %}
100
104
101
-
## Creating a repository custom instructions file
105
+
## Creating custom instructions
102
106
103
107
{% jetbrains %}
104
108
105
-
JetBrains IDEs support a single `.github/copilot-instructions.md` custom instructions file stored in the repository.
109
+
JetBrains IDEs support a single `.github/copilot-instructions.md` custom instructions file stored in the repository, and a locally stored `global-copilot-instructions.md` file.
106
110
107
-
You can create a custom instructions file in your repository using the {% data variables.product.prodname_copilot_short %} settings page, or you can create the file manually.
111
+
You can create the `.github/copilot-instructions.md` file in your repository using the {% data variables.product.prodname_copilot_short %} settings page, or you can create the file manually.
108
112
109
113
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
110
114
@@ -184,40 +188,31 @@ Once saved, these instructions will apply to the current project in Eclipse that
184
188
185
189
{% vscode %}
186
190
187
-
{% data variables.product.prodname_vscode_shortname %} supports either:
191
+
{% data variables.product.prodname_vscode_shortname %} supports two types of repository custom instructions:
188
192
189
-
* A single `.github/copilot-instructions.md` custom instructions file stored in the repository
190
-
* One or more `.instructions.md` files stored within `.github/instructions` in the repository. Each file can specify `applyTo` frontmatter to define what files or directories its instructions apply to.
193
+
***Repository-wide custom instructions**, which apply to all requests made in the context of a repository.
191
194
192
-
### Using a single `.github/copilot-instructions.md` file
195
+
These are specified in a `copilot-instructions.md` file in the `.github` directory of the repository. See [Creating repository-wide custom instructions](#creating-repository-wide-custom-instructions).
193
196
194
-
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
197
+
***Path-specific custom instructions**, which apply to requests made in the context of files that match a specified path.
195
198
196
-
Create the `.github` directory if it does not already exist.
199
+
These are specified in one or more `NAME.instructions.md` files within the `.github/instructions` directory in the repository. See [Creating path-specific custom instructions](#creating-path-specific-custom-instructions).
197
200
198
-
1. Add natural language instructions to the file, in Markdown format.
201
+
If the path you specify matches a file that {% data variables.product.prodname_copilot_short %} is working on, and a repository-wide custom instructions file also exists, then the instructions from both files are used.
199
202
200
-
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
203
+
## Creating repository-wide custom instructions
201
204
202
-
### Using one or more `.instructions.md` files
205
+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
203
206
204
-
1.Create the `.github/instructions` directory if it does not already exist.
207
+
Create the `.github` directory if it does not already exist.
205
208
206
-
1.Create one or more `.instructions.md` files, adding natural language instructions to the file(s).
209
+
1.Add natural language instructions to the file, in Markdown format.
207
210
208
211
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
209
212
210
-
1. Specify what files or directories the instructions apply to by adding `applyTo` frontmatter to the Markdown files, using glob syntax.
213
+
## Creating path-specific custom instructions
211
214
212
-
```markdown
213
-
---
214
-
applyTo: "app/models/**/*.rb"
215
-
---
216
-
217
-
Add custom instructions here
218
-
```
219
-
220
-
To apply the instructions to all files, use the `**` pattern.
215
+
{% data reusables.copilot.custom-instructions-path %}
221
216
222
217
{% endvscode %}
223
218
@@ -237,19 +232,35 @@ Once saved, these instructions will apply to the current project in Eclipse that
237
232
238
233
{% webui %}
239
234
240
-
**{% data variables.copilot.copilot_chat_short %}** on the {% data variables.product.github %} website, **{% data variables.copilot.copilot_coding_agent %}** and **{% data variables.copilot.copilot_code-review_short %}** support a single `.github/copilot-instructions.md` custom instructions file stored in the repository.
235
+
You can create several types of repository custom instructions for use on {% data variables.product.prodname_dotcom_the_website %}:
236
+
237
+
***Repository-wide custom instructions** apply to all requests made in the context of a repository.
238
+
239
+
Supported by: **{% data variables.copilot.copilot_chat_short %}**, **{% data variables.copilot.copilot_coding_agent %}**, and **{% data variables.copilot.copilot_code-review_short %}**.
240
+
241
+
These are specified in a `copilot-instructions.md` file in the `.github` directory of the repository. See [Creating repository-wide custom instructions](#creating-repository-wide-custom-instructions-1).
242
+
243
+
***Path-specific custom instructions** apply to requests made in the context of files that match a specified path.
241
244
242
-
In addition, **{% data variables.copilot.copilot_coding_agent %}**supports:
245
+
Supported by: **{% data variables.copilot.copilot_coding_agent %}**and **{% data variables.copilot.copilot_code-review_short %}**.
243
246
244
-
* One or more `.instructions.md` files stored within `.github/instructions` in the repository. Each file can specify `applyTo` frontmatter to define what files or directories its instructions apply to.
245
-
* One or more `AGENTS.md` files stored anywhere within the repository. When {% data variables.product.prodname_copilot_short %} is working, the nearest `AGENTS.md` file in the directory tree will take precedence.
246
-
* A single `CLAUDE.md` or `GEMINI.md` file stored in the root of the repository.
247
+
These are specified in one or more `NAME.instructions.md` files within the `.github/instructions` directory in the repository. See [Creating path-specific custom instructions](#creating-path-specific-custom-instructions-1).
247
248
248
-
### Using a single `.github/copilot-instructions.md` file
249
+
If the path you specify matches a file that {% data variables.product.prodname_copilot_short %} is working on, and a repository-wide custom instructions file also exists, then the instructions from both files are used.
249
250
250
-
You can ask {% data variables.copilot.copilot_coding_agent %} to generate a `.github/copilot-instructions.md` file, or you can write your own instructions file.
251
+
***Agent instructions** are used by AI agents.
251
252
252
-
#### Asking {% data variables.copilot.copilot_coding_agent %} to generate a `.github/copilot-instructions.md` file
253
+
Supported by: **{% data variables.copilot.copilot_coding_agent %}**.
254
+
255
+
You can create one or more `AGENTS.md` files, stored anywhere within the repository. When {% data variables.product.prodname_copilot_short %} is working, the nearest `AGENTS.md` file in the directory tree will take precedence.
256
+
257
+
Alternatively, you can use a single `CLAUDE.md` or `GEMINI.md` file stored in the root of the repository.
258
+
259
+
## Creating repository-wide custom instructions
260
+
261
+
You can create your own custom instructions file from scratch. See [Writing your own copilot-instructions.md file](#writing-your-own-copilot-instructionsmd-file). Alternatively, you can ask {% data variables.copilot.copilot_coding_agent %} to generate one for you.
262
+
263
+
### Asking {% data variables.copilot.copilot_coding_agent %} to generate a `copilot-instructions.md` file
253
264
254
265
> [!NOTE]
255
266
> {% data reusables.copilot.coding-agent.preview-note-text %}
@@ -341,7 +352,7 @@ You can ask {% data variables.copilot.copilot_coding_agent %} to generate a `.gi
341
352
342
353
{% data variables.product.prodname_copilot_short %} will start a new session, which will appear in the list below the prompt box. {% data variables.product.prodname_copilot_short %} will create a draft pull request, write your custom instructions, push them to the branch, then add you as a reviewer when it has finished, triggering a notification.
343
354
344
-
#### Writing your own `.github/copilot-instructions.md` file
355
+
### Writing your own `copilot-instructions.md` file
345
356
346
357
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
347
358
@@ -354,25 +365,12 @@ You can ask {% data variables.copilot.copilot_coding_agent %} to generate a `.gi
354
365
> [!TIP]
355
366
> The first time you create a pull request in a given repository with {% data variables.copilot.copilot_coding_agent %}, {% data variables.product.prodname_copilot_short %} will leave a comment with a link to automatically generate custom instructions for the repository.
356
367
357
-
### Using one or more `.instructions.md` files
358
-
359
-
1. Create the `.github/instructions` directory if it does not already exist.
360
-
361
-
1. Create one or more `.instructions.md` files, adding natural language instructions to the file(s).
368
+
## Creating path-specific custom instructions
362
369
363
-
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
364
-
365
-
1. Specify what files or directories the instructions apply to by adding `applyTo` frontmatter to the Markdown files, using glob syntax.
366
-
367
-
```markdown
368
-
---
369
-
applyTo: "app/models/**/*.rb"
370
-
---
371
-
372
-
Add custom instructions here
373
-
```
370
+
> [!NOTE]
371
+
> Currently, on {% data variables.product.prodname_dotcom_the_website %}, path-specific custom instructions are only supported for {% data variables.copilot.copilot_coding_agent %} and {% data variables.copilot.copilot_code-review_short %}.
374
372
375
-
To apply the instructions to all files, use the `**` pattern.
373
+
{% data reusables.copilot.custom-instructions-path %}
376
374
377
375
{% endwebui %}
378
376
@@ -459,7 +457,9 @@ Whenever repository custom instructions are used by {% data variables.copilot.co
459
457
460
458
You can click the reference to open the file.
461
459
462
-
{% data reusables.copilot.custom-instructions-interactions-note %}
460
+
> [!NOTE]
461
+
> * {% data reusables.copilot.custom-instructions-chat-precedence %}
462
+
> * {% data reusables.copilot.custom-instructions-conflict %}
0 commit comments