Skip to content

Commit ca9d36a

Browse files
authored
[EDI - Builders] Update custom instructions docs in light of EDI audit (#56698)
1 parent 97dc910 commit ca9d36a

9 files changed

+55
-110
lines changed

content/copilot/concepts/about-customizing-github-copilot-chat-responses.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: About customizing GitHub Copilot Chat responses
33
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.'
55
versions:
66
feature: copilot
77
topics:
@@ -50,6 +50,16 @@ redirect_from:
5050
* **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.
5151
* **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.
5252

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+
5363
{% endwebui %}
5464

5565
{% vscode %}
@@ -122,6 +132,8 @@ Common use cases include:
122132

123133
{% data reusables.copilot.repository-custom-instructions-example %}
124134

135+
{% data reusables.copilot.repository-cust-instr-code-review %}
136+
125137
## About prompt files
126138

127139
> [!NOTE] Prompt files are {% data variables.release-phases.public_preview %} and subject to change.
@@ -189,6 +201,8 @@ Common use cases include:
189201

190202
{% data reusables.copilot.repository-custom-instructions-example %}
191203

204+
{% data reusables.copilot.repository-cust-instr-code-review %}
205+
192206
{% endvisualstudio %}
193207

194208
{% jetbrains %}
@@ -227,6 +241,28 @@ Common use cases include:
227241

228242
{% endxcode %}
229243

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.
264+
```
265+
230266
## Next steps
231267

232268
{% webui %}

content/copilot/get-started/github-copilot-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ AI-generated text completion to help you write pull request descriptions quickly
5555

5656
### {% data variables.product.prodname_copilot_short %} custom instructions
5757

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).
5959

6060
### {% data variables.copilot.copilot_desktop_short %}
6161

content/copilot/how-tos/custom-instructions/adding-organization-custom-instructions-for-github-copilot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ redirect_from:
1414

1515
{% data reusables.copilot.organization-instructions-note %}
1616

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).
1818

1919
## About organization custom instructions for {% data variables.copilot.copilot_chat %}
2020

content/copilot/how-tos/custom-instructions/adding-personal-custom-instructions-for-github-copilot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ redirect_from:
1212

1313
{% data reusables.copilot.personal-instructions-note %}
1414

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).
1616

1717
## About personal custom instructions for {% data variables.copilot.copilot_chat %}
1818

content/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot.md

Lines changed: 11 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -19,80 +19,25 @@ This version of this article is for using repository custom instructions on the
1919

2020
## About repository custom instructions for {% data variables.product.prodname_copilot_short %}
2121

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+
2224
{% data reusables.copilot.repository-custom-instructions-support %}
2325
* **{% data variables.copilot.copilot_coding_agent %}**
2426
* **{% data variables.copilot.copilot_code-review_short %}**
2527

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-
3628
{% endwebui %}
3729

3830
{% vscode %}
3931

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.
4133

4234
## About repository custom instructions and prompt files for {% data variables.product.prodname_copilot_short %}
4335

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+
4438
{% data reusables.copilot.repository-custom-instructions-support %}
4539
* **{% data variables.copilot.copilot_code-review_short %}**
4640

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-
9641
{% endvscode %}
9742

9843
{% visualstudio %}
@@ -103,17 +48,11 @@ This version of this article is for using repository custom instructions in {% d
10348

10449
## About repository custom instructions for {% data variables.product.prodname_copilot_short %}
10550

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+
10653
{% data reusables.copilot.repository-custom-instructions-support %}
10754
* **{% data variables.copilot.copilot_code-review_short %}**
10855

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-
11756
{% endvisualstudio %}
11857

11958
{% jetbrains %}
@@ -124,13 +63,9 @@ This version of this article is for using repository custom instructions in JetB
12463

12564
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
12665

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).
12867

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 %}
13469

13570
{% endjetbrains %}
13671

@@ -142,13 +77,9 @@ This version of this article is for using repository custom instructions in Xcod
14277

14378
## About repository custom instructions for {% data variables.copilot.copilot_chat %}
14479

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).
15081

151-
{% data reusables.copilot.repository-custom-instructions-example %}
82+
{% data reusables.copilot.repository-custom-instructions-support %}
15283

15384
{% endxcode %}
15485

@@ -289,28 +220,6 @@ Did you successfully add a custom instructions file to your repository?
289220

290221
{% endnote %}
291222

292-
## Writing effective repository custom instructions
293-
294-
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-
314223
## Repository custom instructions in use
315224

316225
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 %}.

content/copilot/tutorials/enhancing-copilot-agent-mode-with-mcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Follow these best practices to get the most out of combining MCP servers with ag
3939
* **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.
4040
* **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.
4141
* **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).
4343

4444
### MCP server use
4545

data/reusables/copilot/policies-for-dotcom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* **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:
33

44
* {% 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).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
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

Comments
 (0)