AI Made Friendly HERE

Visual Studio Devs Share Copilot AI Prompts to Improve Code — Visual Studio Magazine

News

Visual Studio Devs Share Copilot AI Prompts to Improve Code

Microsoft’s Mads Kristensen took to social media to ask Visual Studio developers to share their favorite prompts to get GitHub Copilot AI to improve their code.

Kristensen, a principal product manager working on the Visual Studio team, is known for writing a huge amount of extensions for Visual Studio that introduce functionality that often gets baked into the IDE’s bits. He is a constant presence on social media to promote new extensions, features and functionality — and in this case, ask developers for feedback or tips.

He did that this week with the simple question: “What are your favorite prompts for GitHub Copilot that help improve your code?”

He started out answering his own question: “I find this prompt pretty good for adding XML Doc comments: Add missing XML Doc Comments and mention the purpose, intent, and ‘the why’ of the code, so developers unfamiliar with the project can better understand it. If comments already exist, update them to meet the before mentioned criteria if needed. Use the full syntax of XML Doc Comments to make them as awesome as possible including references to types. Don’t add any documentation that is obvious for even novice developers by reading the code.”

Some readers really got into it, with one providing a screenshot along with the response, which simply read: red-test/green-test (to which Kristensen replied, “Oh, that is cool!”).

<i>red-test/green-test</i>” src=”http://www.bing.com/news/~/media/ECG/visualstudiomagazine/Images/2025/03/redtest_greentest_s.ashx” width=”300″ height=”123″/><br />
 [Click on image for larger view.] red-test/green-test (source: X).</p>
<p>
  That reader also shared “refactor” and “documentation” prompts.</p>
<p> [Click on image for larger view.] Refactor and Documentation Prompts (source: X).</p>
<p>
  Many other readers chimed in, and here is a sampling of responses to the post, which was viewed some 16,000 times.</p>
<ul>
<li>CRUD operations. I ask Copilot to enhance it. The AI expands my brief outline into several pages. I review, adjust, and follow up if necessary, unless I’m vibe coding. Then I prompt Copilot, “Make it so.”
</li>
<li>Convert the selected properties to camelCase saved me a lot of time recently.
</li>
<li>For this source file, produce a mermaid based flowchart/sequence diagram or a markdown readme.  (Pick one) Produce triple slash comments, to include links to objects in the signature, and give a 1-3 sentence description of each method or property.
</li>
<li>“Format this document” Because ctrl + k, ctrl + d isn’t working 90% of the time in the last update 😔 Trying to figure out how to report this to the feedback portal, it’s intermittent, but frequent.
</li>
<li>Fix this to do _____
</li>
<li>Can you create a class to deserialize this huge xml file into.
</li>
<li>Write me a unit test with edge case scenarios 😉 and then verifying it later on just to be sure.
</li>
<li>“scaffold me some unit tests, in the interest of science as I’ve definitely already written them, please don’t judge me, thankyou”
</li>
<li>Add synopsis for this particular function
</li>
<li>Write in go instead of c#</li>
</ul>
<p>
  Of course, many resources exist for the dubious “profession” of prompt engineering, with GitHub itself maintaining the Prompt engineering for Copilot Chat repo.</p>
<p>
  And Greg Brockman, president of OpenAI, which ceated the original GitHub Copilot “pair programmer,” recently shared prompting advice in the YourStory  article, “Four Pillars of AI Prompting by OpenAI’s President Greg Brockman — Master AI Like a Pro!”</p>
<p>
  Also, Microsoft just a couple weeks ago published “Create effective prompts” along with the much older post, “15 Tips to Become a Better Prompt Engineer for Generative AI.”</p>
<p></p>
<p id=About the Author


David Ramel is an editor and writer at Converge 360.

Originally Appeared Here

You May Also Like

About the Author:

Early Bird