Skip to content

Commit 3b0b29d

Browse files
adegeoCopilotCopilot
authored
Updates to GHCP app mod (#52881)
* Update GitHub Copilot modernization docs with latest features - Update overview.md with 8 scenarios, VB support, new project types, four-phase workflow, upgrade strategies, flow modes, state management - Update install.md with correct VS Code extension name, VB support - Update faq.yml with new scenarios, version matrix, new Q&As - Update how-to-upgrade with upgrade options phase, flow modes - Create concepts.md covering scenarios, skills, tasks, workflow, state management, flow modes, and resumability - Create scenarios-and-skills.md with full reference of 8 scenarios and 30+ built-in migration skills organized by domain - Create best-practices.md with preparation, collaboration, pitfalls, recovery, security, and performance guidance - Create troubleshooting.md covering workflow, build, Git, performance, and customization issues - Update toc.yml and index.yml with new articles Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add customization and working-with-agent articles - Create customization.md covering custom skills, custom scenarios, scenario artifact editing, chat customization, source control/branching, and skill loading priority with real-world examples - Create working-with-agent.md covering collaboration patterns, teaching preferences/corrections, flow modes, mid-session corrections, multi-session workflows, reviewing work, and quick reference phrase table - Update toc.yml and index.yml with both new articles - Update output.md with fact-check entries for both articles Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix scenarios-and-skills.md per review feedback - Shorten title for SEO compliance - Add periods to all scenario table 'What it does' rows - Fix 'end to end' to 'end-to-end' - Replace em-dashes with colons in section headings - Add CoreWCF GitHub link Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Change from four-phase to three-phase workflow Remove assessment as a numbered phase. Assessment is now described as a preliminary step the agent performs before the three phases (upgrade options, planning, execution) begin. Updated across all 6 affected files: overview.md, concepts.md, how-to-upgrade-with-github-copilot.md, best-practices.md, troubleshooting.md, and working-with-agent.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add intro text between consecutive H2/H3 headings Add brief introductory paragraphs between H2 and H3 headings in best-practices.md (5 instances) and troubleshooting.md (4 instances) to comply with docs style requirement that consecutive headings must have content between them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Apply best-practices.md review feedback - Add guidance to initialize a local Git repo for non-Git projects, with benefits list and example commands - Add note about editing plan.md directly with CAUTION about contradictory instructions - Add 'or stop the session manually' to agent-stuck-in-loop section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Edit pass * Remove file * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Some feedback * Editing * Another editing pass * Review comments * Feedback * Fix VSCode's bad GitHub integration... * Change type to reference --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1b764be commit 3b0b29d

14 files changed

Lines changed: 1661 additions & 80 deletions
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
---
2+
title: Best practices for GitHub Copilot modernization
3+
description: "Learn best practices for using GitHub Copilot modernization to upgrade .NET projects, including preparation, collaboration tips, common pitfalls, and recovery strategies."
4+
ms.topic: best-practice
5+
ms.date: 04/06/2026
6+
ai-usage: ai-assisted
7+
8+
#customer intent: As a developer, I want to follow best practices when using GitHub Copilot modernization so that I can get the best results from my .NET upgrades and avoid common problems.
9+
10+
---
11+
12+
# Best practices for GitHub Copilot modernization
13+
14+
Follow these guidelines to get the best results from GitHub Copilot modernization when upgrading and migrating .NET projects.
15+
16+
## Before you start
17+
18+
Prepare your projects before starting an upgrade to get the best results.
19+
20+
### Verify that your solution builds and tests pass
21+
22+
The agent validates changes it makes by running builds and tests. If your solution is already broken before you start, the agent can't distinguish pre-existing failures from problems it introduced.
23+
24+
Document any known test failures in `scenario-instructions.md` so the agent knows to ignore them.
25+
26+
### Commit or stash uncommitted work
27+
28+
Start with a clean working directory to avoid mixing your uncommitted changes with the agent's modifications. A clean baseline makes it easier to review or revert changes.
29+
30+
```console
31+
git stash
32+
git status
33+
```
34+
35+
### Back up non-Git repositories
36+
37+
The agent also works with folders that aren't under source control. If your project isn't in a Git repository, the agent skips branch and commit operations. If so, back up your project folder before starting so you can restore it if needed.
38+
39+
Consider initializing a local Git repository before starting the upgrade, even if you don't push to a cloud provider. A local Git repository lets you:
40+
41+
- Roll back individual changes with `git revert`.
42+
- Track upgrade progress step by step in the commit history.
43+
- Control which changes to keep or discard.
44+
- Keep your original code safe on the main branch while the agent works on a separate branch.
45+
46+
```console
47+
cd your-project-folder
48+
git init
49+
git add .
50+
git commit -m "Baseline before upgrade"
51+
```
52+
53+
### Review your test coverage
54+
55+
The agent relies on tests to validate that its changes don't break behavior. Projects with good test coverage get higher-confidence upgrades.
56+
57+
> [!TIP]
58+
> You don't need 100% coverage. Focus on code the upgrade is most likely to change, such as API boundaries, serialization, database access, and authentication.
59+
60+
### Start small
61+
62+
If this is your first time using the agent, pick a small, low-risk project as a pilot. A class library or utility project is ideal. Starting small lets you understand the workflow, build confidence, and discover any repo-specific issues before tackling your main application.
63+
64+
## During the upgrade
65+
66+
Follow these guidelines while the agent works through your upgrade.
67+
68+
### Use guided mode for your first upgrade
69+
70+
The agent supports both guided and automatic modes. In guided mode, the agent pauses at key decision points for your review and approval. Start with guided mode to understand what the agent does and why. Switch to automatic mode once you're comfortable with the workflow.
71+
72+
### Review the assessment carefully
73+
74+
The assessment is your best opportunity to catch issues before the agent starts making changes. Look for:
75+
76+
- Projects the agent might have missed or misidentified.
77+
- Dependencies that you know are problematic.
78+
- Anything unusual about your solution that the agent should know.
79+
80+
If you spot something, tell the agent in chat or add the information to `scenario-instructions.md`. You can also edit `assessment.md` directly to add context, correct misidentified projects, or flag concerns before the agent proceeds to planning.
81+
82+
### Take time with the planning stage
83+
84+
The agent generates a plan based on its assessment. Review the plan before proceeding:
85+
86+
- Does the order make sense for your codebase?
87+
- Are there dependencies the agent might not know about?
88+
- Should any projects be excluded or handled differently?
89+
90+
Ask the agent to reorder tasks, skip projects, or change its approach. You know your codebase better than the agent, so use that knowledge. Edit the `plan.md` file directly to adjust task order, add tasks, or remove tasks.
91+
92+
> [!CAUTION]
93+
> Be careful when editing `plan.md` directly. The agent might not fully interpret your changes if they create contradictory instructions. For example, removing a dependency project while keeping the projects that depend on it.
94+
95+
### Give feedback immediately
96+
97+
The agent learns from your corrections within a session. If the agent makes a choice you disagree with:
98+
99+
- Tell it right away: _"Don't use that pattern, use X instead."_
100+
- Add persistent guidance to `scenario-instructions.md` so the agent remembers across tasks and sessions.
101+
102+
### Stay engaged during execution
103+
104+
Execution isn't hands-off. Before telling the agent to start, review `tasks.md`:
105+
106+
- Does the task order make sense for your codebase?
107+
- Are there tasks you want to skip or resequence?
108+
- Are any tasks missing?
109+
110+
Ask the agent to adjust the task list, or edit `tasks.md` directly before execution begins. Once execution starts, if the agent makes a bad call mid-task, tell it immediately — it applies your correction going forward.
111+
112+
You know your codebase better than the agent, so use that knowledge at every stage.
113+
114+
## Common pitfalls
115+
116+
Watch for these common issues that can slow down or complicate an upgrade.
117+
118+
### Large solutions with 50+ projects
119+
120+
The agent works project-by-project, so large solutions take time. Be patient and monitor progress. Consider starting with one representative project end-to-end before committing to the full solution. A single-project pilot surfaces systemic issues early.
121+
122+
### Private NuGet feeds
123+
124+
For private NuGet feeds, authenticate before starting the upgrade (for example, through your organization's credential provider or feed configuration). Without authentication, package restore failures block progress.
125+
126+
### Custom MSBuild targets and imports
127+
128+
Complex build customizations, such as custom `.targets` files, conditional imports, or non-standard build logic, can confuse the assessment and cause unexpected build failures. If your solution has these customizations, mention them in chat or in `scenario-instructions.md` so the agent can account for them.
129+
130+
### Session timeouts
131+
132+
Long-running upgrades might span multiple sessions. The agent tracks its progress in workflow files (under `.github/upgrades/`), so it can pick up where it left off. When you start a new session, mention where you were: _"Continue the .NET 10 upgrade. I was in the middle of the Data.Access project."_
133+
134+
## Collaborate effectively
135+
136+
The quality of your interaction directly affects the quality of the results.
137+
138+
### Be specific about scope
139+
140+
The more specific you are, the better the agent performs:
141+
142+
| Instead of | Try |
143+
|---|---|
144+
| _"Upgrade everything"_ | _"Upgrade the Data.Access project to .NET 10"_ |
145+
| _"Fix the build"_ | _"Fix the build error in CustomerService.cs related to the removed API"_ |
146+
| _"Migrate the database stuff"_ | _"Migrate Entity Framework 6 to EF Core in the Repository project"_ |
147+
148+
### Share your constraints
149+
150+
Tell the agent about real-world constraints upfront:
151+
152+
- _"We can't break backward compatibility for the public API."_
153+
- _"We have a release deadline in two weeks, so prioritize the web projects."_
154+
- _"The legacy reporting module should be excluded from this upgrade."_
155+
156+
### Explain your architecture
157+
158+
The agent analyzes code structure, but it doesn't know your team's mental model. Help the agent understand:
159+
160+
- _"Project A is our shared library. B, C, and D all depend on it."_
161+
- _"The WebApi project is our public-facing API; Internal.Api is for internal services only."_
162+
- _"The Models project is auto-generated from our OpenAPI spec. Don't modify it directly."_
163+
164+
### Ask why
165+
166+
The agent can explain its reasoning. If a decision doesn't look right, ask:
167+
168+
- _"Why did you choose bottom-up order?"_
169+
- _"Why are you upgrading this package to version X instead of Y?"_
170+
- _"Why did you break this into sub-tasks?"_
171+
172+
Understanding the reasoning helps you give better feedback.
173+
174+
### Save preferences early
175+
176+
If you have strong preferences about coding style, patterns, or approaches, add them to `scenario-instructions.md` in the first session. This file persists across sessions and is always in the agent's context, making it the most reliable way to influence behavior.
177+
178+
## Recover from problems
179+
180+
Use these strategies when the upgrade doesn't go as expected.
181+
182+
### Build failures after a task
183+
184+
Tell the agent: _"The build is failing after the last task."_ The agent analyzes the error and attempts to fix it. If the agent can't resolve the issue:
185+
186+
1. Provide a manual fix and tell the agent what you did. The agent learns from your fix.
187+
1. Revert the commit (`git revert` or reset to the previous commit) and ask the agent to try a different approach.
188+
1. Skip the problematic task and come back to it later.
189+
190+
### Wrong strategy chosen
191+
192+
If the agent's overall approach doesn't work for your codebase, restart the planning stage:
193+
194+
- _"Let's redo the plan. I want to upgrade the web projects first instead of bottom-up."_
195+
- _"Change the strategy to upgrade all shared libraries in one batch."_
196+
197+
### Agent stuck in a loop
198+
199+
If the agent repeats the same fix without progress, say _"Stop"_ and describe what you're observing, or stop the session manually. The agent can reset its approach and try something different.
200+
201+
### Undo all changes
202+
203+
If you used a Git branch for the upgrade, undo everything by switching back to your original branch:
204+
205+
```console
206+
git checkout your-original-branch
207+
git branch -D upgrade-branch
208+
```
209+
210+
Your original code is untouched. If you're working without source control, restore from the backup you made before starting.
211+
212+
## Security and privacy
213+
214+
- **Code snippets**: GitHub Copilot processes these according to [GitHub's Copilot privacy policy](https://docs.github.com/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-chat-in-your-ide) and doesn't retain them beyond the immediate session.
215+
- **Workflow files** (`scenario-instructions.md`, custom tasks, preferences) stay in your repository under `.github/upgrades/`. GitHub doesn't transmit these files to external services.
216+
- **The `.github/upgrades/` folder** is part of your repository. Commit the folder because it contains your upgrade progress and state. The agent needs the folder to resume work across sessions. You can remove it after the upgrade is complete.
217+
- **Telemetry**: Disable through your IDE's telemetry settings.
218+
219+
## Performance tips
220+
221+
- **Close unnecessary files and tabs**: The agent analyzes the active workspace, and fewer open files means less noise.
222+
- **Upgrade in stages for very large solutions**: Rather than upgrading all projects at once, batch them. For example, upgrade all libraries first, then all web projects, then tests.
223+
- **Use build caching**: The agent runs many incremental builds during validation. Warm build caches make validation significantly faster. Avoid cleaning the build output between tasks.
224+
225+
## Related content
226+
227+
- [What is GitHub Copilot modernization?](overview.md)
228+
- [Upgrade a .NET app with GitHub Copilot modernization](how-to-upgrade-with-github-copilot.md)
229+
- [Core concepts](concepts.md)
230+
- [Troubleshoot GitHub Copilot modernization](troubleshooting.md)

0 commit comments

Comments
 (0)