GitHub Copilot이 응답하는 방식을 맞춤 설정하는 방법

발행: (2025년 12월 4일 오전 11:34 GMT+9)
6 min read
원문: Dev.to

Source: Dev.to

GitHub Copilot을 자주 사용하고 계신가요? 매 채팅마다 동일하거나 비슷한 지시를 다시 입력하는 것은 번거로울 수 있습니다. 커스텀 인스트럭션을 사용하면 프로젝트별 정책, 네이밍 규칙, 주석 표준과 같은 재사용 가능한 가이드를 저장해 두고 Copilot이 자동으로 적용하도록 할 수 있습니다.

GitHub Copilot이 프롬프트에 응답하는 방식을 커스터마이즈하는 주요 방법은 두 가지입니다:

  • Custom instructions
  • Prompt files (이 글에서는 다루지 않음)

Custom instructions

Custom instructions는 GitHub Copilot의 동작을 안내합니다. 작성 시점에 사용할 수 있는 범위는 다음과 같습니다:

  • Personal custom instructions
  • Repository‑wide custom instructions
  • Path‑specific custom instructions
  • Organization custom instructions (Copilot Enterprise)
  • Agent instructions (AI Agents에서 사용)

Personal custom instructions

개인 인스트럭션은 웹상의 Copilot 채팅 UI에서 설정하며, Copilot이 사용자의 프롬프트를 해석하는 방식을 영향을 줍니다.

GitHub Copilot chat on the web

Example workflow

  1. GitHub Copilot 웹 페이지를 엽니다.

  2. 예를 들어 Create a JavaScript function that converts numbers into Roman numerals와 같이 Copilot에 프롬프트를 입력합니다.

  3. 출력 결과를 확인합니다.

  4. Copilot 설정에서 Profile → Personal instructions를 열고 다음과 같은 가이드를 추가합니다:

    Always do the following when writing functions:
    - Add descriptive comments
    - Add input validation
    - Use early returns for error conditions
    - Use meaningful variable names
    - Include at least one example usage in comments
  5. 동일한 프롬프트를 다시 실행하고 결과를 비교합니다.

GitHub Docs에서 개인 커스텀 인스트럭션에 대해 자세히 읽어보기.

Repository‑wide custom instructions

레포지토리 수준 인스트럭션은 모든 기여자가 동일한 가이드를 받도록 보장합니다—공유 프레임워크, 코딩 표준, 주석 규칙 등에 유용합니다.

  1. 레포지토리의 .github 디렉터리 안에 copilot-instructions.md 파일을 생성합니다.

  2. 마크다운으로 작성된 자연어 가이드를 넣습니다. 예시:

    # Project Overview
    
    This project [describe your project].
    
    ## Folder Structure
    
    [list the folder structure]
    
    ## Libraries and Frameworks
    
    [list any libraries it uses]
    
    ## Coding Standards
    
    [list your coding standards]
    
    ## UI Guidelines
    
    [list your UI guidelines]

    기본적으로 레포지토리 인스트럭션은 활성화됩니다.

Copilot Code review custom instructions

Generating the file with Copilot

Copilot Agents UI를 통해

  1. GitHub Copilot Agents 페이지에 방문해 레포지토리를 선택합니다.

  2. 다음과 같은 요청으로 에이전트에 프롬프트합니다:

    Your task is to add a .github/copilot-instructions.md file to the repository.
    
    [outline the goals you want GitHub Copilot to achieve]
    
    [add limitations such as length or task‑specific constraints]
    
    Add high‑level details about the codebase:
    - A summary of what the repository does.
    - Repository size, primary languages, frameworks, target runtimes.
    
    Include build and validation instructions:
    [insert build steps]
    
    List key architectural facts:
    [describe project layout and architecture]
    
    [describe the steps Copilot should take]
  3. 생성된 copilot-instructions.md를 검토하고 필요에 따라 수정합니다.

VS Code를 통해

  1. 대상 레포지토리를 엽니다.
  2. Copilot 채팅 패널에서 Settings(톱니바퀴) 아이콘을 클릭하고 Generate instructions를 선택합니다.
  3. 생성된 .github/copilot-instructions.md 파일을 확인하고 커밋합니다.

GitHub Docs에서 레포지토리‑wide 커스텀 인스트럭션에 대해 자세히 읽어보기.

Path‑specific custom instructions

Path‑specific 인스트럭션은 선택된 파일이나 패턴에만 적용되어 세밀한 제어가 가능합니다. 현재 VS Code와 JetBrains IDE에서 지원됩니다.

  1. 레포지토리 안에 .github/instructions 폴더를 만듭니다.

  2. .instructions.md라는 마크다운 파일을 추가합니다(설명적인 이름을 선택).

  3. 첫 번째 줄에 applyTo 키로 대상 파일을 지정합니다, 예:

    applyTo: "app/models/**/*.rb"

    여러 패턴을 쉼표로 구분해 지정할 수도 있습니다:

    applyTo: "**/*.ts,**/*.tsx"

    모든 파일에 적용하려면:

    applyTo: "**"
  4. applyTo 라인 아래에 해당 파일들을 위한 가이드를 일반 마크다운 형식으로 작성합니다.

필요에 따라 서로 다른 코드베이스 부분을 대상으로 하는 여러 개의 path‑specific 인스트럭션 파일을 만들 수 있습니다.

Back to Blog

관련 글

더 보기 »