GitHub Copilot Handbook — Complete Reference
V1
Complete Reference
2025–2026 awesome-copilot // series 8 of 8
handbook series · vol 8 of 8

GitHub Copilot Skills · Agents · Instructions · MCP · Hooks · Plugins

The complete reference for GitHub Copilot in 2025–2026 — covering every customisation surface from copilot-instructions.md to Agent Skills, custom agents, MCP servers, hooks, and the full Copilot CLI. Built with the awesome-copilot community collection as reference.

Agent Mode Skills Custom Agents MCP Instructions Hooks Plugins Copilot CLI Cloud Agent
Reference: github/awesome-copilot — Community-contributed instructions, agents, skills, hooks, workflows, and plugins. Install via: copilot plugin install <name>@awesome-copilot
Website: awesome-copilot.github.com · Machine-readable: llms.txt
01

What is GitHub Copilot?

GitHub Copilot has evolved from an autocomplete tool into a fully agentic development environment. It now combines AI code completion, multi-turn chat, multi-file editing, autonomous coding agents, and deep integrations with your development tools — all powered by a choice of leading AI models.

GitHub Copilot — Capability Stack (2025–2026) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Plugins Bundle: agents + skills + MCP + hooks into one installable package Workflows Agentic workflows in GitHub Actions (YAML with 'on:' events) Hooks preToolUse / postToolUse / userPromptSubmitted / errorOccurred Skills SKILL.md folders — loaded when relevant, work across all agents Custom Agents .agent.md files — specialized Copilot variants with their own tools/MCP MCP Servers External tools, APIs, and data via Model Context Protocol Instructions copilot-instructions.md / .instructions.md / AGENTS.md — persistent context Agent Mode Autonomous multi-step coding — files, terminal, tests, self-heal Edit Mode Multi-file edits across workspace Chat Mode Conversational Q&A with workspace context Completions Inline code suggestions as you type ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Interfaces

💻
VS Code

Primary IDE. Agent mode, MCP, skills, custom agents, hooks. Chat Customizations editor.

🖥️
JetBrains / Eclipse / Xcode

Agent mode + MCP in public preview. Custom agents, hooks, AGENTS.md support.

▶️
Copilot CLI

Full agentic terminal experience. GA Feb 2026. Skills, agents, plugins, hooks, /delegate.

☁️
Cloud Agent

Assigns GitHub issues to Copilot. Creates draft PRs. Works in background asynchronously.

📱
GitHub Mobile

Chat, code review assistance, assign tasks to cloud agent from anywhere.

🌐
GitHub.com

Copilot on github.com — agents panel, PR review, inline suggestions in web editor.

Plans & Models

PlanPricePremium RequestsKey Features
Free$0Limited50 chat/mo, 2000 completions/mo, GPT-4o
Pro$10/mo300/moUnlimited completions, cloud agent, CLI
Pro+$39/mo1500/moBest models (o3, Claude Opus 4.6), all features
Business$19/user/mo300/user/moOrg policies, IP indemnity, audit logs
Enterprise$39/user/mo1000/user/moOrg instructions, fine-tuning, knowledge bases
ModelTypeNotes
GPT-4oIncludedDefault base model for chat, completions, agent mode
GPT-4.1 / GPT-5 miniIncludedAvailable in CLI; do not consume premium requests
Claude Opus 4.6Premium1M context, GA Feb 2026. Excellent for complex reasoning
Claude Sonnet 4.xPremiumFast + capable; popular for agent mode tasks
o3 / o4-miniPremiumOpenAI reasoning models; great for hard problems
Gemini 3 ProPremiumAvailable via GitHub Models integration
AutoSmartCopilot picks the best model based on task + availability
◎ Premium Requests

Premium models consume premium requests from your monthly quota. Base model (GPT-4o) usage is unlimited on paid plans. Additional premium requests are available pay-as-you-go at $0.04/request. Use /model in CLI to see all options and your quota.

02

Custom Instructions

Custom instructions let you provide Copilot with persistent context — coding standards, architecture patterns, tech stack, naming conventions — so you never have to repeat them in every chat prompt. Instructions are injected invisibly into each request.

project-root/ ├── .github/ │ ├── copilot-instructions.md ← repo-wide, all requests │ ├── instructions/ │ │ ├── frontend.instructions.md ← applyTo: "src/ui/**" │ │ ├── backend.instructions.md ← applyTo: "src/api/**" │ │ └── tests.instructions.md ← applyTo: "**/*.test.*" │ ├── skills/ ← agent skills (section 4) │ ├── agents/ ← custom agents (section 5) │ ├── prompts/ ← reusable prompt files │ └── chatmodes/ ← custom chat modes ├── AGENTS.md ← open standard, all AI agents └── README.md

copilot-instructions.md

The primary instruction file. Placed at .github/copilot-instructions.md. Applied to every Copilot request in the repository across VS Code, JetBrains, Copilot CLI, and the cloud agent.

markdown — .github/copilot-instructions.md
# Project: E-Commerce Platform

## Stack
- Backend: ASP.NET Core 8, C# 12, EF Core 8
- Frontend: React 18, TypeScript 5, Tailwind CSS 3
- Database: PostgreSQL 16, Redis 7
- Cloud: Azure (App Service, Blob Storage, Service Bus)

## Code Style
- Use async/await throughout; never block threads
- Prefer records over classes for DTOs
- Use primary constructors (C# 12) for simple classes
- All public APIs must have XML doc comments
- No magic strings — use constants or enums

## Testing
- Use xUnit for unit tests, Playwright for E2E
- Test file mirrors source: `src/Foo.cs` → `tests/FooTests.cs`
- Mock external dependencies; never hit real APIs in unit tests

## Git
- Branch names: `feat/`, `fix/`, `chore/`, `docs/`
- Commit format: Conventional Commits (feat: add X)
- PRs require passing CI and one human approval
✦ Auto-generate with /init or cloud agent

In VS Code, type /init in chat — Copilot analyzes your project and generates instructions. In the cloud agent, use the prompt: "Onboard this repository to Copilot by creating a .github/copilot-instructions.md file."

Path-Specific Instructions (.instructions.md)

Files named *.instructions.md in .github/instructions/ apply only when Copilot works on files matching the applyTo glob in the YAML frontmatter. Supported in VS Code, JetBrains, and the cloud agent.

markdown — .github/instructions/react.instructions.md
---
applyTo: "src/ui/**/*.{tsx,jsx}"
---

## React Component Standards
- Use functional components only; no class components
- Props interface must be named `{ComponentName}Props`
- Use `React.memo` for expensive pure components
- Prefer `useCallback` for event handlers passed to children
- All components must be exported as named exports
- Use Tailwind utility classes; no inline styles

AGENTS.md — Open Standard

AGENTS.md is an open standard (Linux Foundation / Agentic AI Foundation) for guiding any AI coding agent — Copilot, Claude Code, Gemini CLI, etc. Copilot treats it as additional instructions alongside copilot-instructions.md.

FileScopeAgent support
AGENTS.md (root)Primary — repo-wideCopilot, Claude Code, Gemini CLI, any agent
AGENTS.md (subdirs)Additional — folder-scopedSame; treated as secondary instructions
CLAUDE.mdRepo root onlyClaude Code, Copilot (reads it automatically)
GEMINI.mdRepo root onlyGemini CLI, Copilot
copilot-instructions.md.github/ dirCopilot only (all surfaces)
*.instructions.md.github/instructions/Copilot (path-specific)
markdown — AGENTS.md
# AGENTS.md — Guidance for AI Coding Agents

## Build & Test
- Build: `dotnet build ./src`
- Run tests: `dotnet test ./tests`
- Lint: `dotnet format --verify-no-changes`
- E2E: `npx playwright test` (requires running server on :5000)

## Important Rules
- Never commit secrets or connection strings
- Do not modify `*.lock` files manually
- Run `dotnet format` before creating any PR
- PRs must not decrease test coverage below 80%

## Architecture
- Domain logic lives in `src/Domain/`
- Never import Domain → Infrastructure (dependency rule)
- Use the MediatR pattern for all commands/queries

Personal Instructions

Across all projects, create ~/.copilot/copilot-instructions.md for personal preferences (preferred language, verbosity, explanation style). Also set via COPILOT_CUSTOM_INSTRUCTIONS_DIRS env var to point to a folder of instruction files.

Organisation-Level Instructions

Copilot Enterprise supports instructions at the GitHub Organisation level — automatically applied to all repos in the org. Set by org owners; synced to VS Code via github.copilot.chat.organizationInstructions.enabled.

Prompt Files

Reusable prompts stored in .github/prompts/ as *.prompt.md — invoke them from chat with /prompt-name or attach them manually. Great for repetitive workflows like "explain this code" or "write tests".

markdown — .github/prompts/write-tests.prompt.md
---
mode: 'agent'
description: 'Generate comprehensive xUnit tests for the selected code'
---

Analyze the selected code and generate comprehensive xUnit tests:

1. Cover all public methods and their edge cases
2. Use `[Theory]` + `[InlineData]` for parameterized tests
3. Mock all external dependencies using Moq
4. Follow Arrange-Act-Assert pattern
5. Test file should be placed in `tests/` mirroring `src/`
6. Include at least one test for the unhappy path (exceptions)

Reference our testing conventions from `.github/instructions/tests.instructions.md`.

Custom Chat Modes

Define a persona or specialized workflow mode in .github/chatmodes/*.chatmode.md. Users switch to it in the chat dropdown. A mode sets a system persona + tools available.

markdown — .github/chatmodes/dba.chatmode.md
---
description: 'Senior DBA: database design, query optimization, index strategy'
tools:
  - pgsql_connect
  - pgsql_query
  - github
---

You are a Senior Database Administrator specializing in PostgreSQL 16.
When reviewing queries: always check for missing indexes, N+1 problems,
and missing pagination. Use EXPLAIN ANALYZE when you have database access.
Prefer CTEs over subqueries for readability. Always consider connection
pooling and transaction scope.
03

Agent Skills

Agent Skills (announced December 2025) are self-contained folders of instructions, scripts, and resources that Copilot loads when relevant to your task. Unlike custom instructions (which always apply), skills are loaded on-demand — keeping your context window efficient.

★ Open Standard

The Agent Skills spec is an open standard. Skills work across Copilot coding agent, Copilot CLI, and VS Code agent mode. If you already have skills in .claude/skills/ for Claude Code, Copilot picks them up automatically.

◎ Skills vs Instructions

Use instructions for coding standards that apply to almost every task. Use skills for deep, specialized procedures (debugging CI failures, Terraform plan review) that Copilot should only load when needed.

✦ Discovery

Copilot matches your prompt to skills by reading each skill's name and description frontmatter. When triggered, it loads the full SKILL.md body. You can also invoke manually: /skill-name in chat.

Skill Directory Locations

LocationScopeNotes
.github/skills/<name>/Project (repo)Checked into version control — shared with team
.claude/skills/<name>/ProjectClaude Code compat — Copilot reads these too
.agents/skills/<name>/ProjectGeneric agents directory
~/.copilot/skills/<name>/PersonalShared across all projects on your machine
~/.claude/skills/<name>/PersonalClaude compat — Copilot reads these too
~/.agents/skills/<name>/PersonalGeneric personal skills

Creating a Skill

1
Create the skill directory

Make a folder under your chosen skills directory. Folder name becomes the skill identifier (use lowercase-with-hyphens).

2
Write SKILL.md with YAML frontmatter

Required fields: name and description. The description is what Copilot reads to decide if this skill is relevant.

3
Add the instruction body

Write detailed Markdown instructions. Reference other files in the skill directory using relative paths.

4
Optionally add supporting resources

Scripts, templates, examples, checklists — anything Copilot should access as it follows the instructions.

structure — .github/skills/github-actions-debugging/
.github/skills/github-actions-debugging/
├── SKILL.md               # Required — frontmatter + instructions
├── checklist.md           # Referenced by SKILL.md
└── examples/
    ├── passing-run.log    # Example for context
    └── failing-run.log    # Example of common failure
markdown — SKILL.md
---
name: github-actions-debugging
description: |
  Guide for debugging failing GitHub Actions workflows.
  Use this when asked to debug failing GitHub Actions workflows,
  CI failures, or pipeline errors in pull requests.
---

## Debugging Failing GitHub Actions Workflows

Use the GitHub MCP Server tools to investigate:

1. Use `list_workflow_runs` to find recent runs for the PR and their status
2. Use `get_workflow_run` to get details of the specific failing run
3. Use `list_workflow_run_logs` to retrieve the full job logs
4. Look for the first `Error:` or `FAILED` line — that's the root cause
5. Check `checklist.md` for common failure patterns

## Common Fixes
- Missing secret → check repo Settings > Secrets
- Cache invalidation → update cache key or clear manually  
- Outdated action version → pin to latest SHA
- Flaky test → check test for async timing issues

See `examples/` for reference logs.

SKILL.md Frontmatter Reference

FieldRequiredDescription
nameYesSkill identifier (slug). Used for manual invocation /name
descriptionYesWhen Copilot should load this skill. Be specific — this is the trigger.
user-invocableNotrue (default) — appears in / menu. false — agent-only.
disable-model-invocationNotrue — prevents model from auto-loading; user must invoke manually.
toolsNoList of tool names this skill expects to use (hint to Copilot)
versionNoSemantic version string for tracking

Installing Community Skills

bash
# Via GitHub CLI (gh v2.90.0+)
gh skill install github/awesome-copilot <skill-name>

# Via Copilot CLI
copilot plugin install <plugin-name>@awesome-copilot

# Register marketplace first (older Copilot CLI versions)
copilot plugin marketplace add github/awesome-copilot
copilot plugin install <plugin-name>@awesome-copilot

# Or copy manually into your skills directory
# cp -r path/to/skill ~/.copilot/skills/skill-name/

Popular Skills from awesome-copilot

SkillPurpose
github-actions-debuggingDebug failing CI pipelines using GitHub MCP tools
codebase-mapperMap, document, and onboard into an existing codebase
lsp-setupInstall & configure LSP servers for code intelligence
git-workflowIssues → branches → commits → PRs with correct conventions
copilot-instructions-generatorGenerate copilot-instructions.md from codebase analysis
migration-blueprintCreate instructions for tech migrations / framework upgrades
agent-governanceGovernance, safety, and trust controls for AI agents
educational-commentsAdd educational comments explaining code to a file
azure-iac-exportExport Azure resources to Bicep/Terraform via Resource Graph
mcp-swift-serverGenerate MCP server projects in Swift
✦ Skill with Script Execution

Skills can reference executable scripts. Copilot CLI has controls for auto-approve: allowlist specific scripts in your config. VS Code provides per-skill execution controls. Always review community skills before enabling script execution.

04

Custom Agents

Custom agents are specialized versions of Copilot for specific tasks. Each agent has its own persona, tools, MCP servers, and system instructions. Switch between agents in the chat interface or invoke via CLI.

Agent Hierarchy ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ GitHub Copilot (base) │ ├─ Custom Agent (.github/agents/test-agent.agent.md) │ └─ Own: tools, MCP servers, instructions, persona │ ├─ Plan Agent decomposes complex tasks, proposes plan first │ └─ Sub-Agent spawned by orchestrator; specialized delegated work │ └─ orchestrator → sub-agent pattern for parallel tasks

Creating Custom Agents

markdown — .github/agents/accessibility-reviewer.agent.md
---
name: accessibility-reviewer
description: |
  Runtime accessibility specialist. Use for keyboard flows,
  focus management, dialog behavior, form errors, and
  evidence-backed WCAG 2.1 validation in the browser.
tools:
  - playwright       # browser automation for testing
  - github           # create issues for violations
mcp_servers:
  - playwright-mcp
---

You are an expert accessibility engineer specializing in WCAG 2.1 AA.

When reviewing code changes:
1. Use Playwright to navigate the page and test keyboard flows
2. Check: focus indicators visible, tab order logical, dialogs trap focus
3. Verify form errors are announced to screen readers (aria-live)
4. Validate color contrast meets 4.5:1 for normal text
5. Create GitHub issues for each WCAG violation found

Report violations with: WCAG criterion, evidence (screenshot/code), fix.
markdown — .github/agents/dotnet-architect.agent.md
---
name: dotnet-architect
description: |
  Senior .NET architect for complex delivery: designs .NET 6+ systems,
  decides between parallel subagents and orchestrated team execution,
  documents lessons learned, and captures durable project memory.
tools:
  - github
  - terminal
  - workspace
---

You are a Senior .NET Architect with 15+ years experience.
Specialise in: Clean Architecture, CQRS + MediatR, EF Core, 
Azure deployment, performance tuning, and distributed systems.

When given a complex task:
- Break into sub-tasks, identify which can run in parallel
- Document architectural decisions with rationale
- Capture lessons learned in `docs/adr/` as ADR files
- Prefer boring technology over clever solutions

Custom Agent Frontmatter

FieldDescription
nameAgent identifier and display name
descriptionWhen to use this agent (shown in picker, used for routing)
toolsList of tools available to this agent (workspace, terminal, github, etc.)
mcp_serversMCP servers this agent connects to
skillsSkills to always load for this agent
modelPreferred model for this agent (e.g., claude-sonnet-4)

Copilot Cloud Agent (Coding Agent)

The cloud agent works asynchronously in the background — you assign a GitHub Issue to Copilot, and it researches, plans, writes code, pushes commits to a draft PR, and pings you for review. Available in GitHub.com, VS Code, CLI, and Mobile.

1
Assign an issue to Copilot

Go to any GitHub Issue → Assignees → select Copilot. Or use the Agents panel at github.com/copilot/agents.

2
Copilot researches and plans

Reads the issue, searches the codebase, builds an implementation plan. All steps are visible in the session log.

3
Code is pushed to a draft PR

Copilot writes code, runs tests (if configured in AGENTS.md), and creates a draft PR. You're notified when ready.

4
Review, iterate, merge

Review the diff, leave PR comments for Copilot to address. Mark ready when satisfied — requires human approval before CI runs.

⚠ Security Model

The cloud agent requires human approval before any CI/CD workflows run — a deliberate safety gate. It respects branch protections. PRs from the agent are labeled and identifiable. It only accesses the repository specified when the task starts (configurable with MCP).

Sub-Agents & Orchestration

markdown — orchestrator pattern
---
name: pure-orchestrator
description: |
  Pure orchestration agent. Decomposes requests, delegates ALL work
  to sub-agents, validates outcomes, and repeats until complete.
---

You ONLY orchestrate. You NEVER write code yourself.

For every request:
1. Analyze and decompose into discrete tasks
2. Identify which tasks can run in parallel
3. Delegate each to the appropriate specialist sub-agent:
   - `accessibility-reviewer` → a11y concerns
   - `dotnet-architect` → backend design
   - `test-agent` → test generation
4. Collect outputs and validate against acceptance criteria
5. If validation fails, delegate corrective tasks
6. Report summary when all tasks pass validation
05

MCP — Model Context Protocol

The Model Context Protocol (MCP) is an open standard that lets Copilot connect to external tools, APIs, and data sources. In agent mode, Copilot uses MCP tools to complete agentic loops without switching context.

🐙
GitHub MCP

Search repos, issues, PRs, manage code, create branches — all from within Copilot.

🗄️
Database MCPs

Connect to PostgreSQL, MySQL, SQLite. Query schemas, explain plans, inspect data.

🎭
Playwright MCP

Browser automation for E2E testing, accessibility audits, and screenshot capture.

☁️
Azure MCP

Inspect Azure resources, Resource Graph queries, IaC generation from existing infra.

📋
Jira / Asana

Create/update tickets, transform requirements into epics and user stories.

📁
Filesystem / Git

Direct file system access, git operations beyond what the IDE provides.

GitHub MCP Server

The GitHub local MCP server is open source and natively supported in VS Code. It enables Copilot to interact with your GitHub repositories, issues, PRs, workflows, and more — directly from your conversation.

ToolWhat it does
search_repositoriesFind repos by query across GitHub
get_file_contentsRead any file from any accessible repo
list_issues / create_issueBrowse and create GitHub Issues
list_pull_requests / create_pull_requestManage PRs from within chat
list_workflow_runs / get_workflow_runInspect CI runs and logs
create_branch / push_filesBranch and push code changes
search_codeSearch for code patterns across repos
copilot_spaces toolsAccess Copilot Spaces context (GA Sep 2025)

MCP Configuration

Configure MCP servers in mcp.json (workspace or user level). VS Code, JetBrains, Eclipse, and Xcode each have an MCP settings UI.

json — .vscode/mcp.json (or .github/mcp.json)
{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"  // OAuth — no token needed
    },
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "args": ["@playwright/mcp-server"]
    },
    "postgres": {
      "type": "stdio",
      "command": "npx",
      "args": ["@modelcontextprotocol/server-postgres"],
      "env": {
        "POSTGRES_CONNECTION_STRING": "${env:DATABASE_URL}"
      }
    }
  }
}
✦ Auto-approve MCP

In VS Code and JetBrains, you can configure auto-approve at the server or tool level — reducing confirmation popups in long agent sessions. Set in: Settings → GitHub Copilot → Chat → MCP Server and Tool Auto-approve Configuration.

⚠ Enterprise Policy

MCP servers are disabled by default for Copilot Business and Enterprise. An admin must enable the "MCP servers in Copilot" policy from the organisation policy settings before members can use them.

06

Hooks, Workflows & Plugins

Hooks

Hooks execute custom shell commands at key points during an agent session. Use them for validation, logging, security scanning, or enforcing policy without modifying the agent itself.

Hook EventWhen it firesCan block?
userPromptSubmittedAfter the user sends a message, before model respondsYes
preToolUseBefore a tool call is executed (e.g., before a file write)Yes — can deny or modify
postToolUseAfter a tool call completesNo — custom post-processing only
errorOccurredWhen an error happens during agent executionNo
json — .github/hooks/security.hooks.json
{
  "hooks": [
    {
      "event": "preToolUse",
      "tool": "write_file",
      "command": "scripts/validate-no-secrets.sh",
      "description": "Scan for secrets before writing files"
    },
    {
      "event": "postToolUse",
      "tool": "run_terminal_command",
      "command": "scripts/log-command.sh",
      "description": "Audit log all terminal commands executed by agent"
    },
    {
      "event": "preToolUse",
      "tool": "create_pull_request",
      "command": "scripts/enforce-pr-template.sh",
      "description": "Verify PR has required sections before creation"
    }
  ]
}
◎ Hook file location

Define hooks in any *.hooks.json file in .github/hooks/. Supported hook events in JetBrains: userPromptSubmitted, preToolUse, postToolUse, errorOccurred. VS Code and CLI hooks are configured in their respective settings.

Agentic Workflows

Agentic Workflows bring Copilot's coding agent directly into GitHub Actions. They run on repository events (push, PR, schedule) and can autonomously perform multi-step development tasks in CI.

markdown — agentic-workflow.md (frontmatter)
---
name: dependency-update-agent
description: |
  Automatically review dependency update PRs, run tests,
  and approve safe updates. Triggered on Dependabot PRs.
on:
  pull_request:
    types: [opened]
    branches: [main]
permissions:
  contents: read
  pull-requests: write
safe-outputs: true
---

When a Dependabot PR is opened:
1. Read the dependency diff to understand what changed
2. Check if the package has known CVEs (use GitHub Security Advisory)
3. Review the CHANGELOG for breaking changes
4. If patch/minor version with no CVEs: approve the PR
5. If major version or CVE found: add a review comment explaining
Workflow FrontmatterDescription
onGitHub Actions trigger events (same syntax as workflow YAML)
permissionsGitHub token permissions granted to the agent
safe-outputstrue — restrict outputs to prevent injection attacks

Plugins

Plugins bundle related agents, skills, commands, and hooks into a single installable package. They are the unit of distribution for the awesome-copilot marketplace.

json — plugin.json
{
  "name": "azure-devops-plugin",
  "version": "1.2.0",
  "description": "Complete Azure DevOps toolset for Copilot",
  "agents": ["agents/azure-iac-agent.agent.md"],
  "skills": ["skills/azure-iac-export/", "skills/bicep-review/"],
  "mcp_servers": [
    {
      "name": "azure-mcp",
      "source": { "npm": "@azure/mcp-server" }
    }
  ]
}
bash — installing plugins
# Install from awesome-copilot marketplace (registered by default)
copilot plugin install azure-devops@awesome-copilot

# Install from any GitHub repo
copilot plugin install owner/repo

# List installed plugins
copilot plugin list

# Validate a plugin during development
npm run plugin:validate
07

Copilot CLI

GitHub Copilot CLI (GA February 2026) brings a full agentic development environment to the terminal. It plans, builds, reviews, and remembers across sessions — with skills, agents, hooks, and plugins — all without leaving the terminal.

bash — install & setup
# Install via npm
npm install -g @github/copilot-cli

# Or via homebrew
brew install gh-copilot

# Authenticate
copilot auth login

# Initialize project (generates instructions + AGENTS.md)
copilot /init

# Start a session
copilot

CLI Commands & Flags

Command / FlagPurpose
/initGenerate copilot-instructions.md + AGENTS.md for the project
/modelShow and switch models. Includes free (GPT-4.1) and premium models
/diffReview all session changes with syntax-highlighted inline diffs
/reviewAnalyze staged/unstaged changes before committing
/delegate <task>Dispatch a coding agent to work on the task in the background
/memoryView and manage agent instruction files and cross-session memory
Shift+TabSwitch to plan mode — Copilot asks clarifying questions, builds structured plan first
Esc EscUndo/rewind — revert file changes to any previous session snapshot
--allow-all-toolsAuto-approve all tool use (for containers / isolated environments)
--allow-tools <list>Allowlist specific tools only
--deny-tools <list>Block specific tools (e.g., deny git push)
--allow-paths <glob>Restrict file access to specific paths
-p / --pipeNon-interactive pipeline mode for scripts and CI
--model <name>Set model for this session

Built-in CLI Agents

AgentPurpose
ExploreFast codebase analysis. Ask questions without cluttering main context.
TaskRun commands like tests and builds. Iterates until they pass.
PlanDecompose a large task, build a structured plan, ask questions first.
bash — CLI workflow example
# Start and describe a task
copilot
> Add input validation to all API endpoints in src/api/

# Copilot plans, writes code, runs tests automatically
# Review what changed
> /diff

# Delegate a related task to cloud agent while you continue
> /delegate Write E2E Playwright tests for the new validation endpoints

# Check for related open issues via GitHub MCP
> Are there any open issues related to input validation?

# Switch to plan mode before a big change (Shift+Tab)
# Copilot asks clarifying questions, shows plan, waits for approval

# Use in CI pipeline (non-interactive)
copilot -p "Review the diff and check for security issues" \
  --allow-tools workspace,github \
  --deny-tools terminal
◎ Auto-compaction

When your session approaches 95% of the context window, Copilot CLI automatically compresses conversation history in the background — no restart needed. Sessions can run as long as you need.

08

Prompting Best Practices

The quality of Copilot's output scales directly with the quality of your prompts. These principles apply across chat, agent mode, and instructions files.

Prompt Anatomy

Effective Prompt Structure ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ CONTEXT Who am I, what is this project, what's the situation TASK What I want Copilot to do (specific verb) CONSTRAINTS What NOT to do, what to preserve, what format EXAMPLES Show don't tell — before/after or reference code Good: "We use EF Core 8 with repository pattern [CONTEXT]. Refactor UserService to use IUserRepository [TASK]. Don't change the public API surface or tests [CONSTRAINTS]. Here's an existing repo for reference: ProductRepository.cs [EXAMPLES]" Bad: "Refactor UserService"

Prompting Principles

principle 01
Be Specific About Scope

Name the exact files, methods, or classes. "Refactor the OrderController.cs file" beats "refactor the order controller."

principle 02
State Your Acceptance Criteria

Tell Copilot how you'll verify the result: "All existing tests must pass, and add tests for the new happy path."

principle 03
Use Negative Constraints

"Don't change the public API", "don't add new NuGet packages", "don't touch files in /tests/" — these prevent common mistakes.

principle 04
Reference Existing Patterns

"Follow the same pattern as ProductController.cs" gives Copilot a concrete model — better than describing conventions abstractly.

principle 05
Use Plan Mode for Big Tasks

Press Shift+Tab in CLI (or ask "create a plan first") before large refactors. Review and refine the plan before execution begins.

principle 06
Iterate via PR Comments

For cloud agent tasks, leave specific line comments on the draft PR — Copilot reads and addresses them in the next iteration.

Instructions File Writing Tips

✦ Keep instructions concise

Very long instruction files cause some instructions to be overlooked (context limits). Target under 500 lines. Use path-specific *.instructions.md to split language-specific rules from general ones.

✦ Use concrete examples, not vague directives

Instead of "write clean code", write: "Use primary constructors for simple service classes. Example: public class OrderService(IOrderRepo repo, ILogger<OrderService> log)."

⚠ Avoid conflicting instructions

If both copilot-instructions.md and a *.instructions.md give conflicting guidance, Copilot's choice is non-deterministic. Structure instructions carefully to avoid overlap.

Power-User Tips

power tip 01
@workspace for Full Context

Prefix with @workspace in VS Code chat to give Copilot access to your entire project. Essential for cross-file refactoring.

power tip 02
#file / #selection

Use #file:path/to/file.cs to attach specific files, or #selection to reference what you've highlighted in the editor.

power tip 03
Copilot Spaces for Knowledge

Copilot Spaces (GA Sep 2025) combine code, docs, and notes into a shared context — great for team standards and project wikis.

power tip 04
Repository Memory in CLI

Copilot CLI remembers conventions and preferences across sessions. Build up good memory by consistently naming patterns in prompts.

power tip 05
Use /delegate Liberally

While you focus on one task in CLI, delegate related work to the cloud agent. Both run in parallel — check the cloud agent PR when you're done.

power tip 06
Auto-Approve with Safeguards

Enable tool auto-approve + preToolUse hooks that validate safety. You get speed without sacrificing security controls.

power tip 07
Verify via References

In VS Code chat, check the References list on any response — confirms whether copilot-instructions.md and skills were actually loaded.

power tip 08
Chat Diagnostics

Right-click in VS Code Chat view → Diagnostics — shows all loaded instruction files and any loading errors. Invaluable for debugging why instructions aren't applied.

power tip 09
Settings Sync for Instructions

Personal ~/.copilot/ instruction files sync across devices via VS Code Settings Sync. Enable "Prompts and Instructions" in Settings Sync config.

Slash Commands Reference

CommandWhat it doesWhere
/explainExplain selected code in plain EnglishVS Code, JetBrains
/fixFix issues in selected codeVS Code, JetBrains
/testsGenerate unit tests for selectionVS Code, JetBrains
/docGenerate documentation/comments for selectionVS Code, JetBrains
/newCreate a new file/project from a templateVS Code
/newNotebookCreate a new Jupyter notebookVS Code
/initGenerate project instructions (CLI + VS Code)CLI, VS Code
/diffReview session changes with syntax-highlighted diffCLI
/reviewQuick sanity check on staged changesCLI
/delegateDispatch cloud agent to work on task in backgroundCLI
/modelView/switch modelsCLI
/memoryOpen agent instruction/memory settingsCLI, JetBrains
/skill-nameManually invoke a named skillVS Code, CLI
09

awesome-copilot Community

The github/awesome-copilot repository is a community-driven collection of instructions, agents, skills, hooks, workflows, and plugins — maintained by GitHub and the developer community.

ResourceDescription
awesome-copilot.github.comFull website with search, filtering, learning hub, tools section
github.com/github/awesome-copilotSource repository — contribute via PRs to staged branch
awesome-copilot.github.com/skills/Browse all skills with descriptions and install commands
llms.txtMachine-readable listing of all resources — for AI agents browsing the collection
Learning HubCurated articles on skills, agents, MCP, hooks, agentic workflows

Contributing to awesome-copilot

bash — contribution workflow
# Fork the repo and clone
git clone https://github.com/YOUR_USERNAME/awesome-copilot
cd awesome-copilot

# Create your content (skill, agent, instruction, etc.)
# File names: lower-case-with-hyphens.md

# Run validation
npm run skill:validate      # validate SKILL.md frontmatter
npm run plugin:validate     # validate plugin.json

# Build (required — updates README automatically)
npm run build

# Fix line endings (required — CI will fail otherwise)
bash scripts/fix-line-endings.sh

# PR MUST target the 'staged' branch, NOT main
git checkout -b feat/my-awesome-skill
git push origin feat/my-awesome-skill
# Open PR → base: staged

Required Frontmatter Checklist

name description tools (recommended) version (optional)
⚠ PR Rules

All PRs must target the staged branch. File names must be lowercase with hyphens. Only .md files accepted — no .yml, .yaml, or .lock.yml. Run npm run build and bash scripts/fix-line-endings.sh before committing.

Recommended Repository Structure

your-repo/ ├── .github/ │ ├── copilot-instructions.md repo-wide instructions │ ├── instructions/ path-specific rules │ │ ├── frontend.instructions.md │ │ └── backend.instructions.md │ ├── skills/ agent skills │ │ ├── ci-debugging/ │ │ │ └── SKILL.md │ │ └── deploy-checklist/ │ │ ├── SKILL.md │ │ └── checklist.md │ ├── agents/ custom agents │ │ └── qa-agent.agent.md │ ├── prompts/ reusable prompts │ │ └── write-tests.prompt.md │ ├── chatmodes/ chat personas │ │ └── dba.chatmode.md │ ├── hooks/ hook definitions │ │ └── security.hooks.json │ └── mcp.json MCP server config ├── AGENTS.md build/test cmds for any agent └── README.md

Quick-Start: First 30 Minutes

1
Generate instructions with /init

Run copilot /init in CLI or type /init in VS Code chat. Copilot analyzes your repo and creates .github/copilot-instructions.md + AGENTS.md.

2
Install the GitHub MCP server

Open VS Code MCP settings and add the GitHub MCP server. Use OAuth — no PAT needed. This gives Copilot access to issues, PRs, and workflows.

3
Browse awesome-copilot and install a skill

Visit awesome-copilot.github.com/skills/ and find a skill relevant to your stack. Install via CLI: copilot plugin install <name>@awesome-copilot.

4
Assign your first issue to the cloud agent

Find a small, well-scoped issue. Go to the Issue → Assignees → select Copilot. Check back in 5–10 minutes to review the draft PR.

5
Create your first custom skill

Identify a repetitive task your team does (e.g., PR review checklist). Write a SKILL.md in .github/skills/ and test it by describing the task in chat.