diff --git a/assets/images/help/copilot/custom-instruction-ref-visual-studio.png b/assets/images/help/copilot/custom-instruction-ref-visual-studio.png new file mode 100644 index 0000000000..2c4b1c2c96 Binary files /dev/null and b/assets/images/help/copilot/custom-instruction-ref-visual-studio.png differ diff --git a/assets/images/help/copilot/custom-instructions-ref-in-github.png b/assets/images/help/copilot/custom-instructions-ref-in-github.png new file mode 100644 index 0000000000..60af86af6a Binary files /dev/null and b/assets/images/help/copilot/custom-instructions-ref-in-github.png differ diff --git a/assets/images/help/copilot/custom-instructions-vscode.png b/assets/images/help/copilot/custom-instructions-vscode.png index 8a938f8313..6e0d1954a6 100644 Binary files a/assets/images/help/copilot/custom-instructions-vscode.png and b/assets/images/help/copilot/custom-instructions-vscode.png differ diff --git a/content/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot.md b/content/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot.md index ceac2eff72..43399d5f94 100644 --- a/content/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot.md +++ b/content/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot.md @@ -8,20 +8,57 @@ topics: - Copilot --- -> [!NOTE] -> * This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change. -> * Custom instructions are currently only supported for {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vscode_shortname %} and {% data variables.product.prodname_vs %}. -## About custom instructions for {% data variables.product.prodname_copilot %} +{% webui %} + +{% data reusables.copilot.custom-instructions-note %} +> +> This version of this article is for using custom instructions on the {% data variables.product.github %} website. Click the tabs above for information on using custom instructions in other environments. + +{% endwebui %} + +{% vscode %} + +{% data reusables.copilot.custom-instructions-note %} +> +> This version of this article is for using custom instructions in {% data variables.product.prodname_vscode_shortname %}. Click the tabs above for instructions on using custom instructions in other environments. + +{% endvscode %} + +{% visualstudio %} + +{% data reusables.copilot.custom-instructions-note %} +> +> This version of this article is for using custom instructions in {% data variables.product.prodname_vs %}. Click the tabs above for instructions on using custom instructions in other environments. + +{% endvisualstudio %} + +## About custom instructions for {% data variables.product.prodname_copilot_chat %} {% 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 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. ## Prerequisites * A custom instructions file (see the instructions below). -* The **Use Instruction Files** ({% data variables.product.prodname_vscode_shortname %}) or **Enable custom instructions** ({% data variables.product.prodname_vs %}) option enabled in your settings. See [Enabling or disabling custom instructions](#enabling-or-disabling-custom-instructions) later in this article. - > [!NOTE] The setting is enabled by default in {% data variables.product.prodname_vscode_shortname %} and disabled by default in {% data variables.product.prodname_vs %}. +{% webui %} + +* Your personal choice of whether to use custom instructions must be set to enabled. This is enabled by default. See [Enabling or disabling custom instructions](#enabling-or-disabling-custom-instructions) later in this article. +* During the {% data variables.release-phases.public_preview %}, if you have a {% data variables.product.prodname_copilot_business_short %} {% ifversion ghec %}or {% data variables.product.prodname_copilot_enterprise_short %}{% endif %} subscription, then the organization {% ifversion ghec %}or enterprise{% endif %} from which you receive your subscription 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){% ifversion ghec %} and [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise#copilot-in-githubcom){% endif %}. + +{% endwebui %} + +{% vscode %} + +* The **Use Instruction Files** option must be enabled in your settings. This is enabled by default. See [Enabling or disabling custom instructions](#enabling-or-disabling-custom-instructions) later in this article. + +{% endvscode %} + +{% visualstudio %} + +* The **Enable custom instructions** option must be enabled in your settings. This is disabled by default. See [Enabling or disabling custom instructions](#enabling-or-disabling-custom-instructions) later in this article. + +{% endvisualstudio %} ## Creating a custom instructions file @@ -69,23 +106,58 @@ Answer all questions in less than 1000 characters, and words of no more than 12 ## Custom instructions in use -The instructions in the `.github/copilot-instructions.md` file are available for use by {% data variables.product.prodname_copilot_chat_short %} as soon as you save the file. The complete set of instructions will be automatically attached to requests that you submit in either the {% data variables.product.prodname_copilot_chat_short %} view, or in inline chat, in {% data variables.product.prodname_vscode_shortname %} and {% data variables.product.prodname_vs %}. +{% webui %} -Custom instructions are not visible in the Chat view or inline chat, but you can verify that they are being used by {% data variables.product.prodname_copilot_short %} by looking at the References list of a response. If custom instructions were added to the prompt that was sent to the model, the `.github/copilot-instructions.md` file is listed as a reference. You can click the reference to open the file. +The instructions in the `.github/copilot-instructions.md` file are available for use by {% data variables.product.prodname_copilot_chat_short %} as soon as you save the file. The complete set of instructions will be automatically added to chat prompts that relate to the repository containing the instructions file. -![Screenshot of the {% data variables.product.prodname_copilot_chat_short %} view in {% data variables.product.prodname_vscode_shortname %} with a reference for the copilot-instructions.md file.](/assets/images/help/copilot/custom-instructions-vscode.png) +In immersive mode (the [https://github.com/copilot](https://github.com/copilot) page), you can start a conversation that uses custom instructions by adding, as an attachment, the repository that contains the instructions file. + +Custom instructions are not visible in {% data variables.product.prodname_copilot_chat_short %}, but you can verify that they are being used by {% data variables.product.prodname_copilot_short %} by expanding the list of references at the top of a chat response in the Chat panel. If custom instructions were added to the prompt that was sent to the model, the `.github/copilot-instructions.md` file is listed as a reference. + +![Screenshot of an expanded References list, showing the 'copilot-instructions.md' file highlighted with a dark organge outline.](/assets/images/help/copilot/custom-instructions-ref-in-github.png) + +You can click the reference to open the file. + +{% endwebui %} + +{% vscode %} + +{% data reusables.copilot.custom-instructions-reference %} + +![Screenshot of an expanded References list, showing the 'copilot-instructions.md' file highlighted with a dark organge outline.](/assets/images/help/copilot/custom-instructions-vscode.png) + +{% endvscode %} + +{% visualstudio %} + +{% data reusables.copilot.custom-instructions-reference %} + +![Screenshot of the References popup, showing the 'copilot-instructions.md' file highlighted with a dark organge outline.](/assets/images/help/copilot/custom-instruction-ref-visual-studio.png) + +{% endvisualstudio %} ## Enabling or disabling custom instructions -You can choose whether or not to have custom instructions added to your chat questions. To do this, select or clear the option in the settings for the {% data variables.product.prodname_copilot_short %} extension. +You can choose whether or not to have custom instructions added to your chat questions. -### In {% data variables.product.prodname_vscode_shortname %} +{% webui %} + +1. Click the {% octicon "kebab-horizontal" aria-label="Conversation options" %} button at the top of the Chat panel, or the top right of the immersive page. +1. Click **Disable custom instructions** or **Enable custom instructions**. + +Your choice persists until you change it. + +{% endwebui %} + +{% vscode %} 1. Open the Setting editor by using the keyboard shortcut Command+, (Mac) / Ctrl+, (Linux/Windows). 1. Type `instruction file` in the search box. 1. Select or clear the checkbox under **Code Generation: Use Instruction Files**. -### In {% data variables.product.prodname_vs %} +{% endvscode %} + +{% visualstudio %} 1. In the {% data variables.product.prodname_vs %} menu bar, under **Tools**, click **Options**. @@ -93,3 +165,5 @@ You can choose whether or not to have custom instructions added to your chat que 1. In the "Options" dialog, type `custom instructions` in the search box. 1. Select or clear the checkbox for **(Preview) Enable custom instructions to be loaded from .github/copilot-instructions.md files and added to requests**. + +{% endvisualstudio %} diff --git a/data/reusables/copilot/custom-instructions-note.md b/data/reusables/copilot/custom-instructions-note.md new file mode 100644 index 0000000000..4bf351da36 --- /dev/null +++ b/data/reusables/copilot/custom-instructions-note.md @@ -0,0 +1,3 @@ +> [!NOTE] +> * This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change. +> * Custom instructions are currently supported for {% data variables.product.prodname_copilot_chat_short %} in {% data variables.product.prodname_vs %}, {% data variables.product.prodname_vscode_shortname %} and on the {% data variables.product.github %} website. diff --git a/data/reusables/copilot/custom-instructions-reference.md b/data/reusables/copilot/custom-instructions-reference.md new file mode 100644 index 0000000000..e034c1d696 --- /dev/null +++ b/data/reusables/copilot/custom-instructions-reference.md @@ -0,0 +1,3 @@ +The instructions in the `.github/copilot-instructions.md` file are available for use by {% data variables.product.prodname_copilot_chat_short %} as soon as you save the file. The complete set of instructions will be automatically attached to requests that you submit in either the {% data variables.product.prodname_copilot_chat_short %} view, or in inline chat. + +Custom instructions are not visible in the Chat view or inline chat, but you can verify that they are being used by {% data variables.product.prodname_copilot_short %} by looking at the References list of a response in the Chat view. If custom instructions were added to the prompt that was sent to the model, the `.github/copilot-instructions.md` file is listed as a reference. You can click the reference to open the file.