Skip to content

Commit 7b241e5

Browse files
authored
Merge pull request #45154 from github/repo-sync
Repo sync
2 parents 0e9fa09 + 7d77302 commit 7b241e5

14 files changed

Lines changed: 231 additions & 13 deletions

File tree

.github/workflows/ready-for-doc-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
owner: github
3030
# Scope must include every repo that calls this reusable workflow, because
3131
# the script resolves the PR node (ITEM_NODE_ID) in the calling repo.
32-
repositories: docs-internal,docs-content,docs-strategy,docs-early-access,github
32+
repositories: docs-internal,docs-content,docs-strategy,docs-early-access,docs-team,github
3333

3434
- name: Check out repo content
3535
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

content/copilot/concepts/agents/code-review.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,21 @@ The more {% data variables.product.prodname_copilot_short %} knows about the cod
186186

187187
These are short, natural-language statements that you write and store as one or more files in a repository. If you are the owner of an organization on {% data variables.product.github %}, you can also define custom instructions in the settings for your organization. For more information, see [AUTOTITLE](/copilot/concepts/prompting/response-customization?tool=webui#about-repository-custom-instructions).
188188

189+
### Choosing between custom instructions, AGENTS.md, and skills
190+
191+
{% data variables.copilot.copilot_code-review_short %} can draw on several sources of customization, and each serves a different purpose. Use `.github/copilot-instructions.md` for repository-wide rules specific to {% data variables.product.prodname_copilot_short %}, use path-specific `*.instructions.md` files under `.github/instructions/` for rules that apply only to certain files or directories, use `AGENTS.md` for standing rules you want to share across AI tools and agents, and use skills for task-specific workflows that {% data variables.product.prodname_copilot_short %} runs on demand. The following table summarizes when to use each and how to provide rules.
192+
193+
| Use | `copilot-instructions.md` | Path-specific `*.instructions.md` | `AGENTS.md` | Skills |
194+
| --- | --- | --- | --- | --- |
195+
| Best for | Repository-wide, always-on rules for {% data variables.product.prodname_copilot_short %} | Always-on rules for specific paths, file types, or directories | Always-on rules shared across AI agents | Task-specific review workflows |
196+
| Stored in | `.github/copilot-instructions.md` | `.github/instructions/**/*.instructions.md` | Repository root (`AGENTS.md`) | `.github/skills/...` |
197+
| Examples | Coding standards, architecture defaults, test expectations | `content/**` writing rules, `src/**` coding conventions, language-specific guidance | Shared repository conventions that should apply beyond {% data variables.product.prodname_copilot_short %} | Reviews, releases, migrations, analysis |
198+
| Activation | Automatic | Automatic when the changed files match the instruction scope | Automatic (read from repository root) | Automatic when relevant (e.g. review-focused skills such as `code-review`), or on demand |
199+
| Scope | Repository-wide and {% data variables.product.prodname_copilot_short %}-specific | Repository sub-paths and {% data variables.product.prodname_copilot_short %}-specific | Cross-tool / agent-agnostic | Invoked per task |
200+
| Rule | "{% data variables.product.prodname_copilot_short %}, always know this for this repository" | "{% data variables.product.prodname_copilot_short %}, always know this when working in these paths" | "Any agent, always know this" | "Do this when needed" |
201+
202+
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills) and [AUTOTITLE](/copilot/how-tos/configure-custom-instructions/add-repository-instructions).
203+
189204
### {% data variables.copilot.copilot_memory %} ({% data variables.release-phases.public_preview %})
190205

191206
If you have a {% data variables.copilot.copilot_pro_short %}, {% data variables.copilot.copilot_pro_plus_short %}, or {% data variables.copilot.copilot_max_short %} plan, you can enable {% data variables.copilot.copilot_memory %}. This allows {% data variables.product.prodname_copilot_short %} to store useful details it has learned about a repository. {% data variables.product.prodname_copilot_short %} can then use this information when it reviews pull requests in that repository. For more information, see [AUTOTITLE](/copilot/concepts/agents/copilot-memory).

content/copilot/how-tos/copilot-on-github/use-copilot-agents/overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Pick a repository where {% data variables.copilot.copilot_cloud_agent %} is enab
3030
While {% data variables.product.prodname_copilot_short %} works on the issue, start a second, non-coding task to see two sessions running in parallel.
3131

3232
1. In the same repository, click the **{% octicon "agent" aria-hidden="true" aria-label="agent" %} Agents** tab.
33-
1. Type a research prompt.
34-
33+
1. Type a research prompt.
34+
3535
For example: `Investigate which dependencies in this repo are outdated and summarize what upgrading would involve.`
3636
1. Click **{% octicon "paper-airplane" aria-label="Start task" %}** or press <kbd>Enter</kbd>.
3737

@@ -52,7 +52,7 @@ For more details on monitoring, steering, and stopping sessions, see [AUTOTITLE]
5252
When the coding task finishes, {% data variables.product.prodname_copilot_short %} opens a pull request and adds you as a reviewer.
5353

5454
1. Open the pull request from the notification or from the session log.
55-
1. In the right sidebar, click **Reviewers**, then select **{% data variables.product.prodname_copilot_short %}**.
55+
1. Under "Reviewers" in the right sidebar, next to **{% data variables.product.prodname_copilot_short %}**, click **Request**.
5656
1. Wait for {% data variables.copilot.copilot_code-review_short %} to leave comments—usually under 30 seconds.
5757

5858
Read through the review comments. {% data variables.product.prodname_copilot_short %} may suggest changes you can apply directly with a click.

content/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ category:
2424

2525
For a full introduction to {% data variables.copilot.copilot_code-review %}, see [AUTOTITLE](/copilot/concepts/agents/code-review).
2626

27+
{% data variables.copilot.copilot_code-review_short %} uses {% data variables.product.prodname_actions %} to run agentic capabilities. For more information, see [Agentic capabilities for {% data variables.copilot.copilot_code-review_short %}](/copilot/concepts/agents/code-review#usage-of-github-actions-runners-for-agentic-capabilities-in-code-review).
28+
2729
{% webui %}
2830

2931
{% data variables.copilot.copilot_code-review_short %} is also available for organization members without a {% data variables.product.prodname_copilot_short %} license, when enabled by an enterprise administrator or organization owner. See [{% data variables.copilot.copilot_code-review_short %} for organization members without a {% data variables.product.prodname_copilot_short %} license](/copilot/concepts/agents/code-review#copilot-code-review-for-organization-members-without-a-copilot-license).

content/copilot/reference/custom-instructions-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ WRITING NOTE: The following tables have been written using HTML rather than Mark
5252
<ul style="list-style: none; padding-left: 1.5em; margin-left: 0;">
5353
{% data reusables.copilot.ci-support-repository %}
5454
{% data reusables.copilot.ci-support-path %}
55+
{% data reusables.copilot.ci-support-agents-only %}
5556
{% data reusables.copilot.ci-support-organization %}
5657
</ul>
5758
</td>

content/copilot/tutorials/customize-code-review.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ const activeUsers = users.filter(user => user.isActive);
109109

110110
## Organizing instructions across files
111111

112-
{% data variables.copilot.copilot_code-review_short %} supports two types of instruction files:
112+
{% data variables.copilot.copilot_code-review_short %} supports several types of instruction files:
113113

114114
1. **`copilot-instructions.md`**: Repository-wide instructions that apply to all files.
115115
1. **`*.instructions.md`**: Path-specific instructions that apply to certain files or directories.
116+
1. **`AGENTS.md`**: Repository-level agent-specific instructions.
116117

117118
Use path-specific instructions to keep {% data variables.product.prodname_copilot_short %} focused and prevent it from applying language-specific rules to the wrong files.
118119

@@ -229,11 +230,37 @@ applyTo: "src/components/**/*.{tsx,jsx}"
229230
- Ensure color contrast meets WCAG AA standards
230231
````
231232

233+
### When to use agent-specific instructions
234+
235+
Use `AGENTS.md` for instructions that apply to specific {% data variables.copilot.custom_agents_short %} in your repository. This allows you to tailor the behavior of different agents for different tasks, including shaping {% data variables.copilot.copilot_code-review_short %} feedback to better reflect your repository's conventions and expectations.
236+
237+
**Example: Agent-specific instructions**
238+
239+
Create a file called `AGENTS.md` at the root of your repository:
240+
241+
````markdown copy
242+
# AGENTS.md
243+
244+
## Code Review
245+
246+
Your primary goal is to validate that incoming code changes are secure, performant, and match this repository's engineering standards.
247+
248+
### Code Style & Anti-Patterns
249+
250+
Enforce these strict patterns for code inspection:
251+
252+
- **Asynchronous Code:** Prefer `async/await` syntax over explicit `.then()` chains.
253+
- **Error Handling:** Every API call must be wrapped in a structured `try/catch` block.
254+
- **State Management:** React components must keep local UI state completely isolated from global stores.
255+
````
256+
232257
### Breaking up complex instruction sets
233258

234259
For large repositories with many concerns, break instructions into multiple focused files:
235260

236261
```text
262+
AGENTS.md # Agent-specific
263+
237264
.github/
238265
copilot-instructions.md # General standards
239266

content/copilot/tutorials/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ children:
1111
- /budgets
1212
- /spark
1313
- /customize-code-review
14+
- /use-copilot-code-review-across-the-pull-request-lifecycle
1415
- /enhance-agent-mode-with-mcp
1516
- /compare-ai-models
1617
- /speed-up-development-work
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: Use GitHub Copilot code review across the pull request lifecycle
3+
shortTitle: Pull request lifecycle
4+
allowTitleToDifferFromFilename: true
5+
intro: Build a repeatable workflow for {% data variables.copilot.copilot_code-review_short %} from draft pull request to merge.
6+
versions:
7+
feature: copilot
8+
contentType: tutorials
9+
category:
10+
- Accelerate PR velocity
11+
- Team collaboration
12+
- Author and optimize with Copilot
13+
---
14+
15+
## Introduction
16+
17+
{% data variables.copilot.copilot_code-review_short %} is most effective when you use it as part of a pull request workflow. This tutorial shows how to choose between manual and automatic reviews, request reviews early on draft pull requests, and decide when to trigger re-review before merge.
18+
19+
You will also learn when to use customization, skills, MCP servers, and runner options to tailor {% data variables.product.prodname_copilot_short %}'s reviews to your needs.
20+
21+
## Work through the pull request lifecycle
22+
23+
Choose a review model and set up early feedback for draft and active pull requests.
24+
25+
### Choose the right review model for your team
26+
27+
{% data variables.copilot.copilot_code-review_short %} can run manually, when you trigger it yourself, or automatically, at one or more points in a pull request's lifecycle. Manual reviews give you control over exactly when {% data variables.copilot.copilot_code-review_short %} weighs in. Automatic reviews ensure consistent coverage, and you can choose whether they trigger on open, on draft, or on every new push.
28+
29+
| Review model | Best for | Why |
30+
| --- | --- | --- |
31+
| Manual review request | High-context changes or selective use | You can trigger {% data variables.product.prodname_copilot_short %} only when you want another perspective. |
32+
| Automatic review on open pull requests | Teams that want broad, consistent coverage | Every pull request gets baseline feedback without relying on individual habits. |
33+
| Automatic review on draft pull requests | Teams that want earlier feedback loops | Authors can fix issues before human review starts. |
34+
| Automatic review on new pushes | Fast-moving pull requests with multiple revisions | {% data variables.product.prodname_copilot_short %} reevaluates substantial updates as the pull request evolves. |
35+
36+
For setup steps, see [AUTOTITLE](/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review) and [AUTOTITLE](/copilot/how-tos/copilot-on-github/set-up-copilot/configure-automatic-review).
37+
38+
### Use {% data variables.copilot.copilot_code-review_short %} early on draft pull requests
39+
40+
Reviewing draft pull requests with {% data variables.copilot.copilot_code-review_short %} gives you an early, dependable check on your code before you request a review from your team.
41+
42+
A useful draft workflow is:
43+
44+
1. Open a pull request as draft.
45+
1. Request a review from {% data variables.copilot.copilot_code-review_short %} under **Reviewers**, or enable automatic review for draft pull requests.
46+
1. Address high-confidence feedback first, such as correctness, security, and clear maintainability issues.
47+
1. Push updates and confirm that major comments have been resolved.
48+
1. Mark the pull request as ready for human review.
49+
50+
This approach helps your team spend more human review time on design tradeoffs and product impact, instead of obvious issues that could have been caught earlier.
51+
52+
## Tune review quality
53+
54+
Improve review quality by deciding when to request re-review and where customization, external context, and runners add value.
55+
56+
### Use re-review before merge
57+
58+
After substantial changes, request re-review to check whether new risks were introduced while addressing earlier feedback.
59+
60+
Request re-review when you:
61+
62+
* Update multiple files across service or package boundaries.
63+
* Change security-sensitive or data-sensitive behavior.
64+
* Apply a large batch of suggested changes and want a final pass.
65+
66+
For teams with frequent updates to active pull requests, enabling automatic reviews on new pushes can reduce manual re-review requests while keeping feedback current.
67+
68+
### Match customization to your workflow
69+
70+
Customization is most useful when each file type supports a review decision point in your workflow:
71+
72+
* Use `.github/copilot-instructions.md` for repository-wide review expectations that should apply to most pull requests.
73+
* Use `.github/instructions/**/*.instructions.md` for agent-specific and path-specific guidance when different parts of the codebase have different standards.
74+
* Use `AGENTS.md` to provide repository context that improves relevance, such as intentional patterns, architecture boundaries, or review priorities.
75+
76+
Keep these files focused on what reviewers need to decide during pull requests. Avoid turning them into full engineering handbooks.
77+
78+
For detailed customization mechanics and examples, see [AUTOTITLE](/copilot/tutorials/customize-code-review).
79+
80+
### Use agent skills and MCP servers for specialized review goals
81+
82+
Agent skills and MCP servers are most valuable when your team needs reviews that depend on organization-specific context.
83+
84+
Use agent skills when you want reusable review routines, for example:
85+
86+
* Applying a standard checklist to migration pull requests.
87+
* Running language- or framework-specific review passes in a monorepo.
88+
* Prioritizing certain risk areas, such as authorization or billing logic.
89+
90+
Use MCP servers when reviews should reference context outside the pull request itself, for example:
91+
92+
* Linking pull request changes to issue, incident, or service ownership data.
93+
* Checking expected rollout or operational context from internal systems.
94+
* Validating implementation details against external documentation sources.
95+
96+
For setup details, see [AUTOTITLE](/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/add-skills) and [AUTOTITLE](/copilot/how-tos/copilot-on-github/customize-copilot/configure-mcp-servers).
97+
98+
### Decide whether you need self-hosted runners
99+
100+
In many cases, standard {% data variables.product.prodname_dotcom %}-hosted runners are sufficient for {% data variables.copilot.copilot_code-review_short %} and require no setup; they are configured for you by default.
101+
102+
Consider self-hosted or larger runners when you need:
103+
104+
* Better performance for heavier review workloads.
105+
* Network access to internal systems required by your organization.
106+
107+
Runners are required because {% data variables.copilot.copilot_code-review_short %} uses {% data variables.product.prodname_actions %} for agentic operations, such as deeper context gathering and tool-calling. If {% data variables.product.prodname_dotcom %}-hosted runners are unavailable and no supported self-hosted option is configured correctly, reviews will fall back to a more limited mode.
108+
109+
For planning and setup details, see [AUTOTITLE](/copilot/how-tos/copilot-on-github/set-up-copilot/configure-runners).
110+
111+
## Recommended workflows by scenario
112+
113+
| Team scenario | Recommended workflow |
114+
| --- | --- |
115+
| Small team with frequent pull requests | Enable automatic reviews for all pull requests, review drafts for early feedback, and use manual re-review before merge when changes are substantial. |
116+
| Large monorepo with mixed stacks | Enable automatic reviews and review new pushes, add path-specific instructions for each major area, and use skills for repeated review patterns. |
117+
| Security-sensitive or regulated codebase | Use draft pull request reviews plus required re-review before merge, keep repository-wide security expectations in `.github/copilot-instructions.md`, and use MCP servers for incident or compliance context stored outside of GitHub. |
118+
| Team with internal platform dependencies | Start with automatic review, then add self-hosted runners and MCP context only when internal-system access is required for useful review feedback. |
119+
120+
## Next steps
121+
122+
* For broader concepts, including review effort and agentic capabilities, see [AUTOTITLE](/copilot/concepts/agents/code-review).
123+
* To tune automated review quality for specific repositories, see [AUTOTITLE](/copilot/tutorials/optimize-code-reviews).
124+
* For excluded file types and other limits, see [AUTOTITLE](/copilot/reference/review-excluded-files).

data/reusables/copilot/code-review/custom-instructions-information.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
You can customize {% data variables.copilot.copilot_code-review_short %} by adding custom instructions to your repository.
1+
You can customize {% data variables.copilot.copilot_code-review_short %} by adding custom instructions to your repository. Repository custom instructions can either be repository wide or path specific.
22

3-
Repository custom instructions can either be repository wide or path specific. You specify repository-wide custom instructions in a `.github/copilot-instructions.md` file in your repository. You can use this file to store information that you want {% data variables.product.prodname_copilot_short %} to consider when reviewing code anywhere in the repository.
3+
Use `.github/copilot-instructions.md` for repository-wide review guidance that should apply across the entire codebase. This is a good place to describe organization-wide expectations, such as coding standards, review criteria, or general practices that {% data variables.product.prodname_copilot_short %} should consider in every review.
44

5-
You can also write instructions that {% data variables.product.prodname_copilot_short %} will only use when reviewing code in files that match a specified path. You write these instructions in one or more `.github/instructions/**/*.instructions.md` files.
5+
Use an `AGENTS.md` file in the root of your repository to provide additional repository context that helps {% data variables.product.prodname_copilot_short %} better understand how your project works. For example, you can explain which patterns are intentional, which parts of the codebase need closer scrutiny, and what your team considers good architecture, testing, and implementation practices. This helps make reviews more relevant and aligned with the way your team builds software.
6+
7+
Use `.github/instructions/**/*.instructions.md` files for path-specific instructions that only apply when reviewing matching files. This is useful when different parts of the repository follow different conventions, require specialized checks, or need review guidance tailored to a particular language, framework, or subsystem.
68

79
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions).
810

0 commit comments

Comments
 (0)