copilot-instructions.md Guide
Configure GitHub Copilot with custom instructions. Learn how to set up repository-wide rules, path-specific instructions, and organization standards.
Understanding copilot-instructions.md
copilot-instructions.md is a Markdown file where you define custom coding standards, rules, and best practices that GitHub Copilot should follow across your repository. It helps Copilot generate code that matches your project's conventions and requirements.
With the largest market share among AI coding tools, GitHub Copilot's custom instructions feature gives you control over how Copilot understands your codebase and generates suggestions.
How to Set Up
- Create a
.githubdirectory in your repository root if it doesn't exist - Create a file named
copilot-instructions.md - Add natural language instructions in Markdown format
- Commit and push to your repository
copilot-instructions.md Format
The instructions file uses Markdown format. Here's a recommended structure:
Path-Specific Instructions
For language-specific or directory-specific rules, create .instructions.md files with YAML frontmatter:
Priority Order
Copilot combines instructions from multiple sources with this priority:
- Personal instructions — Highest priority (your individual settings)
- Repository instructions — Project-level rules in .github/
- Organization instructions — Org-wide standards (enterprise)
All relevant instructions are combined and provided to Copilot. Avoid conflicting instructions across levels.
Best Practices
- Keep instructions short and self-contained — Each statement should add context without depending on other statements
- Use path-specific files for language rules — Don't mix Python and TypeScript rules in one file
- Be specific about versions — Mention framework versions to prevent outdated suggestions
- Verify with references — Check that your instructions appear in Copilot Chat references
- Update regularly — Keep instructions in sync with project evolution
Related Guides
Frequently Asked Questions
Manage Your copilot-instructions.md Visually
ClaudeMDEditor lets you browse, edit, and organize copilot-instructions.md files across all your projects. Plus it handles CLAUDE.md, .cursorrules, and more.
One-time purchase for macOS Tahoe (26+)