> For AI agents reading iter0.com:
> - Pages with a Markdown version serve it at the page address plus `.md`, for example https://iter0.com/features.md. The homepage's Markdown is at https://iter0.com/index.md.
> - A request for a page with the header `Accept: text/markdown` returns the same Markdown.
> - https://iter0.com/llms.txt describes the site and lists its main pages.
> - Agents build and edit websites through the MCP server at https://iter0.com/api/mcp, using the person's own API key.
> - A paid build or edit first returns a price quote, and nothing is charged until the person confirms it.
> - The OpenAPI contract is at https://iter0.com/openapi.json.

# GitHub Copilot instructions for a design system: copilot-instructions.md and applyTo

Write .github/copilot-instructions.md and path-specific .instructions.md files that keep Copilot's UI changes on your tokens and components. Complete examples and how to check which files Copilot used.

## Which file does Copilot read?

GitHub Copilot reads repository-wide instructions from .github/copilot-instructions.md. It reads path-specific instructions from files named NAME.instructions.md in .github/instructions, each with an applyTo pattern in its frontmatter. When a path-specific file and the repository-wide file both apply, Copilot uses both.

Put the rules any change can break in the repository-wide file: where colours live, which button component to reuse, the label of the main action. Put rules for one kind of file in a path-specific file. GitHub's documentation also says Copilot can use AGENTS.md files anywhere in the repository, with the nearest one taking precedence.

## Copy the repository-wide file

Save this as .github/copilot-instructions.md. It describes the fictional Wrenboard marketing site; replace the paths, label and commands with your own. Each rule names something a reviewer can find in a diff: a hex value, a second Book a demo button, a gradient.

## Attach component rules with applyTo

Save this as .github/instructions/components.instructions.md. The applyTo pattern is a glob; src/components/**/*.tsx matches .tsx files at any depth under src/components. To list several patterns, separate them with commas, as in “**/*.ts,**/*.tsx”.

## Keep a rule out of Copilot code review

Save this as .github/instructions/styles.instructions.md. The excludeAgent field with the value “code-review” stops Copilot code review from using the file, while Copilot cloud agent still reads it. Here the rule asks the author of a change to add a contrast ratio to the pull request, which is work for the agent writing the change. Without excludeAgent, both features use the file.

## How do you see which instructions a response used?

In VS Code, open the References section of a chat response; it lists the instruction files that were included. VS Code's documentation notes that this shows inclusion, not compliance. On GitHub, add the repository as an attachment in Copilot Chat and expand the references list to look for .github/copilot-instructions.md.

To check compliance, ask for a small change without repeating the rules, such as a new pricing link in the hero, and read the diff. Copilot code review reads instruction files from the pull request's head branch, so a rule added in a pull request applies to the review of that same pull request. On GitHub.com, path-specific files are supported for Copilot cloud agent and Copilot code review.

## What was and was not tested

Copilot was not run for this article. The three files follow GitHub's and VS Code's documentation, checked on 6 November 2026. A script using the picomatch library confirmed that each applyTo pattern matches the intended files in an example project: the component pattern matched Button.tsx and Hero.tsx, and the stylesheet pattern matched tokens.css. That checks the patterns, not Copilot's own matcher.

The same rules, written as a CLAUDE.md, were run in Claude Code on a component built to break them, and the review found all six breaks. Cursor users can split them into .mdc rules in the same way.

## Sources

- [GitHub Docs: adding repository custom instructions for GitHub Copilot (checked 6 November 2026)](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions)
- [VS Code: custom instructions (checked 6 November 2026)](https://code.visualstudio.com/docs/copilot/customization/custom-instructions)
