GitHub details methods to tailor Copilot behavior for specific codebases
GitHub explains how developers can use custom instructions, agents, and MCP servers to align AI assistance with project standards.

Key points
- Custom instructions allow repositories to define architecture and naming conventions for Copilot.
- Agent skills package repeatable procedures like testing and linting into loadable folders.
- Model Context Protocol servers connect the AI tool to external data sources and browsers.
GitHub published a guide on its official blog explaining how developers can teach GitHub Copilot about their specific codebases. The post outlines four methods for tailoring the AI assistant’s behavior to match project-specific rules and conventions.
The company emphasizes that context is critical for effective AI assistance. Every codebase has unique structural rules, scripts, and framework conventions. Copilot performs better when it understands these house rules automatically rather than requiring manual explanation for every new task.
Configuring Repository Context
Developers can establish baseline context by adding a `.github/copilot-instructions.md` file to their repository. This file defines guidance that applies across the entire project, such as preferred architecture patterns, naming conventions, or testing expectations.
GitHub also supports path-specific instruction files within the `.github/instructions` directory. These files use an `applyTo` field to specify when the guidance is relevant. Copilot combines repository-wide instructions with these specific rules when working on matching files.
Using Agents and Skills
For procedural tasks, developers can package guidance into agent skills. A skill is a folder containing instructions and optional scripts that Copilot loads when relevant. Project-level skills reside in `.github/skills`, with each skill in its own subfolder.
For example, a quality-checks skill could contain a `SKILL.md` file explaining which scripts run tests and linting. This helps Copilot follow established processes instead of guessing commands. Custom agents in `.github/agents` handle broader, specialized work spanning multiple files.
External Tool Integration
Model Context Protocol (MCP) servers expand Copilot’s capabilities beyond the repository. These servers connect the AI tool to external tools, data sources, and services. A documentation server can provide framework guidance, while a server like Playwright enables browser interaction.
Developers can browse available MCP servers in the Copilot app or add custom ones. This integration allows Copilot to access external data and interact with applications in ways that static instructions cannot support.
What should you do?
Review your project’s current coding standards and documentation. Identify which conventions are most critical for AI assistance. Consider creating a `.github/copilot-instructions.md` file to establish baseline rules for Copilot.
Evaluate recurring procedures such as testing or linting. Package these into agent skills within `.github/skills` to ensure consistent execution. Explore MCP servers to connect Copilot to necessary external tools and documentation sources.
What to do and how to stay safe: GitHub
- Create a `.github/copilot-instructions.md` file to define repository-wide coding conventions and architecture preferences.
- Package repeatable procedures like testing into agent skills within the `.github/skills` directory.
- Configure Model Context Protocol servers to connect Copilot to external documentation or browser automation tools.
- Review path-specific instructions in `.github/instructions` to tailor guidance for different file types.
Step-by-step guide: Prompt Injection Warning Signs: How to Spot AI Manipulation
General security guidance from the Threat Times newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
How can I make Copilot follow my project's naming conventions?
Add a `.github/copilot-instructions.md` file to your repository to define naming conventions and other standards.
What is the purpose of agent skills in GitHub Copilot?
Agent skills package repeatable procedures, such as testing or linting, into folders that Copilot can load when relevant.
How do MCP servers enhance Copilot's capabilities?
MCP servers connect Copilot to external tools, data sources, and services, such as documentation or browser automation.


