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/about-customizing-github-copilot-chat-responses.md
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,16 @@ redirect_from:
28
28
29
29
{% endvisualstudio %}
30
30
31
+
{% jetbrains %}
32
+
33
+
> [!NOTE] This version of this article is about custom instructions in JetBrains IDEs. Click the tabs above for other environments. <!-- markdownlint-disable-line MD027 -->
34
+
{% endjetbrains %}
35
+
36
+
{% xcode %}
37
+
38
+
> [!NOTE] This version of this article is about custom instructions in Xcode. Click the tabs above for other environments. <!-- markdownlint-disable-line MD027 -->
39
+
{% endxcode %}
40
+
31
41
## About customizing {% data variables.copilot.copilot_chat %} responses
32
42
33
43
{% webui %}
@@ -61,6 +71,18 @@ While custom instructions help to add codebase-wide context to each AI workflow,
61
71
62
72
{% endvisualstudio %}
63
73
74
+
{% jetbrains %}
75
+
76
+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a custom instructions file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
77
+
78
+
{% endjetbrains %}
79
+
80
+
{% xcode %}
81
+
82
+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a custom instructions file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
83
+
84
+
{% endxcode %}
85
+
64
86
{% webui %}
65
87
66
88
## Using custom instructions
@@ -169,6 +191,42 @@ Common use cases include:
169
191
170
192
{% endvisualstudio %}
171
193
194
+
{% jetbrains %}
195
+
196
+
## About repository custom instructions
197
+
198
+
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.
199
+
200
+
Common use cases include:
201
+
202
+
***Test generation.** Create instructions for test generation, such as specifying the use of a certain test framework.
203
+
***Code review.** Specify instructions for reviewing code, such as telling a reviewer to look for a specific error in the code.
204
+
***Commit message generation.** Write instructions for generating commit messages, such as format or the type of information to include.
205
+
206
+
### Example
207
+
208
+
{% data reusables.copilot.repository-custom-instructions-example %}
209
+
210
+
{% endjetbrains %}
211
+
212
+
{% xcode %}
213
+
214
+
## About repository custom instructions
215
+
216
+
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.
217
+
218
+
Common use cases include:
219
+
220
+
***Test generation.** Create instructions for test generation, such as specifying the use of a certain test framework.
221
+
***Code review.** Specify instructions for reviewing code, such as telling a reviewer to look for a specific error in the code.
222
+
***Commit message generation.** Write instructions for generating commit messages, such as format or the type of information to include.
223
+
224
+
### Example
225
+
226
+
{% data reusables.copilot.repository-custom-instructions-example %}
Copy file name to clipboardExpand all lines: content/copilot/how-tos/chat/asking-github-copilot-questions-in-your-ide.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -372,7 +372,7 @@ You can ask {% data variables.copilot.copilot_chat_short %} to give you code sug
372
372
373
373
The response often includes interactive elements. For example, the response may include buttons to copy or insert a code block.
374
374
375
-
To see the files that {% data variables.copilot.copilot_chat_short %} used to generate the response, select the **References**dropdown below the response.
375
+
To see the files that {% data variables.copilot.copilot_chat_short %} used to generate the response, click the **References**link below the response. The references may include a link to a custom instructions file for your repository. This file contains additional information that is automatically added to all of your chat questions to improve the quality of the responses. For more information, see [AUTOTITLE](/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot).
376
376
377
377
## Using keywords in your prompt
378
378
@@ -488,6 +488,8 @@ You can ask {% data variables.copilot.copilot_chat_short %} to give you code sug
488
488
489
489
The response often includes interactive elements. For example, the response may include buttons to copy or insert a code block.
490
490
491
+
To see the files that {% data variables.copilot.copilot_chat_short %} used to generate the response, click the **References** link below the response. The references may include a link to a custom instructions file for your repository. This file contains additional information that is automatically added to all of your chat questions to improve the quality of the responses. For more information, see [AUTOTITLE](/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot).
492
+
491
493
## AI models for {% data variables.copilot.copilot_chat_short %}
@@ -116,6 +116,42 @@ This version of this article is for using repository custom instructions in {% d
116
116
117
117
{% endvisualstudio %}
118
118
119
+
{% jetbrains %}
120
+
121
+
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
122
+
123
+
This version of this article is for using repository custom instructions in JetBrains IDEs. Click the tabs above for instructions on using custom instructions in other environments.
124
+
125
+
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
126
+
127
+
Repository custom instructions are currently supported for {% data variables.copilot.copilot_chat_short %} in JetBrains IDEs, {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %}, Xcode, and on the {% data variables.product.github %} website.
128
+
129
+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
130
+
131
+
### Example
132
+
133
+
{% data reusables.copilot.repository-custom-instructions-example %}
134
+
135
+
{% endjetbrains %}
136
+
137
+
{% xcode %}
138
+
139
+
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
140
+
141
+
This version of this article is for using repository custom instructions in Xcode. Click the tabs above for instructions on using custom instructions in other environments.
142
+
143
+
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
144
+
145
+
Repository custom instructions are currently supported for {% data variables.copilot.copilot_chat_short %} in Xcode, {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %} JetBrains IDEs, and on the {% data variables.product.github %} website.
146
+
147
+
{% data variables.product.prodname_copilot %} can provide chat responses that are tailored to the way your team works, the tools you use, or the specifics of your project, if you provide it with enough context to do so. Instead of repeatedly adding this contextual detail to your chat questions, you can create a file in your repository that automatically adds this information for you. The additional information is not displayed in the chat, but is available to {% data variables.product.prodname_copilot_short %} to allow it to generate higher quality responses.
148
+
149
+
### Example
150
+
151
+
{% data reusables.copilot.repository-custom-instructions-example %}
152
+
153
+
{% endxcode %}
154
+
119
155
## Prerequisites for repository custom instructions
120
156
121
157
* You must have a custom instructions file (see the instructions below).
@@ -140,17 +176,110 @@ This version of this article is for using repository custom instructions in {% d
140
176
141
177
{% endvisualstudio %}
142
178
179
+
{% jetbrains %}
180
+
181
+
* The latest version of the {% data variables.product.prodname_copilot_short %} extension must be installed in your JetBrains IDE.
182
+
183
+
{% endjetbrains %}
184
+
185
+
{% xcode %}
186
+
187
+
* The latest version of the {% data variables.product.prodname_copilot_short %} extension must be installed in Xcode.
188
+
189
+
{% endxcode %}
190
+
143
191
## Creating a repository custom instructions file
144
192
193
+
{% jetbrains %}
194
+
195
+
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.
196
+
197
+
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.
198
+
199
+
### Using the settings page
200
+
201
+
{% data reusables.copilot.jetbrains-settings %}
202
+
{% data reusables.copilot.jetbrains-languages-and-frameworks %}
203
+
1. Under "{% data variables.product.prodname_copilot_short %} Instructions", click **Workspace** or **Global** to choose whether the custom instructions apply to the current workspace or all workspaces.
204
+
205
+
### Manually creating a workspace custom instructions file
206
+
207
+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
208
+
209
+
Create the `.github` directory if it does not already exist.
210
+
211
+
1. Add natural language instructions to the file, in Markdown format.
212
+
213
+
Once saved, these instructions will apply to the current workspace in JetBrains IDEs that you open with {% data variables.product.prodname_copilot_short %} enabled.
214
+
215
+
### Manually creating a global custom instructions file
216
+
217
+
To apply the same instructions across all workspaces in JetBrains IDEs, you can create a global custom instructions file on your local machine.
218
+
219
+
1. Open your file explorer or terminal.
220
+
1. Navigate to the appropriate location for your operating system:
1. Create a file named `global-copilot-instructions.md` in that directory.
228
+
1. Add your custom instructions in natural language, using Markdown format.
229
+
230
+
Once saved, these instructions will apply globally across all workspaces in JetBrains IDEs that you open with {% data variables.product.prodname_copilot_short %} enabled.
231
+
232
+
{% endjetbrains %}
233
+
234
+
{% xcode %}
235
+
236
+
You can create a custom instructions file in your repository via the {% data variables.product.prodname_copilot_short %} settings page.
237
+
238
+
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.
239
+
240
+
1. Open the {% data variables.product.prodname_copilot %} for Xcode application.
241
+
1. At the top of the application window, click **Advanced**.
242
+
1. To the right of "Custom Instructions", click **Current Workspace** or **Global** to choose whether the custom instructions apply to the current workspace or all workspaces.
243
+
244
+
{% endxcode %}
245
+
246
+
{% vscode %}
247
+
248
+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
249
+
250
+
Create the `.github` directory if it does not already exist.
251
+
252
+
1. Add natural language instructions to the file, in Markdown format.
253
+
254
+
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.
255
+
256
+
{% endvscode %}
257
+
258
+
{% visualstudio %}
259
+
145
260
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
146
261
147
262
Create the `.github` directory if it does not already exist.
148
263
149
264
1. Add natural language instructions to the file, in Markdown format.
150
265
151
-
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.{% webui %}
266
+
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.
152
267
153
-
To see your instructions in action, go to [https://github.com/copilot](https://github.com/copilot), attach the repository containing the instructions file, and start a conversation.{% endwebui %}
268
+
{% endvisualstudio %}
269
+
270
+
{% webui %}
271
+
272
+
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
273
+
274
+
Create the `.github` directory if it does not already exist.
275
+
276
+
1. Add natural language instructions to the file, in Markdown format.
277
+
278
+
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.
279
+
280
+
To see your instructions in action, go to [https://github.com/copilot](https://github.com/copilot), attach the repository containing the instructions file, and start a conversation.
281
+
282
+
{% endwebui %}
154
283
155
284
{% note %}
156
285
@@ -216,16 +345,22 @@ You can click the reference to open the file.
216
345
217
346
{% endvisualstudio %}
218
347
219
-
## Enabling or disabling repository custom instructions
348
+
{% jetbrains %}
220
349
221
-
You can choose whether or not you want {% data variables.product.prodname_copilot_short %} to use repository-based custom instructions.
350
+
{% data reusables.copilot.custom-instructions-reference %}
222
351
223
-
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_chat_short %}
352
+
{% endjetbrains %}
224
353
225
-
Custom instructions are enabled for {% data variables.copilot.copilot_chat_short %} by default but you can disable, or re-enable, them at any time. This applies to your own use of {% data variables.copilot.copilot_chat_short %} and does not affect other users.
354
+
{% xcode %}
355
+
356
+
{% data reusables.copilot.custom-instructions-reference %}
357
+
358
+
{% endxcode %}
226
359
227
360
{% webui %}
228
361
362
+
{% data reusables.copilot.custom-instructions-enabling %}
363
+
229
364
1. On {% data variables.product.prodname_dotcom_the_website %}, do one of the following:
230
365
* Go to a repository with a custom instructions file and open the assistive chat panel.
231
366
* Go to the immersive view of {% data variables.copilot.copilot_chat_short %} ([github.com/copilot](https://github.com/copilot)) and attach a repository that contains a custom instructions file.
@@ -237,35 +372,36 @@ Custom instructions are enabled for {% data variables.copilot.copilot_chat_short
237
372
238
373
Your choice persists, for all repositories containing a custom instructions file, until you change it.
239
374
375
+
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
376
+
240
377
{% endwebui %}
241
378
242
379
{% vscode %}
243
380
381
+
{% data reusables.copilot.custom-instructions-enabling %}
382
+
244
383
1. Open the Setting editor by using the keyboard shortcut <kbd>Command</kbd>+<kbd>,</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>,</kbd> (Linux/Windows).
245
384
1. Type `instruction file` in the search box.
246
385
1. Select or clear the checkbox under **Code Generation: Use Instruction Files**.
247
386
387
+
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
388
+
248
389
{% endvscode %}
249
390
250
391
{% visualstudio %}
251
392
393
+
{% data reusables.copilot.custom-instructions-enabling %}
394
+
252
395
1. In the {% data variables.product.prodname_vs %} menu bar, under **Tools**, click **Options**.
253
396
254
397

255
398
256
399
1. In the "Options" dialog, type `custom instructions` in the search box, then click **{% data variables.product.prodname_copilot_short %}**.
257
400
1. Select or clear the checkbox for **(Preview) Enable custom instructions to be loaded from .github/copilot-instructions.md files and added to requests**.
258
401
259
-
{% endvisualstudio %}
260
-
261
-
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_code-review_short %}
402
+
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
262
403
263
-
Custom instructions are enabled for {% data variables.copilot.copilot_code-review_short %} by default but you can disable, or re-enable, them in the repository settings on {% data variables.product.prodname_dotcom_the_website %}. This applies to {% data variables.product.prodname_copilot_short %}'s use of custom instructions for all code reviews it performs in this repository.
264
-
265
-
{% data reusables.repositories.navigate-to-repo %}
266
-
{% data reusables.repositories.sidebar-settings %}
267
-
1. In the "Code & automation" section of the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**, then **Code review**.
268
-
1. Toggle the “Use custom instructions when reviewing pull requests” option on or off.
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_code-review_short %}
2
+
3
+
Custom instructions are enabled for {% data variables.copilot.copilot_code-review_short %} by default but you can disable, or re-enable, them in the repository settings on {% data variables.product.prodname_dotcom_the_website %}. This applies to {% data variables.product.prodname_copilot_short %}'s use of custom instructions for all code reviews it performs in this repository.
4
+
5
+
{% data reusables.repositories.navigate-to-repo %}
6
+
{% data reusables.repositories.sidebar-settings %}
7
+
1. In the "Code & automation" section of the sidebar, click **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %} {% data variables.product.prodname_copilot_short %}**, then **Code review**.
8
+
1. Toggle the “Use custom instructions when reviewing pull requests” option on or off.
## Enabling or disabling repository custom instructions
2
+
3
+
You can choose whether or not you want {% data variables.product.prodname_copilot_short %} to use repository-based custom instructions.
4
+
5
+
### Enabling or disabling custom instructions for {% data variables.copilot.copilot_chat_short %}
6
+
7
+
Custom instructions are enabled for {% data variables.copilot.copilot_chat_short %} by default but you can disable, or re-enable, them at any time. This applies to your own use of {% data variables.copilot.copilot_chat_short %} and does not affect other users.
0 commit comments