Skip to content

Commit 71b1544

Browse files
sunbryeCopilotam-stead
authored
Copilot code reviews - support for copilot-instructions.md [Public Preview] (#56045)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Anne-Marie <102995847+am-stead@users.noreply.github.com>
1 parent 04c0608 commit 71b1544

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

content/copilot/using-github-copilot/code-review/using-copilot-code-review.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ To request a re-review from {% data variables.product.prodname_copilot_short %},
152152

153153
By default, you manually request a review from {% data variables.product.prodname_copilot_short %} on each pull request, in the same way you would request a review from a human. However, you can set up {% data variables.product.prodname_copilot_short %} to automatically review all pull requests. See [AUTOTITLE](/copilot/using-github-copilot/code-review/configuring-automatic-code-review-by-copilot).
154154

155+
## Customizing {% data variables.product.prodname_copilot_short %}'s reviews with custom instructions
156+
157+
{% data reusables.copilot.code-review.custom-instructions-information %}
158+
155159
## Customizing {% data variables.product.prodname_copilot_short %}'s reviews with coding guidelines
156160

157161
{% data reusables.copilot.code-review.custom-coding-guidelines %}
@@ -223,6 +227,10 @@ To provide feedback, hover over the comment and click the thumbs up or thumbs do
223227

224228
![Screenshot of a comment from {% data variables.product.prodname_copilot_short %} in {% data variables.product.prodname_vscode %} with feedback buttons displayed. The buttons are outlined in dark orange.](/assets/images/help/copilot/code-review/vscode-comment-feedback@2x.png)
225229

230+
## Customizing {% data variables.product.prodname_copilot_short %}'s reviews with custom instructions
231+
232+
{% data reusables.copilot.code-review.custom-instructions-information %}
233+
226234
## Customizing {% data variables.product.prodname_copilot_short %}'s reviews with coding guidelines
227235

228236
{% data reusables.copilot.code-review.custom-coding-guidelines %}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
> [!NOTE]
2+
> Custom instructions for {% data variables.copilot.copilot_code-review_short %} are in {% data variables.release-phases.public_preview %} and are subject to change.
3+
>
4+
> This feature is available with the {% data variables.copilot.copilot_pro_short %}, {% data variables.copilot.copilot_pro_plus_short %} {% data variables.copilot.copilot_business_short %}, and {% data variables.copilot.copilot_enterprise_short %} plan.
5+
>
6+
> During the {% data variables.release-phases.public_preview %}, if you're using a {% data variables.copilot.copilot_business_short %} or {% data variables.copilot.copilot_enterprise_short %} plan, the organization or enterprise that provides your plan must have the **Opt in to preview features** setting enabled. See [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization) or [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise#copilot-in-githubcom)
7+
8+
Customize {% data variables.copilot.copilot_code-review_short %} behavior by adding a repository custom instructions file. To do this, create a `.github/copilot-instructions.md` file in your repository and add natural language text that you want {% data variables.product.prodname_copilot_short %} to consider when reviewing code. This is the same `copilot-instructions.md` used by {% data variables.copilot.copilot_chat_short %}. See [AUTOTITLE](/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot).
9+
10+
To enable or disable custom instructions for code review, go to your repository’s settings, then navigate to **Code Review** under **Copilot**, and toggle the “Use custom instructions when reviewing pull requests” option.
11+
12+
### Example
13+
14+
This example of a `.github/copilot-instructions.md` file contains three instructions that will be applied to all {% data variables.copilot.copilot_code-review_short %}s in the repository.
15+
16+
```text
17+
When performing a code review, respond in Spanish.
18+
19+
When performing a code review, follow our internal security checklist.
20+
21+
When performing a code review, focus on readability and avoid nested ternary operators.
22+
```
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
* **Opt in to user feedback collection:** If enabled, users can provide feedback on {% data variables.product.prodname_copilot_short %} pull request summaries. For more information, see [AUTOTITLE](/enterprise-cloud@latest/copilot/github-copilot-enterprise/copilot-pull-request-summaries/creating-a-pull-request-summary-with-github-copilot).
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 {% data variables.copilot.copilot_spaces %}. See [AUTOTITLE](/copilot/using-github-copilot/copilot-spaces/about-organizing-and-sharing-context-with-copilot-spaces).
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+
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 [Customizing {% data variables.product.prodname_copilot_short %}'s reviews with custom instructions](/copilot/using-github-copilot/code-review/using-copilot-code-review#customizing-copilots-reviews-with-custom-instructions).

0 commit comments

Comments
 (0)