This guide will help you set up and use your custom AI agents across all your projects in VS Code.
- Quick Start
- Setting Up Agents in Projects
- Using Agents in VS Code
- Managing Your Agents
- Troubleshooting
- Reference
When you create a new Git repository, agents are automatically included:
mkdir my-new-project
cd my-new-project
git init✅ Done! Your agents are automatically linked via the Git template.
Navigate to your project and run:
cd /path/to/existing/project
setup-agents✅ Done! Your agents are now available in this project.
Step 1: Open a terminal and navigate to your project:
cd /path/to/your/projectStep 2: Run the setup command:
setup-agentsWhat happens:
- Creates
.githubdirectory if it doesn't exist - Creates symlinks to your global agents in
~/chatmodes/ - Links are created in both
.github/agents/and.github/chatmodes/for compatibility
Output:
✅ Agents linked to ./github/agents
✅ Chatmodes linked to ./.github/chatmodes
Step 1: Navigate to your project:
cd /path/to/your/projectStep 2: Run the alias:
link-agentsOutput:
✅ Agents linked!
Step 1: Run the script from anywhere:
~/setup-agents.sh /path/to/your/projectOr from within the project:
cd /path/to/your/project
~/setup-agents.shAfter setup, verify the agents are linked:
# Check the symlinks
ls -la .github/
# You should see:
# agents -> /home/krishnan/chatmodes
# chatmodes -> /home/krishnan/chatmodes
# List available agents
ls .github/agents/code /path/to/your/projectOr open VS Code and use File → Open Folder
If using GitHub Copilot:
- Press
Ctrl+Shift+I(orCmd+Shift+Ion Mac) to open Copilot Chat - Or click the chat icon in the activity bar
In the chat input box:
- Type
@to see available agents - Or type
@agent-namedirectly
Available agents include:
@python-coding-agent- Python development with PEP8@java-coding-agent- Java with OOP and design patterns@typescript-coding-agent- TypeScript with type safety@javascript-coding-agent- Modern JavaScript ES6+@react-coding-agent- React components and hooks@nodejs-coding-agent- Node.js backend development@rust-coding-agent- Rust with safety and performance@go-coding-agent- Go with concurrency@cpp-coding-agent- Modern C++ standards@aws-cloud-agent- AWS infrastructure and IaC@azure-cloud-agent- Azure solutions and deployments@gcp-cloud-agent- Google Cloud Platform@sql-coding-agent- SQL optimization@postgresql-coding-agent- PostgreSQL features@mongodb-coding-agent- MongoDB schema design@code-review- Senior developer code reviews@debugging-assistant- Systematic debugging help@test-generator- Comprehensive test generation@security-review- Security vulnerability analysis@documentation-writer- Code documentation@api-design-advisor- REST API design@learning-explainer- Teaching and explanations@staff-engineer- Technical leadership- And many more!
Example 1: Python Code Review
@python-coding-agent Review this function for PEP8 compliance and suggest improvements:
def calculate(x,y):
result=x+y
return result
Example 2: Debug a Problem
@debugging-assistant I'm getting a "TypeError: Cannot read property 'name' of undefined"
in my React component. Here's the code:
[paste your code]
Example 3: Generate Tests
@test-generator Create comprehensive unit tests for this function:
[paste your function]
Each agent provides:
- Detailed analysis based on their expertise
- Code examples and suggestions
- Best practices specific to their domain
- Step-by-step instructions when needed
All agents are stored in: ~/chatmodes/
To update an agent:
Step 1: Edit the agent file:
code ~/chatmodes/python-coding-agent.chatmode.mdStep 2: Modify the prompt section:
prompt: |
Your updated instructions here...Step 3: Save the file
✅ All projects automatically get the update because they use symlinks!
Step 1: Create a new file in ~/chatmodes/:
cd ~/chatmodes
code my-new-agent.chatmode.mdStep 2: Use this template:
name: my-new-agent
description: Brief description of what this agent does
prompt: |
You are an expert in [domain].
[Detailed instructions for the agent...]
[Best practices...]
[Guidelines...]
settings:
temperature: 0.2
max_tokens: 512Step 3: Save the file
✅ The new agent is immediately available in all projects!
Simply delete or rename the agent file:
rm ~/chatmodes/unwanted-agent.chatmode.md
# Or rename it to disable
mv ~/chatmodes/old-agent.chatmode.md ~/chatmodes/old-agent.chatmode.md.disabledls ~/chatmodes/*.chatmode.mdOr with descriptions:
grep -H "description:" ~/chatmodes/*.chatmode.mdSolution 1: Restart VS Code
# Close VS Code completely and reopen
code /path/to/your/projectSolution 2: Verify symlinks exist
cd /path/to/your/project
ls -la .github/
# Should show:
# agents -> /home/krishnan/chatmodes
# chatmodes -> /home/krishnan/chatmodesSolution 3: Re-run setup
rm -rf .github/agents .github/chatmodes
setup-agentsSolution 4: Check GitHub Copilot extension
- Ensure GitHub Copilot is installed and enabled
- Check you're logged into GitHub
- Verify Copilot has access to custom agents
Solution: Reload your bash configuration
source ~/.bashrcOr open a new terminal window.
Solution: Each project needs its own setup
cd /path/to/other/project
setup-agentsSolution 1: Verify you're editing the right file
# Check where the symlink points
readlink -f .github/agents
# Should show: /home/krishnan/chatmodesSolution 2: Restart VS Code after making changes
Solution 3: Clear VS Code cache (rare)
rm -rf ~/.config/Code/Cache/*Solution: Check file permissions
chmod 644 ~/chatmodes/*.chatmode.md
chmod 755 ~/chatmodes# Setup agents in current directory
setup-agents
# Setup agents in specific directory
setup-agents /path/to/project
# Quick link in current directory
link-agents
# Standalone script
~/setup-agents.sh
# List all agents
ls ~/chatmodes/*.chatmode.md
# Search for specific agent
ls ~/chatmodes/ | grep python
# View agent configuration
cat ~/chatmodes/python-coding-agent.chatmode.md| Item | Location |
|---|---|
| Agent Files | ~/chatmodes/*.chatmode.md |
| Setup Script | ~/setup-agents.sh |
| Bash Functions | ~/.bashrc (at the end) |
| Git Template | ~/.git-templates/.github/ |
| Project Agents | .github/agents/ (symlink) |
| Project Chatmodes | .github/chatmodes/ (symlink) |
name: agent-name # Unique identifier (no spaces)
description: One-line description # Brief description
prompt: | # Multi-line prompt
Main instructions...
**Section:**
- Details
- More details
Best practices...
settings:
temperature: 0.2 # 0.0-1.0 (lower = more focused)
max_tokens: 512 # Max response lengthAgent Naming:
- Use lowercase with hyphens:
python-coding-agent - Be descriptive but concise
- Use consistent naming pattern
Prompt Writing:
- Start with clear role definition
- Organize with headers (**, ##, etc.)
- Include specific guidelines and examples
- Specify expected output format
- Add edge cases and constraints
Temperature Settings:
0.2- Focused, deterministic (code, reviews)0.3- Balanced (debugging, explanations)0.4- Creative (brainstorming, ideation)0.5+- More creative (rarely needed)
- Main README:
~/chatmodes/README.md - Global Setup Guide:
~/chatmodes/GLOBAL_SETUP_GUIDE.md - This Guide:
~/chatmodes/USER_GUIDE.md
Match the agent to your task:
- Coding: Use language-specific agents
- Reviewing: Use
@code-reviewor@security-review - Learning: Use
@learning-explainer - Debugging: Use
@debugging-assistant
Give agents enough information:
@python-coding-agent I need to parse a large CSV file (500MB) efficiently.
The file has 1M rows and 20 columns. I need to:
- Read it in chunks
- Filter rows based on conditions
- Write results to a database
Follow up with clarifying questions:
Can you show how to handle errors when the CSV is malformed?
What about memory optimization for even larger files?
Use multiple agents for different aspects:
- Generate code with
@python-coding-agent - Review it with
@code-review - Add tests with
@test-generator - Check security with
@security-review
Agents provide educational value:
- Read their explanations thoroughly
- Understand the "why" behind suggestions
- Apply learned patterns to future work
setup-agents # Setup in current directory
setup-agents ~/project # Setup in specific directory
link-agents # Quick setup (current dir)
ls .github/agents/ # List available agentsCtrl+Shift+I # Open Copilot Chat
@agent-name # Use specific agent
Tab # Accept suggestion
New Project:
mkdir project && cd project
git init
code .
# Agents ready!Existing Project:
cd existing-project
setup-agents
code .
# Agents ready!Update Agent:
code ~/chatmodes/python-coding-agent.chatmode.md
# Edit and save
# All projects updated!If you encounter issues not covered in this guide:
- Check symlinks:
ls -la .github/ - Verify agents exist:
ls ~/chatmodes/ - Restart VS Code
- Re-run setup:
setup-agents - Check Copilot status: Ensure extension is active
Happy coding with your AI agents! 🚀
Last updated: January 2, 2026