Creating Custom Chat Modes for GitHub Copilot in VS Code

Supercharge GitHub Copilot with custom AI assistants tailored to your Azure workflow

Introduction

GitHub Copilot has revolutionized how we write code, but did you know you can create custom chat modes to make it even more powerful? Custom chat modes allow you to create specialized AI assistants tailored to your specific needs - whether you’re working with particular frameworks, following specific coding standards, or need assistance with domain-specific tasks.

In this comprehensive guide, we’ll walk through the process of creating custom chat modes for GitHub Copilot in VS Code, from basic setup to advanced customization techniques that will supercharge your development workflow.

Prerequisites

Before we dive in, make sure you have:

  • Visual Studio Code installed
  • GitHub Copilot subscription (individual or business)
  • GitHub Copilot extension installed and configured

Visual Studio Code Setup

First, let’s ensure you have the GitHub Copilot Extension installed and properly configured.

Once installed, you can access the GitHub Copilot chat from the navigation bar on the left side of VS Code.

Understanding Chat Mode Locations

When creating custom chat modes, you’ll be prompted to choose between two storage locations:

  • Repository Specific: Custom modes are stored within your repository and shared with team members
  • Workspace Specific: Custom modes are stored locally and available across all your projects

For team collaboration, repository-specific modes are ideal, while workspace-specific modes are perfect for personal productivity enhancements.

Locating the Prompts Directory

Custom chat modes are stored as markdown files in your VS Code user directory. You can find them at:

1
$Env:APPDATA\Code\User\prompts

On macOS/Linux, the equivalent path would be:

1
~/.vscode/User/prompts

Creating Your First Custom Chat Mode

Let’s create a practical example - a custom chat mode for Azure cloud architecture and PowerShell automation.

Step 1: Create the Prompt File

Navigate to your prompts directory and create a new file called azure-cloud-expert.md:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
title: Azure Cloud Expert
description: A specialized assistant for Azure cloud architecture, PowerShell automation, and Infrastructure as Code with Bicep
authors:
  - Your Name
version: 1.0.0
---

You are an Azure cloud expert assistant. You specialize in:

## Core Expertise
- Azure cloud architecture and design patterns
- PowerShell scripting and Azure CLI automation
- Infrastructure as Code with Bicep and ARM templates
- Azure security best practices and compliance
- Cost optimization and resource management
- Azure DevOps and CI/CD pipelines

## Response Guidelines
- Always provide PowerShell or Azure CLI examples when applicable
- Include Bicep templates for infrastructure deployments
- Consider security implications and best practices
- Suggest cost-effective solutions
- Include monitoring and logging recommendations
- Follow Azure Well-Architected Framework principles

## Code Style
- Use clear, descriptive parameter names in PowerShell
- Include proper error handling and logging
- Use Azure resource naming conventions
- Add meaningful comments for complex logic
- Prefer Azure native services when possible

When providing code examples, always explain the Azure services involved and suggest alternatives for different scenarios.

Step 2: Advanced Customization

You can make your custom modes even more powerful by including specific instructions:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
title: Bicep Infrastructure Specialist
description: Expert in Azure Infrastructure as Code using Bicep, ARM templates, and deployment automation
---

You are a Bicep and Azure Infrastructure specialist focusing on:

## Technical Focus
- Bicep template development and best practices
- Azure Resource Manager (ARM) template conversion
- Modular infrastructure design patterns
- Azure Policy and governance implementation
- Deployment automation with Azure DevOps
- Infrastructure security and compliance

## Response Format
For each infrastructure question:
1. Provide the Bicep implementation
2. Explain the Azure services involved
3. Include parameter files and examples
4. Consider security and compliance requirements
5. Suggest monitoring and alerting strategies

## Code Examples
Always include:
- Proper resource dependencies
- Parameter validation and descriptions
- Output values for integration
- Tags for resource management
- Role-based access control (RBAC) considerations

Best Practices for Custom Chat Modes

1. Be Specific and Detailed

The more specific your instructions, the better the AI can assist you. Include:

  • Exact Azure services and PowerShell modules you use
  • Organizational naming conventions and tagging standards
  • Preferred deployment patterns and architectures
  • Common security and compliance requirements

2. Include Context Examples

Provide examples of the type of responses you expect:

1
2
3
## Example Interaction
User: "How do I deploy a web app with a database in Azure?"
Assistant: "Here's a Bicep template that deploys an App Service with Azure SQL Database..."

3. Define Response Structure

Specify how you want responses formatted:

1
2
3
4
5
6
## Response Structure
1. Brief explanation of Azure services
2. PowerShell or Bicep implementation
3. Alternative Azure solutions
4. Security and compliance considerations
5. Cost optimization recommendations

4. Version Control Your Prompts

If using repository-specific modes, commit them to version control so your team can benefit from shared expertise.

Practical Examples

Azure PowerShell Automation Mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
---
title: Azure PowerShell Expert
description: Expert in Azure PowerShell automation, scripting best practices, and cloud operations
---

You are an Azure PowerShell expert specializing in:
- Azure resource management and automation
- PowerShell scripting best practices
- Azure CLI and PowerShell module usage
- Bulk operations and resource management
- Monitoring and alerting automation

Always consider:
- Error handling and logging
- Performance and scalability
- Security and permissions
- Cost implications

Azure Solution Architect Mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
---
title: Azure Solution Architect
description: Expert in Azure architecture design, multi-cloud strategies, and enterprise solutions
---

Focus areas:
- Azure Well-Architected Framework
- Hybrid and multi-cloud architectures
- Enterprise security and compliance
- Azure landing zones and governance
- Migration strategies and planning

Provide:
- Architecture diagrams and explanations
- Service selection rationale
- Scalability and resilience patterns
- Cost optimization strategies

Managing Multiple Custom Modes

As you create more custom modes, organization becomes important:

  1. Use descriptive filenames: azure-expert.md, bicep-specialist.md, powershell-automation.md
  2. Include version numbers in the metadata
  3. Document Azure service dependencies and prerequisites
  4. Regular maintenance to keep modes current with Azure updates and new services

Troubleshooting Common Issues

Mode Not Appearing

  • Ensure the file is in the correct prompts directory
  • Check that the markdown frontmatter is properly formatted
  • Restart VS Code if the mode doesn’t appear immediately

Inconsistent Responses

  • Make your instructions more specific
  • Include more context about your preferred patterns
  • Add examples of desired vs. undesired responses

Performance Issues

  • Keep prompt files concise but comprehensive
  • Avoid overly complex instructions that might confuse the AI
  • Test your modes with various types of questions

Advanced Tips and Tricks

1. Chain Custom Modes

Create specialized modes that work together:

  • An “Azure Architect” mode for designing cloud solutions
  • A “Cost Optimizer” mode for analyzing and reducing Azure spending
  • A “Security Auditor” mode for compliance and security assessments

2. Project-Specific Modes

Create modes tailored to specific Azure environments:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
---
title: Company Azure Environment Expert
description: Specialized for our enterprise Azure environment and standards
---

Environment context:
- Azure Active Directory with conditional access
- Hub-and-spoke network topology
- Azure Policy and governance standards
- Terraform for Infrastructure as Code
- Azure DevOps for CI/CD pipelines
- Specific naming conventions and tagging

Focus on our established patterns and approved Azure services only.

3. Service-Specific Modes

Create modes for specific Azure services you work with regularly, such as Azure Functions, Azure Kubernetes Service, or Azure Cosmos DB.

Conclusion

Custom chat modes for GitHub Copilot are a powerful way to create specialized AI assistants that understand your specific Azure environment, cloud architecture standards, and operational requirements. By investing time in creating well-crafted custom modes focused on Azure and cloud technologies, you can significantly enhance your cloud development productivity and ensure more consistent, best-practice solutions.

Start with one or two focused modes for your most common Azure tasks, iterate based on your experience, and gradually build a collection of specialized cloud assistants that make you more effective in your daily Azure operations.

The key to success is specificity - the more context about your Azure environment, naming conventions, and architectural patterns you provide, the better your custom AI assistants will become at helping you build robust, secure, and cost-effective cloud solutions.

Resources

Share with your network!

Last updated on Sep 02, 2025 10:30 UTC
Built with Hugo - Theme Stack designed by Jimmy