Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d94d84c

Browse files
jules-pCopilothubwriter
authored
Add example prompts for Chat on GitHub and streamline Chat in GitHub article (#54277)
Co-authored-by: Jules Porter <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: hubwriter <[email protected]>
1 parent bbceccc commit d94d84c

12 files changed

Lines changed: 181 additions & 152 deletions

content/copilot/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ featuredLinks:
1515
- /copilot/quickstart
1616
popular:
1717
- /copilot/using-github-copilot/best-practices-for-using-github-copilot
18-
- /copilot/using-github-copilot/prompt-engineering-for-github-copilot
18+
- /copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat
1919
- /copilot/copilot-chat-cookbook
2020
- /copilot/using-github-copilot/getting-code-suggestions-in-your-ide-with-github-copilot
21-
- /copilot/using-github-copilot/asking-github-copilot-questions-in-your-ide
21+
- /copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide
2222
- /copilot/using-github-copilot/using-github-copilot-in-the-command-line
2323
layout: product-landing
2424
versions:

content/copilot/using-github-copilot/asking-github-copilot-questions-in-github-mobile.md renamed to content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github-mobile.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ redirect_from:
1111
- /copilot/github-copilot-chat/using-github-copilot-chat-in-github-mobile
1212
- /copilot/github-copilot-chat/copilot-chat-in-github-mobile/using-github-copilot-chat-in-github-mobile
1313
- /copilot/github-copilot-chat/copilot-chat-in-github-mobile
14+
- /copilot/using-github-copilot/asking-github-copilot-questions-in-github-mobile
1415
---
1516

1617
## Overview

content/copilot/using-github-copilot/asking-github-copilot-questions-in-github.md renamed to content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-github.md

Lines changed: 48 additions & 140 deletions
Large diffs are not rendered by default.

content/copilot/using-github-copilot/asking-github-copilot-questions-in-your-ide.md renamed to content/copilot/using-github-copilot/copilot-chat/asking-github-copilot-questions-in-your-ide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ redirect_from:
88
- /copilot/github-copilot-chat/using-github-copilot-chat-in-your-ide
99
- /copilot/github-copilot-chat/copilot-chat-in-ides/using-github-copilot-chat-in-your-ide
1010
- /copilot/github-copilot-chat/copilot-chat-in-ides
11+
- /copilot/using-github-copilot/asking-github-copilot-questions-in-your-ide
1112
defaultTool: vscode
1213
versions:
1314
feature: copilot

content/copilot/using-github-copilot/guides-on-using-github-copilot/getting-started-with-prompts-for-copilot-chat.md renamed to content/copilot/using-github-copilot/copilot-chat/getting-started-with-prompts-for-copilot-chat.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ versions:
88
feature: copilot
99
redirect_from:
1010
- /copilot/using-github-copilot/example-use-cases/example-prompts-for-copilot-chat
11+
- /copilot/using-github-copilot/guides-on-using-github-copilot/getting-started-with-prompts-for-copilot-chat
1112
shortTitle: Getting started with chat
1213
---
1314

@@ -236,3 +237,106 @@ The `/tests` slash command writes tests for existing code. If you prefer to writ
236237
* `Add tests for a JavaScript function that should sum a list of integers`
237238

238239
{% endjetbrains %}
240+
241+
{% webui %}
242+
243+
Some of the example prompts require you to be in a specific context on the {% data variables.product.github %} website. For more information on how to access those contexts, see [Asking {% data variables.product.prodname_copilot_chat_short %} questions in different contexts](/copilot/using-github-copilot/asking-github-copilot-questions-in-github#asking-copilot-chat-questions-in-different-contexts).
244+
245+
## Ask general software questions
246+
247+
You can ask {% data variables.product.prodname_copilot_chat_short %} general software questions. For example:
248+
249+
* `tell me about nodejs web server frameworks`
250+
* `how to create an express app`
251+
* `what is the best way to update an npm package`
252+
253+
## Ask questions about a repository
254+
255+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about a repository. For example:
256+
257+
* `what is the purpose of this repository?`
258+
* `When was the most recent release?`
259+
* `Where is rate limiting implemented in our API?`
260+
* `What was the last merged PR by USERNAME`
261+
262+
## Ask questions about a specific file or symbol
263+
264+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about a specific file or symbol. For example:
265+
266+
* `what sorting algorithm does this function use`
267+
* `how are these files related`
268+
* `what is the purpose of this function`
269+
270+
## Ask questions about a knowledge base
271+
272+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about a knowledge base. For example:
273+
274+
* `How do I deploy a new application?`
275+
* `What's the process for creating a new REST API?`
276+
* `What are our best practices for logging?`
277+
278+
## Ask questions about a specific piece of code
279+
280+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about a specific piece of code. You might ask a question about a whole file, or a specific line. For example:
281+
282+
If you are asking about a whole file, you could enter:
283+
284+
* `Explain this file.`
285+
* `How could I improve this code?`
286+
* `How can I test this script?`
287+
288+
If you are asking about specific lines, you could enter:
289+
* `Explain the function at the selected lines.`
290+
* `How could I improve this class?`
291+
* `Add error handling to this code.`
292+
* `Write a unit test for this method.`
293+
294+
## Ask questions about {% data variables.product.prodname_GH_advanced_security %} alerts
295+
296+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about security alerts in repositories in your organization from {% data variables.product.prodname_GH_advanced_security %} features ({% data variables.product.prodname_code_scanning %}, {% data variables.product.prodname_secret_scanning %}, and {% data variables.product.prodname_dependabot_alerts %}). For example:
297+
298+
* `How would I fix this alert?`
299+
* `How many alerts do I have on this pull request?`
300+
* `Which line of code is this {% data variables.product.prodname_code_scanning %} alert referencing?`
301+
* `What library is affected by this {% data variables.product.prodname_dependabot %} alert?`
302+
303+
## Ask {% data variables.product.prodname_copilot_chat_short %} questions in a pull request
304+
305+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions in a pull request. Your question could relate to various elements of the pull request For example:
306+
307+
You might ask for a summary of the changes in the pull request:
308+
309+
* `Summarize this PR for me.`
310+
* `Summarize the comments in this PR.`
311+
* `Summarize the changes in this PR.`
312+
313+
You might ask about the changes in a specific file in the pull request:
314+
315+
* `What's the purpose of this file?`
316+
* `Why has this module been included?`
317+
318+
You might ask about the changes in a specific line in the pull request:
319+
320+
* `What is "actorData" in this line?`
321+
* `Explain this "do..end" block.`
322+
323+
You might ask why a workflow failed:
324+
325+
* `Tell me why this job failed`
326+
* `Suggest a fix for this error`
327+
328+
## Ask {% data variables.product.prodname_copilot_chat_short %} questions about a specific issue or discussion
329+
330+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about a specific issue or discussion. For example:
331+
332+
* `what is the purpose of this issue?`
333+
334+
## Ask {% data variables.product.prodname_copilot_chat_short %} questions about a specific commit
335+
336+
You can ask {% data variables.product.prodname_copilot_chat_short %} questions about a specific commit. For example:
337+
338+
* `what is the purpose of this commit?`
339+
* `what is the expected output of this commit?`
340+
* `what is the best way to test this commit?`
341+
342+
{% endwebui %}

content/copilot/using-github-copilot/github-copilot-chat-cheat-sheet.md renamed to content/copilot/using-github-copilot/copilot-chat/github-copilot-chat-cheat-sheet.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ versions:
66
feature: copilot
77
topics:
88
- Copilot
9+
redirect_from:
10+
- /copilot/using-github-copilot/github-copilot-chat-cheat-sheet
911
---
1012

1113
{% webui %}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Copilot Chat
3+
intro: "Learn how to use {% data variables.product.prodname_copilot_chat_short %} across different environments."
4+
versions:
5+
feature: copilot
6+
topics:
7+
- Copilot
8+
children:
9+
- /asking-github-copilot-questions-in-your-ide
10+
- /asking-github-copilot-questions-in-github
11+
- /asking-github-copilot-questions-in-github-mobile
12+
- /getting-started-with-prompts-for-copilot-chat
13+
- /indexing-repositories-for-copilot-chat
14+
- /prompt-engineering-for-copilot-chat
15+
- /github-copilot-chat-cheat-sheet
16+
---

content/copilot/using-github-copilot/indexing-repositories-for-copilot-chat.md renamed to content/copilot/using-github-copilot/copilot-chat/indexing-repositories-for-copilot-chat.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ redirect_from:
1111
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/enhancing-copilot-for-your-organization/indexing-repositories-for-copilot-chat
1212
- /copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-github-copilot-features-in-your-organization/indexing-repositories-for-copilot-chat
1313
- /copilot/customizing-copilot/indexing-repositories-for-copilot-chat
14+
- /copilot/using-github-copilot/indexing-repositories-for-copilot-chat
1415
---
1516

1617
## Benefit of indexing repositories

content/copilot/using-github-copilot/prompt-engineering-for-github-copilot.md renamed to content/copilot/using-github-copilot/copilot-chat/prompt-engineering-for-copilot-chat.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: Prompt engineering for GitHub Copilot
2+
title: Prompt engineering for Copilot Chat
33
shortTitle: Prompt engineering
44
intro: 'Follow these strategies to improve your {% data variables.product.prodname_copilot_short %} results.'
55
versions:
66
feature: copilot
77
topics:
88
- Copilot
9+
redirect_from:
10+
- /copilot/using-github-copilot/prompt-engineering-for-github-copilot
911
---
1012

1113
A prompt is a request that you make to {% data variables.product.prodname_copilot %}. For example, a question that you ask {% data variables.product.prodname_copilot_chat_short %}, or a code snippet that you ask {% data variables.product.prodname_copilot_short %} to complete. In addition to your prompt, {% data variables.product.prodname_copilot_short %} uses additional context, like the code in your current file and the chat history, to generate a response.

content/copilot/using-github-copilot/guides-on-using-github-copilot/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ topics:
99
redirect_from:
1010
- /copilot/using-github-copilot/example-use-cases
1111
children:
12-
- /getting-started-with-prompts-for-copilot-chat
1312
- /refactoring-code-with-github-copilot
1413
- /using-copilot-to-migrate-a-project
1514
- /writing-tests-with-github-copilot

0 commit comments

Comments
 (0)