Customize your agents

Courtney, a Product Manager on the VS Code team, explains how teams can customize GitHub Copilot agents in VS Code using instruction files, skills, prompts, custom agents, and hooks to better fit their workflows and standards. She highlights the practical use of each feature and recommends starting with instruction files, gradually exploring other options for more tailored and efficient team collaboration.

Courtney, a Product Manager on the VS Code team, introduces the session on customizing GitHub Copilot agents for teams. The goal is to provide a practical guide for tailoring Copilot to fit specific team tools, workflows, and onboarding processes. She outlines several customization options available in VS Code, including instruction files, prompts, custom agents, skills, and hooks. Each of these features allows users to influence how Copilot interacts with their codebase, ensuring it aligns with team standards and practices.

Instruction files serve as global or file-specific context providers, always active during Copilot sessions. These are ideal for enforcing architectural guidelines, coding standards, or other persistent rules. Courtney emphasizes the importance of specificity and clarity in these files, recommending the inclusion of code examples and reasoning to guide Copilot’s behavior. She also advises against duplicating rules already enforced by linters or formatters to avoid unnecessary context bloat.

Skills are similar to instruction files but are loaded dynamically, only when relevant to the current task. This makes them suitable for reusable, domain-specific capabilities without permanently occupying the context window. Courtney demonstrates how skills can be used in VS Code, showing how the agent automatically pulls in a debugging skill when needed. The chat debug log in VS Code allows users to monitor which instructions and skills are being utilized in real time.

Prompts and custom agents provide further customization. Prompts are slash commands best suited for one-shot workflows, such as generating tests or cleaning up pull requests. Custom agents act as role-based personas with specific behaviors, tools, and instructions, enabling more constrained and specialized workflows. Sub-agents, a feature within custom agents, run in their own context windows, allowing for parallelization of tasks and keeping the main agent’s context focused and uncluttered.

Finally, Courtney discusses hooks, a new feature in the latest VS Code release. Hooks are lifecycle triggers that automate contextual actions, such as enforcing security policies or formatting code after edits. They run automatically at various stages of the agent’s execution process and can be monitored through the output channels in VS Code. Courtney concludes by recommending that users start with instruction files for the biggest impact and gradually explore other customization options, referencing community resources like the Awesome Copilot repo for examples and best practices.