GitHub Copilot app for Beginners: How to teach Copilot about your codebase
Key point
GitHub outlines four methods—custom instructions, agent skills, custom agents, and MCP servers—to tailor Copilot's behavior to specific project conventions and workflows.
Details
Context is critical for effective AI coding assistance. GitHub Copilot performs best when it understands a repository's specific house rules, such as component structure, scripts, and framework conventions. Rather than requiring developers to explain these standards repeatedly, the GitHub Copilot app allows this knowledge to live directly inside the repository.
Custom Instructions for Baseline Context
Custom instructions communicate the conventions Copilot should follow. Developers can add a .github/copilot-instructions.md file to define repository-wide guidance, including preferred architecture, naming conventions, and testing expectations. For more granular control, path-specific instruction files can be created in .github/instructions using an applyTo field. This allows Copilot to combine broad repository rules with specific guidance relevant to the file it is currently working on.
Agent Skills for Repeatable Procedures
While custom instructions handle general standards, agent skills package repeatable procedures that apply only during specific tasks, such as running quality checks or preparing a release. A skill is a folder within .github/skills containing a SKILL.md file and optional scripts. The SKILL.md description helps Copilot determine when to load the skill. For example, a quality-checks skill can instruct Copilot on which scripts to run for tests and linting, ensuring it follows the project's established process instead of guessing commands.
Custom Agents for Specialized Tasks
For larger, complex tasks that span multiple files—such as an accessibility review—custom agents provide specialized guidance. These agent profiles, stored in .github/agents, define a dedicated role, instructions, tools, and project context. They are ideal for recurring work that benefits from a focused perspective and the ability to draw on several sources of context simultaneously.
MCP Servers for External Connectivity
Model Context Protocol (MCP) servers expand Copilot's capabilities beyond the repository by connecting it to external tools, data sources, and services. For instance, a documentation server can provide framework guidance, while a Playwright server allows Copilot to open and interact with the application in a browser. This enables verification of both automated checks and actual interface behavior.
Choosing the Right Customization
These four methods solve different problems and are most effective when combined:
- Custom instructions: Define conventions across the repository or for specific files.
- Agent skills: Package repeatable procedures for specific workflows.
- Custom agents: Provide focused expertise for broader, multi-file tasks.
- MCP servers: Connect Copilot to external tools and data sources.
To begin, developers can start small by adding one frequently explained convention to .github/copilot-instructions.md. The community also shares ready-made resources through Awesome Copilot, allowing users to adapt existing instructions, skills, and agents to their own repositories.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.