Lesson 3 of 40
AI & Copilot
Intermediate
40 min
GitHub Copilot Agent Mode
Master GitHub Copilot's Agent Mode in VS 2026 — let AI plan and execute multi-step coding tasks across your entire solution.
Part 1: What is Agent Mode?
Agent Mode elevates Copilot from a suggestion engine to an autonomous programming assistant. In Agent Mode, Copilot can:
- Read and understand your entire solution context
- Create, edit, and delete files
- Run terminal commands to build and test
- Iterate until tests pass
Part 2: Writing Effective Agent Prompts
Be descriptive about goals, not implementation:
// ❌ Too vague
"Add a user feature"
// ✅ Specific goal with constraints
"Create a UserProfile component in React with TypeScript.
Include avatar upload, name/email editing, and validation.
Use the existing AuthContext. Add unit tests with Vitest."
"Add a user feature"
// ✅ Specific goal with constraints
"Create a UserProfile component in React with TypeScript.
Include avatar upload, name/email editing, and validation.
Use the existing AuthContext. Add unit tests with Vitest."
Part 3: Reviewing Agent Changes
Agent Mode shows a Change Summary before applying edits. Each file shows a diff with:
- Green additions, red removals
- AI reasoning annotations
- Risk indicators (breaking changes flagged)
Part 4: Agent Mode Best Practices
| Do | Avoid |
|---|---|
| Commit before large Agent tasks | Running Agent on uncommitted work |
| Specify test frameworks to use | Vague feature requests |
| Review all diffs carefully | Blind "Apply All" on critical code |
| Break large tasks into phases | Asking Agent to rewrite entire apps at once |