Skip to content

Commit 597ecd2

Browse files
authored
Merge pull request #90 from github-samples/content-refresh
Small updates for clarity and new functionality
2 parents 0a43b2d + 8e2ee94 commit 597ecd2

File tree

7 files changed

+31
-91
lines changed

7 files changed

+31
-91
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
This repository contains the project for a 1 hour guided workshop to explore GitHub Copilot Agent Mode and related features in Visual Studio Code. The project is a website for a fictional game crowd-funding company, with a [Flask](https://flask.palletsprojects.com/en/stable/) backend using [SQLAlchemy](https://www.sqlalchemy.org/) and [Astro](https://astro.build/) frontend using [Svelte](https://svelte.dev/) for dynamic pages.
44

5-
To begin the workshop, start at [docs/README.md](./docs/README.md)
5+
## Start the workshop
6+
7+
**To begin the workshop, start at [docs/README.md](./docs/README.md)**
68

79
Or, if just want to run the app...
810

docs/0-prereqs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Exercise 0: Prerequisites
22

3-
Before we get started on the lab, there's a few tasks we need to complete to get everything ready. We need to get a copy of the repository which includes the code, then spin up a [codespace](https://github.com/features/codespaces) to use to create our code.
3+
Before we get started on the lab, there's a few tasks we need to complete to get everything ready. We need to get a copy of the repository which includes the code, then spin up a [codespace][codespaces] to use to create our code.
44

55
## Setting up the Lab Repository
66

7-
To create a copy of the repository for the code you'll create an instance from the [template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository). The new instance will contain all of the necessary files for the lab, and you'll use it as you work through the exercises.
7+
To create a copy of the repository for the code you'll create an instance from the [template][template-repository]. The new instance will contain all of the necessary files for the lab, and you'll use it as you work through the exercises.
88

99
1. In a new browser window, navigate to the GitHub repository for this lab: `https://github.com/github-samples/agents-in-sdlc`.
1010
2. Create your own copy of the repository by selecting the **Use this template** button on the lab repository page. Then select **Create a new repository**.
1111

1212
![Use this template button](images/use-template.png)
1313

14-
> [!IMPORTANT]
15-
> If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors for naming the repository.
16-
1714
3. If you are completing the workshop as part of an event being led by GitHub or Microsoft, follow the instructions provided by the mentors. Otherwise, you can create the new repository in an organization where you have access to Copilot coding agent and can assign issues to Copilot.
1815

1916
![Input the repository template settings](images/repository-template-settings.png)
@@ -22,7 +19,7 @@ To create a copy of the repository for the code you'll create an instance from t
2219

2320
## Creating a codespace
2421

25-
Next up, we will be using a codespace to complete the lab exercises. [GitHub Codespaces](https://github.com/features/codespaces) are a cloud-based development environment that allows you to write, run, and debug code directly in your browser. It provides a fully-featured IDE with support for multiple programming languages, extensions, and tools.
22+
Next up, we will be using a codespace to complete the lab exercises. [GitHub Codespaces][codespaces] are a cloud-based development environment that allows you to write, run, and debug code directly in your browser. It provides a fully-featured IDE with support for multiple programming languages, extensions, and tools.
2623

2724
1. Navigate to your newly created repository.
2825
2. Select the green **Code** button.
@@ -45,3 +42,6 @@ Congratulations, you have created a copy of the lab repository! You also began t
4542
## Next step
4643

4744
Since we've got a few minutes, let's get Copilot working on some tasks asynchronously for us! We can do this by [creating issues and assigning them to Copilot coding agent](./1-copilot-coding-agent.md).
45+
46+
[codespaces]: https://github.com/features/codespaces
47+
[template-repository]: https://docs.github.com/repositories/creating-and-managing-repositories/creating-a-template-repository

docs/1-copilot-coding-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ As has been highlighted, one of the great advantages of GitHub Copilot coding ag
149149
- Before creating the PR, ensure all tests pass
150150
```
151151

152-
7. Note the level of guidance being provided to Copilot to help set everyone up for success.
152+
7. Note the level of guidance being provided to Copilot to help set everyone up for success. While Copilot could infer many of the points we added to the request, it helps to add them in explicitly. This limits the assumptions which need to be made, driving better code generation.
153153
8. Scroll towards the bottom of the dialog box to locate the **Assignee** button.
154154
9. Select **Assignee** to open the dialog box to select assignees.
155155
10. Select **Copilot** from the list.

docs/2-mcp.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Popular existing MCP servers include:
3131

3232
- **[GitHub MCP Server][github-mcp-server]**: This server provides access to a set of APIs for managing your GitHub repositories. It allows the AI agent to perform actions such as creating new repositories, updating existing ones, and managing issues and pull requests.
3333
- **[Playwright MCP Server][playwright-mcp-server]**: This server provides browser automation capabilities using Playwright. It allows the AI agent to perform actions such as navigating to web pages, filling out forms, and clicking buttons.
34-
- **Additional reference servers**: There are many other MCP servers available that provide access to different tools and resources. Anthropic has [a list of MCP servers][anthropic-mcp-servers], including reference, third-party, and community implementations.
34+
- **Additional reference servers**: There are many other MCP servers available that provide access to different tools and resources. GitHub hosts an [MCP registry][mcp-registry], listing including reference, third-party, and community implementations.
3535

3636
> [!IMPORTANT]
3737
> With regard to security, treat MCP servers as you would any other dependency in your project. Before using an MCP server, carefully review its source code, verify the publisher, and consider the security implications. Only use MCP servers that you trust and be cautious about granting access to sensitive resources or operations.
@@ -209,10 +209,9 @@ Notice that the setup process is similar to the GitHub MCP server, but you do no
209209
- [What the heck is MCP and why is everyone talking about it?][mcp-blog-post]
210210
- [GitHub MCP Server][github-mcp-server]
211211
- [Microsoft Playwright MCP Server][playwright-mcp-server]
212-
- [Anthropic MCP Servers][anthropic-mcp-servers]
212+
- [GitHub MCP Registry][mcp-registry]
213213
- [VS Code Extensions][vscode-extensions]
214214
- [GitHub Copilot Chat Extension][copilot-chat-extension]
215-
- [Creating a fine-grained personal access token][github-pat-docs]
216215

217216
---
218217

@@ -225,9 +224,8 @@ Notice that the setup process is similar to the GitHub MCP server, but you do no
225224
[mcp-blog-post]: https://github.blog/ai-and-ml/llms/what-the-heck-is-mcp-and-why-is-everyone-talking-about-it/
226225
[github-mcp-server]: https://github.com/github/github-mcp-server
227226
[playwright-mcp-server]: https://github.com/microsoft/playwright-mcp
228-
[anthropic-mcp-servers]: https://github.com/modelcontextprotocol/servers
227+
[mcp-registry]: https://github.com/mcp
229228
[vscode-extensions]: https://code.visualstudio.com/docs/configure/extensions/extension-marketplace
230229
[copilot-chat-extension]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
231-
[github-pat-docs]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token
232230
[remote-github-mcp-server]: https://github.blog/changelog/2025-06-12-remote-github-mcp-server-is-now-available-in-public-preview/
233231
[vscode-mcp-config]: https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_configuration-format

docs/3-custom-instructions.md

Lines changed: 11 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ Context is key across many aspects of life, and when working with generative AI.
77

88
In this exercise, you will learn how to:
99

10-
- provide Copilot with project-specific context, coding guidelines and documentation standards using custom instructions **.github/copilot-instructions.md**.
11-
- use instruction files to guide Copilot for repetitive or templated tasks.
10+
- provide Copilot with project-specific context, coding guidelines and documentation standards using [repository custom instructions][repository-custom-instructions] **.github/copilot-instructions.md**.
11+
- provide path instruction files to guide Copilot for repetitive or templated tasks on specific types of files.
1212
- implement both repository-wide instructions and task-specific instructions.
1313

14+
> [!NOTE]
15+
> There are other types of files which can be used to provide context or guidance to Copilot currently in preview. This workshop currently focused on generally available features.
16+
1417
## Scenario
1518

1619
As any good dev shop, Tailspin Toys has a set of guidelines and requirements for development practices. These include:
@@ -40,11 +43,13 @@ Custom instructions allow you to provide context and preferences to Copilot chat
4043

4144
There are two types of instructions files:
4245

43-
- **.github/copilot-instructions.md**, a single instruction file sent to Copilot for **every** chat prompt. This file should contain project-level information, context which is relevant for every message. This could include the tech stack being used, an overview of what's being built, or global guidance for Copilot.
46+
- **.github/copilot-instructions.md**, a single instruction file sent to Copilot for **every** chat prompt for the repository. This file should contain project-level information, context which is relevant for most chat requests sent to Copilot. This could include the tech stack being used, an overview of what's being built and best practices, and other global guidance for Copilot.
4447
- **\*.instructions.md** files can be created for specific tasks or file types. You can use **.instructions.md** files to provide guidelines for particular languages (like Python or TypeScript), or for tasks like creating a React component or a new instance of a repository pattern.
4548

4649
> [!NOTE]
4750
> When working in your IDE, instructions files are only used for code generation in Copilot Chat, and not used for code completions or next edit suggestions.
51+
>
52+
> Copilot coding agent will utilize both repository and path instructions files when generating code.
4853
4954
## Use GitHub Copilot Chat before updating custom instructions
5055

@@ -69,9 +74,9 @@ To see the impact of custom instructions, we will start by sending a prompt with
6974
> [!IMPORTANT]
7075
> As highlighted previously, GitHub Copilot and LLM tools are probabilistic, not deterministic. As a result, the exact code generated may vary, and there's even a chance it'll abide by our rules without us spelling it out! But to aid consistency in code we should always document anything we want to ensure Copilot should understand about how we want our code generated.
7176
72-
## Add global standards to copilot-instructions.md
77+
## Add repository standards to copilot-instructions.md
7378

74-
As highlighted previously, `copilot-instructions.md` is designed to provide project-level information to Copilot. Let's ensure global coding standards are documented to improve code suggestions from Copilot chat.
79+
As highlighted previously, `copilot-instructions.md` is designed to provide project-level information to Copilot. Let's ensure repository coding standards are documented to improve code suggestions from Copilot chat.
7580

7681
1. Return to your codespace.
7782
2. Open `.github/copilot-instructions.md`.
@@ -155,68 +160,4 @@ We want to create a new endpoint to list all publishers, and to follow the same
155160

156161
![Screenshot showing the instruction file being added into Copilot Chat](images/copilot-add-instructions-file.png)
157162

158-
13. Send the same prompt as before to generate the desired endpoint:
159-
160-
```plaintext
161-
Create a new endpoint to return a list of all publishers. It should return the name and id for all publishers.
162-
```
163-
164-
14. Note the **References** section and how it uses the **flask-endpoint.instructions.md** file to provide context. If you use instructions files with Copilot agent mode, you will notice that Copilot explores and reads the files referenced in the instructions file.
165-
166-
![Screenshot of the references section, showing the included instructions file](./images/copilot-instructions-references.png)
167-
168-
15. Copilot generates the files. Notice how it generates updates across multiple files, like **publishers.py** and **test_publishers.py**
169-
170-
> [!NOTE]
171-
> Note that the code generated may diverge from some of the standards we set. AI tools like Copilot are non-deterministic, and may not always provide the same result. The other files in our codebase do not contain docstrings or comment headers, which could lead Copilot in another direction. Consistency is key, so making sure that your code follows the established patterns is important. You can always follow-up in chat and ask Copilot to follow your coding standards, which will help guide it in the right direction.
172-
173-
16. After reviewing the code, select **Keep** in Copilot Chat to accept the changes.
174-
17. If you are prompted to run tests select **Cancel**; we'll perform this task later.
175-
18. Open a terminal window by selecting <kbd>Ctl</kbd> + <kbd>\`</kbd>.
176-
19. Run the tests by running the script with the following command:
177-
178-
```sh
179-
./scripts/run-server-tests.sh
180-
```
181-
182-
20. Once the code is correct, and all tests pass, open the **Source Control** panel on the left of the Codespace and review the changes made by Copilot.
183-
184-
> [!NOTE]
185-
> If any tests fail, ask Copilot to suggest a fix. You can use `@terminal /explain` to give Copilot the context of your terminal window.
186-
187-
21. Stage the changes by selecting the **+** icon in the **Source Control** panel.
188-
22. Generate a commit message using the **Sparkle** button.
189-
190-
![Screenshot of the Source Control panel showing the changes made](images/source-control-changes.png)
191-
192-
23. Commit the changes to your repository by selecting **Commit**.
193-
194-
## Summary and next steps
195-
196-
Congratulations! You explored how to ensure Copilot has the right context to generate code following the practices your organization has set forth. This can be done at a repository level with the **.github/copilot-instructions.md** file, or on a task basis with instruction files. You explored how to:
197-
198-
- provide Copilot with project-specific context, coding guidelines and documentation standards using custom instructions (.github/copilot-instructions.md).
199-
- use instruction files to guide Copilot for repetitive or templated tasks.
200-
- implement both repository-wide instructions and task-specific instructions.
201-
202-
Next we'll use [agent mode to add functionality to the site][next-lesson].
203-
204-
## Resources
205-
206-
- [Instruction files for GitHub Copilot customization][instruction-files]
207-
- [Best practices for creating custom instructions][instructions-best-practices]
208-
- [Personal custom instructions for GitHub Copilot][personal-instructions]
209-
210-
---
211-
212-
| [← Previous lesson: Model Context Protocol (MCP)][previous-lesson] | [Next lesson: Copilot agent mode →][next-lesson] |
213-
|:--|--:|
214-
215-
[previous-lesson]: ./2-mcp.md
216-
[next-lesson]: ./4-copilot-agent-mode-vscode.md
217-
[instruction-files]: https://code.visualstudio.com/docs/copilot/copilot-customization
218-
[python-type-hints]: https://docs.python.org/3/library/typing.html
219-
[games-endpoints]: ../server/routes/games.py
220-
[games-tests]: ../server/tests/test_routes/test_games.py
221-
[instructions-best-practices]: https://docs.github.com/en/enterprise-cloud@latest/copilot/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks#adding-custom-instructions-to-your-repository
222-
[personal-instructions]: https://docs.github.com/en/copilot/customizing-copilot/adding-personal-custom-instructions-for-github-copilot
163+
13. Send the same

docs/4-copilot-agent-mode-vscode.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ As the list of games grows there will be a need for paging to be enabled. Using
189189
## Resources
190190

191191
- [Coding agent 101][coding-agent-101]
192-
- [Copilot ask, edit, and agent modes: What they do and when to use them
193-
][choose-mode]
192+
- [Copilot ask, edit, and agent modes: What they do and when to use them][choose-mode]
194193
- [Agent mode in VS Code][vs-code-agent-mode]
195194

196195
---

docs/5-reviewing-coding-agent.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ This is just the beginning, and we can't wait to see how you use Copilot to help
126126
|:----:|
127127

128128
[github-copilot]: https://github.com/features/copilot
129-
[coding-agent-overview]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot#overview-of-copilot-coding-agent
130-
[assign-issue]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/using-copilot-to-work-on-an-issue
131-
[setup-workflow]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks#pre-installing-dependencies-in-github-copilots-environment
132-
[copilot-agents]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot
133-
[coding-agent-best-practices]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks
134-
[agent-firewall]: https://docs.github.com/en/copilot/customizing-copilot/customizing-or-disabling-the-firewall-for-copilot-coding-agent
129+
[coding-agent-overview]: https://docs.github.com/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot#overview-of-copilot-coding-agent
130+
[assign-issue]: https://docs.github.com/copilot/using-github-copilot/coding-agent/using-copilot-to-work-on-an-issue
131+
[setup-workflow]: https://docs.github.com/copilot/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks#pre-installing-dependencies-in-github-copilots-environment
132+
[copilot-agents]: https://docs.github.com/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot
133+
[coding-agent-best-practices]: https://docs.github.com/copilot/using-github-copilot/coding-agent/best-practices-for-using-copilot-to-work-on-tasks
134+
[agent-firewall]: https://docs.github.com/copilot/customizing-copilot/customizing-or-disabling-the-firewall-for-copilot-coding-agent
135135

136136
[previous-lesson]: ./4-copilot-agent-mode-vscode.md

0 commit comments

Comments
 (0)