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
+37-1Lines changed: 37 additions & 1 deletion
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: About customizing GitHub Copilot Chat responses
3
3
shortTitle: Customize Copilot responses
4
-
intro: 'Learn about customizing {% data variables.copilot.copilot_chat %} responses to fit with your preferences and requirements.'
4
+
intro: 'Learn about customizing the behavior of {% data variables.product.prodname_copilot %} to fit with your preferences and requirements.'
5
5
versions:
6
6
feature: copilot
7
7
topics:
@@ -50,6 +50,16 @@ redirect_from:
50
50
***Repository custom instructions** apply to conversations within the context of a specific repository. They are useful for defining project-specific coding standards, frameworks, or tools. For example, you can specify that a repository uses TypeScript and a particular library, ensuring consistent responses for all contributors.
51
51
***Organization custom instructions (public preview)** apply to conversations within the context of an organization on the {% data variables.product.github %} website. They are ideal for enforcing organization-wide preferences, such as a common language or security guidelines. Organization custom instructions can only be set by organization owners for organizations with a {% data variables.copilot.copilot_enterprise_short %} subscription.
52
52
53
+
### About repository custom instructions
54
+
55
+
Repository custom instructions consist of a single file, `.github/copilot-instructions.md`, that you create in a repository.
56
+
57
+
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).
58
+
59
+
{% data reusables.copilot.repository-custom-instructions-example %}
60
+
61
+
{% data reusables.copilot.repository-cust-instr-code-review %}
62
+
53
63
{% endwebui %}
54
64
55
65
{% vscode %}
@@ -122,6 +132,8 @@ Common use cases include:
122
132
123
133
{% data reusables.copilot.repository-custom-instructions-example %}
124
134
135
+
{% data reusables.copilot.repository-cust-instr-code-review %}
136
+
125
137
## About prompt files
126
138
127
139
> [!NOTE] Prompt files are {% data variables.release-phases.public_preview %} and subject to change.
@@ -189,6 +201,8 @@ Common use cases include:
189
201
190
202
{% data reusables.copilot.repository-custom-instructions-example %}
191
203
204
+
{% data reusables.copilot.repository-cust-instr-code-review %}
205
+
192
206
{% endvisualstudio %}
193
207
194
208
{% jetbrains %}
@@ -227,6 +241,28 @@ Common use cases include:
227
241
228
242
{% endxcode %}
229
243
244
+
## Writing effective custom instructions
245
+
246
+
The instructions you add should ideally be short, self-contained statements provide {% data variables.product.prodname_copilot_short %} with relevant information to help it work.
247
+
248
+
When writing custom instructions for a repository, you should also consider the size and complexity of your repository. The following types of instructions may work for a small repository with only a few contributors, but for a large and diverse repository, **these may cause problems**:
249
+
250
+
* Requests to refer to external resources when formulating a response
251
+
* Instructions to answer in a particular style
252
+
* Requests to always respond with a certain level of detail
253
+
254
+
For example, the following instructions **may not have the intended results**:
255
+
256
+
```markdown
257
+
Always conform to the coding styles defined in styleguide.md in repo my-org/my-repo when generating code.
258
+
259
+
Use @terminal when answering questions about Git.
260
+
261
+
Answer all questions in the style of a friendly colleague, using informal language.
262
+
263
+
Answer all questions in less than 1000 characters, and words of no more than 12 characters.
Copy file name to clipboardExpand all lines: content/copilot/get-started/github-copilot-features.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ AI-generated text completion to help you write pull request descriptions quickly
55
55
56
56
### {% data variables.product.prodname_copilot_short %} custom instructions
57
57
58
-
Enhance {% data variables.copilot.copilot_chat_short %} responses by providing contextual details on your preferences, tools, and requirements. See [AUTOTITLE](/copilot/customizing-copilot/about-customizing-github-copilot-chat-responses).
58
+
Enhance {% data variables.copilot.copilot_chat_short %} responses by providing contextual details on your preferences, tools, and requirements. See [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses).
59
59
60
60
### {% data variables.copilot.copilot_desktop_short %}
Copy file name to clipboardExpand all lines: content/copilot/how-tos/custom-instructions/adding-organization-custom-instructions-for-github-copilot.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ redirect_from:
14
14
15
15
{% data reusables.copilot.organization-instructions-note %}
16
16
17
-
For an overview of the methods you can use to customize {% data variables.copilot.copilot_chat %} responses, see [AUTOTITLE](/copilot/customizing-copilot/about-customizing-github-copilot-chat-responses?tool=webui).
17
+
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).
18
18
19
19
## About organization custom instructions for {% data variables.copilot.copilot_chat %}
Copy file name to clipboardExpand all lines: content/copilot/how-tos/custom-instructions/adding-personal-custom-instructions-for-github-copilot.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ redirect_from:
12
12
13
13
{% data reusables.copilot.personal-instructions-note %}
14
14
15
-
For an overview of the methods you can use to customize {% data variables.copilot.copilot_chat %} responses, see [AUTOTITLE](/copilot/customizing-copilot/about-customizing-github-copilot-chat-responses?tool=webui).
15
+
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).
16
16
17
17
## About personal custom instructions for {% data variables.copilot.copilot_chat %}
@@ -19,80 +19,25 @@ This version of this article is for using repository custom instructions on the
19
19
20
20
## About repository custom instructions for {% data variables.product.prodname_copilot_short %}
21
21
22
+
Repository custom instructions let you provide {% data variables.product.prodname_copilot_short %} with repository-specific guidance and preferences. For a full introduction to custom instructions, see [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses?tool=webui).
23
+
22
24
{% data reusables.copilot.repository-custom-instructions-support %}
23
25
***{% data variables.copilot.copilot_coding_agent %}**
24
26
***{% data variables.copilot.copilot_code-review_short %}**
25
27
26
-
{% data reusables.copilot.repository-custom-instructions-intro %} You can do this by creating a file in your repository that provides {% data variables.product.prodname_copilot_short %} with the contextual information it needs to generate higher quality responses.
27
-
28
-
The custom instructions file is 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).
29
-
30
-
### Example
31
-
32
-
{% data reusables.copilot.repository-custom-instructions-example %}
33
-
34
-
{% data reusables.copilot.repository-cust-instr-code-review %}
35
-
36
28
{% endwebui %}
37
29
38
30
{% vscode %}
39
31
40
-
This version of this article is for using repository custom instructions in {% data variables.product.prodname_vscode_shortname %}. Click the tabs above for instructions on using custom instructions in other environments.
32
+
This version of this article is for using repository custom instructions and prompt files in {% data variables.product.prodname_vscode_shortname %}. Click the tabs above for instructions on using custom instructions in other environments.
41
33
42
34
## About repository custom instructions and prompt files for {% data variables.product.prodname_copilot_short %}
43
35
36
+
You can provide {% data variables.product.prodname_copilot_short %} with repository-wide instructions or reusable prompt files to give it context and guidance when working in {% data variables.product.prodname_vscode_shortname %}. For a full introduction to repository custom instructions and prompt files, including examples, see [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses?tool=vscode).
37
+
44
38
{% data reusables.copilot.repository-custom-instructions-support %}
45
39
***{% data variables.copilot.copilot_code-review_short %}**
46
40
47
-
{% data reusables.copilot.repository-custom-instructions-intro %} You can do this by creating a file in your repositories that provides {% data variables.product.prodname_copilot_short %} with the contextual information it needs to generate higher quality responses.
48
-
49
-
There are two types of files you can use to provide context and instructions to {% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vscode_shortname %}:
50
-
51
-
***Repository custom instructions** allow you to specify repository-wide instructions and preferences, in a single file, that {% data variables.product.prodname_copilot_short %} will use when working in this repository.
52
-
***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 {% data variables.copilot.copilot_chat_short %} prompts. Prompt files are only available in {% data variables.product.prodname_vscode_shortname %}.
53
-
54
-
While custom instructions help to add codebase-wide context to each AI workflow, prompt files let you add instructions to a specific {% data variables.product.prodname_copilot_short %} interaction.
55
-
56
-
### Repository custom instructions example
57
-
58
-
{% data reusables.copilot.repository-custom-instructions-example %}
59
-
60
-
{% data reusables.copilot.repository-cust-instr-code-review %}
61
-
62
-
### Prompt file examples
63
-
64
-
The following examples demonstrate how to use prompt files.
65
-
66
-
*`New React form.prompt.md` - contains instructions for a reusable task to generate a form using React.
67
-
68
-
```markdown
69
-
Your goal is to generate a new React form component.
70
-
71
-
Ask for the form name and fields if not provided.
72
-
73
-
Requirements for the form:
74
-
- Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
75
-
- Use `react-hook-form` for form state management:
76
-
- Always define TypeScript types for your form data
77
-
- Prefer *uncontrolled* components using register
78
-
- Use `defaultValues` to prevent unnecessary rerenders
79
-
- Use `yup` for validation:
80
-
- Create reusable validation schemas in separate files
81
-
- Use TypeScript types to ensure type safety
82
-
- Customize UX-friendly validation rules
83
-
```
84
-
85
-
*`API security review.prompt.md` - contains reusable information about security practices for REST APIs, which can be used to do security reviews of REST APIs.
86
-
87
-
```markdown
88
-
Secure REST API review:
89
-
- Ensure all endpoints are protected by authentication and authorization
90
-
- Validate all user inputs and sanitize data
91
-
- Implement rate limiting and throttling
92
-
- Implement logging and monitoring for security events
93
-
…
94
-
```
95
-
96
41
{% endvscode %}
97
42
98
43
{% visualstudio %}
@@ -103,17 +48,11 @@ This version of this article is for using repository custom instructions in {% d
103
48
104
49
## About repository custom instructions for {% data variables.product.prodname_copilot_short %}
105
50
51
+
Repository custom instructions let you provide {% data variables.product.prodname_copilot_short %} with repository-specific guidance and preferences. For a full introduction to custom instructions, see [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses?tool=visualstudio).
52
+
106
53
{% data reusables.copilot.repository-custom-instructions-support %}
107
54
***{% data variables.copilot.copilot_code-review_short %}**
108
55
109
-
{% data reusables.copilot.repository-custom-instructions-intro %} You can do this by creating a file in your repositories that provides {% data variables.product.prodname_copilot_short %} with the contextual information it needs to generate higher quality responses.
110
-
111
-
### Example
112
-
113
-
{% data reusables.copilot.repository-custom-instructions-example %}
114
-
115
-
{% data reusables.copilot.repository-cust-instr-code-review %}
116
-
117
56
{% endvisualstudio %}
118
57
119
58
{% jetbrains %}
@@ -124,13 +63,9 @@ This version of this article is for using repository custom instructions in JetB
124
63
125
64
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
126
65
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.
66
+
Repository custom instructions let you provide {% data variables.product.prodname_copilot_short %} with repository-specific guidance and preferences. For a full introduction to custom instructions, see [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses?tool=jetbrains).
128
67
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 %}
68
+
{% data reusables.copilot.repository-custom-instructions-support %}
134
69
135
70
{% endjetbrains %}
136
71
@@ -142,13 +77,9 @@ This version of this article is for using repository custom instructions in Xcod
142
77
143
78
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
144
79
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
80
+
Repository custom instructions let you provide {% data variables.product.prodname_copilot_short %} with repository-specific guidance and preferences. For a full introduction to custom instructions, see [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses?tool=xcode).
150
81
151
-
{% data reusables.copilot.repository-custom-instructions-example %}
82
+
{% data reusables.copilot.repository-custom-instructions-support %}
152
83
153
84
{% endxcode %}
154
85
@@ -289,28 +220,6 @@ Did you successfully add a custom instructions file to your repository?
The instructions you add to the `.github/copilot-instructions.md` file should be short, self-contained statements provide {% data variables.product.prodname_copilot_short %} with relevant information to help it work in this repository.
295
-
296
-
You should also consider the size and complexity of your repository. The following types of instructions may work for a small repository with only a few contributors, but for a large and diverse repository, **these may cause problems**:
297
-
298
-
* Requests to refer to external resources when formulating a response
299
-
* Instructions to answer in a particular style
300
-
* Requests to always respond with a certain level of detail
301
-
302
-
For example, the following instructions **may not have the intended results**:
303
-
304
-
```markdown
305
-
Always conform to the coding styles defined in styleguide.md in repo my-org/my-repo when generating code.
306
-
307
-
Use @terminal when answering questions about Git.
308
-
309
-
Answer all questions in the style of a friendly colleague, using informal language.
310
-
311
-
Answer all questions in less than 1000 characters, and words of no more than 12 characters.
312
-
```
313
-
314
223
## Repository custom instructions in use
315
224
316
225
The instructions in the `.github/copilot-instructions.md` file are available for use by {% data variables.copilot.copilot_chat_short %} as soon as you save the file. The complete set of instructions will be automatically added to requests that you submit to {% data variables.product.prodname_copilot_short %} in the context of that repository. For example, they are added to the prompt you submit to {% data variables.copilot.copilot_chat_short %}.
Copy file name to clipboardExpand all lines: content/copilot/tutorials/enhancing-copilot-agent-mode-with-mcp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Follow these best practices to get the most out of combining MCP servers with ag
39
39
***Provide context**: Include relevant background information about your project and requirements, including links to external resources that {% data variables.product.prodname_copilot_short %} can access.
40
40
***Set boundaries**: Specify any constraints or limitations for the task. For example, if you want {% data variables.product.prodname_copilot_short %} to only plan a new feature and not make any changes yet, specify that. You can also limit which MCP tools are enabled.
41
41
***Request confirmations**: Ask {% data variables.product.prodname_copilot_short %} to confirm its understanding before proceeding with significant changes.
42
-
***Use prompt files or custom instructions**: You can create prompt files or custom instructions files to guide {% data variables.product.prodname_copilot_short %} on how to behave for different MCP servers. See [AUTOTITLE](/copilot/customizing-copilot/about-customizing-github-copilot-chat-responses).
42
+
***Use prompt files or custom instructions**: You can create prompt files or custom instructions files to guide {% data variables.product.prodname_copilot_short %} on how to behave for different MCP servers. See [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses).
Copy file name to clipboardExpand all lines: data/reusables/copilot/policies-for-dotcom.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@
2
2
***Opt in to preview features:** If enabled, users can test new {% data variables.product.prodname_copilot_short %} features that are not yet generally available. Be aware that previews of features may have flaws, and the features may be changed or discontinued at any time. Current previews of {% data variables.product.prodname_copilot_short %} features include:
3
3
4
4
* {% data variables.copilot.copilot_spaces %}. See [AUTOTITLE](/copilot/using-github-copilot/copilot-spaces/about-organizing-and-sharing-context-with-copilot-spaces).
5
-
* Repository custom instructions for {% data variables.copilot.copilot_code-review_short %}. See [AUTOTITLE](/copilot/customizing-copilot/about-customizing-github-copilot-chat-responses).
5
+
* Repository custom instructions for {% data variables.copilot.copilot_code-review_short %}. See [AUTOTITLE](/copilot/concepts/about-customizing-github-copilot-chat-responses).
For examples of custom instructions used to configure {% data variables.copilot.copilot_code-review_short %}, see [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/using-copilot-code-review?tool=webui#customizing-copilots-reviews-with-custom-instructions).
1
+
For examples of repository custom instructions used to configure {% data variables.copilot.copilot_code-review_short %}, see [AUTOTITLE](/copilot/how-tos/agents/copilot-code-review/using-copilot-code-review?tool=webui#customizing-copilots-reviews-with-custom-instructions).
0 commit comments