Note
This version of this article is about custom instructions on the GitHub website. Click the tabs above for other environments.
About customizing GitHub Copilot Chat responses
GitHub Copilot can provide chat responses that are tailored to your personal preferences, 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 custom instructions that automatically add 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.
Types of custom instructions
- Personal custom instructions apply to all conversations you have with Copilot Chat across the GitHub website. They allow you to specify your individual preferences, such as preferred language or response style, ensuring that the responses are tailored to your personal needs.
- 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.
- Organization custom instructions (public preview) apply to conversations within the context of an organization on the 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 Copilot Enterprise subscription.
Using custom instructions
Custom instructions consist of natural language instructions and are most effective when they are short, self-contained statements. Consider the scope over which you want the instruction to apply when choosing whether to add an instruction on the personal, repository, or (if available) organization level.
Note
- It is possible for multiple types of custom instructions to apply to a conversation. Personal instructions take the highest priority, followed by repository instructions, with organization instructions prioritized last. However, all sets of relevant instructions are still combined and provided to Copilot Chat.
- Whenever possible, you should avoid providing conflicting sets of instructions. If you are concerned about response quality, you can also choose to temporarily disable repository instructions. See Adding repository custom instructions for GitHub Copilot.
Here are some common use cases and examples for each type of custom instructions:
- Personal custom instructions:
- Preferred individual language:
Always respond in Portuguese.
- Individual response preferences:
Explain a single concept per line. Be clear and concise.
- Preferred individual language:
- Repository custom instructions:
- Coding standards:
Use early returns whenever possible.
- Frameworks:
Use Vue with the PrimeVue library.
orUse Typescript rather than Javascript.
- Code style preferences:
Use camel case for variable names.
- Coding standards:
- Organization custom instructions:
- Describe how to answer certain questions:
For questions related to security, use the Security Docs Knowledge Base or advise people to consult with #security on Slack.
- Preferred language for a company which exclusively speaks a single language:
Always respond in Portuguese.
- Organization-wide preferences:
Do not generate code blocks in responses.
- Describe how to answer certain questions:
Next steps
- Adding personal custom instructions for GitHub Copilot
- Adding repository custom instructions for GitHub Copilot
- Adding organization custom instructions for GitHub Copilot in the GitHub Enterprise Cloud documentation