Skip to content

Copilot Prompt Creator

This skill provides a structured approach to creating effective custom prompts for GitHub Copilot, ensuring that the latest information and best practices from GitHub's resources are incorporated.

When to Use This Skill

Use this skill when: - Creating custom prompts for Copilot to perform specific tasks - Developing prompts for code generation, refactoring, or analysis - Building prompts for documentation, testing, or debugging workflows - Need to ensure prompts are based on the most current Copilot capabilities and guidelines

Prerequisites

  • Access to GitHub repositories and documentation
  • Understanding of the task or domain for which the prompt is being created
  • Knowledge of Copilot's capabilities and limitations

Instructions

  1. Research Latest Information from GitHub
  2. Use the github_repo tool to search for official GitHub Copilot documentation and examples
  3. Search for repositories like github/copilot-docs or microsoft/vscode-copilot for latest features
  4. Use fetch_webpage tool to check GitHub's official documentation at https://docs.github.com/en/copilot
  5. Look for recent updates on prompt engineering techniques specific to Copilot

  6. Analyze Requirements and Context

  7. Identify the specific task or workflow the prompt should address
  8. Determine the programming language, framework, or domain
  9. Consider the user's skill level and expected output format
  10. Review existing similar prompts or examples from the research

  11. Design the Prompt Structure

  12. Start with a clear, specific instruction
  13. Include context about the codebase or project when relevant
  14. Specify the desired output format (code, explanation, steps, etc.)
  15. Add constraints or guidelines to improve accuracy
  16. Incorporate best practices from the latest GitHub resources

  17. Incorporate Latest Copilot Features

  18. Include references to recent Copilot capabilities discovered in research
  19. Use new prompt patterns or techniques from official documentation
  20. Ensure compatibility with current Copilot versions and limitations

  21. Test and Refine the Prompt

  22. Test the prompt in a development environment
  23. Iterate based on Copilot's responses
  24. Refine based on accuracy, completeness, and usefulness
  25. Document any limitations or edge cases

  26. Document the Prompt

  27. Include usage instructions and examples
  28. Note any prerequisites or setup requirements
  29. Provide context for when and how to use the prompt effectively

Examples

Example 1: Creating a Code Review Prompt

After researching GitHub's latest Copilot documentation:

You are an expert code reviewer. Review the following [language] code for:
- Security vulnerabilities
- Performance issues
- Code quality and best practices
- Potential bugs

Code to review:
```[language]
[code here]

Provide specific, actionable feedback with code examples for fixes.

### Example 2: API Documentation Prompt

Based on current Copilot capabilities:
Generate comprehensive API documentation for the following [language] function/class. Include: - Purpose and functionality - Parameters with types and descriptions - Return values - Usage examples - Error handling

Function/Class: ```[language] [code here]

Format as clean Markdown with proper headings and code blocks.

Best Practices

  • Always start with research to ensure using current best practices
  • Be specific about the task and expected output format
  • Include context from the codebase when possible
  • Test prompts with multiple scenarios
  • Keep prompts concise but comprehensive
  • Use clear, natural language that Copilot can understand

Common Issues

Issue: Prompt generates incorrect or outdated code patterns Solution: Ensure research step includes checking for latest language/framework updates

Issue: Copilot doesn't understand the context Solution: Provide more specific codebase context and examples in the prompt

Issue: Prompt is too vague, leading to inconsistent results Solution: Add specific constraints, examples, and output format requirements

Additional Resources