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.

copilotgithubconfigurationcopilot-instructionsvscode

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

SectionPurposeExample
Project StackFrameworks, runtime, versions"Next.js 14, TypeScript strict, Tailwind CSS v4"
ConventionsProject-specific rules"Named exports, co-located tests, @/ path alias"
Code StyleFormatting and patterns"No any, early returns, error boundaries"
CommandsBuild/test/lint scripts"npm run dev, npm run build, npm run lint"
ConstraintsWhat 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

SettingWhat it does
github.copilot.chat.codeGeneration.instructionsArray of instruction strings applied to every chat request
github.copilot.enableEnable/disable Copilot by language or file type
github.copilot.chat.localeOverrideForce response language
github.copilot.advancedAdvanced 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"
    }
  ]
}
SettingDefaultPurpose
nextEditSuggestions.enabledtruePredict next edit location (agent mode)
chat.agent.enabledtrueEnable agent mode in chat
agent.codeGeneration.instructions[]Instructions specific to agent mode

Environment Variables

VariablePurpose
GITHUB_TOKENGitHub authentication (for PR/issue context)
COPILOT_API_KEYEnterprise Copilot API key

Project Types for Better Context

Copilot understands project types from conventional files:

File PresentWhat Copilot Infers
next.config.tsNext.js project — App Router, server components
vite.config.tsVite project — ESM modules, HMR
tailwind.config.tsTailwind CSS — utility classes
tsconfig.json with strict modeTypeScript — no any, strict null checks
prisma/schema.prismaPrisma ORM — typed database access