Create Custom Agent
This skill helps you create VS Code custom agent files that define specialized AI personas for development tasks. Custom agents configure which tools are available, provide specialized instructions, and can chain together via handoffs.
When to Use
- Creating a new custom agent from scratch
- Scaffolding an
.agent.mdfile with proper frontmatter - Setting up agent-to-agent handoffs for multi-step workflows
- Configuring tool restrictions for specialized roles (planner, reviewer, etc.)
- Creating workspace-shared or user-profile agents
When Not to Use
- Creating instruction files (use
.instructions.mdinstead) - Creating reusable prompts (use
.prompt.mdinstead) - Modifying existing agents (edit the file directly)
Inputs
Workflow
Step 1: Create the agent file
Create a file with .agent.md extension in the agents/ directory:
Step 2: Add YAML frontmatter
Add the header with required and optional fields:
Available frontmatter fields:
Step 3: Configure tools
Specify which tools the agent can use:
Common tool patterns:
- Read-only agents:
['search', 'fetch', 'codebase'] - Full editing agents:
['*']or specific editing tools - Specialized agents: Cherry-pick specific tools
Step 4: Add handoffs (optional)
Configure transitions to other agents:
Handoff fields:
label: Button text displayed to useragent: Target agent identifierprompt: Pre-filled prompt for target agentsend: Auto-submit prompt (default: false)model: Optional model override for handoff
Step 5: Write agent instructions (body)
Add the agent's behavior instructions in Markdown:
Tips for instructions:
- Use Markdown links to reference other files
- Reference tools with
#tool:<tool-name>syntax - Be specific about agent behavior and constraints
Step 6: Validate the agent
Verify the agent loads correctly:
- Open Command Palette (Ctrl+Shift+P)
- Run "Chat: New Custom Agent" or check agents dropdown
- Use "Diagnostics" view (right-click in Chat view) to check for errors
Template
Example Agents
Planning Agent
Code Review Agent
Validation Checklist
- File has
.agent.mdextension - File is in
agents/directory - YAML frontmatter is valid (proper indentation, no syntax errors)
- Description is non-empty and descriptive
- Tools list contains only available tools
- Handoff agent names match existing agents
- Instructions are clear and actionable
- Agent appears in agents dropdown


