Quick Start¶
Create a custom agent in VS Code and use it.
Prerequisites¶
- VS Code with GitHub Copilot enabled
- A workspace folder to put the agent in
Create your first agent¶
- Create the folder
.github/agents/in your workspace. - Create
.github/agents/reviewer.agent.md:
---
description: Reviews code for bugs and security problems without changing it
tools: ["read", "search"]
---
You are a code reviewer. Read the code you are asked about and report bugs,
security problems, and missing tests. Cite the file and line for each finding.
Never edit files.
- Open the Chat view and choose reviewer from the Agent dropdown.
- Ask it something:
Review src/auth/login.ts.
The agent can only read and search, because those are the only tools it lists. To see the effect, remove the tools line and the agent gets every tool.
You can also generate an agent for you: run Chat: New Custom Agent, or, in a Local harness session, type /create-agent in chat and describe the role.
Install a ready-made agent¶
The repository's example agents install into your project with the GitHub CLI:
Or copy a file from
agents/
into .github/agents/ by hand.
Share it¶
Commit .github/agents/ and everyone who opens the workspace gets the agents. To use an agent in every workspace, put it in ~/.copilot/agents/ instead.
Next steps¶
- Custom Agent Files: locations, frontmatter, and tools
- Agent Examples: ten ready-made agents
- Subagents: agents that delegate to other agents
- Troubleshooting: when an agent does not show up or behave