File-scoped custom instruction files for GitHub Copilot and VS Code, using applyTo patterns to target specific file types or tasks with tailored AI guidance.
.instructions.md
.instructions.md files are scoped custom-instruction documents for GitHub Copilot and VS Code that let a project carry its coding conventions directly into the AI’s context. Each file uses YAML frontmatter with an applyTo glob pattern, so guidance can target specific file types or tasks — one set of rules for **/*.test.ts, another for **/*.py — instead of applying every instruction everywhere.
applyTotargeting - A glob pattern in the frontmatter scopes the instructions to the files or tasks they belong to.- Composable guidance - Multiple
.instructions.mdfiles can coexist, each governing a different slice of the codebase. - Version-controlled convention - The files live in the repository, so team standards travel with the code and evolve through pull requests.
- Editor-native - VS Code and Copilot load them automatically, feeding project rules into every relevant completion and chat.
In the agentic turn, .instructions.md is part of a growing family of in-repo AI configuration — alongside broader files like AGENTS.md — that encodes how a team wants machines to work inside its codebase. For API teams it is a practical place to pin governance and design conventions so that generated code respects naming, error handling, and security patterns rather than drifting from the house style.