GitHub Copilot هو مبرمج زوجي قوي يعمل بالذكاء الاصطناعي، ولكن إمكاناته الحقيقية تفتح من خلال التخصيص. يوفر مستودع github/awesome-copilot ثروة من الموارد التي ساهم بها المجتمع لتخصيص Copilot لتلبية احتياجاتك الخاصة ومعايير فريقك ومتطلبات مشروعك. يتعمق هذا المنشور في كيفية الاستفادة من هذا المستودع لتعزيز تجربة Copilot الخاصة بك.
فهم تخصيص GitHub Copilot
يوفر GitHub Copilot ثلاث طرق أساسية للتخصيص: التعليمات المخصصة والمطالبات القابلة لإعادة الاستخدام وأنماط الدردشة المخصصة. كل منها يلبي جوانب مختلفة من سلوك الذكاء الاصطناعي وتفاعله. يوفر مستودع awesome-copilot أمثلة وإرشادات مسبقة الصنع لتبدأ في استخدام كل من هذه.
- التعليمات المخصصة: هذه هي الإرشادات الشاملة التي توجه سلوك Copilot عبر مهام مختلفة. يتم تضمينها تلقائيًا في كل طلب دردشة، مما يضمن الاتساق والالتزام بممارسات الترميز الخاصة بالفريق أو متطلبات المشروع. فكر فيها على أنها تحدد النبرة العامة وحدود Copilot. تتضمن الأمثلة معايير الترميز وتفضيلات المشروع.
- المطالبات القابلة لإعادة الاستخدام: هذه هي مطالبات قائمة بذاتها ومحددة مسبقًا مصممة لمهام محددة، مثل إنشاء التعليمات البرمجية أو المراجعات أو إنشاء رسائل الالتزام. إنها تلغي الحاجة إلى كتابة نفس التعليمات بشكل متكرر، مما يوفر الوقت والجهد. يمكن أيضًا مشاركة المطالبات عبر الفرق.
- أنماط الدردشة المخصصة: تحدد هذه الأنماط سلوكيات وأدوات محددة لـ Copilot Chat، مما يتيح مساعدة واعية بالسياق لمهام أو سير عمل معينة. إنها تمنحك التحكم في كيفية تفاعل Copilot مع قاعدة التعليمات البرمجية الخاصة بك والأدوات التي يستخدمها.
استكشاف مستودع awesome-copilot
مستودع awesome-copilot هو كنز دفين من الموارد المنظمة في فئات واضحة:
-
التعليمات المخصصة: يقدم هذا القسم مجموعة من التعليمات الخاصة بالفريق والمشروع والتي تعمل على تخصيص سلوك GitHub Copilot لتقنيات وممارسات ترميز معينة. تتضمن الأمثلة:
- تعليمات تطوير Angular
- إرشادات تطوير ASP.NET REST API
- أنماط Azure Functions TypeScript
- إرشادات الترميز الآمن و OWASP (لجميع اللغات/الأطر)
-
المطالبات القابلة لإعادة الاستخدام: يحتوي هذا الدليل على قوالب مطالبات جاهزة للاستخدام لسيناريوهات ومهام التطوير الشائعة. تتضمن الأمثلة:
- إنشاء وثائق ASP.NET Minimal API باستخدام OpenAPI
- تحليل تحسين تكلفة Azure وإنشاء المشكلات
- إنشاء Dockerfile متعدد المراحل
- أفضل الممارسات لأطر عمل اختبار الوحدة المختلفة (MSTest، NUnit، XUnit)
-
أنماط الدردشة المخصصة: يوفر هذا الدليل أمثلة لأنماط الدردشة المخصصة لسير العمل المتخصصة:
- “Beast Mode” للحصول على مساعدة ترميز محسنة من GPT-4.
- تعليمات وضع التصحيح
- تعليمات وضع التخطيط
- وضع إدارة قاعدة بيانات PostgreSQL.
كيفية استخدام الموارد
للاستفادة من موارد awesome-copilot، اتبع الخطوات التالية:
- تصفح المستودع: استكشف التعليمات المخصصة والمطالبات وأنماط الدردشة المتاحة للعثور على تلك التي تتوافق مع احتياجاتك.
- تنفيذ التعليمات المخصصة: انسخ محتويات ملفات
.md ذات الصلة (مثل تعليمات تطوير Angular) إلى ملف .github/copilot-instructions.md الخاص بك أو أنشئ ملفات .github/.instructions.md خاصة بالمهمة في مجلد .github/instructions في مساحة العمل الخاصة بك.
- استخدم المطالبات القابلة لإعادة الاستخدام: استخدم
/prompt-name في دردشة VS Code، أو قم بتشغيل الأمر “Chat: Run Prompt”، أو انقر فوق زر التشغيل أثناء فتح ملف مطالبة.
- تكوين أنماط الدردشة المخصصة: قم بإنشاء أنماط دردشة جديدة باستخدام الأمر “Chat: Configure Chat Modes…” وقم بتبديل نمط الدردشة الخاص بك في إدخال الدردشة.
المساهمة في المجتمع
يزدهر مستودع awesome-copilot بفضل مساهمات المجتمع. إذا قمت بتطوير تعليمات مخصصة أو مطالبات أو أنماط دردشة تعتقد أنها ستفيد الآخرين، ففكر في المساهمة بها في المستودع. راجع ملف CONTRIBUTING.md للحصول على إرشادات حول كيفية إرسال مساهماتك.
خاتمة
يعد مستودع github/awesome-copilot موردًا قيمًا للمطورين الذين يسعون إلى زيادة فعالية GitHub Copilot. من خلال الاستفادة من التعليمات والمطالبات وأنماط الدردشة التي ساهم بها المجتمع، يمكنك تخصيص Copilot لسير العمل الخاص بك وتحسين جودة التعليمات البرمجية وتحسين تعاون الفريق. ابدأ في استكشاف المستودع اليوم وافتح الإمكانات الكاملة لمبرمجك الزوجي الذي يعمل بالذكاء الاصطناعي.
المصدر: github
GitHub Copilot is a powerful AI pair programmer, but its true potential is unlocked through customization. The github/awesome-copilot repository provides a wealth of community-contributed resources to tailor Copilot to your specific needs, team standards, and project requirements. This post delves into how you can leverage this repository to enhance your Copilot experience.
Understanding GitHub Copilot Customization
GitHub Copilot offers three primary methods for personalization: custom instructions, reusable prompts, and custom chat modes. Each caters to different aspects of the AI’s behavior and interaction. The awesome-copilot repository provides pre-built examples and guidance to get you started with each of these.
- Custom Instructions: These are overarching guidelines that inform Copilot’s behavior across various tasks. They are automatically included in every chat request, ensuring consistency and adherence to team-specific coding practices or project requirements. Think of them as setting the general tone and boundaries for Copilot. Example include coding standards and project preferences.
- Reusable Prompts: These are standalone, pre-defined prompts designed for specific tasks, such as code generation, reviews, or commit message creation. They eliminate the need to repeatedly write out the same instructions, saving time and effort. Prompts can also be shared accross teams.
- Custom Chat Modes: These modes define specific behaviors and tools for Copilot Chat, enabling context-aware assistance for particular tasks or workflows. They give you control over how Copilot interacts with your codebase and the tools it uses.
Exploring the awesome-copilot Repository
The awesome-copilot repository is a treasure trove of resources organized into clear categories:
-
Custom Instructions: This section offers a collection of team and project-specific instructions that tailor GitHub Copilot’s behavior for particular technologies and coding practices. Examples include:
- Angular Development Instructions
- ASP.NET REST API Development Guidelines
- Azure Functions TypeScript patterns
- Secure Coding and OWASP Guidelines (for all languages/frameworks)
-
Reusable Prompts: This directory contains ready-to-use prompt templates for common development scenarios and tasks. Examples include:
- ASP.NET Minimal API with OpenAPI documentation generation
- Azure Cost Optimization analysis and issue creation
- Multi-Stage Dockerfile creation
- Best practices for various unit testing frameworks (MSTest, NUnit, XUnit)
-
Custom Chat Modes: This directory provides examples of custom chat modes for specialized workflows:
- “Beast Mode” for enhanced coding assistance from GPT-4.
- Debug Mode instructions.
- Planning Mode instructions
- PostgreSQL database administration mode.
How to Use the Resources
To leverage the awesome-copilot resources, follow these steps:
- Browse the repository: Explore the available custom instructions, prompts, and chat modes to find ones that align with your needs.
- Implement Custom Instructions: Copy the contents of relevant
.md files (e.g., Angular Development Instructions) to your .github/copilot-instructions.md file or create task-specific .github/.instructions.md files in your workspace’s .github/instructions folder.
- Use Reusable Prompts: Use
/prompt-name in VS Code chat, run the “Chat: Run Prompt” command, or click the run button while a prompt file is open.
- Configure Custom Chat Modes: Create new chat modes using the “Chat: Configure Chat Modes…” command and switch your chat mode in the Chat input.
The awesome-copilot repository thrives on community contributions. If you’ve developed custom instructions, prompts, or chat modes that you think would benefit others, consider contributing them to the repository. Refer to the CONTRIBUTING.md file for guidelines on how to submit your contributions.
Conclusion
The github/awesome-copilot repository is a valuable resource for developers seeking to maximize the effectiveness of GitHub Copilot. By leveraging the community-contributed instructions, prompts, and chat modes, you can tailor Copilot to your specific workflows, enhance code quality, and improve team collaboration. Start exploring the repository today and unlock the full potential of your AI pair programmer.
Source: github
جاري تحميل التعليقات...