Artificial intelligence assistants perform best when they have context. Each project enforces its own set of rules: how code gets organized, which build commands to execute, and what style guidelines apply across different technologies and file formats.
GitHub Copilot can refactor code across entire projects, yet its effectiveness improves dramatically when it grasps those project-specific rules. Rather than storing this knowledge externally, teams can embed it directly in the repository, allowing Copilot to absorb these patterns automatically instead of requiring repeated explanations of the same standards and procedures.
Four complementary techniques enable teams to customize how Copilot interacts with their codebase:
- Custom instructions communicate the conventions Copilot should follow.
- Agent skills package repeatable procedures.
- Custom agents bring specialized guidance to larger tasks.
- Model Context Protocol (MCP) servers connect Copilot to external tools and data sources, expanding what it can do.
Start with custom instructions
Consider asking Copilot to implement a custom page size feature in an application. Beyond writing the code itself, the implementation must align with patterns already established by the team.
Repository custom instructions supply Copilot with that foundational understanding. Teams create a .github/copilot-instructions.md file to specify guidance applicable throughout the repository, including preferred architecture patterns, naming standards, or requirements for testing and validation.
Path-specific instruction files can also be created within .github/instructions. These files employ an applyTo field to indicate when Copilot should apply the guidance.
When Copilot processes a matching file, it can leverage both repository-wide instructions and more granular guidance. This approach keeps overarching principles centralized without forcing all file types to conform to identical rules.
Package repeatable procedures as agent skills
Custom instructions address standards that should influence numerous tasks. However, certain guidance only becomes relevant when Copilot executes a specific procedure, such as performing quality assurance, preparing a release, or investigating a workflow failure.
Agent skills fulfill this purpose. A skill comprises a folder with instructions and, optionally, scripts and supplementary materials that Copilot can activate when appropriate. Project-level skills reside in .github/skills, with each skill occupying its own subfolder.
For instance, a .github/skills/quality-checks folder might include a SKILL.md file describing:
- When Copilot should use the skill.
- Which scripts run the project's tests and linting.
- What each script checks.
- How to troubleshoot common failures.
The description in SKILL.md assists Copilot in determining when the skill applies. After modifying the interface, Copilot can activate the quality-checks skill and adhere to the project's established testing and linting workflow rather than attempting to guess which commands to run.
Use a custom agent for broader, specialized work
Certain assignments exceed the scope of a single procedure. An accessibility audit, for example, might require Copilot to examine components, templates, styles, and user interactions distributed across numerous files.
Custom agents enable teams to build specialized versions of Copilot for such work. A repository-level agent profile resides in .github/agents and can specify the agent's role, instructions, available tools, and pertinent project information.
Deploy a custom agent when a recurring category of work gains value from a dedicated function or viewpoint, particularly when the assignment spans multiple files and incorporates several tools or information sources.
Connect Copilot to external tools with MCP servers
Instructions, skills, and agents equip Copilot to operate within project boundaries. MCP servers broaden what it can reach and accomplish outside the repository.
MCP servers link Copilot to external applications, information repositories, and services. A documentation server might supply access to framework documentation, while a server like Playwright enables it to launch and manipulate your application within a browser.
Teams can explore available MCP servers through the Copilot app or integrate a custom one. Once Playwright is set up, users can request: Use the Playwright MCP server to test the functionality manually.
Copilot can then employ Playwright to launch the application in a browser and engage with it as a person would. This capability allows it to confirm not just that code satisfies automated testing, but also that the modified interface functions as intended.
Choose the right type of customizations
These customization approaches address distinct challenges, yet they amplify their value when used together:
- Custom instructions define the conventions Copilot should follow across the repository or for particular files.
- Agent skills package repeatable procedures that Copilot can load when they're relevant.
- Custom agents provide focused expertise and guidance for broader tasks.
- MCP servers connect Copilot to external tools, services, and data sources, expanding what Copilot can do.
Getting started
Equipping Copilot with meaningful project context begins with four key questions:
- What project convention do I keep explaining?
- What multi-step procedure do I repeat?
- What complex task could benefit from a dedicated custom agent?
- What outside tool or source does Copilot need?
Uncertain where to start? The community has published ready-made instructions, skills, agents, and more through Awesome Copilot. Locate one addressing a workflow you already perform, examine its contents, and customize it to match your repository's tools and conventions.
Begin modestly: identify one standard you repeatedly clarify, add it to .github/copilot-instructions.md, and observe how Copilot applies it during your next assignment.