Skip to content

Commit d957940

Browse files
FidelusAleksanderarilivigniCopilotchriswblake
authored
refactor: make Agent mode step non optional and full exercise refresh (#92)
Co-authored-by: Ari LiVigni <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Christopher W. Blake <[email protected]>
1 parent b0db603 commit d957940

15 files changed

+426
-266
lines changed

.github/steps/1-preparing.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,30 @@ In this exercise, you will be using different GitHub Copilot features to work on
66

77
<img width="600" alt="screenshot of Mergington High School WebApp" src="https://github.com/user-attachments/assets/472398fd-1aa1-4084-b443-4e242deb30d9" />
88

9-
### What is GitHub Copilot?
9+
### 📖 Theory: Getting to know GitHub Copilot
1010

1111
<img width="150" align="right" alt="copilot logo" src="https://github.com/user-attachments/assets/4d22496d-850b-4785-aafe-11cba03cd5f2" />
1212

1313
GitHub Copilot is an AI coding assistant that helps you write code faster and with less effort, allowing you to focus more energy on problem solving and collaboration.
1414

1515
GitHub Copilot has been proven to increase developer productivity and accelerate the pace of software development. For more information, see [Research: quantifying GitHub Copilot’s impact on developer productivity and happiness in the GitHub blog.](https://github.blog/news-insights/research/research-quantifying-github-copilots-impact-on-developer-productivity-and-happiness/)
1616

17-
Your most common interactions will likely be:
17+
As you work in your IDE, you'll most often interact with GitHub Copilot in the following ways:
1818

19-
- **Inline suggestions**: As you type, Copilot uses the nearby context to suggest code directly in your editor. This will be a familiar interaction if you have used code completion tools like [Intellisense](https://code.visualstudio.com/docs/editor/intellisense), except that the completions may be entire functions.
20-
- **Copilot - Ask Mode**: A dedicated chat panel that lets you ask coding related questions. This will feel familiar if you have used online AI assistant chats. The big difference however, is that your project files will provide automatic context to provide tailored responses.
21-
- **Copilot - Edit Mode**: Similar to Ask mode, but less conversational. Copilot will make changes to your selected files to implement your request.
22-
- **Copilot - Agent Mode**: Copilot will run iteratively until it achieves your request. It will select context, make code changes, run terminal commands, run tools, and most importantly review its work to make adjustments.
19+
| Interaction Mode | 📝 Description | 🎯 Best For |
20+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
21+
| **⚡ Inline suggestions** | AI-powered code suggestions that appear as you type, offering context-aware completions from single lines to entire functions. | Completion of the current line, sometimes a whole new block of code |
22+
| **💬 Ask Mode** | Optimized for answering questions about your codebase, coding, and general technology concepts. | Understanding how code works, brainstorming ideas, asking questions |
23+
| **✏️ Edit Mode** | Optimized for making code edits across multiple files in your project. VS Code directly applies the code changes in the editor for in-place review. | Coding tasks when you have a good understanding of the changes you want to make and which files you want to edit |
24+
| **🤖 Agent Mode** | Optimized for making autonomous edits across multiple files in your project. | Coding tasks when you have a less well-defined task that might also require running terminal commands and tools |
25+
| **💭 Inline Chat** | Interactive chat scoped to your current file or selection. Ask questions about specific code blocks. | Code explanations, debugging specific functions, targeted improvements |
2326

24-
> [!TIP]
25-
> You can learn more about current and upcoming features in the [GitHub Copilot Features](https://docs.github.com/en/copilot/about-github-copilot/github-copilot-features) documentation. You can also select different [models](https://docs.github.com/en/github-models) and make your own [extensions](https://github.com/features/copilot/extensions), but that's for a different lesson!
27+
As you work, you'll find GitHub Copilot can help out in several places across the `github.com` website and in your favorite coding environments such as VS Code, Jet Brains, and Xcode!
2628

27-
### How can I use GitHub Copilot?
29+
For today's coding though, we will practice with VS Code in a pre-configured development environment known as a [GitHub Codespace](https://github.com/features/codespaces).
2830

29-
As you work, you'll find GitHub Copilot can help out in several places across the website and in your favorite coding environments such as VS Code, Jet Brains, and Xcode! For today's coding though, we will practice with VS Code in a pre-configured development environment known as [Codespace](https://github.com/features/codespaces).
31+
> [!TIP]
32+
> You can learn more about current and upcoming features in the [GitHub Copilot Features](https://docs.github.com/en/copilot/about-github-copilot/github-copilot-features) documentation.
3033
3134
### :keyboard: Activity: Get a project intro from Copilot Chat
3235

@@ -49,13 +52,17 @@ Let's start up our development environment, use copilot to learn a bit about the
4952

5053
<img width="350" alt="python extension for VS Code" src="https://github.com/user-attachments/assets/3040c0f5-1658-47e2-a439-20504a384f77" />
5154

52-
1. At the top of VS Code, locate and click the **Copilot icon** to open a Copilot Chat panel.
55+
1. At the top of VS Code, locate and click the **Toggle Chat icon** to open a Copilot Chat side panel.
56+
57+
<img width="150" alt="image" src="https://github.com/user-attachments/assets/abf584e9-ef68-4725-8b22-4803805e6d55" />
58+
59+
> 🪧 **Note:** If this is your first time using GitHub Copilot, you will need to accept the usage terms to continue.
5360
54-
<img width="150" alt="image" src="https://github.com/user-attachments/assets/5e64db46-95cb-415d-badc-b6b8677f10c1" />
61+
1. Make sure you are in **Ask Mode** for our first interaction
5562

56-
1. If this is your first time using GitHub Copilot, you will need to accept the usage terms to continue.
5763

58-
1. Enter the below prompt to ask Copilot to introduce you to the project. Use Copilot **Ask Mode** for this prompt.
64+
<img width="350" alt="screenshot showing Ask Mode selection in Copilot Chat" src="https://github.com/user-attachments/assets/fb1d7cac-2d39-4199-b5d9-0f3dfcfb3bcd" />
65+
1. Enter the below prompt to ask Copilot to introduce you to the project.
5966

6067
> ![Static Badge](https://img.shields.io/badge/-Prompt-text?style=social&logo=github%20copilot)
6168
>
@@ -64,11 +71,13 @@ Let's start up our development environment, use copilot to learn a bit about the
6471
> What should I do to run it?
6572
> ```
6673
67-
> **Note**: It is not necessary to follow Copilot's recommended instructions. We have already prepared the environment for you.
74+
> 🪧 **Note:** It is not necessary to follow Copilot's recommended instructions. We have already prepared the environment for you.
6875
6976
<details>
7077
<summary>What is @workspace?</summary>
71-
Nice job noticing the details, but let's just use it for now. 🤓 We promise to explain in the next step.
78+
79+
Great question! This is a specialized [chat participant](https://docs.github.com/en/copilot/using-github-copilot/copilot-chat/github-copilot-chat-cheat-sheet?tool=vscode#chat-participants) that will explore the project repository and try to include relevant additional context.
80+
7281
</details>
7382
7483
1. Now that we know a bit more about the project, let's actually try running it! In the left sidebar, select the `Run and Debug` tab and then press the **Start Debugging** icon.
@@ -85,11 +94,9 @@ Let's start up our development environment, use copilot to learn a bit about the
8594
8695
Great work! Now that we are familiar with the app and we know it works, let's ask copilot for help starting a branch so we can do some customizing.
8796
88-
1. If not already there, return to VS Code.
89-
90-
1. In the bottom panel, select the **Terminal** tab. On the right side, click the plus `+` sign to create a new terminal window.
97+
1. In VS Code's bottom panel, select the **Terminal** tab and on the right side click the plus `+` sign to create a new terminal window.
9198
92-
> **Note:** This will avoid stopping the existing debug session that is hosting our web application service.
99+
> 🪧 **Note:** This will avoid stopping the existing debug session that is hosting our web application service.
93100
94101
1. Within the new terminal window use the keyboard shortcut `Ctrl + I` (windows) or `Cmd + I` (mac) to bring up **Copilot's Terminal Inline Chat**.
95102
@@ -101,7 +108,7 @@ Great work! Now that we are familiar with the app and we know it works, let's as
101108
> Hey copilot, how can I create and publish a new Git branch called "accelerate-with-copilot"?
102109
> ```
103110
104-
> **Tip:** If Copilot doesn't give you quite what you want, you can always continue explaining what you need. Copilot will remember the conversation history for follow-up responses.
111+
> 💡 **Tip:** If Copilot doesn't give you quite what you want, you can always continue explaining what you need. Copilot will remember the conversation history for follow-up responses.
105112
106113
1. Press the `Run` button to let Copilot insert the terminal command for us. No need to copy and paste!
107114

.github/steps/2-first-introduction.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
In the previous step, GitHub Copilot was able to help us onboard to the project. That alone is a huge time saver, but now let's get some work done!
44

5-
We recently learned there is a bug where students are registering for the same activities twice. That simply isn't acceptable, so let's get it fixed!
5+
:bug: **THERE IS A BUG ON THE WEBSITE** :bug:
66

7-
Unfortunately, we were given little information to solve this problem. So, let's enlist Copilot to help find the problem area and get a potential solution made.
7+
We’ve discovered that something’s off in the signup flow.
8+
Students can currently register for the same activity **more than once**! Let’s see how far Copilot can take us in uncovering the cause and shaping a clean fix.
89

9-
But before we do that, let's learn a bit more about Copilot! 🧑‍🚀
10+
Before we dive in, a quick primer on how Copilot works. 🧑‍🚀
1011

11-
### How does Copilot work?
12+
### 📖 Theory: How Copilot works
1213

1314
In short, you can think of Copilot like a very specialized coworker. To be effective with them, you need to provide them background (context) and clear direction (prompts). Additionally, different people are better at different things because of their unique experiences (models).
1415

@@ -32,13 +33,6 @@ In short, you can think of Copilot like a very specialized coworker. To be effec
3233
> Where could this bug be coming from?
3334
> ```
3435
35-
<details>
36-
<summary>What is @workspace?</summary>
37-
38-
Great question! This is a specialized [chat participant](https://docs.github.com/en/copilot/using-github-copilot/copilot-chat/github-copilot-chat-cheat-sheet?tool=vscode#chat-participants) that will explore the project repository and try to include relevant additional context.
39-
40-
</details>
41-
4236
1. Now that we know the issue is in the `src/app.py` file and the `signup_for_activity` method, let's follow Copilot's recommendation and go fix it (semi-manually). We'll start with a comment and let Copilot finish the correction.
4337
4438
1. In VS Code, select the file **Explorer tab** to show the project files and open the `src/app.py` file.
@@ -55,8 +49,6 @@ In short, you can think of Copilot like a very specialized coworker. To be effec
5549
5650
1. Press `Tab` to accept Copilot's suggestion and convert the shadow text to code.
5751
58-
> **Tip:** If you would like to see other suggestions, instead of pressing `Tab`, hover over the shadow text suggestion and a toolbar will appear. Use the arrows to select other suggestions or the three dots `...` and `Open Completions Panel` option to show all suggestions in a dedicated panel.
59-
6052
<details>
6153
<summary>Example Results</summary><br/>
6254
@@ -88,15 +80,13 @@ In short, you can think of Copilot like a very specialized coworker. To be effec
8880

8981
In new project developments, it's often helpful to have some realistic looking fake data for testing. Copilot is excellent at this task, so let's add some more sample activities and introduce another way to interact with Copilot using **Inline Chat**
9082

91-
**Inline Chat** and the **Copilot Chat** panel are very similar tools, but with slightly different automatic context. As such, while Copilot Chat is good at explaining about the project, inline chat might feel more natural for asking about a particular line or function.
92-
93-
1. If not already open, open the `src/app.py` file.
83+
**Inline Chat** and the **Copilot Chat** panel are similar, but differ in scope: Copilot Chat handles broader, multi-file or exploratory questions; Inline Chat is faster when you want targeted help on the exact line or block in front of you.
9484

95-
1. Near the top (about line 23), find the `activities` variable, where our example extracurricular activities are configured.
85+
1. Near the top of the `src/app.py` file (about line 23), find the `activities` variable, where our example extracurricular activities are configured.
9686

9787
1. Click on any of the related lines and bring up Copilot inline chat by using the keyboard command `Ctrl + I` (windows) or `Cmd + I` (mac).
9888

99-
> **Tip:** Another way to bring up Copilot inline chat is: `right click` on any of the selected lines -> `Copilot` -> `Editor Inline Chat`.
89+
> 💡 **Tip:** Another way to bring up Copilot inline chat is: `right click` on any of the selected lines -> `Copilot` -> `Editor Inline Chat`.
10090
10191
1. Enter the following prompt text and press enter or the **Send and Dispatch** button.
10292

@@ -182,7 +172,7 @@ Nice work fixing that bug and expanding the example activities! Now let's get ou
182172

183173
1. In the left sidebar, select the `Source Control` tab.
184174

185-
> **Tip:** Opening a file from the source control area will show the differences to the original rather than simply opening it.
175+
> 💡 **Tip:** Opening a file from the source control area will show the differences to the original rather than simply opening it.
186176
187177
1. Find the `app.py` file and press the `+` sign to collect your changes together in the staging area.
188178

@@ -192,7 +182,7 @@ Nice work fixing that bug and expanding the example activities! Now let's get ou
192182

193183
- Typically, you would write a short description of the changes here, but now we have Copilot to help out!
194184

195-
1. To the right of the **Message** text box, find and click the **Generate Commit Message with Copilot** button (sparkles icon).
185+
1. To the right of the **Message** text box, find and click the **Generate Commit Message** button (sparkles icon).
196186

197187
1. Press the **Commit** button and **Sync Changes** button to push your changes to GitHub.
198188

0 commit comments

Comments
 (0)