You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Using-GitHub-Copilot-with-CSharp/README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,7 +162,7 @@ Review the suggestions from Copilot and verify the output. **Note:** It is impor
162
162
**Note:** Inthecasethatyoudonotsee [NextEditSuggestions](https://code.visualstudio.com/blogs/2025/02/12/next-edit-suggestions) appear in your editor, check that they are enabled in your editor.
Copy file name to clipboardExpand all lines: Using-GitHub-Copilot-with-Python/README.md
+17-26Lines changed: 17 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ To get started:
75
75
4. As a visual learner, you can ask GitHub Copilot to 'create a diagram of the workflow of the application'. This could be saved into a README for further documentation.
76
76
77
77
<divalign="left">
78
-
<imgsrc="./images/003diagramoutput.gif"alt="Output of application diagram"width="500"height="300">
78
+
<imgsrc="./images/003diagramoutput.gif"alt="Output of Mermaid syntax"width="500"height="300">
79
79
</div>
80
80
81
81
In the above exercises we achieved the following:
@@ -100,9 +100,8 @@ In the previous section you learned how to use both natural language or slash co
100
100
101
101
The output should be similar to this:
102
102
103
-
TODO
104
103
<divalign="left">
105
-
<imgsrc="./images/004.jpg"alt="changes to existing record"width="500"height="300">
104
+
<imgsrc="./images/004pydanticmodel.jpg"alt="Create a Pydantic model"width="500"height="300">
106
105
</div>
107
106
108
107
2. Now we want to use the inline feature of Copilot. When using the inline feature we can focus on the code in front of us and make progressive changes in our code base. Next, we are going to generate a new endpoint at the bottom of the `main.py` file. Place your cursor under the last route that was created and prest `CTRL + I` to open inline chat. Type or copy in the following text:
@@ -111,9 +110,8 @@ TODO
111
110
# Create a FastAPI endpoint that accepts a POST request with a JSON body containing a single field called "text" and returns a checksum of the text
Review the suggestions from Copilot and verify the output. In this instance we combined both the slash command ability and the inline chat feature.**Note:** It is important to always verify the output from Copilot.
@@ -148,10 +144,8 @@ Improve the docstring for the checksum_text function with more details and examp
148
144
149
145
**Note:** In the case that you do not see [Next Edit Suggestions](https://code.visualstudio.com/blogs/2025/02/12/next-edit-suggestions) appear in your editor, check that they are enabled in your editor.
150
146
151
-
TODO
152
-
153
147
<div align="left">
154
-
<img src="./images/NextEdit.gif" alt="Output of /Explain" width="500" height="300">
@@ -169,10 +163,8 @@ In the above exercises we achieved the following:
169
163
170
164
1. Open GitHub Copilot Chat. Notice in the text box you can 'add context', which allows you to attach files, folders and other items to the context of Copilot so that it can better understand your codebase. Agent mode should be selected by default. You have the capability to choose your model as well. Also note, the open tab `main.py`andis being referenced to for context.
171
165
172
-
TODO-- Agent View
173
-
174
166
<div align="left">
175
-
<img src="./images/009agentview.jpg" alt="Output of /Explain">
2. Give Agent mode a detailed prompt. For this example we are going to ask Copilot to make several improvements to our project. Copy and paste the prompt below into the Chat window.
@@ -184,28 +176,21 @@ TODO -- Agent View
184
176
4. Make this application deployment ready
185
177
5. Improve the performance and security of this application.
186
178
```
179
+
187
180
When executing in Agent mode, Copilot will take a bit longer to work through all of the tasks. It will first parse your intent from the prompt above. It will plan and execute the various tasks.
But where Agent mode really shines is that it will iterate on its own output until it resolves errors and reaches a working solution. As agent mode is running, we can see it is running tests to check and verify its own code:
For this step in the workshop, agent mode should have taken several minutes to complete your tasks. Review the various changes and confirm that they have achieved all of the given output. With Agent mode, it also outputs what changes were made. The following summary of changes that were made are summarized below:
210
195
211
196
```md
@@ -249,6 +234,9 @@ For this step in the workshop, agent mode should have taken several minutes to c
🚀Congratulations! Now you understand the power behind Agent Mode and the many tasks that it can help with. Scroll down to the next section that will show you how to add context and customization to Copilot.
254
242
@@ -261,6 +249,10 @@ Agent Mode was able to perform C# specific tasks:
261
249
262
250
### 🗒️ Section 4: Customization and Context
263
251
252
+
🎯 Learning Goals
253
+
- Understand the different ways to customize GitHub Copilot and receive better responses from prompts.
254
+
- Understand the role of Model Context Protocol (MCP).
255
+
264
256
**Part 1: Custom Instructions**
265
257
266
258
GitHub Copilot instructions files are markdown documents that provide essential context to guide Copilot’s behavior within a specific codebase. These files help tailor AI-generated suggestions to match your team’s coding standards, architectural patterns, naming conventions, testing strategies, and deployment practices. There are two types of instructions files: global instructions, which apply to the entire repository and are stored in `copilot-instructions.md`, and scoped instructions, which apply only to specific files or folders and are placed in `.github/instructions/*instructions.md`.
@@ -276,9 +268,8 @@ Let's create our first global custom instructions file!
276
268
277
269
1. Create a `copilot-instructions.md` file in the `.github` directory:
The example below can be customized in your own project, for this example we've created an instructions file specific to our C# requirements in this project.
0 commit comments