|
3 | 3 | | [← Previous lesson: Custom instructions][previous-lesson] | [Next lesson: Reviewing coding agent →][next-lesson] | |
4 | 4 | |:--|--:| |
5 | 5 |
|
6 | | -Even the simplest of updates to an application typically require updates to multiple files and operations to be performed like running tests. As a developer your flow typically involves tracking down all the necessary files, making the changes, running the tests, debugging, figuring out which file was missed, making another update... |
| 6 | +Even the simplest of updates to an application typically require updates to multiple files and operations to be performed like running tests. As a developer your flow typically involves tracking down all the necessary files, making the changes, running the tests, debugging, figuring out which file was missed, making another update... The list goes on and on. |
7 | 7 |
|
8 | 8 | This is where Copilot Agent Mode comes into play. |
9 | 9 |
|
@@ -50,28 +50,27 @@ To make running the website easier, we have provided a script that will start bo |
50 | 50 | 4. Open the website by using <kbd>Ctrl</kbd>-**Click** (or <kbd>Cmd</kbd>-**Click** on a Mac) on the client address (http://localhost:4321) in the terminal. |
51 | 51 |
|
52 | 52 | > [!NOTE] |
53 | | -> When accessing GitHub Codespaces: |
54 | | -> - If you're using Codespaces in a web browser: Clicking the localhost URL from the Codespace terminal will automatically redirect you to `https://<your-codespace-name>-4321.app.github.dev/` |
55 | | -> - If you're running Codespaces locally through VS Code or using a local development environment: You can access the site directly via `http://localhost:4321` |
| 53 | +> When using a codespace, selecting a link for the localhost URL from the Codespace terminal will automatically redirect you to `https://<your-codespace-name>-4321.app.github.dev/`. This is a private tunnel to your codespace, which is now hosting your web server! |
56 | 54 |
|
57 | 55 | ### Exploring the website |
58 | 56 |
|
59 | 57 | Once the website is running, you can explore its functionality. The main features of the website include: |
60 | 58 |
|
61 | 59 | - **Home Page**: Displays a list of board games with their titles, images, and descriptions. |
62 | | -- **Game Details Page**: When you click on a game, it takes you to a details page with more information about the game, including its title, description, and image. |
| 60 | +- **Game Details Page**: When you select a game, you'll be brought to a details page with more information about the game, including its title, description, publisher and category. |
63 | 61 |
|
64 | 62 | ## Explore the backlog from Copilot |
65 | 63 |
|
66 | 64 | The initial implementation of the website is functional, but we want to enhance it by adding new capabilities. Let's start off by reviewing the backlog. Ask GitHub Copilot to show you the backlog of items that we created in the previous exercise. |
67 | 65 |
|
68 | | -1. Open **Copilot Chat**. |
69 | | -2. Create a new chat session by selecting the **New Chat** button, which will remove any previous context. |
70 | | -3. Ensure **Agent** is selected from the list of modes. |
| 66 | +1. Return to your codespace. |
| 67 | +2. Open **Copilot Chat**. |
| 68 | +3. Create a new chat session by selecting the **New Chat** button, which will remove any previous context. |
| 69 | +4. Ensure **Agent** is selected from the list of modes. |
71 | 70 |
|
72 | 71 |  |
73 | 72 |
|
74 | | -4. Select **Claude 3.5 Sonnet** from the list of available models. |
| 73 | +5. Select **Claude 3.5 Sonnet** from the list of available models. |
75 | 74 |
|
76 | 75 | > [!IMPORTANT] |
77 | 76 | > 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. |
@@ -102,22 +101,26 @@ To implement filtering, no less than three separate updates will need to be made |
102 | 101 |
|
103 | 102 | In addition, the tests need to run (and pass) before we merge everything into our Codebase. Copilot Agent Mode can perform these tasks for us! Let's add the functionality. |
104 | 103 |
|
105 | | -1. Select **Add Context**, **Instructions**, and **flask-endpoint .github/instructions** as the instructions file. |
| 104 | +1. Return to your codespace. |
| 105 | +2. Select **Add Context**, **Instructions**, and **flask-endpoint .github/instructions** as the instructions file. |
106 | 106 |
|
107 | 107 |  |
108 | 108 |
|
109 | | -2. Ensure **Agent** mode is still selected. |
| 109 | +> [!NOTE] |
| 110 | +> Even though Copilot agent mode may have discovered this file on its own, if you're aware of an important piece of information, like a `.instructions.md` file, then absolutely add it to Copilot's context. This helps set Copilot (and you) up for success. |
| 111 | +
|
| 112 | +3. Ensure **Agent** mode is still selected. |
110 | 113 |
|
111 | 114 |  |
112 | 115 |
|
113 | | -3. Ensure **Claude 3.5** is still selected for the model. |
114 | | -4. Prompt Copilot to implement the functionality based on the issue we created earlier by using the following prompt, replacing **<YOUR_REPOSITORY_PATH>** with the organization/name of your repository which you noted earlier: |
| 116 | +4. Ensure **Claude 3.5** is still selected for the model. |
| 117 | +5. Prompt Copilot to implement the functionality based on the issue we created earlier by using the following prompt, replacing **<YOUR_REPOSITORY_PATH>** with the organization/name of your repository which you noted earlier: |
115 | 118 |
|
116 | 119 | ```plaintext |
117 | 120 | Please update the site to include filtering by publisher and category based on the requirements from the related GitHub issue in the backlog of <YOUR_REPOSITORY_PATH>. |
118 | 121 | ``` |
119 | 122 |
|
120 | | -5. Watch as Copilot begins by exploring the project, locating the files associated with the desired functionality. You should see it finding both the API and UI definitions, as well as the tests. It then begins modifying the files and running the tests. |
| 123 | +6. Watch as Copilot begins by exploring the project, locating the files associated with the desired functionality. You should see it finding both the API and UI definitions, as well as the tests. It then begins modifying the files and running the tests. |
121 | 124 |
|
122 | 125 |  |
123 | 126 |
|
@@ -164,10 +167,10 @@ There are several ways to create a pull request, including through github.com an |
164 | 167 | ``` |
165 | 168 |
|
166 | 169 | 3. As needed, select **Continue** to allow Copilot to perform the tasks necessary to gather information and perform operations. |
167 | | -4. Notice how Copilot searches through the issues, finds the right one, and creates the PR. |
| 170 | +4. Notice how Copilot searches through the issues, finds the right one, and creates the PR. |
168 | 171 | 5. Select the link generated by Copilot to review your pull request! |
169 | 172 |
|
170 | | -## Summary |
| 173 | +## Summary and next steps |
171 | 174 |
|
172 | 175 | Congratulations! In this exercise, we explored how to use GitHub Copilot Agent Mode to add new capabilities to the Tailspin Toys website. We learned how: |
173 | 176 |
|
|
0 commit comments