Skip to content

Commit 80074dc

Browse files
Merge pull request #60 from chrisreddington/instruction-updates
Instruction updates
2 parents bd0b677 + 32a59d0 commit 80074dc

24 files changed

+94
-117
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ This is a crowdfunding platform for games with a developer theme. The applicatio
1313
- When adding new functionality, make sure you update the README
1414
- Make sure all guidance in the Copilot Instructions file is updated with any relevant changes, including to project structure and scripts, and programming guidance
1515

16-
### Global language guidance
16+
### Code formatting requirements
1717

18-
- Use type hints for function parameters and return values for all languages which support them
18+
- When writing Python, you must use type hints for return values and function parameters.
1919

2020
### Python and Flask Patterns
2121

.github/instructions/flask-endpoint.instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
- All endpoints require tests
88
- Use the `unittest` module for testing
99
- All tests must pass
10-
- A script is provided to run tests at `scripts/run-server-tests.sh`
10+
- [A script is provided to run tests](../../scripts/run-server-tests.sh)
1111

1212
## Project notes
1313

1414
- The Python virtual environment is located in the root of the project in a **venv** folder
15-
- Register all blueprints in `server/app.py`
16-
- Use the [test instructions](.github/instructions/python-tests.instructions.md) when creating tests
15+
- Register all blueprints in [the app entrypoint](../../server/app.py)
16+
- Use the [test instructions](./python-tests.instructions.md) when creating tests
1717

1818
## Prototype files
1919

20-
- [Endpoint prototype](server/routes/games.py)
21-
- [Tests prototype](server/tests/test_games.py)
20+
- [Endpoint prototype](../../server/routes/games.py)
21+
- [Tests prototype](../../server/tests/test_games.py)

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ bld/
6666
msbuild.log
6767
msbuild.err
6868
msbuild.wrn
69+
70+
# SQLite
71+
*.db

.vscode/mcp.json

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
11
{
2-
"inputs": [
3-
{
4-
"type": "promptString",
5-
"id": "github_token",
6-
"description": "GitHub Personal Access Token",
7-
"password": true
8-
}
9-
],
10-
"servers": {
11-
"github": {
12-
"command": "docker",
13-
"args": [
14-
"run",
15-
"-i",
16-
"--rm",
17-
"-e",
18-
"GITHUB_PERSONAL_ACCESS_TOKEN",
19-
"ghcr.io/github/github-mcp-server"
20-
],
21-
"env": {
22-
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
23-
}
24-
}
2+
"servers": {
3+
"github": {
4+
"type": "http",
5+
"url": "https://api.githubcopilot.com/mcp/"
256
}
7+
}
268
}

docs/0-prereqs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ To create a copy of the repository for the code you'll create an instance from t
1414
> [!IMPORTANT]
1515
> 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.
1616
17-
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 either GitHub Copilot Pro+ or GitHub Copilot Enterprise.
17+
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.
1818

1919
![Input the repository template settings](images/repository-template-settings.png)
2020

21-
4. Make a note of the repository path you created (`organization-or-user-name/repository-name`), as you will be referring to this later in the lab.
21+
4. Make a note of the repository path you created (**organization-or-user-name/repository-name**), as you will be referring to this later in the lab.
2222

2323
## Creating a codespace
2424

docs/1-copilot-coding-agent.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ As a result, we want to [be mindful about how we approach assigning tasks to Cop
3434

3535
Creating code, regardless of who's involved, typically requires a specific environment and some setup scripts to be run to ensure everything is in a good state. This holds true when assigning tasks to Copilot, which is performing tasks in a similar fashion to a SWE.
3636

37-
[Copilot coding agent supports a special workflow][setup-workflow], set in the `.github/workflows/copilot-setup-steps.yml` file, to run before it gets to work. This enables it to have access to the required development tools and dependencies. We pre-configured this ahead of the lab to help the lab flow and allow this learning opportunity. It makes sure that Copilot had access to Python, Node.JS, and the required dependencies for the client and server:
37+
[Copilot coding agent supports a special workflow][setup-workflow], set in the **.github/workflows/copilot-setup-steps.yml** file, to run before it gets to work. This enables it to have access to the required development tools and dependencies. We pre-configured this ahead of the lab to help the lab flow and allow this learning opportunity. It makes sure that Copilot had access to Python, Node.JS, and the required dependencies for the client and server:
3838

3939
```yaml
4040
name: "Copilot Setup Steps"
@@ -79,8 +79,8 @@ jobs:
7979
8080
It looks like any other GitHub workflow file, but it has a few key points:
8181
82-
- It contains a single job called `copilot-setup-steps`. This job is executed in GitHub Actions before Copilot starts working on the pull request.
83-
- We've also added a `workflow_dispatch` trigger, which allows you to run the workflow manually from the Actions tab of your repository. This is useful for testing that the workflow runs successfully instead of waiting for Copilot to run it.
82+
- It contains a single job called **copilot-setup-steps**. This job is executed in GitHub Actions before Copilot starts working on the pull request.
83+
- We've also added a **workflow_dispatch** trigger, which allows you to run the workflow manually from the Actions tab of your repository. This is useful for testing that the workflow runs successfully instead of waiting for Copilot to run it.
8484
8585
## Improving code documentation
8686
@@ -109,13 +109,17 @@ While every developer and organization understands the importance of documentati
109109

110110
11. Select the **Pull Requests** tab.
111111
12. Open the newly generated issue, which will be titled something similar to **[WIP]: Code lacks documentation**.
112-
13. Notice how Copilot has created a todo list.
112+
13. After a few minutes, you should see that Copilot has created a todo list.
113113
14. Review the list and the tasks it's going to complete.
114114
15. Scroll down the pull request timeline, and you should see an update that Copilot has started working on the issue.
115115
16. Select the **View session** button.
116116

117117
![Copilot session view](images/ex4-view-session.png)
118118

119+
120+
> [!IMPORTANT]
121+
> You may need to refresh the window to see the updated indicator.
122+
119123
17. Notice that you can scroll through the live session, and how Copilot is solving the problem. That includes exploring the code and understanding the state, how Copilot pauses to think and decide on the appropriate plan and also creating code.
120124

121125
This will likely take several minutes. One of the primary goals of Copilot coding agent is to allow it to perform tasks asynchronously, freeing us to focus on other tasks. We're going to take advantage of that very feature by both assigning another task to Copilot coding agent, then turning our attention to writing some code to add features to our application.
@@ -180,7 +184,7 @@ You explored the these concepts:
180184
- the importance of clearly scoped issues.
181185
- assigning issues to Copilot.
182186

183-
With coding agent working diligently in the background, we can now turn our attention to our next lesson, [using MCP servers to interact with external services][next-lesson].
187+
With coding agent working diligently in the background, we can now turn our attention to our next lesson, [using MCP servers to interact with external services][next-lesson]. [Copilot coding agent can also use MCP servers][coding-agent-mcp], but we're going to switch back to our Codespace and try use MCP with Copilot agent mode.
184188

185189
## Resources
186190

@@ -194,6 +198,7 @@ With coding agent working diligently in the background, we can now turn our atte
194198
|:--|--:|
195199

196200
[coding-agent-overview]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot#overview-of-copilot-coding-agent
201+
[coding-agent-mcp]: https://docs.github.com/en/copilot/how-tos/agents/copilot-coding-agent/extending-copilot-coding-agent-with-mcp
197202
[assign-issue]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/using-copilot-to-work-on-an-issue
198203
[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
199204
[copilot-agents]: https://docs.github.com/en/copilot/using-github-copilot/coding-agent/about-assigning-tasks-to-copilot

docs/2-mcp.md

Lines changed: 26 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Once you have the extension installed, you may need to authenticate with your Gi
8383
![Example of selecting the Claude 3.5 Sonnet model](images/copilot-agent-mode-model.png)
8484

8585
> [!IMPORTANT]
86-
> The authors of this lab are not indicating a preference towards one model or another. When building this lab, we used Claude 3.5, and as such are including that in the instructions. The hope is the code suggestions you receive will be relatively consistent to ensure a good experience. However, because LLMs are probabilistic, you may notice the suggestions received differ from what is indicated in the lab. This is perfectly normal and expected.
86+
> The authors of this lab are not indicating a preference towards one model or another. When building this lab, we used Claude 3.5 Sonnet, and as such are including that in the instructions. The hope is the code suggestions you receive will be relatively consistent to ensure a good experience. However, because LLMs are probabilistic, you may notice the suggestions received differ from what is indicated in the lab. This is perfectly normal and expected.
8787
8888
8. The chat pane should update to indicate that you are now in agent mode. You should see a tools icon, showing that we can configure tools for GitHub Copilot to use.
8989

@@ -100,74 +100,50 @@ The **.vscode/mcp.json** file is used to configure the MCP servers that are avai
100100

101101
```json
102102
{
103-
"inputs": [
104-
{
105-
"type": "promptString",
106-
"id": "github_token",
107-
"description": "GitHub Personal Access Token",
108-
"password": true
109-
}
110-
],
111103
"servers": {
112104
"github": {
113-
"command": "docker",
114-
"args": [
115-
"run",
116-
"-i",
117-
"--rm",
118-
"-e",
119-
"GITHUB_PERSONAL_ACCESS_TOKEN",
120-
"ghcr.io/github/github-mcp-server"
121-
],
122-
"env": {
123-
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
124-
}
105+
"type": "http",
106+
"url": "https://api.githubcopilot.com/mcp/"
125107
}
126108
}
127109
}
128110
```
129111

130-
The `inputs` section defines the inputs that the MCP server will require. In this case, we are asking for a GitHub Personal Access Token, which is required to authenticate with the GitHub API. The `password` field is set to `true`, which means that the input will be masked when you enter it.
131-
132-
> [!IMPORTANT]
133-
> Make sure that you do not share your GitHub Personal Access Token with anyone, as it provides access to your GitHub account and repositories. Treat it like a password and keep it secure. That means you should not check it into source control or share it with anyone else.
134-
>
135-
> Because it is a sensitive password, **DO NOT** paste it into the **mcp.json** file, is an artifact of the source code. Published tokens is the leading cause of security breaches. Instead, you'll securely add it to your codespace in a later step.
112+
This configuration provides GitHub Copilot access to several additional tools so that it can interact with GitHub repositories, issues, pull requests, and more. This particular configuration uses the [remote GitHub MCP server][remote-github-mcp-server]. By using this approach, we don't need to worry about running the MCP server locally (and the associated management, like keeping it up to date), and we can authenticate to the remote server using OAuth 2.0 instead of a personal access token (PAT).
136113

137-
The `servers` section defines the MCP server that you want to use. In this case, we are using the GitHub MCP server, which is run in a Docker container. The `command` field specifies the command to run the MCP server, and the `args` field specifies the arguments to pass to the command. The `env` field specifies the environment variables to set when running the MCP server. The `GITHUB_PERSONAL_ACCESS_TOKEN` environment variable is set to the value of the `github_token` input, which is provided by the user when prompted.
114+
The MCP server configuration is defined in the **servers** section of the **mcp.json** file. Each MCP server is defined by a unique name (in this case, github) and its type (in this case, **http**). When using local MCP servers, the type may be **stdio** and have a **command** and **args** field to specify how to start the MCP server. You can find out more about the configuration format in the [VS Code documentation][vscode-mcp-config]. In some configurations (not for the remote GitHub MCP server with OAuth), you may also see an **inputs** section. This defines any inputs (like sensitive tokens) that the MCP server may require. You can read more about the configuration properties in the [VS Code documentation][vscode-mcp-config]
138115

139-
## Obtain the token
116+
To utilize an MCP server it needs to be "started". This will allow GitHub Copilot to communicate with the server and perform the tasks you request.
140117

141-
In order to interact with GitHub via the MCP server you'll need to have a token. This can either be done by [creating a personal access token (PAT)][github-pat-docs], or (as in our case) using the GitHub token from the codespace. Let's obtain the GitHub token.
118+
1. Inside VS Code, open **.vscode/mcp.json**.
119+
2. To start the GitHub MCP server, select **Start** above the GitHub server.
142120

143-
1. Open the terminal in your Codespace by selecting <kbd>Ctl</kbd>+<kbd>\`</kbd>.
144-
2. Run the following command to print the value of the GITHUB_TOKEN environment variable:
121+
![The start button above the GitHub MCP server entry](images/ex2-start-mcp.png)
145122

146-
```bash
147-
echo $GITHUB_TOKEN
148-
```
123+
3. You should see a popup asking you to authenticate to GitHub.
149124

150-
3. Highlight the token and copy it to the clipboard.
125+
![A popup showing that the GitHub MCP server wants to authenticate to GitHub](images/ex2-mcp-auth-popup.png)
151126

152-
## Start the MCP server
127+
4. Select **Continue** on the user account that you're using for this lab.
153128

154-
To utilize an MCP server it needs to be "started". This will allow GitHub Copilot to communicate with the server and perform the tasks you request.
129+
![A popup showing the user account selection for GitHub authentication](images/ex2-mcp-select-account.png)
155130

156-
1. Inside VS Code, open **.vscode/mcp.json**.
157-
2. To start the GitHub MCP server, select **Start** above the GitHub server.
158-
3. You should see a prompt asking for the GitHub personal access token.
159-
4. Paste the token you copied previously.
131+
5. If the page appears, select **Authorize visual-studio-code** to allow the GitHub MCP server to login as your selected user account. Once complete, the page should say "You can now close the window.".
160132

161-
![Example of the start button and the prompt asking for the GitHub personal access token](images/copilot-github-mcp-token-prompt.png)
133+
![A popup showing the authorization for visual-studio-code app](images/ex2-mcp-auth-vscode.png)
162134

163-
> [!IMPORTANT]
164-
> Do not share your PAT with anyone, as it provides access to your GitHub account and repositories. Treat it like a password and keep it secure. That includes not checking it into source control. **Do not paste it directly into the .vscode/mcp.json file.**
135+
6. After navigating back to the GitHub Codespace, you should see that the GitHub MCP server has started. You can check this in two places:
136+
- The line in **.vscode/mcp.json** which previously said start. It should now present several options, and show a number of tools available.
137+
- Select the tools icon in the Copilot Chat pane to see the tools available. Scroll down the list that appears at the top of the screen, and you should see a list of tools from the GitHub MCP server.
165138

166-
5. The GitHub MCP server should start up, and you should now see the number of tools available in the Copilot Chat window increase from 0. This indicates that the AI agent is now able to access the GitHub MCP server and perform actions on your behalf.
139+
![Example of the MCP server started with tools available](images/ex2-mcp-server-started.png)
167140

168-
![Example of the Copilot Chat Pane showing tools available](images/copilot-agent-mode-mcp-tools.png)
141+
That's it! You can now use Copilot Chat in agent mode to create issues, manage pull requests, and more.
169142

170-
6. You can select the tools icon to see the list of available tools that the GitHub MCP server provides. This includes tools for creating and managing repositories, issues, pull requests, and more.
143+
> [!IMPORTANT]
144+
> If you have any issues with this MCP server configuration, there are alternate configuration options in the [GitHub MCP server][github-mcp-server] repository using local or remote MCP. If you opt for a configuration that requires authentication via a GitHub Personal Access Token (PAT), make sure that you do not share it with anyone. Treat it like a password and keep it secure. That means you should not check it into source control or share it with anyone else.
145+
>
146+
> Because it is a sensitive password, **DO NOT** paste it into the **mcp.json** file. Instead use the **inputs** property to pass the token as an input variable. Published tokens is one of the leading causes of security breaches.
171147

172148
## Creating a backlog of tasks
173149

@@ -267,3 +243,5 @@ Notice that the setup process is similar to the GitHub MCP server, but you do no
267243
[vscode-extensions]: https://code.visualstudio.com/docs/configure/extensions/extension-marketplace
268244
[copilot-chat-extension]: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot
269245
[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
246+
[remote-github-mcp-server]: https://github.blog/changelog/2025-06-12-remote-github-mcp-server-is-now-available-in-public-preview/
247+
[vscode-mcp-config]: https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_configuration-format

0 commit comments

Comments
 (0)