Copilot Instructions

How to write GitHub and Microsoft
Copilot system prompts

Copilot is two different products - GitHub Copilot for developers and Microsoft 365 Copilot for business users. Each has its own system prompt approach. Learn how to configure both effectively.

⏱ 10 min read Updated 2026 Works with GitHub Copilot and Microsoft 365 Copilot
Quick start

How to add instructions to GitHub Copilot

GitHub Copilot uses a markdown file in your repository. Here is the fastest path.

1
Create .github/copilot-instructions.md in your repository root
2
Add your coding standards, tech stack, and architecture context in markdown
3
Commit the file so all team members get the same Copilot behavior
4
Test in VS Code Copilot Chat - ask about your codebase to verify
Build your Copilot prompt free →
12
AI tools covered
3
Prompt types built
5min
To your first prompt
$0
To start
GitHub Copilot instructions file and M365 Copilot agent configuration
Copilot — .github/copilot-instructions.md + Copilot Studio agentsUse TypeScript. Prefer functional components. Never modify files outside scope.Write tests for all new functions. Ask before adding dependencies.Architecture: [describe your stack and patterns here]...

Understanding the two Copilot products

Copilot is two distinct products from Microsoft with different use cases, different system prompt approaches, and different audiences. GitHub Copilot is a developer tool for code completion and AI pair programming. Microsoft 365 Copilot is an AI assistant embedded in Word, Excel, Teams, and Outlook with deep Microsoft Graph integration.

GitHub Copilot vs Microsoft 365 Copilot
GitHub Copilot: developer tool, code-focused, repository-level instructions in .github/copilot-instructions.md, primarily accessed through VS Code and GitHub.com. Microsoft 365 Copilot: business tool, document and communication focused, instructions configured via Copilot Studio agents or set by IT admin at tenant level.

GitHub Copilot - instructions via copilot-instructions.md

Create .github/copilot-instructions.md in your repository root. See the GitHub Copilot custom instructions documentation.

# Tech stack
- TypeScript, React 18, Next.js App Router
- Tailwind CSS v3, shadcn/ui components
- Prisma for database, PostgreSQL

# Code standards
- TypeScript strict mode always
- Server components unless client interactivity needed
- Co-locate tests with source files (.test.ts)

# Architecture
- API routes in app/api/ follow REST conventions
- Auth handled by NextAuth - do not reimplement

# Behavior
- Explain significant changes before making them
- Ask before adding new dependencies
- Write JSDoc for all exported functions

Microsoft 365 Copilot - system prompts via agents

Individual users can create custom Copilot agents via Copilot Studio. Each agent has its own system prompt (called "instructions"), access to specific data sources, and defined behavior.

🔍
M365 Copilot-specific tip
The most powerful M365 Copilot instructions explicitly tell it which Microsoft services to use for different request types. Copilot has access to SharePoint, Teams, Exchange, OneDrive - but without instructions it may not always search the right place first. Explicit routing instructions produce dramatically better results.

Common questions

Do GitHub Copilot instructions work in GitHub.com and VS Code?

Yes. .github/copilot-instructions.md is recognized across all GitHub Copilot interfaces.

Can I have different instructions for different branches?

Not directly - .github/copilot-instructions.md applies at the repository level. For different instruction contexts, use the VS Code settings.json approach with multiple scoped files.

How does GitHub Copilot compare to Cursor?

Both support custom instructions via repository files. Cursor's .cursor/rules/ supports more granular scoping. GitHub Copilot integrates directly with GitHub workflows. See our Cursor guide for comparison.

Build your Copilot system prompt now

Answer a short set of questions and get a master prompt engineered specifically for Copilot. Free, no account needed.

Build free with Copilot →

Copilot prompts free · 3 builds/month · Pro is $19/month for unlimited builds and Advanced mode

System prompts optimized for
understandingAI · free newsletter
Get more from your AI tools
Practical tips on system prompts, prompt engineering, and getting real results from AI. No fluff.

No spam. Unsubscribe anytime.