Skip to content

Commit 1e481f6

Browse files
authored
Merge pull request #39696 from github/repo-sync
Repo sync
2 parents f584b8f + b753dff commit 1e481f6

File tree

10 files changed

+399
-77
lines changed

10 files changed

+399
-77
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ---------------------------------------------------------------
99
# To update the sha:
1010
# https://github.com/github/gh-base-image/pkgs/container/gh-base-image%2Fgh-base-noble
11-
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250730-174526-g48ad667e7 AS base
11+
FROM ghcr.io/github/gh-base-image/gh-base-noble:20250805-204228-g50c20871f AS base
1212

1313
# Install curl for Node install and determining the early access branch
1414
# Install git for cloning docs-early-access & translations repos

content/copilot/how-tos/configure-custom-instructions/add-repository-instructions.md

Lines changed: 102 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ contentType: how-tos
1616

1717
{% webui %}
1818

19-
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
20-
2119
This version of this article is for using repository custom instructions on the {% data variables.product.github %} website. Click the tabs above for information on using custom instructions in other environments. <!-- markdownlint-disable-line MD027 -->
2220

2321
{% endwebui %}
@@ -36,16 +34,12 @@ This version of this article is for using repository custom instructions in {% d
3634

3735
{% jetbrains %}
3836

39-
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
40-
4137
This version of this article is for using repository custom instructions in JetBrains IDEs. Click the tabs above for instructions on using custom instructions in other environments.
4238

4339
{% endjetbrains %}
4440

4541
{% xcode %}
4642

47-
> [!NOTE] This feature is currently in {% data variables.release-phases.public_preview %} and is subject to change.
48-
4943
This version of this article is for using repository custom instructions in Xcode. Click the tabs above for instructions on using custom instructions in other environments.
5044

5145
{% endxcode %}
@@ -64,8 +58,6 @@ Repository custom instructions let you provide {% data variables.product.prodnam
6458

6559
* Your personal choice of whether to use custom instructions must be set to enabled. This is enabled by default. See [Enabling or disabling repository custom instructions](#enabling-or-disabling-repository-custom-instructions) later in this article.
6660

67-
* During the {% data variables.release-phases.public_preview %}, if you're using a {% data variables.copilot.copilot_business_short %} {% ifversion ghec %}or {% data variables.copilot.copilot_enterprise_short %}{% endif %} plan, the organization {% ifversion ghec %}or enterprise{% endif %} that provides your plan must have the **Opt in to preview features** setting enabled. See [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization){% ifversion ghec %} and [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise#copilot-in-githubcom){% endif %}.
68-
6961
{% endwebui %}
7062

7163
{% vscode %}
@@ -76,7 +68,7 @@ Repository custom instructions let you provide {% data variables.product.prodnam
7668

7769
{% visualstudio %}
7870

79-
* The **Enable custom instructions** option must be enabled in your settings. This is enabled by default. See [Enabling or disabling repository custom instructions](#enabling-or-disabling-repository-custom-instructions) later in this article.
71+
* The **Enable custom instructions...** option must be enabled in your settings. This is enabled by default. See [Enabling or disabling repository custom instructions](#enabling-or-disabling-repository-custom-instructions) later in this article.
8072

8173
{% endvisualstudio %}
8274

@@ -206,12 +198,108 @@ Whitespace between instructions is ignored, so the instructions can be written a
206198

207199
{% webui %}
208200

209-
**{% data variables.copilot.copilot_chat_short %}** on the {% data variables.product.github %} website and **{% data variables.copilot.copilot_code-review_short %}** support a single `.github/copilot-instructions.md` custom instructions file stored in the repository.
201+
**{% data variables.copilot.copilot_chat_short %}** on the {% data variables.product.github %} website, **{% data variables.copilot.copilot_coding_agent %}** and **{% data variables.copilot.copilot_code-review_short %}** support a single `.github/copilot-instructions.md` custom instructions file stored in the repository.
210202

211203
In addition, **{% data variables.copilot.copilot_coding_agent %}** supports one or more `.instructions.md` files stored within `.github/instructions` in the repository. Each file can specify `applyTo` frontmatter to define what files or directories its instructions apply to.
212204

213205
### Using a single `.github/copilot-instructions.md` file
214206

207+
You can ask {% data variables.copilot.copilot_coding_agent %} to generate a `.github/copilot-instructions.md` file, or you can write your own instructions file.
208+
209+
#### Asking {% data variables.copilot.copilot_coding_agent %} to generate a `.github/copilot-instructions.md` file
210+
211+
> [!NOTE]
212+
> {% data reusables.copilot.coding-agent.preview-note-text %}
213+
214+
1. Navigate to the Agents page at [github.com/copilot/agents](https://github.com/copilot/agents).
215+
216+
You can also reach this page by clicking the **{% octicon "copilot" aria-label="Copilot icon" %}** button next to the search bar on any page on {% data variables.product.github %}, then selecting **Agents** from the sidebar.
217+
218+
1. Using the dropdown menu in the prompt field, select the repository you want {% data variables.product.prodname_copilot_short %} to generate custom instructions for.
219+
220+
1. Copy the following prompt, customizing it if needed:
221+
222+
```markdown copy
223+
Your task is to "onboard" this repository to Copilot coding agent by adding a .github/copilot-instructions.md file in the repository that contains information describing how a coding agent seeing it for the first time can work most efficiently.
224+
225+
You will do this task only one time per repository and doing a good job can SIGNIFICANTLY improve the quality of the agent's work, so take your time, think carefully, and search thoroughly before writing the instructions.
226+
227+
<Goals>
228+
- Reduce the likelihood of a coding agent pull request getting rejected by the user due to
229+
generating code that fails the continuous integration build, fails a validation pipeline, or
230+
having misbehavior.
231+
- Minimize bash command and build failures.
232+
- Allow the agent to complete its task more quickly by minimizing the need for exploration using grep, find, str_replace_editor, and code search tools.
233+
</Goals>
234+
235+
<Limitations>
236+
- Instructions must be no longer than 2 pages.
237+
- Instructions must not be task specific.
238+
</Limitations>
239+
240+
<WhatToAdd>
241+
242+
Add the following high level details about the codebase to reduce the amount of searching the agent has to do to understand the codebase each time:
243+
<HighLevelDetails>
244+
245+
- A summary of what the repository does.
246+
- High level repository information, such as the size of the repo, the type of the project, the languages, frameworks, or target runtimes in use.
247+
</HighLevelDetails>
248+
249+
Add information about how to build and validate changes so the agent does not need to search and find it each time.
250+
<BuildInstructions>
251+
252+
- For each of bootstrap, build, test, run, lint, and any other scripted step, document the sequence of steps to take to run it successfully as well as the versions of any runtime or build tools used.
253+
- Each command should be validated by running it to ensure that it works correctly as well as any preconditions and postconditions.
254+
- Try cleaning the repo and environment and running commands in different orders and document errors and and misbehavior observed as well as any steps used to mitigate the problem.
255+
- Run the tests and document the order of steps required to run the tests.
256+
- Make a change to the codebase. Document any unexpected build issues as well as the workarounds.
257+
- Document environment setup steps that seem optional but that you have validated are actually required.
258+
- Document the time required for commands that failed due to timing out.
259+
- When you find a sequence of commands that work for a particular purpose, document them in detail.
260+
- Use language to indicate when something should always be done. For example: "always run npm install before building".
261+
- Record any validation steps from documentation.
262+
</BuildInstructions>
263+
264+
List key facts about the layout and architecture of the codebase to help the agent find where to make changes with minimal searching.
265+
<ProjectLayout>
266+
267+
- A description of the major architectural elements of the project, including the relative paths to the main project files, the location
268+
of configuration files for linting, compilation, testing, and preferences.
269+
- A description of the checks run prior to check in, including any GitHub workflows, continuous integration builds, or other validation pipelines.
270+
- Document the steps so that the agent can replicate these itself.
271+
- Any explicit validation steps that the agent can consider to have further confidence in its changes.
272+
- Dependencies that aren't obvious from the layout or file structure.
273+
- Finally, fill in any remaining space with detailed lists of the following, in order of priority: the list of files in the repo root, the
274+
contents of the README, the contents of any key source files, the list of files in the next level down of directories, giving priority to the more structurally important and snippets of code from key source files, such as the one containing the main method.
275+
</ProjectLayout>
276+
</WhatToAdd>
277+
278+
<StepsToFollow>
279+
- Perform a comprehensive inventory of the codebase. Search for and view:
280+
- README.md, CONTRIBUTING.md, and all other documentation files.
281+
- Search the codebase for build steps and indications of workarounds like 'HACK', 'TODO', etc.
282+
- All scripts, particularly those pertaining to build and repo or environment setup.
283+
- All build and actions pipelines.
284+
- All project files.
285+
- All configuration and linting files.
286+
- For each file:
287+
- think: are the contents or the existence of the file information that the coding agent will need to implement, build, test, validate, or demo a code change?
288+
- If yes:
289+
- Document the command or information in detail.
290+
- Explicitly indicate which commands work and which do not and the order in which commands should be run.
291+
- Document any errors encountered as well as the steps taken to workaround them.
292+
- Document any other steps or information that the agent can use to reduce time spent exploring or trying and failing to run bash commands.
293+
- Finally, explicitly instruct the agent to trust the instructions and only perform a search if the information in the instructions is incomplete or found to be in error.
294+
</StepsToFollow>
295+
- Document any errors encountered as well as the steps taken to work-around them.
296+
297+
1. Click **Send now** or press <kbd>Return</kbd>.
298+
299+
{% data variables.product.prodname_copilot_short %} will start a new session, which will appear in the list below the prompt box. {% data variables.product.prodname_copilot_short %} will create a draft pull request, write your custom instructions, push them to the branch, then add you as a reviewer when it has finished, triggering a notification.
300+
301+
#### Writing your own `.github/copilot-instructions.md` file
302+
215303
1. In the root of your repository, create a file named `.github/copilot-instructions.md`.
216304

217305
Create the `.github` directory if it does not already exist.
@@ -220,6 +308,9 @@ In addition, **{% data variables.copilot.copilot_coding_agent %}** supports one
220308

221309
Whitespace between instructions is ignored, so the instructions can be written as a single paragraph, each on a new line, or separated by blank lines for legibility.
222310

311+
> [!TIP]
312+
> The first time you create a pull request in a given repository with {% data variables.copilot.copilot_coding_agent %}, {% data variables.product.prodname_copilot_short %} will leave a comment with a link to automatically generate custom instructions for the repository.
313+
223314
### Using one or more `.instructions.md` files
224315

225316
1. Create the `.github/instructions` directory if it does not already exist.
@@ -397,7 +488,7 @@ Your choice persists, for all repositories containing a custom instructions file
397488
![Screenshot of the {% data variables.product.prodname_vs %} menu bar. The "Tools" menu is expanded, and the "Options" item is highlighted with an orange outline.](/assets/images/help/copilot/vs-toolbar-options.png)
398489

399490
1. In the "Options" dialog, type `custom instructions` in the search box, then click **{% data variables.product.prodname_copilot_short %}**.
400-
1. Select or clear the checkbox for **(Preview) Enable custom instructions to be loaded from .github/copilot-instructions.md files and added to requests**.
491+
1. Select or clear the checkbox for **Enable custom instructions to be loaded from .github/copilot-instructions.md files and added to requests**.
401492

402493
{% data reusables.copilot.custom-instructions-enabling-for-ccr %}
403494

content/copilot/tutorials/coding-agent/get-the-best-results.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ If {% data variables.product.prodname_copilot_short %} is able to build, test an
7979

8080
You can add instructions in a single `.github/copilot-instructions.md` file in the repository, or create one or more `.github/instructions/**/*.instructions.md` files applying to different files or directories in your repository. For more information, see [AUTOTITLE](/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot?tool=webui).
8181

82-
Here is an example of an effective `copilot-instructions.md` file:
82+
The first time you ask {% data variables.product.prodname_copilot_short %} to create a pull request in a given repository, {% data variables.product.prodname_copilot_short %} will leave a comment with a link to automatically generate custom instructions. You can also ask {% data variables.product.prodname_copilot_short %} to generate custom instructions for you at any time using our recommended prompt. See [AUTOTITLE](/copilot/how-tos/configure-custom-instructions/add-repository-instructions?tool=webui#asking-copilot-coding-agent-to-generate-a-githubcopilot-instructionsmd-file).
83+
84+
You can also choose to write your own custom instructions at any time. Here is an example of an effective `copilot-instructions.md` file:
8385

8486
```markdown
8587
This is a Go based repository with a Ruby client for certain API endpoints. It is primarily responsible for ingesting metered usage for GitHub and recording that usage. Please follow these guidelines when contributing:

content/site-policy/github-terms/github-pre-release-license-terms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ These terms apply to the pre-release software made available to you by GitHub. T
2626

2727
## 2. Installation and Use Rights.
2828

29-
a. **General**. GitHub grants you a limited right to use a non-production instance of the software. You may use any number of copies of the software to develop and test your applications, including deployment within your internal corporate network. You may also use the software in demonstrating your applications.
29+
a. **General**. GitHub grants you a limited right to use a non-production instance of the software for evaluation and testing. This means you may use any number of copies of the software to evaluate its functionality and internally develop and test your applications, including deployment of the software within your internal corporate network for evaluation but not external distribution. You may also use the software in internally demonstrating your applications, but may not use the pre-release software in any active production environment, including any use to process live customer data.
3030

3131
b. **Inclusion of Third-Party Components.** The software may include third-party components with separate legal notices or governed by other agreements, as may be described in a license file accompanying the software.
3232

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
> [!NOTE]
2-
> Custom instructions for {% data variables.copilot.copilot_code-review_short %} are in {% data variables.release-phases.public_preview %} and are subject to change.
3-
>
4-
> During the {% data variables.release-phases.public_preview %}, if you're using a {% data variables.copilot.copilot_business_short %} or {% data variables.copilot.copilot_enterprise_short %} plan, the organization or enterprise that provides your plan must have the **Opt in to preview features** setting enabled. See [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization) or [AUTOTITLE](/enterprise-cloud@latest/copilot/managing-copilot/managing-copilot-for-your-enterprise/managing-policies-and-features-for-copilot-in-your-enterprise#copilot-in-githubcom)
5-
61
You can customize {% data variables.copilot.copilot_code-review_short %} by adding a `.github/copilot-instructions.md` file in your repository containing information that you want {% data variables.product.prodname_copilot_short %} to consider when reviewing code. This is the same `copilot-instructions.md` used by {% data variables.copilot.copilot_chat_short %}. See [AUTOTITLE](/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot).
72

83
### Example

src/ghes-releases/lib/enterprise-dates.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
},
154154
"3.14": {
155155
"releaseDate": "2024-08-06",
156-
"deprecationDate": "2025-08-27"
156+
"deprecationDate": "2026-01-27"
157157
},
158158
"3.15": {
159159
"releaseDate": "2024-11-12",
@@ -191,4 +191,4 @@
191191
"releaseDate": "2026-11-10",
192192
"deprecationDate": "2027-12-08"
193193
}
194-
}
194+
}

0 commit comments

Comments
 (0)