Search LA24X

Keyboard shortcut: Ctrl / ⌘ + K

Type two characters to search, or explore the library.

Open the topic library →

Privacy choices

Choose what suits you. Reading and tools work without analytics or optional saving.

Necessary — always active

Page delivery, language and privacy preferences.

Advertising

Storage details ↗

Give Copilot repository instructions that can be checked

Describe the project’s real commands and constraints, keep instructions concise and confirm the feature actually reads the supported file.

Illustration for Give Copilot repository instructions that can be checked
✓ An instruction file should describe the actual project.✓ Generated-file rules do not enforce themselves.

In brief

Repository instructions help a coding assistant understand the project’s conventions. Write the commands and constraints that are true for the repository, not an aspirational architecture or a list of praise.

This can reduce repeated corrections about tests, generated files and supported patterns.

Document useful facts

List the real build and relevant validation commands, source-of-truth directories and patterns that should be preserved. Say where generated output comes from and how to recreate it. Do not include secrets or private credentials in the instruction file.

Use supported scope

GitHub supports repository-wide instructions through its documented file and feature-specific mechanisms. Read the current path and applicability rules; do not assume a similarly named file is read by every assistant. Keep conflicting instructions out of overlapping scopes.

Check compliance in the result

Use a small legitimate change and inspect whether the assistant used the stated source and checks. Correct stale instructions when commands or architecture change. Keep CI and review checks authoritative; a claim that instructions were followed does not prove a test ran.

Before you act

Instruction support differs across Copilot features and environments. Instructions are guidance, not a substitute for code checks or a security permission boundary.

What to do next

  1. Read the current supported repository-instruction format for the Copilot feature you use.
  2. Add concise true build, test, style and generated-file guidance.
  3. Confirm the feature receives the instructions and review a small result against them.
You’ve reached the end. Save this guide for later.Back to top ↑