This repository includes Copilot training exercises intended to give you practical experience using +
Learn of how to use prompt engineering techniques to get accurate responses from +
- Provide references
- Improve relevance of the response by providing an example and context
- Write clear instruction
- Refine your prompt, provide context, write clearly, and give Copilot ample input for better results
- Split up big tasks
- Breaking down complex tasks minimizes errors and utilizes previous outcomes for efficiency
- Allow GitHub Copilot time to think
- Requesting Copilot’s thought process will enhance Copilot accuracy, but it may prolong wait times.
- Test changes systematically
- Measure performance, watch for prompt changes' side effects, and use test suites for implementation
- Context :: Provide Examples
- Information to help GitHub Copilot understand the task better
- Intent :: Give Directions
- The specific goal or purpose you have in mind when creating a prompt
- Clarity :: Easy to Understand
- Being clear, transparent, and easily understood
- Specificity :: Precision in Detail
- Providing precise and detailed information, leaving little room for ambiguity or interpretation
- Zero-shot
- One-Shot
- Few-shot
Javascript
- Copilot
- Copilot Chat
Optional
Note: DEMO 4 is an advanced demo that requires the use of the VS-Code Leetcode extension
Write me unit tests for all the operations in my calculator.js file
Write me unit tests for all the operations in my calculator.js file
Use the following example: test(‘adds 1 + 2 to equal 3’, () => ( expect(calculate(1, 2 ‘+’)).toBe(3); });
Can you create an HTML calculator for me?
Can you create an HTML calculator for me? Use the following example:
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
</html>
Can you write me the code for a snake game?
Can you write me the code for a snake game?
Example: Ensure that there is a leaderboard mechanic
This exercise creates an MVC App that functions as an RSS Feeds client to report GitHub Health information
Get GitHub Status with Copilot Guide
DEMO 5 - LeetCode (Advanced Demo)
This demo uses a very detailed prompt with examples to guide Copilot in generating effective suggestions.
Setup and detailed walkthrough with the LeetCode extension
1. Install the LeetCode extension in VS-Code
2.1 At the time of writing this document, the LeetCode extension may experience difficulties with logging in to leetcode.com. For guidance on connecting to the website, please refer to the instructions provided in this blog.
1. Open the `leetcode` extension
2. Select a problem to solve.
3. Start the coding exercise.
NOTE: before leetcode opens a solution file, it will ask for some info:
We recommend to use the following options:
-
Select an implementation language
(your choice) -
Just open the problem file
(opens a new tab)
4. Now use the problem descption from leetcode with Copilot Chat (copy & paste), ask it to create the code
Use the right click pop-up menu in the solutions file to test
and submit
your solution to leetcode
The final step is to evaluate the Copilot suggestion for its 'pass' or 'fail' status and to determin its corresponding 'score'
Contributions are warmly welcomed! ✨
To contribute to a public exercise, please refer to our contribution guidelines here.
To create a net new exercise, please use this repository template.