How to set up and use Copilot's AI agents for real coding work — from inline completions to autonomous multi-file changes.
This is your project's AI constitution. Create .github/copilot-instructions.md to set coding standards, architecture constraints, and naming conventions. Applied to every Copilot suggestion.
Encode repeatable patterns as reusable agent knowledge. A skill is a SKILL.md file plus optional scripts.
| Location | Purpose |
|---|---|
.github/skills/extract-service/SKILL.md |
Step-by-step service extraction pattern |
.github/skills/add-endpoint/SKILL.md |
API endpoint scaffolding with tests |
.github/skills/migrate-db/SKILL.md |
Safe database migration workflow |
Connect Copilot to external data. Configure in .vscode/mcp.json.
| Connection | What It Provides |
|---|---|
| PostgreSQL / SQL Server | Query schemas and data directly in context |
| Jira / Azure DevOps | Pull ticket details and requirements |
| Confluence / Wiki | Access documentation and architecture decisions |
| Custom internal APIs | Domain-specific data and operations |
| Feature | Agent Mode (VS Code) | Coding Agent (GitHub.com) |
|---|---|---|
| Where | VS Code, local | GitHub.com, cloud |
| Trigger | Chat panel, Ctrl+I | Assign issue to @copilot |
| Scope | Multi-file, runs terminal | Full repo, creates branch + PR |
| Supervision | You watch in real-time | Asynchronous, review the PR |
| Best for | Complex tasks you want to steer | Well-defined issues, autonomous work |
1. Refactoring:
2. Feature implementation:
3. Multi-file scaffolding:
Agent mode's real power is its feedback loop. It runs terminal commands (build, test, lint), reads the output, and self-corrects. Make sure your project has: a working build command, runnable tests, and a linter. The better your harness, the better the agent performs.