---
title: "GitHub Copilot custom instructions: パスと形式 · DotsAgent"
description: ".github/copilot-instructions.mdの配置場所、形式とfrontmatter、グローバル版とネストされた版の統合方法、読み込むツールを解説します。2026-10-01時点で確認済み。"
url: https://dotsagent.io/ja/instructions/files/github-copilot-instructions
---

.github/copilot-instructions.md

# GitHub Copilot custom instructions: 配置場所とツールでの読み込み方

GitHub Copilotは、リポジトリ全体に適用される .github/copilot-instructions.md と、パス固有の .instructions.md ファイルを読み込みます。また、AGENTS.md、またはルートにある単一の CLAUDE.md か GEMINI.md も読み込みます。

## 配置場所

- .github/copilot-instructions.md。リポジトリ全体に適用されます。
- .github/instructions/**/NAME.instructions.md。applyTo に一致するファイルに適用されます。
- リポジトリ内の任意の場所にある AGENTS.md。最も近いファイルが優先されます。
- 代替として、ルートにある単一の CLAUDE.md または GEMINI.md。

## 形式

Markdown。指示の間の空白は無視されます。frontmatterを指定できるのは .instructions.md ファイルのみです。applyTo にはカンマ区切りのglobを指定し、excludeAgent には "code-review" または "cloud-agent" を指定します。コードレビューの4,000文字制限は2026-06-12に撤廃されました。GitHubは、1ファイルあたり約1,000行以内を推奨しています。

Frontmatterのキー: `applyTo``excludeAgent`

`.github/copilot-instructions.md`

```
# Copilot instructions

This is a Rails app with a React front end in app/javascript/.

## Build and test

- Install: `bundle install && yarn install`
- Test: `bin/rails test`
- Lint: `bin/rubocop`

## Conventions

- Put business logic in app/services/, not in controllers.
- Every migration must be reversible.
- Never commit credentials or edit config/master.key.
```

## 優先順位と統合

個人の指示、リポジトリの指示、組織の指示の順に適用され、該当する指示セットはすべて送信されます。パス固有のファイルとリポジトリ全体に適用されるファイルの両方が一致する場合、Copilotは両方を使用します。コードレビューでは、pull requestのheadブランチにある指示が読み込まれます。

## ヒント

- github.comでは、パス固有の .instructions.md ファイルが使えるのはCopilot cloud agentとCopilot code reviewのみです。
- レビューでファイルを使わず、cloud agentでは引き続き使うには、excludeAgent: "code-review" を追加してください。
- Copilot cloud agentに copilot-instructions.md の下書きを作成させることができます。内容はおよそ2ページに収め、特定のタスクに限定しないでください。

1つのフォームから、AGENTS.mdと5つのツールに対応するルールファイルを生成します。 [AGENTS.mdジェネレーターを開く →](https://dotsagent.io/ja/instructions)

## その他の指示ファイル

[AGENTS.md](https://dotsagent.io/ja/instructions/files/agents-md)

[CLAUDE.md](https://dotsagent.io/ja/instructions/files/claude-md)

[GEMINI.md](https://dotsagent.io/ja/instructions/files/gemini-md)

[.cursor/rules/*.mdc](https://dotsagent.io/ja/instructions/files/cursor-rules)

[.devin/rules/*.md](https://dotsagent.io/ja/instructions/files/windsurf-rules)

[.clinerules/](https://dotsagent.io/ja/instructions/files/cline-rules)

[~/.openclaw/workspace/AGENTS.md](https://dotsagent.io/ja/instructions/files/openclaw-workspace)

## 出典

1. [docs.github.com](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions)/en/copilot/how-tos/configure-custom-instructions/add-repository-instr
2. [docs.github.com](https://docs.github.com/en/copilot/reference/custom-instructions-support)/en/copilot/reference/custom-instructions-support
3. [docs.github.com](https://docs.github.com/en/copilot/tutorials/customize-code-review)/en/copilot/tutorials/customize-code-review
4. [github.blog](https://github.blog/changelog/2026-06-12-copilot-code-review-new-configurations-and-controls/)/changelog/2026-06-12-copilot-code-review-new-configurations-and-contr

AIエージェント開発者向けの独立したリファレンスです。ここに記載されているいずれのベンダーとも提携していません。

© 2026 DotsAgent · 確認日: 2026年10月1日
