Navigation: Part 1 – Setup & Chat | Part 2 – Custom Skills | Part 3 | Part 4 – Issues & Review
Goal: Create a custom Copilot agent — a specialized persona with its own behavior, tool access, and instructions.
Custom agents are specialized versions of Copilot tailored to specific workflows. Unlike skills (which are auto-loaded based on relevance), agents are manually selected by the user from a dropdown menu in Copilot Chat or on GitHub.com.
Agents are defined as Markdown files with YAML frontmatter, placed in .github/agents/.
The simplest way to understand the difference:
-
A skill is knowledge — it teaches Copilot how to do something. Think of it like a reference card or a runbook. Copilot picks it up automatically whenever it's relevant, regardless of which "mode" you're in. A skill about your CI pipeline helps whether you're debugging, writing code, or planning a release.
-
An agent is a persona — it changes who you're talking to. When you select an agent, you're switching Copilot's entire personality, focus, and toolset. A code reviewer agent thinks differently than a documentation agent, even when looking at the same code.
Put another way: skills add to what Copilot knows, agents change how Copilot behaves. You can combine both — an agent can pick up skills, giving you a specialized persona that also has access to your team's domain knowledge.
| Skills | Agents | |
|---|---|---|
| Concept | Knowledge — how to do a task | Persona — who is helping you |
| Analogy | A reference card anyone can pick up | A specialist you bring into the room |
| Invocation | Automatic (Copilot loads when relevant) | Manual (you select from a dropdown) |
| Effect | Adds knowledge to the current session | Changes behavior, tone, and focus |
| Tool control | Inherits from context | Can restrict via tools property |
| Structure | Folder with SKILL.md |
Single .md file with YAML frontmatter |
| Location | .github/skills/<name>/SKILL.md |
.github/agents/<name>.md |
| MCP servers | No MCP config | Can configure MCP servers |
| Combined | Available to any agent automatically | Can leverage any skill in the repo |
Documentation: About custom agents
7. Build a code review agent
Make sure you're on your
copilot-hackathonbranch before creating these files.
- In your repo, create the directory:
.github/agents/
- Create
.github/agents/code-reviewer.md— copy the content from the reference file in this repo:.github/agents/code-reviewer.md
Key things to notice in the file:
tools: ["read", "search"]— this agent can only read and search, it cannot edit files- The prompt defines a review process and explicitly tells the agent not to modify anything
- The
descriptionfield is what Copilot shows in the agent dropdown
- Open Copilot Chat in your IDE.
- Look for the agent dropdown (model/agent selector) and select "Code Reviewer".
- Ask it to review a file in your project.
- Notice how it only uses
readandsearch— it cannot edit files.
8. Build a documentation agent
Make sure you're on your
copilot-hackathonbranch before creating this file.
- Create
.github/agents/doc-writer.md— copy the content from the reference file in this repo:.github/agents/doc-writer.md
Key things to notice:
tools: ["read", "search", "edit"]— unlike the reviewer, this agent can modify files- The prompt focuses on documentation, not code logic
- Compare the tool lists between the two agents — this is how you shape what an agent can do
- Select the "Doc Writer" agent in Copilot Chat.
- Ask it to document a function or module in your project.
- Notice it has
editaccess — it can create and modify documentation files.
BONUS. Design your own agent
Make sure you're on your
copilot-hackathonbranch before creating this file.
Now that you've seen how both agents work, create your own agent tailored to your team's needs.
Ideas to get started:
- A security reviewer that scans for common vulnerabilities (
read+searchonly) - A migration assistant that helps port code to a new library or framework
- A test generator that focuses exclusively on writing tests for untested code
- A release notes writer that drafts changelogs from commits and PRs
-
Create
.github/agents/<your-agent-name>.mdwith a basic YAML frontmatter block (name,description,tools) and a one-paragraph summary of what you want the agent to do — you don't need to write polished instructions yourself. -
Open Copilot Chat (Agent mode) and ask Copilot to expand your summary into full agent instructions. For example:
"I've created
.github/agents/security-reviewer.mdwith a short description. Please write detailed instructions for this agent following best practices for GitHub Copilot custom agents."Copilot will generate the full prompt body for you — review and tweak as needed.
-
(Optional) The community
finalize-agent-promptskill fromgithub/awesome-copilotis purpose-built for exactly this. Copy it into your.github/skills/folder and then ask Copilot to use it to polish your agent file — it will check structure, wording, and clarity against proven patterns. -
Test your agent in Copilot Chat by selecting it from the agent dropdown.
-
Consider: would a skill complement this agent? Create a matching skill if so.
- Agents give you persona-based control — you define what the agent can do, what tools it has, and how it behaves.
- The
toolsproperty is powerful — restricting tools shapes the agent's capabilities (e.g., a reviewer that can read but not edit). - Agents can be shared across an organization or enterprise by placing them in a
.github-privaterepository (see docs). - Combine agents with skills for maximum effect: agents define who is helping, skills define what they know.
Getting started:
- About custom agents — overview of agents, file format, and where to place them
- Custom agents in VS Code — how to create and invoke custom agents in VS Code
Technical reference:
- Creating custom agents — full YAML frontmatter reference and tool options
- About agent skills — how skills and agents interact
Community & examples:
- awesome-copilot — curated collection of community agents, skills, and extensions
Next up: Part 4 – Issues, Coding Agent & Review (continues at step 9)