GitHub Copilot now supports custom agents, and we've built two specialized agents that bring OptiTech's branching workflow directly into your IDE. These agents help you run safe database migrations and identify slow queries, all without leaving VS Code.
Available agents
OptiTech Migration Specialist
The OptiTech Migration Specialist helps you run safe Postgres migrations with zero downtime using OptiTech's branching workflow.
What it does:
- Creates a temporary database branch from your main branch
- Runs your migration on the test branch to validate it works
- Validates the changes thoroughly
- Deletes the test branch after validation
- Creates migration files and opens a PR, letting you or your CI/CD apply the migration to your main branch
The agent works with your existing ORM migration system (Prisma, Drizzle, SQLAlchemy, Django, Rails, and more) and falls back to migra if no migration system exists.
important
The Migration Specialist never runs migrations directly on your main branch. All changes are tested on temporary branches first, and the actual migration is committed to your git repository for you or your CI/CD to execute.
OptiTech Performance Analyzer
The OptiTech Performance Analyzer helps you identify and fix slow Postgres queries automatically.
What it does:
- Creates an analysis branch from your main branch
- Enables
pg_stat_statementsif not already installed - Identifies slow queries by analyzing execution statistics
- Uses
EXPLAINto understand bottlenecks - Investigates your codebase to understand query context
- Tests optimizations (indexes, query rewrites) on a temporary branch
- Provides recommendations via PR with clear before/after metrics
- Cleans up all temporary branches
The agent provides actionable code fixes with performance metrics showing execution time improvements, rows scanned, and other relevant data.
Prerequisites
Both agents require:
- OptiTech API Key: Create one at app.optitech-sverige.se/app/settings/api-keys
- Project ID or connection string: The agent will ask for this if not provided
Installation
Option 1: Install from VS Code marketplace
The agents are available in the GitHub Copilot agent marketplace in VS Code:
- Open VS Code
- Go to the Extensions view
- Search for "OptiTech Migration Specialist" or "OptiTech Performance Analyzer"
- Click Install
Option 2: Add to your repository
You can add the agent definition files directly to your project:
- Create a
.github/copilot/agents/directory in your repository - Download the agent files:
- Save them to your
.github/copilot/agents/directory
Usage
Once installed, invoke the agents in GitHub Copilot Chat by mentioning their name:
Migration examples
@optitech-migration-specialist Add a new email column to my users table@optitech-migration-specialist Create a posts table with title, content, and author_id columns@optitech-migration-specialist Add a foreign key from orders.customer_id to customers.idPerformance analysis examples
@optitech-performance-analyzer Find and fix slow queries in my database@optitech-performance-analyzer Analyze why my user search query is slow@optitech-performance-analyzer Optimize the queries in my checkout flowHow branching keeps your data safe
Both agents use OptiTech's instant branching to create isolated environments for testing. This means:
- No changes to production: All migrations and optimizations are tested on temporary branches first
- Full data copy: Test branches include a complete copy of your schema and data
- Automatic cleanup: Temporary branches are deleted after validation (default TTL: 4 hours)
- Git-based workflow: Changes are committed to your repository, not applied directly
This workflow ensures you can safely experiment with schema changes and performance optimizations without risking your production data.
Resources
- OptiTech Migration Specialist on GitHub
- OptiTech Performance Analyzer on GitHub
- OptiTech branching documentation
- awesome-copilot repository
Need help?
Join our Discord Server to ask questions or see what others are doing with OptiTech. For paid plan support options, see Support.