https://docs.github.com/ko/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot
VS Code에서 GitHub Copilot Chat에 컨텍스트와 지침을 제공하는 데 사용할 수 있는 두 가지 유형의 파일이 있습니다.
- 리포지토리 사용자 지정 지침을 사용하면 리포지토리의 컨텍스트에서 진행되는 모든 대화에 적용되는 리포지토리 전체의 지침 및 기본 설정을 단일 파일에 지정할 수 있습니다.
- 프롬프트 파일(공개 미리 보기)을 사용하면 일반적인 프롬프트 지침과 관련 컨텍스트를 Markdown 파일(
*.prompt.md)에 저장하여 채팅 프롬프트에서 다시 사용할 수 있습니다. 프롬프트 파일은 VS Code에서만 사용할 수 있습니다.
사용자 지정 지침은 각 AI 워크플로에 코드베이스 전체 컨텍스트를 추가하는 데 도움이 되지만 프롬프트 파일을 사용하면 특정 채팅 상호 작용에 지침을 추가할 수 있습니다.
리포지토리 사용자 지정 지침 예시
This example of a .github/copilot-instructions.md file contains three instructions that will be added to all chat questions.
We use Bazel for managing our Java dependencies, not Maven, so when talking about Java packages, always give me instructions and code samples that use Bazel.
We always write JavaScript with double quotes and tabs for indentation, so when your responses include JavaScript code, please follow those conventions.
Our team uses Jira for tracking items of work.
프롬프트 파일 예제
다음 예제에서는 프롬프트 파일을 사용하는 방법을 보여 줍니다.
New React form.prompt.md- React를 사용하여 폼을 생성하는 재사용 가능한 작업에 대한 지침을 포함합니다.
Your goal is to generate a new React form component.
Ask for the form name and fields if not provided.
Requirements for the form:
- Use form design system components: [design-system/Form.md](../docs/design-system/Form.md)
- Use `react-hook-form` for form state management:
- Always define TypeScript types for your form data
- Prefer *uncontrolled* components using register
- Use `defaultValues` to prevent unnecessary rerenders
- Use `yup` for validation:
- Create reusable validation schemas in separate files
- Use TypeScript types to ensure type safety
- Customize UX-friendly validation rules
API security review.prompt.md- REST API의 보안 검토를 수행하는 데 사용할 수 있는 REST API의 보안 사례에 대한 재사용 가능한 정보를 포함합니다.
Secure REST API review:
- Ensure all endpoints are protected by authentication and authorization
- Validate all user inputs and sanitize data
- Implement rate limiting and throttling
- Implement logging and monitoring for security events
…
반응형