From One-Off Prompts to Workflows: How to Use Custom Agents in GitHub Copilot CLI
Key point
GitHub Copilot CLI lets you define custom agents that reflect your team's standards via Markdown files and automate workflows.
Details
Developers work across various environments such as CLI, IDE, and GitHub, and often spend time repeating the same commands or explaining context over and over. Using the Custom Agents feature in GitHub Copilot CLI, you can reduce this hassle and build reusable workflows that reflect your team's unique stack and standards.
A Custom Agent is a Copilot agent defined by a Markdown file that goes beyond generic answers, letting you specify the agent's role, the tools it can use, the standards it must follow, and the output format. For example, instead of just cleaning up code, you can create a specialized agent that applies your team's formatting rules, Accessibility standards, and security requirements all at once.
Agent profiles are stored as .agent.md files in the .github/agents directory within a repository. This allows team members to review the agents and version-control them, ensuring that workflows defined in the CLI are applied consistently across the IDE and Pull Request stages.
How to set up a Custom Agent:
- Invoke the agent in Copilot CLI using the
/agentcommand - Create a Markdown file with YAML frontmatter in the
.github/agentsdirectory of the target repository - Define the agent's role, scope, capabilities, and guardrails to ensure consistent behavior
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.