참고 항목
- Copilot prompt files are in 공개 미리 보기 and subject to change. Prompt files are only available in VS Code. See GitHub Copilot Chat 응답 사용자 지정 정보.
- For community-contributed examples of prompt files for specific languages and scenarios, see the Awesome GitHub Copilot Customizations repository.
사용자 지정 정보
두 가지 유형의 파일을 사용하여 GitHub Copilot의 응답을 사용자 지정할 수 있습니다.
- 사용자 지정 지침은 GitHub Copilot이 모든 상호 작용에서 어떻게 작동해야 하는지에 대한 지속적인 지침을 제공합니다. 소개 예시는 첫 번째 사용자 지정 지침을(를) 참조하세요.
- 프롬프트 파일(공개 미리 보기) 은 필요할 때 호출할 수 있는 특정 작업에 대한 재사용 가능한 프롬프트를 정의합니다. 프롬프트 파일은 VS Code에서만 사용할 수 있습니다.
첫 번째 프롬프트 파일
명확하고 잘 문서화된 코드 설명을 작성하는 데 도움이 되는 간단한 프롬프트 파일로 시작하세요.
코드 설명 프롬프트
--- mode: 'agent' description: 'Generate a clear code explanation with examples' --- Explain the following code in a clear, beginner-friendly way: Code to explain: ${input:code:Paste your code here} Target audience: ${input:audience:Who is this explanation for? (e.g., beginners, intermediate developers, etc.)} Please provide: * A brief overview of what the code does * A step-by-step breakdown of the main parts * Explanation of any key concepts or terminology * A simple example showing how it works * Common use cases or when you might use this approach Use clear, simple language and avoid unnecessary jargon.
---
mode: 'agent'
description: 'Generate a clear code explanation with examples'
---
Explain the following code in a clear, beginner-friendly way:
Code to explain: ${input:code:Paste your code here}
Target audience: ${input:audience:Who is this explanation for? (e.g., beginners, intermediate developers, etc.)}
Please provide:
* A brief overview of what the code does
* A step-by-step breakdown of the main parts
* Explanation of any key concepts or terminology
* A simple example showing how it works
* Common use cases or when you might use this approach
Use clear, simple language and avoid unnecessary jargon.
테스트
-
위의 프롬프트 파일을
explain-code.prompt.md
라는 이름으로.github/prompts
폴더에 저장하세요. -
Visual Studio Code에서 Copilot Chat 보기를 표시하고
/explain-code
를 입력합니다.아직 선택되지 않은 경우, Copilot은 에이전트 모드로 전환하고 일부 코드와 대상 형식을 입력하라는 메시지를 표시합니다.
-
다음을 입력합니다.
Text The code is `function fibonacci(n) { return n <= 1 ? n : fibonacci(n-1) + fibonacci(n-2); }`. The audience is beginners.
The code is `function fibonacci(n) { return n <= 1 ? n : fibonacci(n-1) + fibonacci(n-2); }`. The audience is beginners.
Further reading
- Use prompt files in Visual Studio Code in the Visual Studio Code documentation - Information on how to create and use prompt files
- GitHub Copilot Chat 응답 사용자 지정 정보 - Overview of response customization in GitHub Copilot
- Awesome GitHub Copilot Customizations - Repository of community-contributed custom prompt files and other customizations for specific languages and scenarios