{"id":57933,"date":"2025-09-03T10:05:00","date_gmt":"2025-09-03T17:05:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=57933"},"modified":"2025-09-03T09:25:36","modified_gmt":"2025-09-03T16:25:36","slug":"copilot-coding-agent-dotnet","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/copilot-coding-agent-dotnet\/","title":{"rendered":"Let Copilot Coding Agent handle the busy work"},"content":{"rendered":"<p>The GitHub Copilot Coding Agent changes how .NET developers get work done. Beyond inline suggestions, it can analyze your repo, plan multi\u2011step tasks, create issues and pull requests, and carry changes across projects\u2014all in the cloud. In this post, we\u2019ll show two concrete scenarios using the eShopLite sample: automatically creating missing unit tests and implementing a new feature starting from a PRD.<\/p>\n<h2>Accelerating .NET Development with GitHub Copilot Coding Agent<\/h2>\n<p>The .NET ecosystem continues to evolve, and AI-powered tools are starting to play a key role in how developers build, test, and maintain their applications. One of the most exciting opportunities for .NET developers is the GitHub Copilot Coding Agent.<\/p>\n<p>Unlike the classic Copilot inline completions, the Coding Agent will work on the cloud, and it can take on <strong>multi-step tasks<\/strong>, coordinate with GitHub repositories, and even create issues and pull requests on your behalf. This transforms Copilot from being a \u201cpair programmer\u201d into an <strong>automation agent<\/strong> that can accelerate repetitive tasks and free you to focus on architecture and innovation.<\/p>\n<p>In this post, we\u2019ll walk through two real-world scenarios using the <a href=\"https:\/\/aka.ms\/eShopLite\/repo\">eShopLite<\/a> sample solution:<\/p>\n<ol>\n<li>Automating unit test creation.<\/li>\n<li>Implementing a new feature with a Product Requirements Document (PRD).<\/li>\n<\/ol>\n<hr \/>\n<h3>Scenario 1: Automating Unit Tests with Copilot<\/h3>\n<p>As developers, we know unit tests are critical to maintainable software. But let\u2019s be honest: writing unit tests is not always the most exciting part of the job (I know, that&#8217;s maybe just me). That\u2019s where GitHub Copilot Coding Agent can help.<\/p>\n<h4>Step 1 \u2013 Identify Missing Unit Tests<\/h4>\n<p>We start by asking Copilot to analyze the solution and identify gaps in the test coverage.<\/p>\n<p><strong>Prompt used:<\/strong><\/p>\n<pre><code class=\"language-plaintext\">Analyze the current solution and propose unit tests to add in the scenario \r\n[scenarios\\01-SemanticSearch].\r\nMake a list of tests where each element has title, description, rationale, \r\naffectedFiles (paths), testMethodName, testCases (objects with name, arrange, \r\nact, assert, optional expected), dependencies (to mock), priority \r\n(High|Medium|Low), and complexity (Small|Medium|Large).\r\nKeep suggestions actionable and use repo-relative file paths.<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/09\/10-identifymissingunittests.png\" alt=\"Identify Missing Unit Tests\" \/><\/p>\n<h4>Step 2 \u2013 Review Suggested Tests<\/h4>\n<p>Copilot provides a structured proposal with clear rationales and expected outcomes. This helps developers quickly validate whether the suggested tests align with project requirements.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/09\/12-unittest-done.png\" alt=\"Suggested Unit Tests\" \/><\/p>\n<h4>Step 3 \u2013 Create GitHub Issue<\/h4>\n<p>Once we are satisfied with the list, we instruct Copilot to create a GitHub Issue that contains all the details of the missing unit tests.<\/p>\n<p><strong>Prompt used:<\/strong><\/p>\n<pre><code class=\"language-plaintext\">Given the current list of missing unit tests, create a new GitHub issue titled \r\n\"Implement missing Unit Tests\".\r\nThe new GitHub issue content should describe each missing test to be implemented later.\r\nShow the ID and URL of the new created Issue in the current repository.<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/09\/15-generate-ghissue.png\" alt=\"Generated GitHub Issue\" \/><\/p>\n<p>\ud83d\udc49 Example issue: <a href=\"https:\/\/github.com\/Azure-Samples\/eShopLite\/issues\/47\">#47 Implement missing Unit Tests<\/a><\/p>\n<p><div class=\"alert alert-primary\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Note<\/strong><\/p>In order to create the issue, we use the GitHub MCP Server tools with Copilot.<\/div><\/p>\n<h4>Step 4 \u2013 Assign to Copilot Coding Agent<\/h4>\n<p>The last step is to assign the issue to the Copilot Coding Agent. From here, Copilot automatically generates the tests, opens a pull request, and awaits human review.<\/p>\n<p><strong>Prompt used:<\/strong><\/p>\n<pre><code class=\"language-plaintext\">assign the new issue to @copilot<\/code><\/pre>\n<p>\ud83d\udc49 Example PR: <a href=\"https:\/\/github.com\/Azure-Samples\/eShopLite\/pull\/48\">#48 Add Unit Tests<\/a><\/p>\n<p>This workflow reduces the manual burden of writing boilerplate tests and helps ensure consistent test quality across the solution.<\/p>\n<hr \/>\n<h3>Scenario 2: Implementing a Feature with a Mock Payment Server<\/h3>\n<p>The second scenario demonstrates how Copilot Coding Agent can go beyond testing and actually implement new functionality. Instead of jumping directly into code, we start with a <strong>Product Requirements Document (PRD)<\/strong>.<\/p>\n<h4>Step 1 \u2013 Generate PRD<\/h4>\n<p>We ask Copilot to draft a PRD that captures the intent and requirements of adding a mock payment service.<\/p>\n<p><strong>Prompt used:<\/strong><\/p>\n<pre><code class=\"language-plaintext\">Create a new Markdown file named `04-PRD_Add_Payment_Mock_Server.md` containing a \r\nProduct Requirements Document (PRD) titled \"PRD: Add Mock Payment Server \/ Payment \r\nService to eShopLite\".\r\nKeep the document business-focused and concise. Include sections: Purpose, Scope, \r\nKey success criteria, Quick checklist, Assumptions, High-level design overview, API \r\ncontract summary, Data model summary, Implementation notes, Configuration &amp; local \r\ndefaults, Security &amp; privacy notes, Testing &amp; validation, Acceptance criteria, \r\nRollout plan, and Appendix with example request\/response JSON.<\/code><\/pre>\n<p>The generated PRD is not just filler text; it provides actionable details like endpoints, environment variables, and acceptance criteria. This ensures that both developers and stakeholders are aligned before any code is written.<\/p>\n<h4>Step 2 \u2013 Implement PRD<\/h4>\n<p>Once the PRD is approved, we pass it to Copilot Coding Agent to implement the desired features.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/09\/20-implementPRD.png\" alt=\"PRD Creation\" \/><\/p>\n<p>Copilot creates the code changes, updates configurations, and even generates UI elements where needed. It will also use MCP tools, like Playwright, to capture screenshots and validate the end-to-end experience.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2025\/09\/25-paymentPRIncludeScreenShots.png\" alt=\"Payment Service PR with Screenshots\" \/><\/p>\n<p>\ud83d\udc49 Example PR: <a href=\"https:\/\/github.com\/Azure-Samples\/eShopLite\/pull\/49\">#49 Implement Mock Payment Server<\/a><\/p>\n<p>This shows the real potential: using AI to bridge <strong>documentation, planning, and execution<\/strong>. Copilot doesn\u2019t just help you type faster\u2014it helps you ship features faster.<\/p>\n<hr \/>\n<h2>Summary<\/h2>\n<p>GitHub Copilot Coding Agent represents a shift in how .NET developers can approach productivity.<\/p>\n<ul>\n<li>For <strong>testing<\/strong>, it identifies missing coverage, creates issues, and generates PRs.<\/li>\n<li>For <strong>features<\/strong>, it translates requirements into working code via PRDs.<\/li>\n<li>For <strong>collaboration<\/strong>, it integrates seamlessly with GitHub workflows and pull requests.<\/li>\n<li>And more!<\/li>\n<\/ul>\n<p>Instead of replacing developers, it augments their workflow, automating repetitive steps and letting humans focus on creativity, design, and review.<\/p>\n<p>If you\u2019re working with .NET and haven\u2019t tried Copilot Coding Agent yet, now is the perfect time to experiment. And remember, you can customize how the Coding Agent works in your repo with AGENTS.md custom instructions\u2014see the <a href=\"https:\/\/github.blog\/changelog\/2025-08-28-copilot-coding-agent-now-supports-agents-md-custom-instructions\/\">Copilot Coding Agent changelog announcement<\/a>.<\/p>\n<p><div class=\"alert alert-danger\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--ErrorBadge\"><\/i><strong>Caution<\/strong><\/p>While Copilot can successfully implement missing unit tests and even generate new features, it is critical to carefully review the generated code before merging. Human oversight ensures code quality, security, and alignment with project standards.<\/div><\/p>\n<hr \/>\n<h2>References<\/h2>\n<ul>\n<li>eShopLite sample repository: <a href=\"https:\/\/aka.ms\/eShopLite\/repo\">eShopLite on GitHub<\/a><\/li>\n<li>10 Microsoft MCP Servers to Accelerate Your Development Workflow: <a href=\"https:\/\/devblogs.microsoft.com\/blog\/10-microsoft-mcp-servers-to-accelerate-your-development-workflow\">Read the blog post<\/a><\/li>\n<li>Copilot Coding Agent AGENTS.md custom instructions: <a href=\"https:\/\/github.blog\/changelog\/2025-08-28-copilot-coding-agent-now-supports-agents-md-custom-instructions\">GitHub Changelog<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>See how GitHub Copilot Coding Agent automates unit tests and ships features from a PRD in a real .NET sample, so you can focus on design and review.<\/p>\n","protected":false},"author":120281,"featured_media":57934,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,7781,756],"tags":[568,7869],"class_list":["post-57933","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-ai","category-csharp","tag-ai","tag-github-copilot"],"acf":[],"blog_post_summary":"<p>See how GitHub Copilot Coding Agent automates unit tests and ships features from a PRD in a real .NET sample, so you can focus on design and review.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/57933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/120281"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=57933"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/57933\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/57934"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=57933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=57933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=57933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}