diff --git a/docs/ide/copilot-specialized-agents.md b/docs/ide/copilot-specialized-agents.md index 8e73226ee0a..ca8f3706957 100644 --- a/docs/ide/copilot-specialized-agents.md +++ b/docs/ide/copilot-specialized-agents.md @@ -8,7 +8,7 @@ ms.author: mikejo ms.subservice: ai-tools ms.collection: ce-skilling-ai-copilot -ms.custom: awp +ms.custom: awp, doc-kit-assisted ai-usage: ai-assisted ms.update-cycle: 180-days monikerRange: '>= vs-2022' @@ -52,6 +52,7 @@ Each built-in agent focuses on a specific developer workflow. These agents integ | Agent | Description | | ----- | ----------- | | **@debugger** | Goes beyond reading error messages. Uses your call stacks, variable state, and diagnostic tools to walk through error diagnosis systematically across your solution. | +| **@git** | Reviews your local uncommitted changes and surfaces feedback as inline comments in the editor and in the Git Changes experience. | | **@profiler** | Connects to Visual Studio's profiling infrastructure to identify bottlenecks and suggest targeted optimizations grounded in your codebase, not generic advice. | | **@test** | Generates unit tests tuned to your project's framework and patterns, not boilerplate that your CI rejects. | | **@modernize** | (.NET and C++ only) Handles framework and dependency upgrades with awareness of your actual project graph. Flags breaking changes, generates migration code, and follows your existing patterns. | @@ -65,6 +66,8 @@ Each built-in agent focuses on a specific developer workflow. These agents integ | ----- | ----------- | | **@profiler** | Connects to Visual Studio's profiling infrastructure to identify bottlenecks and suggest targeted optimizations grounded in your codebase, not generic advice. | +::: moniker-end + :::moniker-end :::moniker range="visualstudio" @@ -85,6 +88,23 @@ The @debugger agent helps you diagnose errors systematically by analyzing your d ::: moniker-end +:::moniker range="visualstudio" + +### Use the @git agent + +Use the @git agent to review local uncommitted changes without leaving Copilot Chat. + +**Example prompts**: + ++ `@git Review my changes` ++ `@git Explain this review comment and suggest a fix` + +:::image type="content" source="../version-control/media/visualstudio/git-agent-code-review-icebreaker.png" alt-text="Screenshot showing Copilot Chat with the Git agent and Review changes option highlighted."::: + +For the full local review workflow, see [Review local changes with Copilot Chat](../version-control/git-make-commit.md#review-local-changes-with-copilot-chat). + +::: moniker-end + ### Use the @profiler agent The @profiler agent connects to Visual Studio's profiling tools to help identify and fix performance issues. diff --git a/docs/version-control/git-make-commit.md b/docs/version-control/git-make-commit.md index 4359c01e4e1..e526d45e0f3 100644 --- a/docs/version-control/git-make-commit.md +++ b/docs/version-control/git-make-commit.md @@ -137,25 +137,29 @@ The **Git Changes** window also shows a list of all Copilot review comments, org ![Screenshot showing code review comments for each file in the Git Changes window.](./media/visualstudio/local-code-review-comment-list-cropped.png) -:::moniker-end +#### Review from the Git agent in Copilot Chat -:::moniker range="vs-2022" +In Copilot Chat, switch to the **Git** agent. You can select it from the agent picker or type `@git` in the chat input. -In the **Git Changes** window, select the **Review changes with Copilot** button, which looks like a comment icon with a sparkle. +![Screenshot showing the Git agent description card in Copilot Chat.](./media/visualstudio/git-agent-code-review-description.png) -After a few moments, a link showing the number of code review comments appears in the **Git Changes** window that you can select to view and navigate the comments. If no issues are detected, the message **Copilot did not comment on any files** appears. +Ask the agent to review your changes. You can use the suggested **Review changes** prompt or type your own. -![Screenshot showing Git Changes window with Review changes button.](./media/vs-2022/git-code-review-changes-button.png) +![Screenshot showing Copilot Chat with the Git agent and Review changes option highlighted.](./media/visualstudio/git-agent-code-review-icebreaker.png) -The code review feedback shows up as comments, which show brief summary of the potential problem, and you can decide to make a change, or dismiss the comment box by using the up arrow button on the top right of the comment box. +The agent analyzes your uncommitted changes by using GitHub Copilot code review. After the service returns a result, a link showing the number of code review comments appears in the **Git Changes** window. Select the link to view and navigate comments. If no issues are detected, the message **Copilot did not comment on any files** appears. -![Screenshot showing GitHub code review comment.](./media/vs-2022/git-code-review-comment.png) +The review feedback appears inline in the editor and in the **Git Changes** comment list. You can continue the conversation in chat to ask for explanations, discuss findings, and work through suggested edits. -To remove all comments, use the **X** in the Git Changes window to close the Copilot code review link. +![Screenshot showing an inline code review comment from the Git agent in the editor.](./media/visualstudio/git-agent-code-review-comment-2.png) -:::moniker-end +To remove all comments, use the **X** in the **Git Changes** window to close the Copilot code review link. -:::moniker range="visualstudio" +##### Navigate comments for Git agent reviews + +The **Git Changes** window also shows a list of all Copilot review comments, organized by file. You can double-click any comment in the list to navigate directly to that comment located inline with the corresponding code in the editor. + +![Screenshot showing code review comments for each file in the Git Changes window.](./media/visualstudio/local-code-review-comment-list-cropped.png) ### Apply suggestions from local code review @@ -171,6 +175,22 @@ You can also apply code suggestions from [pull request comments](git-create-pull :::moniker-end +:::moniker range="vs-2022" + +In the **Git Changes** window, click on the **Review changes with Copilot** button, which looks like a comment icon with a sparkle. + +After a few moments, a link showing the number of code review comments appears in the **Git Changes** window that you can click on to view and navigate the comments. If no issues are detected, the message **Copilot did not comment on any files** appears. + +![Screenshot showing Git Changes window with Review changes button.](./media/vs-2022/git-code-review-changes-button.png) + +The code review feedback shows up as comments, which show brief summary of the potential problem, and you can decide to make a change, or dismiss the comment box by using the up arrow button on the top right of the comment box. + +![Screenshot showing GitHub code review comment.](./media/vs-2022/git-code-review-comment.png) + +To remove all comments, use the **X** in the **Git Changes** window to close the Copilot code review link. + +:::moniker-end + ## Revert, reset, or amend a commit When you double-click a **Commit**, Visual Studio opens its details in a separate tool window. From here you can revert the commit, reset (undo) the commit, amend the commit message, or create a tag on the commit. When you select a changed file in the commit, Visual Studio opens the side-by-side **Diff** view of the commit and its parent. diff --git a/docs/version-control/media/visualstudio/git-agent-code-review-description.png b/docs/version-control/media/visualstudio/git-agent-code-review-description.png new file mode 100644 index 00000000000..c0de6a5022e Binary files /dev/null and b/docs/version-control/media/visualstudio/git-agent-code-review-description.png differ diff --git a/docs/version-control/media/visualstudio/git-agent-code-review-icebreaker.png b/docs/version-control/media/visualstudio/git-agent-code-review-icebreaker.png new file mode 100644 index 00000000000..6c13ee6ab8c Binary files /dev/null and b/docs/version-control/media/visualstudio/git-agent-code-review-icebreaker.png differ