Skip to main content

Agents — Examples for GitHub Copilot

Agents are specialised AI personas you can invoke in GitHub Copilot Chat. Each agent has a defined role, expertise, and workflow that shapes how Copilot responds.

How agents work

When you select an agent in Copilot Chat (using @agent-name), Copilot adopts that persona for the conversation. The agent’s instructions override the default behaviour, giving you focused, role-specific assistance.

Agent files live in .github/agents/ and use the .agent.md extension.

How to use these examples

  1. Copy the .agent.md file into your repository’s .github/agents/ directory
  2. Edit any project-specific details (service name, tech stack, team conventions)
  3. Open Copilot Chat and select the agent from the agent picker

Keep agents current. Defra standards evolve. Revisit agent files quarterly or when the Defra software development standards (opens in new tab) repository is updated.

Available examples

Agent Purpose Best for
Defra App Developer Builds Defra-compliant applications Writing new features, implementing user stories
Code Reviewer Systematic code review Reviewing PRs, checking standards compliance
Tester BDD-focused testing and Playwright journey tests Writing unit tests, acceptance tests, journey tests, coverage gaps
Accessibility Advisor WCAG 2.2 AA and GOV.UK Design System compliance Reviewing or fixing UI templates, forms, and components
Orchestrator Plans and delegates complex tasks to specialist agents Large features, multi-phase work, multi-agent workflows
Repo Setup Interviews you about your project and generates the full Copilot config Setting up a new repo, adding Copilot to an existing project

Writing your own agents

Follow this structure:

---
description: One-line summary of what this agent does
tools: [edit, execute, read, search, web, todos, thinking]
---

# Agent Name

## Role
What this agent is and its expertise.

## Workflow
1. Step one
2. Step two
3. Step three

## Rules
- What the agent must always do
- What the agent must never do

## References
- Links to standards or instruction files this agent follows

Tips:

  • Keep the description under 100 characters — it appears in the agent picker
  • Prefer tool sets (edit, execute, read, search, web, agent) over individual tool names — each set bundles all the related built-in tools so the agent has full Agent-mode capability without a long brittle list
  • Add todos for any multi-step agent — it gives the agent (and you) a visible progress checklist
  • For read-only review agents, omit edit and execute to enforce the principle of least privilege
  • VS Code silently ignores unknown tool names (opens in new tab), so MCP and extension tools can be listed safely
  • Reference instruction files rather than restating rules
  • Define clear boundaries — what the agent does and does not do

Back to Getting Started