Add .github/copilot-instructions.md and copilot-setup-steps.yml for coding agent onboarding#5
Add .github/copilot-instructions.md and copilot-setup-steps.yml for coding agent onboarding#5
Conversation
Co-authored-by: jaredmixpanel <10504508+jaredmixpanel@users.noreply.github.com>
|
@copilot Add a # Customizing the development environment for GitHub Copilot coding agent
Learn how to customize GitHub Copilot's development environment with additional tools.
## About customizing Copilot coding agent's development environment
While working on a task, Copilot has access to its own ephemeral development environment, powered by GitHub Actions, where it can explore your code, make changes, execute automated tests and linters and more.
You can customize Copilot's development environment with a [Copilot setup steps file](#customizing-copilots-development-environment-with-copilot-setup-steps). You can use a Copilot setup steps file to:
* [Preinstall tools or dependencies in Copilot's environment](#preinstalling-tools-or-dependencies-in-copilots-environment)
* [Upgrade from standard GitHub-hosted GitHub Actions runners to larger runners](#upgrading-to-larger-github-hosted-github-actions-runners)
* [Run on GitHub Actions self-hosted runners](#using-self-hosted-github-actions-runners)
* [Give Copilot a Windows development environment](#switching-copilot-to-a-windows-development-environment), instead of the default Ubuntu Linux environment
* [Enable Git Large File Storage (LFS)](#enabling-git-large-file-storage-lfs)
In addition, you can:
* [Set environment variables in Copilot's environment](#setting-environment-variables-in-copilots-environment)
* [Disable or customize the agent's firewall](/en/copilot/customizing-copilot/customizing-or-disabling-the-firewall-for-copilot-coding-agent).
## Customizing Copilot's development environment with Copilot setup steps
You can customize Copilot's environment by creating a special GitHub Actions workflow file, located at `.github/workflows/copilot-setup-steps.yml` within your repository.
A `copilot-setup-steps.yml` file looks like a normal GitHub Actions workflow file, but must contain a single `copilot-setup-steps` job. The steps in this job will be executed in GitHub Actions before Copilot starts working. For more information on GitHub Actions workflow files, see [Workflow syntax for GitHub Actions](/en/actions/using-workflows/workflow-syntax-for-github-actions).
> \[!NOTE]
> The `copilot-setup-steps.yml` workflow won't trigger unless it's present on your default branch.
Here is a simple example of a `copilot-setup-steps.yml` file for a TypeScript project that clones the project, installs Node.js and downloads and caches the project's dependencies. You should customize this to fit your own project's language(s) and dependencies:
```yaml copy
name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission.
# If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
# ...In your
For more information on these options, see Workflow syntax for GitHub Actions. Any value that is set for the Your Once you have merged the yml file into your default branch, you can manually run the workflow from the repository's Actions tab at any time to check that everything works as expected. For more information, see Manually running a workflow. When Copilot starts work, your setup steps will be run, and updates will show in the session logs. See Tracking GitHub Copilot's sessions. If any setup step fails by returning a non-zero exit code, Copilot will skip the remaining setup steps and begin working with the current state of its development environment. Preinstalling tools or dependencies in Copilot's environmentIn its ephemeral development environment, Copilot can build or compile your project and run automated tests, linters and other tools. To do this, it will need to install your project's dependencies. Copilot can discover and install these dependencies itself via a process of trial and error, but this can be slow and unreliable, given the non-deterministic nature of large language models (LLMs), and in some cases, it may be completely unable to download these dependencies—for example, if they are private. You can use a Copilot setup steps file to deterministically install tools or dependencies before Copilot starts work. To do this, add # ...
jobs:
copilot-setup-steps:
# ...
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install JavaScript dependencies
run: npm ciUpgrading to larger GitHub-hosted GitHub Actions runnersBy default, Copilot works in a standard GitHub Actions runner. You can upgrade to larger runners for better performance (CPU and memory), more disk space and advanced features like Azure private networking. For more information, see Larger runners.
Note
Using self-hosted GitHub Actions runnersYou can run Copilot coding agent on self-hosted runners. You may want to do this to match how you run CI/CD workflows on GitHub Actions, or to give Copilot access to internal resources on your network. We recommend that you only use Copilot coding agent with ephemeral, single-use runners that are not reused for multiple jobs. Most customers set this up using ARC (Actions Runner Controller) or the GitHub Actions Runner Scale Set Client. For more information, see Self-hosted runners reference. Note Copilot coding agent is only compatible with Ubuntu x64 and Windows 64-bit runners. Runners with macOS or other operating systems are not supported.
Switching Copilot to a Windows development environmentBy default, Copilot uses an Ubuntu Linux-based development environment. You may want to use a Windows development environment if you're building software for Windows or your repository uses a Windows-based toolchain so Copilot can build your project, run tests and validate its work. Copilot coding agent's integrated firewall is not compatible with Windows, so we recommend that you only use self-hosted runners or larger GitHub-hosted runners with Azure private networking where you can implement your own network controls. For more information on runners with Azure private networking, see About Azure private networking for GitHub-hosted runners in your enterprise. To use Windows with self-hosted runners, follow the instructions in the Using self-hosted GitHub Actions runners section above, using the label for your Windows runners. To use Windows with larger GitHub-hosted runners, follow the instructions in the Upgrading to larger runners section above, using the label for your Windows runners. Enabling Git Large File Storage (LFS)If you use Git Large File Storage (LFS) to store large files in your repository, you will need to customize Copilot's environment to install Git LFS and fetch LFS objects. To enable Git LFS, add a # ...
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout
steps:
- uses: actions/checkout@v5
with:
lfs: trueSetting environment variables in Copilot's environmentYou may want to set environment variables in Copilot's environment to configure or authenticate tools or dependencies that it has access to. To set an environment variable for Copilot, create a GitHub Actions variable or secret in the
Further reading |
Co-authored-by: jaredmixpanel <10504508+jaredmixpanel@users.noreply.github.com>
... Added |
There was a problem hiding this comment.
Pull request overview
Adds Copilot coding agent onboarding materials to make repository setup, conventions, CI expectations, and architecture easier to discover and follow.
Changes:
- Add a GitHub Actions workflow to provision Flutter 3.41.2 and fetch dependencies for agent runs.
- Add
.github/copilot-instructions.mdsummarizing repo layout, commands, CI job matrix, architecture, performance/testing rules, and known reviewed decisions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/copilot-setup-steps.yml | Adds a setup workflow to install Flutter 3.41.2 and run basic version verification. |
| .github/copilot-instructions.md | Adds a consolidated onboarding guide for Copilot agent work (commands, CI, architecture, conventions). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Adds repository onboarding configuration for Copilot coding agent, synthesized from existing docs (CLAUDE.md, ARCHITECTURE.md, CI workflows, test patterns).
.github/workflows/copilot-setup-steps.ymlpre-installs Flutter 3.41.2 (matching CI) and resolves project dependencies so the agent can runflutter test,dart analyze, anddart formatdirectly--language-version=latestformatting requirement that silently produces different output without it🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.