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: content/copilot/concepts/ai-tools.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ On {% data variables.product.github %}, use **{% data variables.product.prodname
45
45
46
46
Once you've chosen an issue to address, **{% data variables.copilot.copilot_chat_short %}** can help you brainstorm ideas for your project and learn about the various tools, libraries, and resources you might need. You can ask {% data variables.copilot.copilot_chat_short %} generalized questions about the project you're envisioning to get suggestions on a path forward. For example:
47
47
48
-
> I'd like to build an web app that helps users track their daily habits and provides personalized recommendations. Can you suggest features and technologies I could use?
48
+
`I'd like to build an web app that helps users track their daily habits and provides personalized recommendations. Can you suggest features and technologies I could use?`
49
49
50
50
## Creation
51
51
@@ -59,27 +59,27 @@ With **{% data variables.copilot.next_edit_suggestions %}** ({% data variables.r
59
59
60
60
Use {% data variables.copilot.copilot_chat_short %} in **ask mode** as your pair programmer to get help with coding tasks, understand tricky concepts, and improve your code. You can ask it questions, get explanations, or request suggestions in real time.
61
61
62
-
> Can you explain what this JavaScript function does? I'm not sure why it uses a `forEach` loop instead of a `for` loop.
62
+
*`Can you explain what this JavaScript function does? I'm not sure why it uses a forEach loop instead of a for loop.`
63
63
64
-
> What’s the difference between `let`, `const`, and `var` in JavaScript? When should I use each one?
64
+
*`What’s the difference between let, const, and var in JavaScript? When should I use each one?`
65
65
66
66
### Using {% data variables.copilot.copilot_chat_short %} in edit mode
67
67
68
68
Use {% data variables.copilot.copilot_chat_short %} in **edit mode** when you want more granular control over the edits that {% data variables.product.prodname_copilot_short %} proposes. In edit mode, you choose which files {% data variables.product.prodname_copilot_short %} can make changes to, provide context to {% data variables.product.prodname_copilot_short %} with each iteration, and decide whether or not to accept the suggested edits.
69
69
70
-
> Refactor the `calculateTotal` function to improve readability and efficiency.
70
+
*`Refactor the calculateTotal function to improve readability and efficiency.`
71
71
72
-
> The login function is not working as expected. Can you debug it?
72
+
*`The login function is not working as expected. Can you debug it?`
73
73
74
-
> Format this code to follow Python’s PEP 8 style guide.
74
+
*`Format this code to follow Python’s PEP 8 style guide.`
75
75
76
76
### Using {% data variables.copilot.copilot_chat_short %} in agent mode
77
77
78
78
In **agent mode**, {% data variables.copilot.copilot_chat_short %} can assist with automating repetitive tasks and managing your workflow directly within your project. Use it to create pull requests after you make code changes. You can also use it to run tests and linters in the background while you're working on your project.
79
79
80
-
> Create a pull request for the recent changes in the `user-auth` module and include a summary of the updates.
80
+
*`Create a pull request for the recent changes in the user-auth module and include a summary of the updates.`
81
81
82
-
> Run all tests and linters for the `payment-processing` module and provide a summary of any issues or errors found.
82
+
*`Run all tests and linters for the payment-processing module and provide a summary of any issues or errors found.`
83
83
84
84
## Reviews
85
85
@@ -98,25 +98,25 @@ The testing phase validates that your application works as intended. This phase
98
98
99
99
**{% data variables.copilot.copilot_chat_short %}** can assist by generating unit and integration tests, debugging failures, and suggesting additional test cases to ensure comprehensive coverage. Here are some example prompts:
100
100
101
-
> Write unit tests for this function to calculate the factorial of a number. Include edge cases like 0 and negative numbers.
101
+
*`Write unit tests for this function to calculate the factorial of a number. Include edge cases like 0 and negative numbers.`
102
102
103
-
> How do I run these tests using Python's unittest framework?
103
+
*`How do I run these tests using Python's unittest framework?`
104
104
105
-
> Write integration tests for the `deposit` function in the BankAccount class. Use mocks to simulate the NotificationSystem.
105
+
*`Write integration tests for the deposit function in the BankAccount class. Use mocks to simulate the NotificationSystem.`
106
106
107
-
> What additional tests should I include to ensure full coverage for this module?
107
+
*`What additional tests should I include to ensure full coverage for this module?`
108
108
109
109
## Deployment
110
110
111
111
The deployment phase involves preparing your code for production and ensuring a smooth release.
112
112
113
113
**{% data variables.copilot.copilot_chat_short %}** can help you configure deployment scripts, set up CI/CD pipelines, and troubleshoot issues. Here are some example prompts:
114
114
115
-
> Write a deployment script for a Node.js application using GitHub Actions to deploy to an AWS EC2 instance.
115
+
*`Write a deployment script for a Node.js application using GitHub Actions to deploy to an AWS EC2 instance.`
116
116
117
-
> Set up a GitHub Actions workflow to build, test, and deploy a Python application to Heroku.
117
+
*`Set up a GitHub Actions workflow to build, test, and deploy a Python application to Heroku.`
118
118
119
-
> Analyze this deployment log and suggest why the deployment failed.
119
+
*`Analyze this deployment log and suggest why the deployment failed.`
120
120
121
121
## Operation
122
122
@@ -126,11 +126,11 @@ You can use the **{% data variables.copilot.copilot_coding_agent %}** ({% data v
126
126
127
127
For issues you're tackling yourself, use **{% data variables.copilot.copilot_chat_short %}** for help analyzing logs, debugging issues, and suggesting optimizations. For example:
128
128
129
-
> Analyze this error log and suggest possible causes for the issue.
129
+
*`Analyze this error log and suggest possible causes for the issue.`
130
130
131
-
> Write a script to monitor the memory usage of this application and alert when it exceeds a threshold.
131
+
*`Write a script to monitor the memory usage of this application and alert when it exceeds a threshold.`
132
132
133
-
> How can I optimize the database queries in this code to improve performance?
133
+
*`How can I optimize the database queries in this code to improve performance?`
Copy file name to clipboardExpand all lines: content/copilot/concepts/prompt-engineering.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,34 +23,38 @@ When writing a prompt for {% data variables.product.prodname_copilot_short %}, f
23
23
24
24
For example:
25
25
26
-
> Write a function that tells me if a number is prime
27
-
>
28
-
> The function should take an integer and return true if the integer is prime
29
-
>
30
-
> The function should error if the input is not a positive integer
26
+
```copilot copy prompt
27
+
Write a JavaScript function that tells me if a number is prime
28
+
29
+
The function should take an integer and return true if the integer is prime
30
+
31
+
The function should error if the input is not a positive integer
32
+
```
31
33
32
34
## Give examples
33
35
34
36
Use examples to help {% data variables.product.prodname_copilot_short %} understand what you want. You can provide example input data, example outputs, and example implementations.
35
37
36
38
For example:
37
39
38
-
> Write a function that finds all dates in a string and returns them in an array. Dates can be formatted like:
39
-
>
40
-
> * 05/02/24
41
-
> * 05/02/2024
42
-
> * 5/2/24
43
-
> * 5/2/2024
44
-
> * 05-02-24
45
-
> * 05-02-2024
46
-
> * 5-2-24
47
-
> * 5-2-2024
48
-
>
49
-
> Example:
50
-
>
51
-
> findDates("I have a dentist appointment on 11/14/2023 and book club on 12-1-23")
52
-
>
53
-
> Returns: ["11/14/2023", "12-1-23"]
40
+
```copilot copy prompt
41
+
Write a Go function that finds all dates in a string and returns them in an array. Dates can be formatted like:
42
+
43
+
* 05/02/24
44
+
* 05/02/2024
45
+
* 5/2/24
46
+
* 5/2/2024
47
+
* 05-02-24
48
+
* 05-02-2024
49
+
* 5-2-24
50
+
* 5-2-2024
51
+
52
+
Example:
53
+
54
+
findDates("I have a dentist appointment on 11/14/2023 and book club on 12-1-23")
55
+
56
+
Returns: ["11/14/2023", "12-1-23"]
57
+
```
54
58
55
59
Unit tests can also serve as examples. Before writing your function, you can use {% data variables.product.prodname_copilot_short %} to write unit tests for the function. Then, you can ask {% data variables.product.prodname_copilot_short %} to write a function described by those unit tests.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server.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
@@ -434,7 +434,7 @@ To configure the remote {% data variables.product.github %} MCP server with a PA
434
434
}
435
435
}
436
436
```
437
-
437
+
438
438
## Using the {% data variables.product.github %} MCP server in Xcode
439
439
440
440
The {% data variables.product.github %} MCP server enables you to perform a wide range of actions on {% data variables.product.github %}, via {% data variables.copilot.copilot_chat_short %} in Xcode.
@@ -546,8 +546,12 @@ The {% data variables.product.github %} MCP server is automatically configured i
546
546
1. In the prompt box, type a request related to the skill you want {% data variables.copilot.copilot_chat_short %} to perform, and press **Enter**.
547
547
548
548
Some examples of requests you can make are:
549
-
*`Create a new branch called [BRANCH-NAME] in the repository [USERNAME/REPO-NAME].`
550
-
*`Merge the pull request [PULL-REQUEST-NUMBER] in the repository [USERNAME/REPO-NAME].`
549
+
550
+
{% prompt %}Create a new branch called [BRANCH-NAME] in the repository [OWNER/REPO-NAME].{% endprompt %}
551
+
552
+
{% prompt %}Search for users with the name [USER-NAME]{% endprompt %}
553
+
554
+
{% prompt %}Merge the pull request [PR-NUMBER] in the repository [OWNER/REPO-NAME].{% endprompt %}
551
555
552
556
1. {% data variables.copilot.copilot_chat_short %} will ask you to confirm that you want to proceed with the action. Click **Allow** to confirm.
553
557
1. {% data variables.copilot.copilot_chat_short %} will use the relevant skill from the {% data variables.product.github %} MCP server to perform the action you requested. {% data variables.copilot.copilot_chat_short %} will show you the result of the action in the chat interface.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/use-chat/use-chat-in-github.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,11 +35,11 @@ Depending on the question you ask, and your enterprise and organization settings
35
35
36
36
Some examples of general questions you could ask are:
37
37
38
-
*`What are the advantages of the Go programming language?`
39
-
*`What is Agile software development?`
40
-
*`What is the most popular JavaScript framework?`
41
-
*`Give me some examples of regular expressions.`
42
-
*`Write a bash script to output today's date.`
38
+
*{% prompt %}What are the advantages of the Go programming language?{% endprompt %}
39
+
*{% prompt %}What is Agile software development?{% endprompt %}
40
+
*{% prompt %}What is the most popular JavaScript framework?{% endprompt %}
41
+
*{% prompt %}Give me some examples of regular expressions.{% endprompt %}
42
+
*{% prompt %}Write a bash script to output today's date.{% endprompt %}
43
43
44
44
{% data reusables.copilot.stop-response-generation %}
45
45
1. If {% data variables.product.prodname_copilot_short %} uses a Bing search to answer your question, you can click the **_n_ references** link at the top of the response to see the search results that {% data variables.product.prodname_copilot_short %} used to answer your question.
@@ -59,7 +59,7 @@ Depending on the question you ask, and your enterprise and organization settings
59
59
60
60
When you ask a question, {% data variables.product.prodname_copilot_short %} may generate one or more files as part of its response. In the {% data variables.copilot.copilot_chat_short %} panel, the files are displayed inline, within the chat response. In immersive view (that is, at [https://github.com/copilot](https://github.com/copilot)), the generated files are displayed in a side panel. You can view and edit the files in the panel, or download them to your computer.
61
61
62
-
For example, asking `Generate a simple calculator using HTML, CSS, and JavaScript` may generate multiple files, such as `index.html`, `styles.css`, and `script.js`.
62
+
For example, asking {% prompt %}Generate a simple calculator using HTML, CSS, and JavaScript{% endprompt %} may generate multiple files, such as `index.html`, `styles.css`, and `script.js`.
63
63
64
64
In immersive view, you can also preview how some file formats, such as Markdown, render by toggling to the "Preview" tab in the side panel.
65
65
@@ -118,9 +118,9 @@ To navigate between subthreads:
118
118
119
119
{% data variables.product.prodname_copilot_short %} has access to a collection of skills to fetch data from {% data variables.product.github %}, which are dynamically selected based on the question you ask.
120
120
121
-
You can explicitly ask {% data variables.copilot.copilot_chat_dotcom %} to use a particular skill - for example, `Use the Bing skill to find the latest GPT4 model from OpenAI`.
121
+
You can explicitly ask {% data variables.copilot.copilot_chat_dotcom %} to use a particular skill - for example, {% prompt %}Use the Bing skill to find the latest GPT4 model from OpenAI.{% endprompt %}
122
122
123
-
Generate a list of currently available skills by asking {% data variables.product.prodname_copilot_short %}: `What skills are available?`
123
+
Generate a list of currently available skills by asking {% data variables.product.prodname_copilot_short %}: {% prompt %}What skills are available?{% endprompt %}
124
124
125
125
## Asking {% data variables.copilot.copilot_chat_short %} questions in different contexts
126
126
@@ -171,9 +171,9 @@ You can ask {% data variables.product.prodname_copilot_short %} a question about
171
171
172
172
For example, you could enter:
173
173
174
-
* What does this repo do?
175
-
* Where is authentication implemented in this codebase?
176
-
* How does license file detection work in this repo?
174
+
*`What does this repo do?`
175
+
*`Where is authentication implemented in this codebase?`
176
+
*`How does license file detection work in this repo?`
177
177
178
178
1. Click **Ask {% data variables.product.prodname_copilot_short %}**.
Copy file name to clipboardExpand all lines: content/copilot/how-tos/use-chat/use-chat-in-mobile.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,11 +63,11 @@ You can ask a general question about software development{% ifversion ghec %} th
63
63
1. At the bottom of the page, in the "Ask {% data variables.product.prodname_copilot_short %}" box, type a question and send the message.
64
64
65
65
Some examples of general questions you could ask are:
66
-
* What are the advantages of the Go programming language?
67
-
* What is Agile software development?
68
-
* What is the most popular JavaScript framework?
69
-
* Give me some examples of regular expressions.
70
-
* Write a bash script to output today's date.
66
+
*`What are the advantages of the Go programming language?`
67
+
*`What is Agile software development?`
68
+
*`What is the most popular JavaScript framework?`
69
+
*`Give me some examples of regular expressions.`
70
+
*`Write a bash script to output today's date.`
71
71
72
72
1. Within a conversation thread, you can ask follow-up questions. {% data variables.product.prodname_copilot_short %} will answer within the context of the conversation. For example, you could type "tell me more" to get {% data variables.product.prodname_copilot_short %} to expand on its last comment.
73
73
@@ -84,11 +84,11 @@ You can ask questions about a specific repository, to get help with understandin
84
84
85
85
For example, if you chose the repository you are working in as the context, you could ask:
86
86
87
-
* What is the main purpose of this repo? What problem does it solve or what functionality does it provide?
88
-
* What web frameworks are used in this project?
89
-
* Where is rate limiting implemented in our API?
90
-
* How is the code organized? Explain the project architecture.
91
-
* Are there any specific environment requirements for working on this project?
87
+
*`What is the main purpose of this repo? What problem does it solve or what functionality does it provide?`
88
+
*`What web frameworks are used in this project?`
89
+
*`Where is rate limiting implemented in our API?`
90
+
*`How is the code organized? Explain the project architecture.`
91
+
*`Are there any specific environment requirements for working on this project?`
92
92
93
93
> [!IMPORTANT]
94
94
> {% data variables.product.prodname_copilot_short %}'s ability to answer natural language questions like these in a repository context is improved when the repository has been indexed for semantic code search. Without indexing, {% data variables.copilot.copilot_mobile_short %} may not be able to provide the most relevant answers to your questions.
@@ -110,15 +110,15 @@ You can chat with {% data variables.product.prodname_copilot_short %} about a fi
110
110
111
111
For example, if you are asking about the entire file, you could enter:
112
112
113
-
* Explain this file.
114
-
* How could I improve this code?
115
-
* How can I test this script?
113
+
*`Explain this file.`
114
+
*`How could I improve this code?`
115
+
*`How can I test this script?`
116
116
117
117
If you are asking about specific lines, you could enter:
118
118
119
-
* How could I improve this class?
120
-
* Add error handling to this code.
121
-
* Write a unit test for this method.
119
+
*`How could I improve this class?`
120
+
*`Add error handling to this code.`
121
+
*`Write a unit test for this method.`
122
122
123
123
{% data variables.product.prodname_copilot_short %} responds to your request in the panel.
124
124
@@ -135,10 +135,10 @@ You can ask questions about a specific pull request in a repository.
135
135
136
136
For example, you could ask:
137
137
138
-
* What is the purpose of this pull request?
139
-
* What changes are being made in this pull request?
140
-
* Are there any potential issues with this pull request?
141
-
* What is the status of this pull request?
138
+
*`What is the purpose of this pull request?`
139
+
*`What changes are being made in this pull request?`
140
+
*`Are there any potential issues with this pull request?`
141
+
*`What is the status of this pull request?`
142
142
143
143
{% data variables.product.prodname_copilot_short %} responds to your request in the panel.
144
144
@@ -153,10 +153,10 @@ You can ask questions about a specific issue in a repository.
153
153
154
154
For example, you could ask:
155
155
156
-
* What is the purpose of this issue?
157
-
* What is the status of this issue?
158
-
* What are the steps to reproduce this issue?
159
-
* Are there any potential solutions to this issue?
156
+
*`What is the purpose of this issue?`
157
+
*`What is the status of this issue?`
158
+
*`What are the steps to reproduce this issue?`
159
+
*`Are there any potential solutions to this issue?`
160
160
161
161
{% data variables.product.prodname_copilot_short %} responds to your request in the panel.
162
162
@@ -171,10 +171,10 @@ You can ask questions about a specific discussion in a repository.
171
171
172
172
For example, you could ask:
173
173
174
-
* What is the purpose of this discussion?
175
-
* What are the main points of this discussion?
176
-
* What are the next steps for this discussion?
177
-
* Are there any potential issues with this discussion?
174
+
*`What is the purpose of this discussion?`
175
+
*`What are the main points of this discussion?`
176
+
*`What are the next steps for this discussion?`
177
+
*`Are there any potential issues with this discussion?`
178
178
179
179
{% data variables.product.prodname_copilot_short %} responds to your request in the panel.
0 commit comments