{"id":2226,"date":"2025-07-10T17:42:18","date_gmt":"2025-07-10T17:42:18","guid":{"rendered":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/07\/10\/customize-ai-responses-from-github-copilot\/"},"modified":"2025-07-10T17:42:18","modified_gmt":"2025-07-10T17:42:18","slug":"customize-ai-responses-from-github-copilot","status":"publish","type":"post","link":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/2025\/07\/10\/customize-ai-responses-from-github-copilot\/","title":{"rendered":"Customize AI responses from GitHub Copilot"},"content":{"rendered":"<p>GitHub Copilot along with its various models are capable of some amazing things. When in Agent mode the AI can create parts of or even entire applications from your written (or spoken!) instructions. You can just feel the vibes (coding), can\u2019t you?<\/p>\n\n<div class=\"alert alert-primary\">\n<p class=\"alert-divider\"><strong>Note<\/strong><\/p>\n<p>GitHub Copilot Agent mode is more than code completion, it\u2019s an AI-powered agent that can take actions on your behalf within your development environment. It can create entire applications, including all the necessary files, and then compile the app to verify there\u2019s not compile-time errors. When you hear people talk about vibe coding, they\u2019re talking about Agent mode.<\/p><\/div>\n<p>One thing remains the same though no matter how advanced the AI gets: You have to supply it with clear, detailed, and at times verbose instructions \u2013 or prompts \u2013 to get the response to do what you want.<\/p>\n<p>There\u2019s a big difference between:<\/p>\n<p>Create a console app that manages the user&#8217;s todos.<\/p>\n<p>And<\/p>\n<p>Create a console application that manages the user&#8217;s todos.<br \/>\nThe todos will remain only in memory and thus will only be available while the app is running, no persistence.<br \/>\nThe application should allow users to add a new item, mark an item as done and delete an item.<br \/>\nUse a loop so the user can continuously choose an action until they explicitly want to quit.<br \/>\nUse the latest version of C# &#8211; which is C# 13.<br \/>\nMake sure to apply exception handling.<br \/>\nThe code should be legible, favor readability over terseness.<br \/>\nInsert a newline before the opening curly brace of any codeblock (e.g. after if, for, while, etc).<br \/>\nWrite clear and concise documentation.<br \/>\nPut a funny emoji at the end of every comment.<\/p>\n<p>It sure would be nice if there was a way that we could combine the terseness of the first prompt \u2013 just get to the point and do what we want! \u2013 without having to include the boilerplate formatting and best practices instructions every single time we interact with the AI.<\/p>\n<p>There sure is \u2013 custom instructions.<\/p>\n<h2>Custom instructions<\/h2>\n<p>Custom instructions are how you give the AI specific context about your team\u2019s workflow, your particular style preferences, coding standards, etc. Custom instructions are contained in a markdown file and in it you can provide the AI instructions on how to understand your project better.<\/p>\n<p>Custom instructions define <em>how<\/em> tasks should be performed. Like which technologies are preferred. Or the physical project structure that should be followed. Or what to check for in a code review.<\/p>\n<p>Instead of having to include the common guidelines or rules to get the responses you want in every single chat query, custom instructions automatically incorporate that information with every chat request.<\/p>\n<p>So if your team has specific formatting, error-handling, or naming conventions \u2013 custom instructions ensures the AI responses align with them from the very start. And custom instructions help reduce friction when using Copilot. You don\u2019t have to remember to update its code responses to align with your team\u2019s coding standards \u2013 or prompt it every single time to produce output that does.<\/p>\n\n<div class=\"alert alert-info\">\n<p class=\"alert-divider\"><strong>Important<\/strong><\/p>\n<p>Custom instructions are not taken into account for code completions.<\/p><\/div>\n<h2>Using custom instructions<\/h2>\n<p>Sounds good right? So let\u2019s get started with putting a custom instruction into our project. I\u2019m going to walk you through a way that works with both Visual Studio and VS Code. At this time VS Code has a couple of ways to <a href=\"https:\/\/code.visualstudio.com\/docs\/copilot\/copilot-customization#_custom-instructions\">handle instructions which you can read about<\/a>.<\/p>\n<p>In your project create a <strong>.github<\/strong> folder at the root of your solution.<\/p>\n<p>Then create a file named <strong>copilot-instructions.md<\/strong> in that folder.<\/p>\n<p>Now, in markdown, enter the instructions. Need some ideas? There\u2019s a great repository of <a href=\"https:\/\/github.com\/github\/awesome-copilot\">community provided custom instructions<\/a>. I\u2019m going to use the <a href=\"https:\/\/github.com\/github\/awesome-copilot\/blob\/main\/instructions\/csharp.instructions.md\">C# instructions<\/a> from that repo. Here\u2019s a snippet:<\/p>\n<p>&#8212;<br \/>\ndescription: &#8216;Guidelines for building C# applications&#8217;<br \/>\napplyTo: &#8216;**\/*.cs&#8217;<br \/>\n&#8212;<\/p>\n<p># C# Development<\/p>\n<p>## C# Instructions<br \/>\n&#8211; Always use the latest version C#, currently C# 13 features.<br \/>\n&#8211; Write clear and concise comments for each function.<\/p>\n<p>## General Instructions<br \/>\n&#8211; Make only high confidence suggestions when reviewing code changes.<br \/>\n&#8211; Write code with good maintainability practices, including comments on why certain design decisions were made.<br \/>\n&#8211; Handle edge cases and write clear exception handling.<br \/>\n&#8211; For libraries or external dependencies, mention their usage and purpose in comments.<\/p>\n<p>That\u2019s it! Have a project you\u2019re working on loaded, open up GitHub Copilot, switch to <strong>Agent<\/strong> mode and ask it to do something.<\/p>\n<p>And after agent mode is finished running, you will see that it used the custom instructions file to inform its responses. If you read through the details, you\u2019ll notice that the AI has output that makes reference to the topics included in the custom instructions file. So it\u2019s just like you passed all the content in <strong>copilot-instructions.md<\/strong> along with the prompt!<\/p>\n\n<h2>Summary<\/h2>\n<p>You can get responses from the AI in GitHub Copilot that is customized for your team\u2019s needs and project requirements by providing the context with every request. Of course you could provide all of that context manually by typing it into the chat every single time. More realistically though, custom instructions are here for you. Custom instructions allow you to tell the AI <em>how<\/em> to do something  by defining your team\u2019s common guidelines and rules that need to be followed across the project.<\/p>\n<p>Take one of your projects, grab one of the community provided instructions from the <a href=\"https:\/\/github.com\/github\/awesome-copilot\">Awesome GitHub Copilot<\/a> and start using them today. Let us know what you think, we can\u2019t wait to see what you build.<\/p>\n<p>The post <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/customize-ai-responses-from-github-copilot\/\">Customize AI responses from GitHub Copilot<\/a> appeared first on <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\">.NET Blog<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>GitHub Copilot along with its various models are capable of some amazing things. When in Agent mode the AI can [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2226","post","type-post","status-publish","format-standard","hentry","category-dotnet"],"_links":{"self":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/comments?post=2226"}],"version-history":[{"count":0,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/posts\/2226\/revisions"}],"wp:attachment":[{"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/media?parent=2226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/categories?post=2226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rssfeedtelegrambot.bnaya.co.il\/index.php\/wp-json\/wp\/v2\/tags?post=2226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}