What is GitHub Copilot?
GitHub Copilot is an AI coding assistant available in supported developer tools and workflows. Exact capabilities depend on the subscription, IDE, organisation settings and current product release.
Key uses
- Suggest code while typing and help draft routine functions.
- Explain unfamiliar code and propose refactoring ideas.
- Help create tests, documentation and debugging hypotheses.
- Support coding conversations in eligible environments.
Benefits
Can reduce repetitive work and help developers explore implementation options, especially when they provide context and verify the generated code.
Limitations
- Suggestions may be insecure, incorrect, inefficient or inconsistent with project conventions.
- Never merge generated code without review, tests and security checks.
- Understand your organisation’s policy for proprietary code and AI services.
Prompt template
Context: [language, framework, relevant files]. Goal: [specific change]. Constraints: preserve existing public interfaces, follow project conventions, avoid unrelated refactors. Before coding, state assumptions and propose a minimal plan. Include tests and explain edge cases.
Example prompts
- “Write unit tests for this function, including boundary cases and invalid inputs. Do not change the function itself.”
- “Explain the likely cause of this error, list two hypotheses and show how to test each before suggesting a fix.”
- “Review this diff for security, performance and maintainability risks. Refer to specific lines and distinguish definite bugs from concerns.”
Recommended workflow
Keep changes small, read every diff, run tests and linters, and ask for reasoning about trade-offs rather than accepting code on confidence alone.