Note
This version of this article is about custom instructions in Visual Studio. Click the tabs above for other environments.
About customizing GitHub Copilot Chat responses
GitHub 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 Copilot to allow it to generate higher quality responses.
About repository custom instructions
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.
Common use cases include:
- Test generation. Create instructions for test generation, such as specifying the use of a certain test framework.
- Code review. Specify instructions for reviewing code, such as telling a reviewer to look for a specific error in the code.
- Commit message generation. Write instructions for generating commit messages, such as format or the type of information to include.
Example
This example of a .github/copilot-instructions.md
file contains three instructions that will be added to all chat questions.
We use Bazel for managing our Java dependencies, not Maven, so when talking about Java packages, always give me instructions and code samples that use Bazel.
We always write JavaScript with double quotes and tabs for indentation, so when your responses include JavaScript code, please follow those conventions.
Our team uses Jira for tracking items of work.