GitHub Copilot — Configuration Reference
Configure GitHub Copilot for your project. copilot-instructions.md, .vscode/settings.json, .github/ conventions, model settings, and integration with Copilot Chat and Agent mode.
GitHub Copilot — Configuration Reference
Copilot's behavior is configured through .github/copilot-instructions.md (project-wide system prompt), .vscode/settings.json (personal preferences), and VS Code Copilot settings.
copilot-instructions.md
Create .github/copilot-instructions.md at project root. Copilot reads this for every interaction — it's your project's system prompt:
# Copilot Instructions for PromptGenius
## Project Stack
- Next.js 14 with App Router
- TypeScript strict mode
- Tailwind CSS v4 with OKLCH color system
- Content via MDX with gray-matter frontmatter
## Conventions
- Use server components by default
- `'use client'` only for interactivity
- Path alias: `@/` → project root
- Named exports over default exports
- Co-locate tests: `*.test.ts` next to source
## Code Style
- No `any` types — use `unknown` and type guards
- Prefer early returns over nested conditionals
- Extract business logic from components into lib/ functions
- Error boundaries wrap every route segment
## Commands
- `npm run dev` — Start dev server
- `npm run build` — Production build
- `npm run lint` — ESLint + TypeScript check
## Constraints
- NEVER modify next.config.ts without asking
- NEVER install packages without confirmation
- ALWAYS run `npm run lint` after code changes
Sections to Include
| Section | Purpose | Example |
|---|---|---|
| Project Stack | Frameworks, runtime, versions | "Next.js 14, TypeScript strict, Tailwind CSS v4" |
| Conventions | Project-specific rules | "Named exports, co-located tests, @/ path alias" |
| Code Style | Formatting and patterns | "No any, early returns, error boundaries" |
| Commands | Build/test/lint scripts | "npm run dev, npm run build, npm run lint" |
| Constraints | What NOT to do | "Never modify config, never install packages" |
.vscode/settings.json
Personal preferences that override or complement project instructions:
{
"github.copilot.chat.codeGeneration.instructions": [
{
"text": "Use interfaces over type aliases for object shapes"
},
{
"text": "Always add JSDoc comments to exported functions"
},
{
"text": "Never use console.log — use the logger from src/lib/logger.ts"
}
],
"github.copilot.chat.localeOverride": "en",
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": true
}
}
Key Settings
| Setting | What it does |
|---|---|
github.copilot.chat.codeGeneration.instructions | Array of instruction strings applied to every chat request |
github.copilot.enable | Enable/disable Copilot by language or file type |
github.copilot.chat.localeOverride | Force response language |
github.copilot.advanced | Advanced model and behavior settings |
.github/ Directory Conventions
.github/
├── copilot-instructions.md # Project-wide system prompt
├── prompts/ # Shared prompt templates
│ └── pr-review.prompt.md
└── actions/ # GitHub Actions workflows (Copilot can reference)
Model Settings
Copilot model selection in VS Code settings:
{
"github.copilot.nextEditSuggestions.enabled": true,
"github.copilot.chat.agent.enabled": true,
"github.copilot.agent.codeGeneration.instructions": [
{
"text": "Run npm run typecheck after every code change"
}
]
}
| Setting | Default | Purpose |
|---|---|---|
nextEditSuggestions.enabled | true | Predict next edit location (agent mode) |
chat.agent.enabled | true | Enable agent mode in chat |
agent.codeGeneration.instructions | [] | Instructions specific to agent mode |
Environment Variables
| Variable | Purpose |
|---|---|
GITHUB_TOKEN | GitHub authentication (for PR/issue context) |
COPILOT_API_KEY | Enterprise Copilot API key |
Project Types for Better Context
Copilot understands project types from conventional files:
| File Present | What Copilot Infers |
|---|---|
next.config.ts | Next.js project — App Router, server components |
vite.config.ts | Vite project — ESM modules, HMR |
tailwind.config.ts | Tailwind CSS — utility classes |
tsconfig.json with strict mode | TypeScript — no any, strict null checks |
prisma/schema.prisma | Prisma ORM — typed database access |
Related Pages
- Prompt Engineering in Copilot — Prompt patterns, agent mode, workplace context
- Tool Comparison — Copilot vs Cursor vs Claude Code vs OpenCode vs Gemini CLI
- Cursor Rules Section — Rules templates (similar concept, cross-compatible)
- MCP Section — MCP servers that work with Copilot's VS Code integration
Related Articles
Claude Code — Getting Started
Install and configure Claude Code, Anthropic's terminal-based AI coding agent. Covers installation, API key setup, project configuration, and first session walkthrough.
OpenCode — Configuration Reference
Complete OpenCode configuration reference. Covers opencode.json settings, MCP server integration, skills system, .opencode/ directory conventions, and environment variables.
Cursor — Configuration & Rules
Configure Cursor IDE for optimal AI coding. .cursorrules setup, Cursor settings, model selection, .cursor/ directory conventions, and integration with cursor rules templates.