GitHub Copilot カスタムインストラクション公式ガイド
GitHub公式の.github/copilot-instructions.mdガイド。リポジトリ全体・パス別の指示設定とglobパターン対応。
# GitHub Copilot Custom Instructions
## File Location
Create `.github/copilot-instructions.md` in your repository root. Uses Markdown format with natural language instructions.
## Three Types of Custom Instructions
1. **Repository-wide**: `copilot-instructions.md` in `.github/` applies to all requests
2. **Path-specific**: `NAME.instructions.md` files in `.github/instructions/` with glob patterns via frontmatter
3. **Agent instructions**: `AGENTS.md`, `CLAUDE.md`, or `GEMINI.md` files for AI agents
## Path-Specific Frontmatter
```yaml
---
applyTo: "app/models/**/*.rb"
excludeAgent: "code-review"
---
```
## Best Practices
### Include:
- Repository summary and purpose
- Languages, frameworks, runtimes
- Bootstrap, build, test, run, lint commands
- Project layout with relative paths
- CI/CD checks and validation pipelines
- Key source files and code snippets
### Guidelines:
- Keep instructions concise (ideally 2 pages maximum)
- Make instructions task-agnostic for reusability
- Explicitly instruct the agent to trust the instructions
- Only perform a search if information is incomplete or in error こちらもおすすめ
DevOps カテゴリの他のルール
もっとルールを探す
CLAUDE.md、.cursorrules、AGENTS.md、Image Prompts の全 157 ルールをチェック。



