Last week when talking about a new release of the JetBrains AI assistant, I noticed a specific feature I really liked; the prompt library. This allows you to tweak the prompts that are used in specific contexts.
This made me wonder, does a similar feature exists for GitHub Copilot? Let’s find out…
Custom instructions(preview)
For GitHub Copilot, a similar feature is in preview; Custom Instructions. With custom instructions you can provide extra context that will be added to your conversations so that Copilot can generate higher quality responses.
To use this feature, we first need to enable it because it is still in preview. I’ll show you how to this using Visual Studio(check the link at the bottom of this post to see the instructions for VS Code).
- Open Visual Studio (make sure you have the latest version installed)
- Go to Tools -> Options
- Search for custom instructions
- Select the checkbox for (Preview) Enable custom instructions to be loaded from .github/copilot-instructions.md files and added to requests.
Now that the feature is enabled, we can use it by creating a copilot-instructions.md
file in a .github
folder at the root of our repository.
Here is an example I created:
If I now ask Copilot a question, my instructions are taken into account:
More information
Adding custom instructions for GitHub Copilot - GitHub Docs
JetBrains AI Assistent–Ollama support
Master Copilot Your Way: Unlocking the Power of Copilot Instructions in Visual Studio!