copilot-agent-builder
Generate custom GitHub Copilot agents (.agent.md files) for VS Code with proper YAML frontmatter, tools configuration, and handoff workflows. Use when "create copilot agent", "generate github copilot agent", "new copilot agent for", "make a copilot agent", or "build copilot agent".
When & Why to Use This Skill
The GitHub Copilot Agent Builder is a specialized Claude skill designed to automate the creation of custom AI agents for VS Code. It streamlines the generation of `.agent.md` files by ensuring proper YAML frontmatter, tool configurations (such as codebase search and GitHub integration), and complex handoff workflows, significantly enhancing developer productivity through tailored AI assistance.
Use Cases
- Architectural Planning: Create specialized agents that analyze codebase structures and search documentation before handing off tasks to implementation agents.
- Automated Workflow Design: Configure multi-step agent handoffs, such as a 'Reviewer' agent automatically passing feedback back to a 'Coder' agent for fixes.
- Standardized Team Tooling: Generate consistent agent definitions within the `.github/agents` directory to ensure all team members use the same AI personas and toolsets.
- Security and Quality Audits: Build dedicated agents with restricted tool access focused specifically on security scanning or unit test generation.
| name | copilot-agent-builder |
|---|---|
| description | Generate custom GitHub Copilot agents (.agent.md files) for VS Code with proper YAML frontmatter, tools configuration, and handoff workflows. Use when "create copilot agent", "generate github copilot agent", "new copilot agent for", "make a copilot agent", or "build copilot agent". |
| allowed-tools | Read, Write, Glob, Bash, AskUserQuestion |
GitHub Copilot Agent Builder
Generate custom GitHub Copilot agents following VS Code's .agent.md format with proper YAML frontmatter and markdown instructions.
When to Activate
Trigger this skill when user says:
- "create copilot agent"
- "generate github copilot agent"
- "new copilot agent for [purpose]"
- "make a copilot agent"
- "build copilot agent"
- "copilot custom agent"
Agent Creation Process
Step 1: Gather Requirements
Ask user for agent configuration:
Agent Purpose & Name:
- What should the agent do? (e.g., "plan features", "review security", "write tests")
- Suggested name: Extract from purpose (e.g., "planner", "security-reviewer", "test-writer")
Tools Selection (multi-select):
fetch- Retrieve web content and documentationsearch- Search codebase and filesgithubRepo- Access GitHub repository datausages- Find code references and usage patternsfiles- File operations- Custom tools if available
Handoff Workflows (optional):
- Should this agent hand off to another? (e.g., planner → coder)
- Handoff agent name
- Handoff prompt text
- Auto-send handoff? (yes/no)
Additional Configuration (optional):
- Specific model to use?
- Argument hint for users?
Step 2: Validate Directory Structure
# Ensure .github/agents directory exists
mkdir -p .github/agents
Step 3: Generate Agent File
Create .github/agents/{agent-name}.agent.md with:
YAML Frontmatter Structure:
---
description: [Brief overview shown in chat input]
name: [Agent identifier, lowercase with hyphens]
tools: [Array of tool names]
handoffs: # Optional
- label: [Button text]
agent: [Target agent name]
prompt: [Handoff message]
send: [true/false - auto-submit?]
model: [Optional - specific model name]
argument-hint: [Optional - user guidance text]
---
Markdown Body:
- Clear role definition
- Specific instructions
- Tool usage guidance (reference as
#tool:toolname) - Output format expectations
- Constraints and guidelines
Step 4: Validate Format
Ensure generated file has:
- ✓ Valid YAML frontmatter with
---delimiters - ✓ All required fields (description, name)
- ✓ Tools array properly formatted
- ✓ Handoffs array if specified (with label, agent, prompt, send)
- ✓ Markdown instructions that are clear and actionable
Step 5: Confirm Creation
Show user:
✅ GitHub Copilot Agent Created
📁 Location: `.github/agents/{name}.agent.md`
🎯 Agent: {name}
📝 Description: {description}
🛠️ Tools: {tools list}
To use:
1. Reload VS Code window (Cmd/Ctrl + Shift + P → "Reload Window")
2. Open GitHub Copilot Chat
3. Type `@{name}` to invoke your custom agent
{If handoffs configured: "This agent can hand off to: {handoff targets}"}
Output Format
After creation, provide:
- File path confirmation
- Configuration summary (name, description, tools, handoffs)
- Usage instructions (how to reload and use)
- Next steps (testing suggestions)
Reference Documentation
- Templates and structures →
templates.md - Real-world examples →
examples.md
Important Guidelines
- Naming Convention: Use lowercase with hyphens (e.g.,
feature-planner,security-reviewer) - Description: Brief (1-2 sentences), shown in chat input UI
- Tools: Only include tools the agent actually needs
- Handoffs: Enable multi-step workflows (planning → implementation → testing)
- Instructions: Be specific about what the agent should and shouldn't do
- Tool References: Use
#tool:toolnamesyntax in markdown body
Common Agent Patterns
Planning Agent:
- Tools:
fetch,search,githubRepo,usages - Handoff: To implementation agent
- Focus: Analysis and planning, no code edits
Implementation Agent:
- Tools:
search,files,usages - Handoff: To testing agent
- Focus: Write and modify code
Review Agent:
- Tools:
search,githubRepo,usages - Handoff: Back to implementation for fixes
- Focus: Quality, security, performance checks
Testing Agent:
- Tools:
search,files - Handoff: Back to implementation or to review
- Focus: Test creation and validation
Ready to build custom GitHub Copilot agents!