Use Copilot agent mode for multi-step coding work
Hand Copilot agent mode larger coding jobs that need file selection, command runs, and repeated fixes, not just quick text edits.
- What they did
- A commenter described using GitHub Copilot’s agent mode for involved programming tasks where the agent has to choose which files matter, inspect the codebase, run commands, and keep revising its work. They said it helps most on jobs like version upgrades, test coverage work, refactors, debugging, and build errors. One example started with plan mode to map out a technology upgrade and unit-test changes, then switched to agent mode to carry out the implementation.
- How it went
- Several commenters reported good results on multi-file refactors and on fixing compile or test failures. They also noted that small, obvious edits can still take longer than just doing them by hand.
- Tips
- Give the agent repo-specific instructions, and add instruction files, prompts, skills, or custom agents when a project needs repeated context. Use a pause-and-confirm step before any action that would send, delete, or submit something.
Try it yourself with GitHub Copilot
In GitHub Copilot agent mode, handle this task in my [repo]: [describe the coding task]. First inspect the relevant files, choose the ones you need to edit, and run the commands needed to build and test your changes. Keep working through failures and update the code until [tests pass / the feature works]. Before you make any irreversible change such as deleting files, submitting code, or triggering a deployment, stop and ask me to approve it. Do not modify [files or folders to avoid]. When you finish, give me a concise list of every file you changed and the main edits in each one.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Use Copilot to draft a hard Flutter function
A developer had GitHub Copilot write a tricky Flutter function, then checked it with their own tests and harness.
Use Copilot to handle small site edits in draft PRs
A developer handed GitHub Copilot two minor website tweaks and got back separate draft pull requests that were easy to test and merge.
Assign a GitHub issue to Copilot and review the PR
A developer used GitHub Copilot to tackle a backlog issue, then checked its branch choice, tests, and pull request before deciding what to merge.
Use Copilot to assemble a FastAPI image browser
A developer asked GitHub Copilot Agent Mode for one FastAPI app and got a working image browser back.
Split development work into phases before using Copilot
A developer plans features in stages first, then feeds the approved steps to GitHub Copilot instead of asking it to make all architecture decisions at once.
Create a filtered summary page with Copilot
Copilot agent mode in Visual Studio 2022 built a charges report in a Razor Pages app, added navigation, and drafted the commit steps.