Skip to content

Add Copilot instructions #2401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add Copilot instructions #2401

wants to merge 3 commits into from

Conversation

heaths
Copy link
Member

@heaths heaths commented Mar 27, 2025

No description provided.

Copy link
Member Author

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RickWinter @LarryOsterman this is just a first draft of some ideas I had and some cribbed from some other examples. What's not yet clear - and I'll play around with these settings a bit "on the side" - is whether I need to specify instructions for each use case individually as documented in https://code.visualstudio.com/docs/copilot/copilot-customization. Perhaps @l0lawrence or @kristapratico would know.

@l0lawrence
Copy link
Member

@RickWinter @LarryOsterman this is just a first draft of some ideas I had and some cribbed from some other examples. What's not yet clear - and I'll play around with these settings a bit "on the side" - is whether I need to specify instructions for each use case individually as documented in https://code.visualstudio.com/docs/copilot/copilot-customization. Perhaps @l0lawrence or @kristapratico would know.

My interpretation (which could be incorrect) of that page is you can separate out everything you would put into a copilot-instructions into different files and have some instructions only apply to specific requests, with the goal of improving results. I personally haven't played around a ton with it yet to speak on how much better it gets, but if you find out I would love to know!

@heaths
Copy link
Member Author

heaths commented Mar 27, 2025

I'll have to try an experiment and see which yields better results. I could see separating them out might yield better results just because context is clearer and isolated to specific use cases.

@heaths
Copy link
Member Author

heaths commented Mar 28, 2025

I'll be making some edits as I use a copy of this file in other changes, but not committing in those PRs until I've improved it a bit more. The last PR I made didn't seem to use these instructions, so we may indeed need to separate them out into separate files.

@RickWinter
Copy link
Member

I like where you are headed here. What is left to get this enabled for all users of the repo?

@kristapratico
Copy link
Member

@heaths there were some good tips and tricks here: https://code.visualstudio.com/blogs/2025/03/26/custom-instructions

@heaths
Copy link
Member Author

heaths commented Mar 28, 2025

@heaths there were some good tips and tricks here: https://code.visualstudio.com/blogs/2025/03/26/custom-instructions

@kristapratico thanks for the reference. I had read that, but other documentation showed combining some things. That said, the "smaller is better" comment might be applicable here, especially since it seems writing commits and pull requests in VSCode didn't use anything of my .github/copilot-instructions.md file. From another post on that site, it seems to imply - though not explicitly state - that the aforementioned file is only for code generation. Seems to work for test code generation as well, though I can't imagine why those are any different anyway: both are code.

I like where you are headed here. What is left to get this enabled for all users of the repo?

@RickWinter when I get something that is a little more helpful. This still isn't great, but after seeing how much better Copilot does once it has some code e.g., test code, in context and what @jongio showed me, I realize now that maybe we need more code samples in here and not just higher-level, hand-wavy instructions.

E.g., the initial tests module with a couple of test functions were close but not quite right (some parameters were wrong and it wouldn't compile). I decided to just accept the result and fix up the couple of mistakes because it was faster. When I added a test function later, those parameters were correct even when variations e.g., StatusCode::Created instead of StatedCode::Ok were used.

- Added GitHub Copilot extension to devcontainer and VSCode recommendations.
- Updated Copilot instructions for clarity and improved guidance.
- Enhanced VSCode settings to include Copilot message generation instructions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants