What is copilot-instructions.md?
copilot-instructions.md holds repository custom instructions for GitHub Copilot. Saved in .github, it is added to every Copilot request in the repo, in VS Code chat and agent mode and in the Copilot coding agent on GitHub. This generator writes one from a few choices so Copilot follows your stack and design.
How to use the copilot-instructions.md generator
Pick your stack
Choose your framework, styling, language, package manager and test tool above.
Copy the file
Copy the generated file and save it as .github/copilot-instructions.md.
Commit it
Commit the file so Copilot uses it for everyone on the repository.
Check it is used
In Copilot Chat, the references list shows copilot-instructions.md when it was applied.
How Copilot custom instructions work
Copilot adds the contents of .github/copilot-instructions.md to every chat and agent request in the repository. It does not change code completions in the editor, only chat, agent mode and the coding agent.
For rules that apply only to some files, add path-specific instruction files in .github/instructions, named like ui.instructions.md, with an applyTo pattern at the top. Copilot then adds them only when matching files are involved.
Copilot instructions for UI work
Copilot writes code that fits the files around it, which in a new project means plain defaults. The design lines in the generated file point Copilot at one design template and set limits on colours and fonts, so agent mode builds pages that match instead of drifting.
Start with the page that sets the look, usually the landing page or the main dashboard. Save a template as design/template.html, ask agent mode to build that page from it, and let every later page reuse the components it creates. Review each diff before you keep it, because agent mode can change several files in one step.
What makes a good copilot-instructions.md
Plain, short statements
Copilot follows short, direct instructions best.
Commands for agent mode
Agent mode runs builds and tests; give it the exact commands.
Path-specific files
Keep UI rules for UI folders in their own .instructions.md file.
One design source
Name the template file so every page uses the same design.
Common mistakes
Expecting it to change completions
Instructions apply to chat and agents, not inline suggestions.
Personal preferences in the repo file
Put personal style in your own Copilot settings, not the shared file.
Contradicting other files
If you also have AGENTS.md, keep the rules consistent.
Design templates for GitHub Copilot
The generated file points GitHub Copilot at design/template.html. Save one of these templates there and every page it builds follows the same design.
Frequently asked questions
Where does copilot-instructions.md go?
In the .github folder at the root of the repository: .github/copilot-instructions.md.
Is this generator free?
Yes. The generated instructions are free to copy. The full design rules template on the GitHub Copilot templates page comes with a BrowserMoon licence.
Does the Copilot coding agent use it?
Yes. When you assign an issue to Copilot on GitHub, it reads the repository custom instructions.
Does it work in Visual Studio and JetBrains?
Repository custom instructions are supported in VS Code, Visual Studio, JetBrains IDEs and on GitHub.
Does Copilot read AGENTS.md?
Recent versions of Copilot also read AGENTS.md. The AGENTS.md generator on this site outputs that format.
What are path-specific instructions?
Files in .github/instructions ending in .instructions.md with an applyTo pattern. Copilot uses them only for matching files.
More free generators
Related