Skip to content

Commit 32910ee

Browse files
committed
Updated link to use reference link
1 parent 7fd5016 commit 32910ee

File tree

1 file changed

+2
-66
lines changed

1 file changed

+2
-66
lines changed

docs/3-custom-instructions.md

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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 [repository custom instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions) **.github/copilot-instructions.md**.
10+
- provide Copilot with project-specific context, coding guidelines and documentation standards using [repository custom instructions][repository-custom-instructions] **.github/copilot-instructions.md**.
1111
- 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

@@ -160,68 +160,4 @@ We want to create a new endpoint to list all publishers, and to follow the same
160160

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

163-
13. Send the same prompt as before to generate the desired endpoint:
164-
165-
```plaintext
166-
Create a new endpoint to return a list of all publishers. It should return the name and id for all publishers.
167-
```
168-
169-
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.
170-
171-
![Screenshot of the references section, showing the included instructions file](./images/copilot-instructions-references.png)
172-
173-
15. Copilot generates the files. Notice how it generates updates across multiple files, like **publishers.py** and **test_publishers.py**
174-
175-
> [!NOTE]
176-
> 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.
177-
178-
16. After reviewing the code, select **Keep** in Copilot Chat to accept the changes.
179-
17. If you are prompted to run tests select **Cancel**; we'll perform this task later.
180-
18. Open a terminal window by selecting <kbd>Ctl</kbd> + <kbd>\`</kbd>.
181-
19. Run the tests by running the script with the following command:
182-
183-
```sh
184-
./scripts/run-server-tests.sh
185-
```
186-
187-
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.
188-
189-
> [!NOTE]
190-
> If any tests fail, ask Copilot to suggest a fix. You can use `@terminal /explain` to give Copilot the context of your terminal window.
191-
192-
21. Stage the changes by selecting the **+** icon in the **Source Control** panel.
193-
22. Generate a commit message using the **Sparkle** button.
194-
195-
![Screenshot of the Source Control panel showing the changes made](images/source-control-changes.png)
196-
197-
23. Commit the changes to your repository by selecting **Commit**.
198-
199-
## Summary and next steps
200-
201-
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:
202-
203-
- provide Copilot with project-specific context, coding guidelines and documentation standards using custom instructions (.github/copilot-instructions.md).
204-
- use instruction files to guide Copilot for repetitive or templated tasks.
205-
- implement both repository-wide instructions and task-specific instructions.
206-
207-
Next we'll use [agent mode to add functionality to the site][next-lesson].
208-
209-
## Resources
210-
211-
- [Instruction files for GitHub Copilot customization][instruction-files]
212-
- [Best practices for creating custom instructions][instructions-best-practices]
213-
- [Personal custom instructions for GitHub Copilot][personal-instructions]
214-
215-
---
216-
217-
| [← Previous lesson: Model Context Protocol (MCP)][previous-lesson] | [Next lesson: Copilot agent mode →][next-lesson] |
218-
|:--|--:|
219-
220-
[previous-lesson]: ./2-mcp.md
221-
[next-lesson]: ./4-copilot-agent-mode-vscode.md
222-
[instruction-files]: https://code.visualstudio.com/docs/copilot/copilot-customization
223-
[python-type-hints]: https://docs.python.org/3/library/typing.html
224-
[games-endpoints]: ../server/routes/games.py
225-
[games-tests]: ../server/tests/test_routes/test_games.py
226-
[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
227-
[personal-instructions]: https://docs.github.com/en/copilot/customizing-copilot/adding-personal-custom-instructions-for-github-copilot
163+
13. Send the same

0 commit comments

Comments
 (0)