This quickstart walks you through customizing GitHub Copilot for a repository. By the end, Copilot will know your project's conventions, have a specialized agent for common tasks, and have curated project context.
Scenario: You work on a team's web application repository with an established test suite, coding conventions, and active issues. You want Copilot to work effectively with the codebase from day one.
Prerequisites
- A Copilot plan that includes Copilot-Cloud-Agent (GitHub-Copilot Pro+, Copilot Business, or Copilot Enterprise). For more information, see Pläne für GitHub Copilot.
- Cloudagent enabled for your organization or account. For more information, see Verwalten des Zugriffs auf GitHub Copilot Cloud-Agent.
- Write access to a GitHub repository.
Step 1: Teach Copilot your project's conventions
Repository custom instructions give Copilot persistent context about your project—its structure, coding standards, and how to build and test code. Every Copilot interaction in the repository uses these instructions automatically.
Ask Copilot-Cloud-Agent to generate a copilot-instructions.md file:
-
Go to github.com/copilot/agents.
-
Select your repository from the dropdown menu in the prompt field.
-
Enter the following prompt:
Text Onboard this repository to Copilot cloud agent by adding a .github/copilot-instructions.md file. Include information about project structure, coding conventions, the test framework, and how to build and run the project.
Onboard this repository to Copilot cloud agent by adding a .github/copilot-instructions.md file. Include information about project structure, coding conventions, the test framework, and how to build and run the project. -
Review the generated file and merge the pull request.
Copilot now understands your project's conventions across chat, code review, and agent sessions. See Adding repository custom instructions for GitHub Copilot.
Step 2: Create a specialized agent
Benutzerdefinierte Agents let you create focused assistants for recurring tasks. In this example, create an agent that diagnoses and fixes bugs.
-
Go to github.com/copilot/agents and select your repository.
-
In the prompt field, click . Then click Create a custom agent.
-
Rename the file to
bug-fixer.agent.md. -
Replace the template content with:
YAML --- name: Bug Fixer description: Diagnoses and fixes bugs reported in GitHub issues. tools: - read - edit - terminal - search --- You are a bug-fixing specialist. When given a bug report or issue: 1. Reproduce the bug by writing a failing test. 2. Identify the root cause. 3. Fix the code. 4. Verify the fix passes the test and doesn't break existing tests. Always follow the project's testing conventions and coding standards.
--- name: Bug Fixer description: Diagnoses and fixes bugs reported in GitHub issues. tools: - read - edit - terminal - search --- You are a bug-fixing specialist. When given a bug report or issue: 1. Reproduce the bug by writing a failing test. 2. Identify the root cause. 3. Fix the code. 4. Verify the fix passes the test and doesn't break existing tests. Always follow the project's testing conventions and coding standards. -
Commit the file and merge it into the default branch.
Your bug-fixer agent now appears in the agents dropdown on the agents tab. Select it before pasting an issue URL to start a focused debugging session. See Creating custom agents for Copilot-Cloud-Agent.
Step 3: Organize project context with a space
Copilot Räume let you curate the exact context Copilot needs for a specific area of your project. Answers are grounded in relevant files, issues, and documentation.
- Go to github.com/copilot/spaces and click Create space.
- Name the space (for example, "API Architecture") and choose an owner.
- Click Add sources, then add context that's relevant to your project:
- Add files and repositories — Add architecture docs, API schemas, or key configuration files.
- Link files, pull requests, and issues — Paste URLs for active issues or design discussions.
- In the space's chat, ask a question like: "What patterns does our API use for error handling?"
Copilot answers using only the context you've curated. See Creating GitHub Copilot Spaces.
Next steps
- Adding personal custom instructions for GitHub Copilot — Set personal preferences that apply across all your repositories.
- Adding agent skills for GitHub Copilot — Add new capabilities to your agents.
- Connect agents to external tools — Connect agents to external tools and services.
- Collaborating with others using GitHub Copilot Spaces — Share your spaces with teammates.