Build a Custom Copilot Chat command in seconds

A simple yet underrated way of accelerating standardisation in an enterprise engineering platform is to build custom Copilot instructions to bundle in your repositories.

Whilst that is very true, we should not just think of them as overarching, standard prompts that give custom information to our developers. That would be true of a copilot-instructions.md file in the root of the repository, however anyone can develop their own, just by adding a <command>.prompt.md file in the .github/prompts folder.

Something like this:

You will be able to invoke it from the /pirate command in Copilot Chat:

This would invoke the prompt (“can you help?”) with my pre-defined context setup for the command:

And it will result in… well, exactly what you’d expect 😂

It’s not magic, it’s not special, it’s just part of the GitHub Copilot infrastructure in Visual Studio Code, that allows you to create custom instructions.

Obviously, being a Markdown-based approach, you can also use it in your coding agents if you have something specific in them - all you have to do is to refer to them as part of your Agent prompt.