{"id":22762,"date":"2026-06-10T13:54:48","date_gmt":"2026-06-10T05:54:48","guid":{"rendered":"https:\/\/ab123.xyz\/?p=22762"},"modified":"2026-06-10T13:54:48","modified_gmt":"2026-06-10T05:54:48","slug":"github-copilot-custom-prompts%ef%bc%9a%e6%99%ba%e8%83%bd%e5%8c%96%e7%bc%96%e7%a8%8b%e7%9a%84%e5%85%a8%e6%96%b0%e7%bb%b4%e5%ba%a6","status":"publish","type":"post","link":"https:\/\/ab123.xyz\/?p=22762","title":{"rendered":"GitHub Copilot Custom Prompts\uff1a\u667a\u80fd\u5316\u7f16\u7a0b\u7684\u5168\u65b0\u7ef4\u5ea6"},"content":{"rendered":"<p>\u5728\u4eba\u5de5\u667a\u80fd\u8f85\u52a9\u7f16\u7a0b\u9886\u57df\uff0cGitHub Copilot \u4e00\u76f4\u626e\u6f14\u7740\u9769\u65b0\u8005\u7684\u89d2\u8272\u3002\u5176\u6700\u65b0\u63a8\u51fa\u7684 Custom Prompts \u529f\u80fd\uff0c\u5c06\u4ee3\u7801\u667a\u80fd\u8865\u5168\u63d0\u5347\u5230\u4e86\u524d\u6240\u672a\u6709\u7684\u9ad8\u5ea6\u2014\u2014\u5f00\u53d1\u8005\u4e0d\u4ec5\u53ef\u4ee5\u83b7\u5f97\u5373\u65f6\u7684\u4ee3\u7801\u5efa\u8bae\uff0c\u8fd8\u80fd\u901a\u8fc7\u5b9a\u5236\u5316\u7684\u63d0\u793a\u8bcd\uff08Prompt\uff09\u8ba9 Copilot \u7cbe\u51c6\u7406\u89e3\u9879\u76ee\u4e0a\u4e0b\u6587\u3001\u56e2\u961f\u89c4\u8303\u548c\u4e1a\u52a1\u903b\u8f91\uff0c\u771f\u6b63\u5b9e\u73b0\u201c\u6240\u89c1\u5373\u6240\u5f97\u201d\u7684\u7f16\u7a0b\u4f53\u9a8c\u3002<\/p>\n<h2>\u4ec0\u4e48\u662fGitHub Copilot Custom Prompts\uff1f<\/h2>\n<p>Custom Prompts \u662f GitHub Copilot \u7684\u4e00\u9879\u9ad8\u7ea7\u914d\u7f6e\u80fd\u529b\uff0c\u5141\u8bb8\u7528\u6237\u4e3a\u7279\u5b9a\u4ed3\u5e93\u3001\u6587\u4ef6\u6216\u4ee3\u7801\u6a21\u5f0f\u5b9a\u4e49\u4e13\u5c5e\u7684\u63d0\u793a\u6307\u4ee4\u3002\u4e0d\u540c\u4e8e\u901a\u7528 Copilot \u7684\u968f\u673a\u8054\u60f3\uff0cCustom Prompts \u901a\u8fc7 YAML \u6216 JSON \u6587\u4ef6\uff08\u5982 .github\/copilot-instructions.md\uff09\u5199\u5165\u89c4\u5219\uff0c\u8ba9 AI \u6a21\u578b\u5728\u751f\u6210\u4ee3\u7801\u65f6\u4f18\u5148\u9075\u5faa\u8fd9\u4e9b\u81ea\u5b9a\u4e49\u63cf\u8ff0\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u8981\u6c42 Copilot \u201c\u59cb\u7ec8\u4f7f\u7528 TypeScript \u7684\u4e25\u683c\u6a21\u5f0f\u201d\u3001\u201c\u4e3a\u6240\u6709 API \u7aef\u70b9\u6dfb\u52a0 JSDoc \u6ce8\u91ca\u201d\u6216\u201c\u91c7\u7528\u5f53\u524d\u9879\u76ee\u4e2d\u7684\u9519\u8bef\u5904\u7406\u98ce\u683c\u201d\u3002<\/p>\n<h2>\u6838\u5fc3\u529f\u80fd\u4e0e\u4f18\u52bf<\/h2>\n<h3>\u4e0a\u4e0b\u6587\u611f\u77e5\u7684\u4ee3\u7801\u751f\u6210<\/h3>\n<p>Custom Prompts \u80fd\u901a\u8fc7\u8bfb\u53d6\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u81ea\u52a8\u8bc6\u522b\u4ee3\u7801\u5e93\u7684\u8bed\u8a00\u3001\u6846\u67b6\u548c\u67b6\u6784\u7ea6\u5b9a\u3002\u65e0\u8bba\u662f React \u7ec4\u4ef6\u5199\u6cd5\uff0c\u8fd8\u662f Python \u7684\u88c5\u9970\u5668\u98ce\u683c\uff0cAI \u90fd\u80fd\u65e0\u7f1d\u9002\u914d\uff0c\u907f\u514d\u751f\u6210\u4e0d\u7b26\u5408\u56e2\u961f\u89c4\u8303\u7684\u201c\u91ce\u4ee3\u7801\u201d\u3002<\/p>\n<h3>\u56e2\u961f\u534f\u4f5c\u4e00\u81f4\u6027<\/h3>\n<p>\u5f53\u6574\u4e2a\u5f00\u53d1\u7ec4\u5171\u4eab\u540c\u4e00\u4efd .github\/copilot-instructions.md \u65f6\uff0c\u6bcf\u4f4d\u6210\u5458\u83b7\u5f97\u7684\u4ee3\u7801\u5efa\u8bae\u90fd\u9075\u5faa\u7edf\u4e00\u7684\u547d\u540d\u89c4\u5219\u3001\u6ce8\u91ca\u683c\u5f0f\u548c\u8bbe\u8ba1\u6a21\u5f0f\u3002\u8fd9\u6781\u5927\u5730\u51cf\u5c11\u4e86\u4ee3\u7801\u5ba1\u67e5\u4e2d\u7684\u98ce\u683c\u4e89\u8bba\uff0c\u63d0\u5347\u4ea4\u4ed8\u6548\u7387\u3002<\/p>\n<h3>\u7075\u6d3b\u5b9a\u5236\u89c4\u5219<\/h3>\n<p>\u652f\u6301\u5728\u6587\u4ef6\u7ea7\u522b\u3001\u76ee\u5f55\u7ea7\u522b\u6216\u5168\u5c40\u751f\u6548\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u9488\u5bf9\u4e0d\u540c\u6a21\u5757\uff08\u5982\u524d\u7aef\u3001\u540e\u7aef\u3001\u6d4b\u8bd5\u6587\u4ef6\uff09\u8bbe\u7f6e\u5dee\u5f02\u5316\u7684 Prompt \u89c4\u5219\u3002\u4f8b\u5982\uff0c\u4e3a\u6d4b\u8bd5\u6587\u4ef6\u6307\u5b9a\u201c\u4f7f\u7528 Jest \u7684 describe\/it \u8bed\u6cd5\u201d\uff0c\u4e3a API \u8def\u7531\u6307\u5b9a\u201c\u4f18\u5148\u4f7f\u7528 async\/await\u201d\u3002<\/p>\n<h2>\u5e94\u7528\u573a\u666f\u4e0e\u4f7f\u7528\u6307\u5357<\/h2>\n<h3>\u4f01\u4e1a\u7ea7\u4ee3\u7801\u89c4\u8303\u843d\u5730<\/h3>\n<p>\u6280\u672f\u4e3b\u7ba1\u53ef\u5c06\u516c\u53f8\u5185\u90e8\u7684\u7f16\u7801\u6807\u51c6\u5199\u5165 Custom Prompts\uff0c\u65b0\u624b\u5f00\u53d1\u8005\u53ea\u9700\u8ddf\u968f Copilot \u7684\u63d0\u793a\u5373\u53ef\u5199\u51fa\u7b26\u5408\u89c4\u8303\u7684\u4ee3\u7801\uff0c\u964d\u4f4e\u57f9\u8bad\u6210\u672c\u3002<\/p>\n<h3>\u52a0\u901f\u9057\u7559\u9879\u76ee\u8fc1\u79fb<\/h3>\n<p>\u5f53\u4ece jQuery \u8fc1\u79fb\u5230 React \u65f6\uff0c\u5728\u8fc1\u79fb\u4ed3\u5e93\u4e2d\u914d\u7f6e\u201c\u5efa\u8bae\u4f7f\u7528\u51fd\u6570\u7ec4\u4ef6 + Hooks\u201d\u7684 Prompt\uff0cCopilot \u4f1a\u81ea\u52a8\u751f\u6210\u73b0\u4ee3 React \u6a21\u5f0f\uff0c\u51cf\u5c11\u624b\u52a8\u6539\u5199\u5de5\u4f5c\u91cf\u3002<\/p>\n<h3>\u5982\u4f55\u914d\u7f6eCustom Prompts<\/h3>\n<p>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u521b\u5efa .github\/copilot-instructions.md \u6587\u4ef6\uff0c\u4f7f\u7528 Markdown \u7f16\u5199\u81ea\u7136\u8bed\u8a00\u6307\u4ee4\u3002\u4f8b\u5982\uff1a\u201c# Instructions &#8211; \u4f7f\u7528 ES6 \u6a21\u5757 &#8211; \u6240\u6709\u51fd\u6570\u9700\u6709 TypeScript \u7c7b\u578b\u6ce8\u89e3 &#8211; \u9519\u8bef\u5904\u7406\u7edf\u4e00\u4f7f\u7528 try\/catch\u201d\u3002\u4fdd\u5b58\u5e76\u63a8\u9001\u81f3\u8fdc\u7a0b\u4ed3\u5e93\uff0cCopilot \u5728\u7f16\u8f91\u8be5\u4ed3\u5e93\u4ee3\u7801\u65f6\u4fbf\u4f1a\u81ea\u52a8\u9075\u5faa\u8fd9\u4e9b\u89c4\u5219\u3002\u66f4\u8be6\u7ec6\u7684\u914d\u7f6e\u8bf4\u660e\u53ef\u8bbf\u95ee\u5b98\u65b9\u6587\u6863\uff1a<a href=\"https:\/\/github.com\/features\/copilot\" target=\"_blank\">\u5b98\u65b9\u7f51\u7ad9<\/a>\u3002<\/p>\n<p>GitHub Copilot Custom Prompts \u5c06 AI \u7f16\u7a0b\u4ece\u201c\u88ab\u52a8\u8865\u5168\u201d\u63a8\u5411\u201c\u4e3b\u52a8\u534f\u4f5c\u201d\uff0c\u5b83\u4e0d\u4ec5\u662f\u4ee3\u7801\u751f\u6210\u5de5\u5177\uff0c\u66f4\u662f\u56e2\u961f\u77e5\u8bc6\u6c89\u6dc0\u4e0e\u5f00\u53d1\u6548\u7387\u7684\u500d\u589e\u5668\u3002\u65e0\u8bba\u662f\u4e2a\u4eba\u5f00\u53d1\u8005\u8fd8\u662f\u5927\u578b\u4f01\u4e1a\uff0c\u90fd\u503c\u5f97\u7acb\u5373\u5c1d\u8bd5\u8fd9\u4e00\u667a\u80fd\u5316\u7f16\u7a0b\u65b0\u8303\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4eba\u5de5\u667a\u80fd\u8f85\u52a9\u7f16\u7a0b\u9886\u57df\uff0cGitHub Copilot \u4e00\u76f4\u626e\u6f14\u7740\u9769\u65b0\u8005\u7684\u89d2\u8272\u3002\u5176\u6700\u65b0\u63a8\u51fa\u7684 Custom Pr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[5415,25866,6180,5417,14],"class_list":["post-22762","post","type-post","status-publish","format-standard","hentry","category-4","tag-ai","tag-custom-prompts","tag-github-copilot","tag-5417","tag-14"],"_links":{"self":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/22762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=22762"}],"version-history":[{"count":1,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/22762\/revisions"}],"predecessor-version":[{"id":22763,"href":"https:\/\/ab123.xyz\/index.php?rest_route=\/wp\/v2\/posts\/22762\/revisions\/22763"}],"wp:attachment":[{"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=22762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=22762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ab123.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=22762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}