GitHub Copilot instructions
Last updated: June 2026
Copilot has a configuration file called .github/copilot-instructions.md. It's a markdown file where you write coding standards, conventions, and preferences that Copilot follows when generating suggestions.
Without it, Copilot generates generic code. With it, the suggestions match your project's style. The difference is noticeable after the first few lines you write.
How to set it up
Create the file at .github/copilot-instructions.md in your repository. That's it. GitHub Copilot reads this file automatically when you're working in the repo.
mkdir -p .github && touch .github/copilot-instructions.mdThe file is just markdown. Write instructions in plain English. Copilot understands natural language — you don't need a special syntax or schema.
Template
# Copilot Instructions ## Language & Style - Use TypeScript for all new files. No JavaScript. - Prefer functional components with hooks. - Use named exports, not default exports. - Keep functions under 30 lines. ## Naming - Components: PascalCase (UserProfile.tsx) - Utilities: camelCase (formatDate.ts) - Constants: UPPER_SNAKE_CASE (MAX_RETRIES) - CSS classes: use Tailwind utility classes ## Patterns - Use React Query for server state. - Use Zustand for client state. - All API calls go through /lib/api.ts. - Validate inputs with Zod schemas. ## Testing - Write tests for all new functions. - Use Vitest + Testing Library. - Test file goes next to the source file. - Test the behavior, not the implementation. ## Do Not - Do not use `any` type. - Do not use inline styles. - Do not make API calls in components directly. - Do not commit console.log statements.
Best practices
- •Be specific."Use TypeScript" is better than "Use good types." Copilot follows precise instructions better than vague ones.
- •Include anti-patterns.Tell Copilot what notto do. "Do not use any" and "Do not use inline styles" prevent common mistakes.
- •Keep it under 100 lines. Copilot has limited context for custom instructions. A focused, short file works better than an exhaustive one.
- •Commit it to git. This way, everyone on your team gets the same Copilot behavior. It's version-controlled configuration.
Copilot instructions vs skill.md
Copilot has one config file. Claude Code has a layered system: agents.md for persistent rules and skill.md files for on-demand workflows. The comparison isn't exact, but here's the mapping:
| Use case | Copilot | Claude Code |
|---|---|---|
| Coding standards | copilot-instructions.md | agents.md |
| Task workflows | Not supported | skill.md |
| Scope | Single file | agents.md + skills |
If you're using Claude Code and want to know whether your instructions belong in agents.md or a skill.md file, try ClaudeOrNot to get an instant recommendation.
Configure your AI agent the right way
Whether you use Copilot or Claude Code, good configuration makes the difference between okay suggestions and great ones.
Try ClaudeOrNot →