Skip to content

Commit 1b2223d

Browse files
Add navbar, update links to reference format, add additional copilot extensions
1 parent e1442c4 commit 1b2223d

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

content/full-day/5-context.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# Helping GitHub Copilot understand context
22

3+
| [← Implement testing][walkthrough-previous] | [Next: Coding with GitHub Copilot →][walkthrough-next] |
4+
|:-----------------------------------|------------------------------------------:|
5+
36
The key to success when coding (and much of life) is context. Before we add code to a codebase, we want to understand the rules and structures already in place. When working with an AI coding assistant such as GitHub Copilot the same concept applies - the quality of suggestion is directly proportional to the context Copilot has. Let's use this opportunity to both explore the project we've been given and how to interact with Copilot to ensure it has the context it needs to do its best work.
47

58
## Scenario
69

7-
Before adding new functionality to the website, you want to explore the existing structure to determine where the updates need to be made. You also want to provide Copilot some context in the form of [custom instructions](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot?tool=vscode) so it has a better idea of how best to generate code.
10+
Before adding new functionality to the website, you want to explore the existing structure to determine where the updates need to be made. You also want to provide Copilot some context in the form of [custom instructions][copilot-custom-instructions] so it has a better idea of how best to generate code.
811

912
## Getting started with GitHub Copilot
1013

11-
GitHub Copilot is a cloud-based service offered for both individuals and businesses. As an individual, you can [sign up for a free account](https://github.com/github-copilot/signup) of the service. After enrolling you will typically install the extension for your IDE, which is available for [Visual Studio](https://marketplace.visualstudio.com/items?itemName=GitHub.copilotvs), [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot), [NeoVIM](https://github.com/github/copilot.vim#getting-started) and the [JetBrains IDEs](https://plugins.jetbrains.com/plugin/17718-github-copilot). Because we'll be using the [codespace](./3-codespaces.md) you defined in the previous exercise, you won't need to manually install the extension - you did that when you configured the dev container!
14+
GitHub Copilot is a cloud-based service offered for both individuals and businesses. As an individual, you can [sign up for a free account][copilot-signup] of the service. After enrolling you will typically install the extension for your IDE, which is available for [Visual Studio][copilot-vs], [Visual Studio Code][copilot-vscode], [NeoVIM][copilot-vim] and the [JetBrains IDEs][copilot-jetbrains], [XCode](copilot-xcode) and [Eclipse][copilot-eclipse]. Because we'll be using the [Codespace][walkthrough-codespaces] you defined in the previous exercise, you won't need to manually install the extension - you did that when you configured the dev container!
1215

13-
1. If you don't already have access to GitHub Copilot, [sign up for a free trial](https://github.com/github-copilot/signup).
14-
2. In the [previous exercise](./3-codespaces.md) you configured your [devcontainer](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containers) to automatically install the extension for GitHub Copilot, so you're all set and ready to go!
16+
1. If you don't already have access to GitHub Copilot, [sign up for a free trial][copilot-signup].
17+
2. In the [previous exercise][walkthrough-codespaces] you configured your [devcontainer][devcontainer-docs] to automatically install the extension for GitHub Copilot, so you're all set and ready to go!
1518

1619
## Chat participants and extensions
1720

@@ -35,10 +38,10 @@ GitHub Copilot Chat has a set of available chat participants and extensions avai
3538

3639
## Providing custom instructions
3740

38-
Context is key to ensuring the code suggestions you receive from GitHub Copilot align with your expectations. When operating with limited information, Copilot makes assumptions about what you're looking for, and can sometimes guess incorrectly. By providing context, you allow Copilot to better align with your objectives. One great way to do this is by building a [copilot-instructions.md](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot?tool=vscode) file. This markdown file is placed in your **.github** folder and becomes part of your project. You can use this file to indicate various coding standards you wish to follow, the technologies your project uses, or anything else important for Copilot Chat to understand when generating suggestions.
41+
Context is key to ensuring the code suggestions you receive from GitHub Copilot align with your expectations. When operating with limited information, Copilot makes assumptions about what you're looking for, and can sometimes guess incorrectly. By providing context, you allow Copilot to better align with your objectives. One great way to do this is by building a [copilot-instructions.md][copilot-custom-instructions] file. This markdown file is placed in your **.github** folder and becomes part of your project. You can use this file to indicate various coding standards you wish to follow, the technologies your project uses, or anything else important for Copilot Chat to understand when generating suggestions.
3942

4043
> [!IMPORTANT]
41-
> The *copilot-instructions.md* file is included in **every** call to GitHub Copilot Chat, and will be part of the context sent to Copilot. Because there is always a limited set of tokens an LLM can operate on, a large set of Copilot instructions can obscure relevant information. As such, you should limit your Copilot instructions file to project-wide information, providing an overview of what you're building and how you're building it. If you need to provide more specific information for particular tasks, you can create [prompt files](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot?tool=vscode#about-prompt-files) as needed.
44+
> The *copilot-instructions.md* file is included in **every** call to GitHub Copilot Chat, and will be part of the context sent to Copilot. Because there is always a limited set of tokens an LLM can operate on, a large set of Copilot instructions can obscure relevant information. As such, you should limit your Copilot instructions file to project-wide information, providing an overview of what you're building and how you're building it. If you need to provide more specific information for particular tasks, you can create [prompt files][copilot-custom-instructions] as needed.
4245
4346
Here are some guidelines to consider when creating a Copilot instructions file:
4447

@@ -94,12 +97,32 @@ Whenever you make a call to Copilot chat, the response will always include the c
9497

9598
## Summary and next steps
9699

97-
Congratulations! You've explored context in GitHub Copilot, which is key to generating quality suggestions. You saw how you can use chat participants to help guide GitHub Copilot, and create a Copilot instructions file to provide an overview of what you're building and how you're building it. With this in place, it's time to turn our attention to [adding new functionality to our website](./6-code.md)!
100+
Congratulations! You've explored context in GitHub Copilot, which is key to generating quality suggestions. You saw how you can use chat participants to help guide GitHub Copilot, and create a Copilot instructions file to provide an overview of what you're building and how you're building it. With this in place, it's time to turn our attention to [adding new functionality to our website][walkthrough-next]!
98101

99102
## Resources
100103

101-
- [Getting started with GitHub Copilot](https://docs.github.com/en/copilot/getting-started-with-github-copilot)
102-
- [Adding repository custom instructions for GitHub Copilot](https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot)
103-
- [Adding personal custom instructions for GitHub Copilot](https://docs.github.com/en/copilot/customizing-copilot/adding-personal-custom-instructions-for-github-copilot)
104-
- [Copilot Chat cookbook](https://docs.github.com/en/copilot/copilot-chat-cookbook)
105-
- [Use Copilot Chat in VS Code](https://code.visualstudio.com/docs/copilot/copilot-chat)
104+
- [Getting started with GitHub Copilot][copilot-getting-started]
105+
- [Adding repository custom instructions for GitHub Copilot][copilot-custom-instructions]
106+
- [Adding personal custom instructions for GitHub Copilot][copilot-personal-instructions]
107+
- [Copilot Chat cookbook][copilot-chat-cookbook]
108+
- [Use Copilot Chat in VS Code][vscode-copilot-chat]
109+
110+
| [← Implement testing][walkthrough-previous] | [Next: Coding with GitHub Copilot →][walkthrough-next] |
111+
|:-----------------------------------|------------------------------------------:|
112+
113+
[copilot-chat-cookbook]: https://docs.github.com/en/copilot/copilot-chat-cookbook
114+
[copilot-eclipse]: https://marketplace.eclipse.org/content/github-copilot
115+
[copilot-getting-started]: https://docs.github.com/en/copilot/getting-started-with-github-copilotlot/adding-repository-custom-instructions-for-github-copilot?tool=vscode
116+
[copilot-jetbrains]: https://plugins.jetbrains.com/plugin/17718-github-copilot
117+
[copilot-personal-instructions]: https://docs.github.com/en/copilot/customizing-copilot/adding-personal-custom-instructions-for-github-copilote=GitHub.copilot
118+
[copilot-signup]: https://github.com/github-copilot/signup
119+
[copilot-vim]: https://github.com/github/copilot.vim#getting-startedins.com/plugin/17718-github-copilot
120+
[copilot-vs]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilotvs
121+
[copilot-vscode]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
122+
[copilot-xcode]: https://github.com/github/CopilotForXcode
123+
[devcontainer-docs]: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/introduction-to-dev-containersopilot/adding-personal-custom-instructions-for-github-copilot
124+
[vscode-copilot-chat]: https://code.visualstudio.com/docs/copilot/copilot-chatook
125+
[walkthrough-codespaces]: ./3-codespaces.mdvisualstudio.com/docs/copilot/copilot-chat
126+
[walkthrough-next]: 6-code.mdting.md
127+
[walkthrough-previous]: 4-testing.md[walkthrough-next]: 6-code.md
128+

0 commit comments

Comments
 (0)