Skip to content
vibespell

How to write GitHub Copilot instructions

Where `.github/copilot-instructions.md` goes and what Copilot should be told about build, test, and review.

The path is fixed

GitHub Copilot looks for `.github/copilot-instructions.md`. The file applies to the repository. It is a good home for the commands Copilot should run, the folders it should not invent, and a short review checklist.

Copilot will not see a rule that lives only in Cursor's `.cursor` directory. If your team uses both, generate a Copilot file and an AGENTS.md from the same stack so the commands stay aligned.

Write a review checklist

End the file with checks a reviewer would actually leave: validation at the boundary, no new dependency without a reason, no secrets in the diff. Stack-specific lines matter. A Laravel app should mention Form Requests. An Electron app should mention context isolation.

Do it in this order

  1. 01

    Create the folder

    Add `.github` if the repo does not have it.

  2. 02

    Commit the instructions

    Copilot uses the file that is in the repository, not a local-only note.

  3. 03

    Include commands

    Name the test and lint scripts. Copilot suggests those commands in explanations.

  4. 04

    Try a pull request

    Ask Copilot to review a small diff and see whether it cites your checklist.

Questions

Does this replace Copilot custom instructions in the IDE?

Personal instructions still exist in the editor settings. The repository file is shared. Put project facts in the file, not in one developer's settings.

Can I have several instruction files?

The repository file Copilot loads by default is `.github/copilot-instructions.md`. Keep that one complete.