text
stringlengths
12
91.7k
metadata
dict
Before optimizing your budget configuration, make sure you understand how budget controls work and how the system evaluates them. See AUTOTITLE. If you haven't set up budgets yet, start with AUTOTITLE to get the basics in place, then come back to this guide to optimize your configuration. To decide between managing cos...
{ "source": "github-docs/copilot/tutorials/budgets/optimizing-your-budget-configuration.md", "title": "Optimizing your budget configuration" }
Before you enable , it is good practice to set up your enterprise so you can be confident will operate within secure, predictable guardrails. Learn about built-in protections has a strong base of built-in security protections designed to protect against common risk points of AI agents. See AUTOTITLE. Plan policy se...
{ "source": "github-docs/copilot/tutorials/cloud-agent/build-guardrails.md", "title": "Building guardrails for GitHub Copilot cloud agent" }
[!NOTE] For an introduction to , see AUTOTITLE. Making sure your issues are well-scoped provides better results when assigned clear, well-scoped tasks. An ideal task includes: A clear description of the problem to be solved or the work required. Complete acceptance criteria on what a good solution looks like (for ...
{ "source": "github-docs/copilot/tutorials/cloud-agent/get-the-best-results.md", "title": "Best practices for using GitHub Copilot to work on tasks" }
can connect to MCP servers, use private packages, and access external services, but only if your organization's repositories are configured to allow it. Although much of the configuration below is done at the repository level, organization owners have control over which resources are in scope and who can configure acce...
{ "source": "github-docs/copilot/tutorials/cloud-agent/give-access-to-resources.md", "title": "Giving GitHub Copilot cloud agent access to resources in your organization" }
[!NOTE] For an introduction to , see AUTOTITLE. Introduction Modern development often starts with good intentions: a quick script, a prototype, maybe an action to automate one small thing. But as projects evolve, those early efforts can become brittle. This tutorial shows how you can use to improve a mature project,...
{ "source": "github-docs/copilot/tutorials/cloud-agent/improve-a-project.md", "title": "Using GitHub Copilot cloud agent to improve a project" }
<!--JTBD: When rolling out , I want to understand use cases and follow best practices, so I can ensure I'm using it as intended and get value from a pilot program.-- is an autonomous, AI-powered agent that completes software development tasks on . Adopting in your organization frees your engineering teams to spend mo...
{ "source": "github-docs/copilot/tutorials/cloud-agent/pilot-cloud-agent.md", "title": "Piloting GitHub Copilot cloud agent in your organization" }
Overview Each AI model supported in has different strengths. To help you decide which model to use, this article provides real-world examples of common developer tasks along with sample prompts, responses, and guidance on why a particular model is a good fit. These examples show how models vary in their reasoning styl...
{ "source": "github-docs/copilot/tutorials/compare-ai-models.md", "title": "Comparing AI models using different tasks" }
This tutorial is for DevOps engineers, platform teams, and engineering leaders who support developers using . Hooks are custom scripts that run at specific points during a session. They can inspect prompts and tool calls, log information for auditing, and even block execution of certain commands. You’ll configure repo...
{ "source": "github-docs/copilot/tutorials/copilot-cli-hooks.md", "title": "Using hooks with Copilot CLI for predictable, policy-compliant execution" }
COPILOT CLI POLICY ACTIVE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Prompts and tool use may be logged for auditing • High-risk commands may be blocked automatically • If something is blocked, follow the guidance shown ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ EOF exit 0 Create the session banner script ...
{ "source": "github-docs/copilot/tutorials/copilot-cli-hooks.md", "title": "Using hooks with Copilot CLI for predictable, policy-compliant execution" }
COPILOT CLI POLICY ACTIVE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Prompts and tool use may be logged for auditing • High-risk commands may be blocked automatically • If something is blocked, follow the guidance shown ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ "@ exit 0 Test the session banner You can te...
{ "source": "github-docs/copilot/tutorials/copilot-cli-hooks.md", "title": "Using hooks with Copilot CLI for predictable, policy-compliant execution" }
Gathering and incorporating user feedback is crucial for product development, but it can be a challenging process. Developers and product teams often struggle to effectively analyze user feedback, prioritize it, and implement changes based on that feedback without disrupting existing workflows or introducing new issues...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/analyze-functionality/analyze-feedback.md", "title": "Analyzing and incorporating user feedback" }
When tasked with implementing new features or enhancing existing ones, developers often face decisions about the best approach to take. can assist by analyzing the problem and generating implementation options so that you can explore multiple solutions. Example scenario You're assigned the task of creating a new feat...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/analyze-functionality/explore-implementations.md", "title": "Exploring potential feature implementations" }
While they may be considered "common knowledge" by many developers, the vast majority of newly introduced security weaknesses are due to vulnerabilities like cross-site scripting (XSS), SQL injection, and cross-site request forgery (CSRF). These vulnerabilities can be mitigated by following secure coding practices, suc...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/analyze-security/find-vulnerabilities.md", "title": "Finding existing vulnerabilities in code" }
Automate dependency updates Example scenario Let's say your project depends on numerous libraries and packages. Vulnerable or outdated dependencies create security risks that can affect your project and others that rely on it. can help you get set up with security and version updates, so that your dependencies alway...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/analyze-security/manage-dependency-updates.md", "title": "Managing dependency updates" }
Configure essential security features Example scenario Let's say you recently created a repository for a new web application, you want to secure it and you don't know where to start. can walk you through configuring the most essential security features to ensure your repository remains secure. Example prompt Provide...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/analyze-security/secure-your-repository.md", "title": "Securing your repository" }
on can help you create Mermaid diagrams to visualize data, making it easier to understand and communicate insights. You can ask to generate diagrams based on your data or code, and it will provide you with the necessary code to create those diagrams. Example scenario You want to create a Gantt chart to visualize the...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/communicate-effectively/creating-diagrams.md", "title": "Creating diagrams" }
can help you create templates for various purposes, such as project documentation, code snippets, or issue tracking. By using templates, you can streamline your workflow and ensure consistency across your projects. Example scenario You want to create a template for a project README file that includes sections for proj...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/communicate-effectively/creating-templates.md", "title": "Creating templates" }
can help you create tables for various purposes, such as organizing data, comparing options, or summarizing information. By using tables, you can present information in a clear and structured way that is easy to read and understand. You can ask to generate tables based on existing data or to create empty tables based ...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/communicate-effectively/generating-tables.md", "title": "Generating tables" }
can help you summarize all recent activity in a repository. will find information about issues, pull requests, commits, CI health, and security notifications, and you can ask it to summarize this information in a report for you. Example scenario You are returning to a repository after a week away and need to catch up...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/communicate-effectively/summarize-repository-activity.md", "title": "Triage and summarize repository activity" }
When working with research data, can assist you in synthesizing findings and insights from multiple sources into a cohesive summary. This can be particularly useful for preparing reports, presentations, or discussions with stakeholders. You can ask to identify key trends, insights, and recommendations based on the re...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/communicate-effectively/synthesizing-research.md", "title": "Synthesizing research" }
When working with JSON data, you may encounter issues such as trailing commas, mismatched braces, or incorrect data types that make the JSON invalid. can help you debug and fix these errors by suggesting corrections to fix invalid JSON. Example scenario Consider a scenario where an application consumes JSON data from...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/debug-errors/debug-invalid-json.md", "title": "Debugging invalid JSON" }
ships with the GitHub MCP server, which gives it direct access to your GitHub Actions workflow runs, job logs, and check statuses. Combined with access to your local files, it can fetch CI failure details, correlate them to your code, and propose fixes from your terminal. Example scenario 1: Tests pass locally but fai...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/debug-errors/diagnose-ci-test-failures.md", "title": "Diagnosing CI test failures" }
When making requests to APIs, it's common to encounter rate limits that restrict the number of calls you can make within a certain time frame. can help you handle these limits by suggesting code to detect rate limit responses and automatically retry requests after a delay. Example scenario The following Python code f...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/debug-errors/handle-api-rate-limits.md", "title": "Handling API rate limits" }
Working with legacy code can be challenging for developers, especially when the code is complex or not well-documented. In such cases, it can be helpful to use Copilot Chat to explain unclear or complex code to other developers or to document it for future reference. Example scenario The block of COBOL below connects ...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/document-legacy-code.md", "title": "Documenting legacy code" }
Comment this code thoroughly [!NOTE] If you want the documentation generated in another format like Markdown, you can specify the desired output format in the prompt. For example: Document this code in Markdown. Example response Copilot will provide a text overview of the code block, and an updated version with comme...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/document-legacy-code.md", "title": "Documenting legacy code" }
There may be times where you need to explain complex algorithms or logic in your code. This can be challenging, especially when you're trying to make it understandable to others. can help you with this task by providing you with suggestions on how to explain the algorithm or logic in a clear and concise manner. Examp...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/explain-complex-logic.md", "title": "Explaining complex algorithms or logic" }
Add comments to this code to make it more understandable Example response responds with an overview of the update it suggests, and the code snippet with the comments added: // Shared HttpClient instance for making HTTP requests (best practice for reuse) private static readonly HttpClient _client = new HttpClient(); /...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/explain-complex-logic.md", "title": "Explaining complex algorithms or logic" }
One of the biggest challenges with legacy code is helping developers understand it who aren't familiar with the languages or frameworks. With , you can explain the background you have and ask for an explanation. Example scenario Consider the following COBOL code. If you're a Python developer (as an example), you might...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/explain-legacy-code.md", "title": "Explaining legacy code" }
can open GitHub issues for you from the terminal. Instead of switching to a browser and filling out an issue by hand, you describe what you want and Copilot gathers context from your repository and GitHub, then creates the issue so you can keep working. Example scenario 1: Filing an issue from a CI failure Your CI is ...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/filing-issues-without-breaking-your-flow.md", "title": "Filing issues without breaking your flow" }
It can be difficult to keep documentation up to date with changes to code. However, good documentation is essential for maintaining codebases and ensuring that developers can work effectively with the code. can assist in updating existing code documentation. Example scenario Imagine a scenario where you have a TypeS...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/sync-documentation.md", "title": "Syncing documentation with code changes" }
When you're working on code, you often need to quickly create accurate and comprehensive explanations to share your work with teammates or the broader community. can help by suggesting ideas, outlines, or complete drafts for discussions or blog posts—enabling you to document and communicate clearly, so you can spend m...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/document-code/write-discussions-or-blog-posts.md", "title": "Writing discussions or blog posts" }
can read a issue, propose an implementation plan, and draft code changes that satisfy the requirements. Because the workflow is conversational, you can correct assumptions, point to relevant files, and refine the approach as works. Example scenario Imagine you work on a platform team that maintains an internal Node....
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/generate-code/implement-a-feature.md", "title": "Implementing a feature from a GitHub Issue" }
In many front-end frameworks, business logic can become embedded within user interface (UI) components, making the code hard to maintain or extend, especially as the application grows. can help you refactor your code to extract business logic into separate services or state management solutions. This allows the busine...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/decouple-business-logic.md", "title": "Decoupling business logic from UI components" }
Complex database operations–particularly those involving transactions–can lead to deadlocks or data inconsistencies that are hard to debug. can help by identifying points in a transaction where locking or deadlocks could occur, and can suggest best practices for transaction isolation or deadlock resolution, such as ad...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/fix-database-deadlocks.md", "title": "Fixing database deadlocks or data integrity issues" }
BEGIN BEGIN TRANSACTION; INSERT INTO target_table (first_name, last_name, email, dept, role, hire_date) SELECT first_name, last_name, email, department, job_title, start_date FROM source_table WHERE (department = 'Engineering' AND salary > 95000) OR (department = 'Engineering' AND years_of_ex...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/fix-database-deadlocks.md", "title": "Fixing database deadlocks or data integrity issues" }
BEGIN CATCH ROLLBACK TRANSACTION; -- Handle the error, e.g., log it or re-throw DECLARE @ErrorMessage NVARCHAR(4000); DECLARE @ErrorSeverity INT; DECLARE @ErrorState INT; SELECT @ErrorMessage = ERROR_MESSAGE(), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE(...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/fix-database-deadlocks.md", "title": "Fixing database deadlocks or data integrity issues" }
It's good practice to use a linter to check your code for potential errors, style violations, or deviations from best practices. Linters can help you to catch bugs early, improve the readability of your code, and ensure that your code is consistent and maintainable. Example scenario You have run a linter on your code ...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/fix-lint-errors.md", "title": "Fixing lint errors" }
Cross-cutting concerns are aspects of a program that affect multiple parts of the system, such as logging, security, data validation, and error handling. They can become scattered throughout a codebase, leading to code duplication and maintenance challenges. can help refactor cross-cutting concerns by suggesting the i...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/handle-cross-cutting.md", "title": "Handling cross-cutting concerns" }
Code with poor readability is difficult for other developers to maintain and extend. can help in a number of ways. For example, by: Suggesting improvements to variable names Avoiding sequential conditional checks Reducing nested logic Splitting large methods into smaller, more readable ones Documenting your code i...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/improve-code-readability.md", "title": "Improving code readability and maintainability" }
Improve the variable names in this function Example response suggests descriptive variable names. function logPersonAge(name, age, revealAge) { if (revealAge) { console.log(name + " is " + age + " years old."); } else { console.log(name + " does not want to reveal their age."); } } Avoiding sequential ...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/improve-code-readability.md", "title": "Improving code readability and maintainability" }
Hardcoded SQL queries and tightly coupled data access code can make it difficult to scale or switch databases, and they often lead to repeated logic. can recommend implementing a repository pattern or data access layer that abstracts database interactions, making the code more modular and reducing redundancy. It can a...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/refactor-data-access-layers.md", "title": "Refactoring data access layers" }
Code that doesn’t follow established design patterns (like Singleton, Factory, or Observer) can lead to issues like tight coupling, lack of flexibility, or duplicated code. can help you use appropriate design patterns to make your code more flexible and maintainable. For example, it can recommend converting repetitive...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/refactor-design-patterns.md", "title": "Refactoring to implement a design pattern" }
Refactor this code using the module pattern Example response 2 const PersonModule = (function() { class Person { constructor(name, age) { this.name = name; this.age = age; } } const people = {}; function addPerson(name, age) { people[name] = new Person(name, age); } function getAge(...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/refactor-design-patterns.md", "title": "Refactoring to implement a design pattern" }
Existing code may function correctly but be inefficient, leading to performance bottlenecks. Examples of coding that can adversely impact performance include inefficient loops, unnecessary computations, and excessive memory allocation. can identify performance hotspots and suggest refactoring strategies such as optimi...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/refactor-for-optimization.md", "title": "Refactoring for performance optimization" }
Optimize this code for performance Example response suggests using a sieve function to generate the prime numbers much more efficiently. If you run this program it will complete in a fraction of a second. [!NOTE] responses are non-deterministic, so you may get a different response from the one shown here. import ti...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/refactor-for-optimization.md", "title": "Refactoring for performance optimization" }
Code that is inefficient in its use of computational resources can lead to higher energy consumption, which has a negative impact on the environment. Examples of such code include algorithms with high time complexity, excessive memory usage, and unnecessary processing. can help identify inefficient algorithms or resou...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/refactor-for-sustainability.md", "title": "Refactoring for environmental sustainability" }
Deep inheritance hierarchies, or improper use of inheritance, can lead to code that is hard to maintain, making it difficult to follow relationships between classes, or to extend them without causing breakage. can suggest refactoring inheritance-based designs into more flexible composition-based designs (favoring comp...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/simplify-inheritance-hierarchies.md", "title": "Simplifying complex inheritance hierarchies" }
There are many reasons why you might want to move code from one programming language to another. Each programming language has its own strengths and weaknesses, and you might want to take advantage of features that are available in another language. For example, you might want to move code to a language that has better...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/refactor-code/translate-code.md", "title": "Translating code to a different programming language" }
Creating end-to-end tests for a webpage can be time-consuming and complex as the HTML will be generated dynamically. can help you create end-to-end tests for a webpage by suggesting the necessary code to interact with the webpage and validate the expected results. Example scenario Imagine a React application that dis...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/testing-code/create-end-to-end-tests.md", "title": "Creating end-to-end tests for a webpage" }
When creating unit tests, it's important to ensure they're isolated and not depending on external services. One way to achieve this is to create mock objects that abstract layers of your application. can help you generate the code you need to create these mock objects. Example scenario Imagine a website built with Ty...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/testing-code/create-mock-objects.md", "title": "Creating mock objects to abstract layers" }
A good suite of unit tests is critical to the success of any project. However, writing these tests can be time-consuming and are often neglected. can help generate these tests for you. Example scenario Imagine you have a Python function which validates data before updating the database. You need to create unit tests ...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/testing-code/generate-unit-tests.md", "title": "Generating unit tests" }
When you make changes to your code, it's important to update any tests to verify the new behavior and catch any bugs that the new code has introduced. can help you quickly update tests to match your code changes, ensuring your test suite stays in sync with your implementation. Example scenario Imagine you have a Pyth...
{ "source": "github-docs/copilot/tutorials/copilot-cookbook/testing-code/update-unit-tests.md", "title": "Updating unit tests to match code changes" }
An extension lets you add your own capabilities to . Each extension is a small Node.js module that runs as a separate process alongside your interactive session and connects back to it. Through that connection, an extension can add tools that can call while it works on your behalf, and slash commands that you run your...
{ "source": "github-docs/copilot/tutorials/create-an-extension.md", "title": "Creating extensions for {% data variables.copilot.copilot_cli %}" }
This acts as your dedicated bug-fixing teammate. It scans your project for issues, prioritizes the most critical bugs, and works through fixes while teaching you debugging best practices along the way. --- name: bug-fix-teammate description: Identifies critical bugs in your project and implements targeted fixes with w...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-agents/bug-fix-teammate.md", "title": "Bug fix teammate" }
This specializes in cleaning up codebases. It removes dead code, eliminates duplication, refactors messy patterns, and applies consistent formatting across both code files and documentation files. --- name: cleanup-specialist description: Cleans up messy code, removes duplication, and improves maintainability across c...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-agents/cleanup-specialist.md", "title": "Cleanup specialist" }
This specializes in feature breakdown and implementation strategy. It helps you analyze requirements, create detailed plans, and identify potential risks before you start coding. --- name: implementation-planner description: Creates detailed implementation plans and technical specifications in markdown format tools: [...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-agents/implementation-planner.md", "title": "Implementation planner" }
About are specialized versions of that maintain consistent expertise across entire workflows. Unlike custom instructions that apply broadly, or prompt files for one-time tasks, are selected for specific tasks and maintain their configuration throughout the workflow. For a more in-depth overview, see AUTOTITLE. You...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-agents/your-first-custom-agent.md", "title": "Your first custom agent" }
The following example shows a path-specific accessibility.instructions.md file that applies only to HTML files in your repository, and guides to generate accessible, inclusive HTML that follows WCAG guidelines. For more information about path-specific instructions files, see AUTOTITLE. --- applyTo: **/*.html --- When ...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/accessibility-auditor.md", "title": "Accessibility auditor" }
The following example shows custom instructions to guide to provide thorough, constructive code reviews focused on security, performance, and code quality. When reviewing code, focus on: ## Security Critical Issues - Check for hardcoded secrets, API keys, or credentials - Look for SQL injection and XSS vulnerabilities...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/code-reviewer.md", "title": "Code reviewer" }
The following example shows custom instructions to guide to explain complex technical concepts in clear, beginner-friendly ways with practical examples. When explaining technical concepts: ## Start Simple, Build Up - Begin with everyday analogies and familiar examples - Introduce technical terms gradually after concep...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/concept-explainer.md", "title": "Concept explainer" }
The following example shows custom instructions to guide to teach systematic debugging methodology and build independent problem-solving skills. When helping with debugging, guide users through: ## Systematic Approach - Start by reproducing the issue consistently - Read error messages carefully—they contain crucial cl...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/debugging-tutor.md", "title": "Debugging tutor" }
The following example shows a path-specific actions.instructions.md file that applies only to workflow files in your repository, using the applyTo field. For more information about path-specific instructions files, see AUTOTITLE. --- applyTo: ".github/workflows/**/*.yml" --- When generating or improving {% data variab...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/github-actions-helper.md", "title": "GitHub Actions helper" }
The following example shows custom instructions to guide to create well-structured, actionable issues and provide effective issue management. When creating or managing {% data variables.product.prodname_dotcom %} issues: ## Bug Report Essentials **Description**: Clear, concise summary of the problem **Steps to Reprod...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/issue-manager.md", "title": "Issue manager" }
The following example shows custom instructions to guide to create detailed pull request descriptions and provide constructive code reviews. When creating pull request descriptions or reviewing PRs: ## PR Description Template **What changed** - Clear summary of modifications and affected components - Link to related i...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/pull-request-assistant.md", "title": "Pull request assistant" }
This example shows a path-specific python-tests.instructions.md file that applies only to Python test files in your repository, using the applyTo field. For more information about path-specific instructions files, see AUTOTITLE. --- applyTo: "tests/**/*.py" --- When writing Python tests: ## Test Structure Essentials - ...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/testing-automation.md", "title": "Testing automation" }
About customizations You can customize 's responses using two types of files: Custom instructions provide ongoing guidance for how should behave across all your interactions. Prompt files (public preview) define reusable prompts for specific tasks that you can invoke when needed. For an introductory example, see AU...
{ "source": "github-docs/copilot/tutorials/customization-library/custom-instructions/your-first-custom-instructions.md", "title": "Your first custom instructions" }
This prompt file creates professional, comprehensive README files by analyzing your entire project structure and codebase. README generator prompt --- agent: 'agent' description: 'Create a comprehensive README.md file for the project' --- ## Role You're a senior software engineer with extensive experience in open sour...
{ "source": "github-docs/copilot/tutorials/customization-library/prompt-files/create-readme.md", "title": "Create README" }
This prompt file generates OpenAPI 3.0 specifications for REST API endpoints by analyzing your API code and creating standardized, machine-readable documentation. OpenAPI specification prompt --- agent: 'agent' description: 'Generate OpenAPI 3.0 specification for API endpoints' --- ## Task Analyze the API endpoint cod...
{ "source": "github-docs/copilot/tutorials/customization-library/prompt-files/document-api.md", "title": "Document API" }
This prompt file generates focused unit tests for specific functions or methods, emphasizing practical test cases and maintainable code. Unit test generation prompt --- agent: 'agent' description: 'Generate unit tests for selected functions or methods' --- ## Task Analyze the selected function/method and generate focu...
{ "source": "github-docs/copilot/tutorials/customization-library/prompt-files/generate-unit-tests.md", "title": "Generate unit tests" }
Onboarding plan prompt --- agent: 'agent' description: 'Help new team members onboard with a phased plan and suggestions for first tasks.' --- # Create My Onboarding Plan I'm a new team member joining ${input:team:Team or project name} and I need help creating a structured onboarding plan. My background: ${input:backgr...
{ "source": "github-docs/copilot/tutorials/customization-library/prompt-files/onboarding-plan.md", "title": "Onboarding plan" }
This prompt file conducts thorough code reviews and provides structured, actionable feedback as a single comprehensive report in . You can also use in , see AUTOTITLE. gives interactive, step-by-step feedback with inline editor comments you can apply directly, while this prompt file gives a comprehensive report with ...
{ "source": "github-docs/copilot/tutorials/customization-library/prompt-files/review-code.md", "title": "Review code" }
About customizations You can customize 's responses using two types of files: Custom instructions provide ongoing guidance for how should behave across all your interactions. For an introductory example, see AUTOTITLE. Prompt files (public preview) define reusable prompts for specific tasks that you can invoke when ...
{ "source": "github-docs/copilot/tutorials/customization-library/prompt-files/your-first-prompt-file.md", "title": "Your first prompt file" }
Introduction code review can be customized using instruction files to tailor the review experience to your team's needs and coding standards. However, writing effective custom instructions requires understanding how processes these instructions and what approaches work best. In this tutorial, you'll learn how to writ...
{ "source": "github-docs/copilot/tutorials/customize-code-review.md", "title": "Using custom instructions to unlock the power of Copilot code review" }
About 's agentic capabilities and MCP 's agentic capabilities refer to the ability to work independently by executing multi-step workflows without constant guidance, make decisions by choosing appropriate tools and approaches based on context, and iterate and adapt by adjusting its approach according to feedback and re...
{ "source": "github-docs/copilot/tutorials/enhance-agent-mode-with-mcp.md", "title": "Enhancing GitHub Copilot agent mode with MCP" }
Introduction If you've been assigned to work on a project that you're not familiar with—or you've found an interesting open source project that you want to contribute to—you'll need some understanding of the codebase before you can start making changes. This guide will show you how to use to explore a codebase and qui...
{ "source": "github-docs/copilot/tutorials/explore-a-codebase.md", "title": "Using GitHub Copilot to explore a codebase" }
Introduction can help you quickly gain context of lengthy discussions and issues on . You can ask to summarize discussions, identify key participants, and provide insights into the status of an issue or discussion. The quality of 's responses may be degraded when working with issues or discussions that have very long...
{ "source": "github-docs/copilot/tutorials/explore-issues-and-discussions.md", "title": "Using GitHub Copilot to explore issues and discussions" }
Introduction You can ask different questions about a pull request, from different views within the pull request. For example, you can ask to summarize a pull request, or explain what has changed within specific files or lines of code in a pull request. Get a summary of a pull request You can ask to summarize a pull...
{ "source": "github-docs/copilot/tutorials/explore-pull-requests.md", "title": "Using GitHub Copilot to explore pull requests" }
Introduction can help you learn how to code: whether you have no prior programming experience, or when you are learning an additional programming language. This guide is all about the latter use case: you already have a good knowledge of how to code in one or more programming languages, but now you want to learn a new...
{ "source": "github-docs/copilot/tutorials/learn-a-new-language.md", "title": "Learning a new programming language with GitHub Copilot" }
Introduction Migrating a project to a new programming language can be a difficult and time-consuming task. can help you with this process by explaining the changes you need to make and suggesting replacement code in the new language. Principles of migrating a project to a new language Consider the points before you s...
{ "source": "github-docs/copilot/tutorials/migrate-a-project.md", "title": "Using GitHub Copilot to migrate a project to another programming language" }
LICENSE content ├── 404.phtml ├── about-us.phtml ├── contact.phtml ├── home.phtml └── products.phtml includes ├── config.php └── functions.php index.php readme.md template ├── style.css └── template.php This example gives the prompts you can enter into to complete the migration, and the responses returned for one ins...
{ "source": "github-docs/copilot/tutorials/migrate-a-project.md", "title": "Using GitHub Copilot to migrate a project to another programming language" }
<!-- expires 2026-10-31 -- <!-- When this expires, check with the stakeholder for release 18998 on whether or not the content is still needed -- The app modernization extension in automates Java upgrades by identifying outdated frameworks, deprecated APIs, and upgrade blockers. applies code changes, updates build fi...
{ "source": "github-docs/copilot/tutorials/modernize-java-applications.md", "title": "Modernizing Java applications with GitHub Copilot" }
[!NOTE] The responses shown in this article are examples. responses are non-deterministic, so you may get different responses from the ones shown here. Legacy code is code that is old, outdated, or no longer supported by the original developers. It can be difficult to maintain and extend because it may not follow mode...
{ "source": "github-docs/copilot/tutorials/modernize-legacy-code.md", "title": "Modernizing legacy code with GitHub Copilot" }
Convert this to markdown syntax to insert as a new file outputs a test plan in Markdown format that you can use to validate the application. To use this plan later in the process, create a file called TESTPLAN.md and copy the suggested plan into it. This will allow you to reference the test plan when generating test c...
{ "source": "github-docs/copilot/tutorials/modernize-legacy-code.md", "title": "Modernizing legacy code with GitHub Copilot" }
Introduction The strategies outlined in this article show you how to improve efficiency and, as a result, use fewer . 1. Choose the right model for the right task By selecting the right capability level for your task, configuring reasoning appropriately, and leveraging and cheaper models for specific workloads, you ...
{ "source": "github-docs/copilot/tutorials/optimize-ai-usage.md", "title": "Optimizing your AI usage to maximize efficiency and reduce cost" }
Introduction Code reviews are more efficient when you spend less time on minor implementation details, such as naming and style conventions, and instead focus your effort on higher level design, problem solving, and functionality that meets user needs. In this article, we'll show how automatic reviews from can help op...
{ "source": "github-docs/copilot/tutorials/optimize-code-reviews.md", "title": "Build an optimized review process with {% data variables.product.prodname_copilot_short %}" }
Missing error handling for network calls The notify_inventory function makes a synchronous network call without any error handling for timeouts, connection failures, or non-200 responses. Why this matters: - Network failures will cause unhandled exceptions and crash the order processing flow - Orders could be marked as...
{ "source": "github-docs/copilot/tutorials/optimize-code-reviews.md", "title": "Build an optimized review process with {% data variables.product.prodname_copilot_short %}" }
[!NOTE] This feature is in and subject to change. The responses shown in this article are examples. responses are non-deterministic, so you may get different responses from the ones shown here. Manage your project with using . In this tutorial, you’ll use ’s agentic issue creation features to turn your product i...
{ "source": "github-docs/copilot/tutorials/plan-a-project.md", "title": "Planning a project with GitHub Copilot" }
Introduction Technical debt accumulates in every codebase: duplicate code, missing tests, outdated dependencies, and inconsistent patterns. These issues can accumulate because feature development is typically given a higher priority. This tutorial explains how you can use to tackle technical debt systematically, witho...
{ "source": "github-docs/copilot/tutorials/reduce-technical-debt.md", "title": "Using GitHub Copilot to reduce technical debt" }
Introduction Refactoring code is the process of restructuring existing code without changing its behavior. The benefits of refactoring include improving code readability, reducing complexity, making the code easier to maintain, and allowing new features to be added more easily. This article gives you some ideas for usi...
{ "source": "github-docs/copilot/tutorials/refactor-code.md", "title": "Refactoring code with GitHub Copilot" }
Reviewing code generated by AI tools like , ChatGPT, or other agents is becoming an essential part of the modern developer workflow. This guide provides practical techniques, emphasizes the importance of human oversight and testing, and includes example prompts to showcase how AI can assist in the review process. For b...
{ "source": "github-docs/copilot/tutorials/review-ai-generated-code.md", "title": "Review AI-generated code" }
Introduction When you adopt in a company, you will sign up to a plan designed for businesses. These plans allow you to grant access to users and meet security requirements with policies and audit logs. To identify which plan is right for your company: 1. Define the overall goals you are hoping to achieve with your r...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/assign-licenses/choose-enterprise-plan.md", "title": "Choosing your enterprise's plan for GitHub Copilot" }
When you're rolling out in a business, it's important to keep track of which users are using their license, so you can respond effectively by reassigning unused licenses or helping people to get started with . You can use the List all Copilot seat assignments for an organization API endpoint to find the last activity...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/assign-licenses/remind-inactive-users.md", "title": "Reminding inactive users to use their GitHub Copilot license" }
When you've enabled in an organization or enterprise, you can set up a self-serve workflow to allow users to request licenses. This allows you to allocate licenses to people who want them, and means people can get started with quickly. has found that many successful rollouts offer a fully self-service model where de...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/assign-licenses/set-up-self-serve-licenses.md", "title": "Setting up a self-serve process for GitHub Copilot licenses" }
After you assign licenses across your enterprise, you can use the usage metrics dashboard and APIs to verify that licenses are active and monitor early usage trends. This helps you evaluate whether your rollout is reaching the right people and take quick action if adoption is slower than expected. To get a wider view...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/assign-licenses/track-usage-and-adoption.md", "title": "Tracking license activation and initial usage with Copilot usage metrics" }
1. Identify barriers to success Teams often experience delays in merging pull requests due to lengthy review cycles. These delays often stem from: Complex code changes that are difficult to understand Inconsistent code formatting that makes reviews challenging A general lack of context provided with the changes Soc...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/drive-downstream-impact/accelerate-pull-requests.md", "title": "Accelerating pull requests in your company with GitHub Copilot" }
When your company rolls out a new tool such as , you will want to measure the impact of the tool on your engineering systems and assess the tool's contribution to your company's goals. 's Engineering System Success Playbook (ESSP) provides strategies and metrics for driving meaningful and measurable improvements. The p...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/drive-downstream-impact/achieve-company-goals.md", "title": "Achieving your company's engineering goals with GitHub Copilot" }
1. Identify barriers to success Many software teams face persistent challenges in maintaining high-quality code due to low unit test coverage. In fast-paced development environments, writing tests is often seen as time-consuming or non-essential, especially when teams are under pressure to deliver features quickly. As ...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/drive-downstream-impact/increase-test-coverage.md", "title": "Increasing test coverage in your company with GitHub Copilot" }
1. Identify barriers to success Development teams often focus on speed and functionality to deliver new features and keep applications running smoothly. Over time, small issues can accumulate, such as: Known security weaknesses that remain unfixed Reliance on older software components with potential flaws Delays in ...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/drive-downstream-impact/reduce-security-debt.md", "title": "Reducing security debt in your company with GitHub Copilot" }
An effective enablement process is essential to drive adoption of in your organization. This process should be tailored to your organization's needs and goals, and should be designed to help your teams understand how to use effectively. Your enablement process may evolve based on feedback and results. You should regu...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/enable-developers/drive-adoption.md", "title": "Driving GitHub Copilot adoption in your company" }
About AI agents on Developers in your enterprise may already use AI as a pair programming tool, receiving code suggestions synchronously during development. AI agents are more like peer programmers. They can: Perform asynchronous tasks, such as running tests or fixing issues in your backlog, with less need for human ...
{ "source": "github-docs/copilot/tutorials/roll-out-at-scale/enable-developers/integrate-ai-agents.md", "title": "Integrating agentic AI into your enterprise's software development lifecycle" }