Copilot Agent Chat Implementation
Use this skill when setting up repository structures and file schemas for .github/copilot-instructions.md, .github/instructions/*.instructions.md, .github/prompts/*.prompt.md, .github/agents/*.agent.md, and .github/skills/<skill>/SKILL.md.
File Type Reference
1. Always-On Instructions — .github/copilot-instructions.md
- •Automatically applied to every chat request in the workspace
- •No frontmatter required — plain Markdown
- •Use for: coding standards, architecture decisions, library preferences, security requirements
2. Scoped Instructions — .github/instructions/*.instructions.md
Required frontmatter:
--- description: "Short description shown on hover" applyTo: '**/*.py' # Glob pattern — omit to use semantic matching only ---
Applied when: a file matching applyTo is active, or when the description semantically matches the task.
3. Reusable Prompts — .github/prompts/*.prompt.md
Required frontmatter:
---
description: "What this prompt does"
agent: 'agent' # Use 'agent' for full agentic mode
tools: ['search', 'edit', 'read', 'problems', 'execute']
argument-hint: "${input:myVariable}" # Optional input placeholder
---
Invoked via /prompt-name slash command in Copilot Chat.
4. Custom Agents — .github/agents/*.agent.md
Required frontmatter:
---
description: "Agent specialisation description"
name: My Agent Name
tools: ['search', 'edit', 'execute', 'read', 'problems']
model: 'Claude Sonnet 4.5'
target: 'vscode'
infer: true
handoffs:
- label: "Review Security"
agent: security-review # Must match another .agent.md filename (without extension)
---
Invoked via @agent-name in Copilot Chat.
5. Project Skills — .github/skills/<name>/SKILL.md
Required frontmatter:
--- name: skill-name # Must match parent directory name exactly (lowercase, hyphens) description: > # Max 1024 chars; specific about when to trigger Detailed trigger description... argument-hint: "[...]" # Optional user-invokable: true # Optional, default true ---
Directory Structure
.github/
├── copilot-instructions.md
├── instructions/
│ └── *.instructions.md
├── prompts/
│ └── *.prompt.md
├── agents/
│ └── *.agent.md
└── skills/
└── <skill-name>/
└── SKILL.md
Core Requirements
- •Place always-on rules in
.github/copilot-instructions.md - •Place scoped rules in
.github/instructions/*.instructions.mdwithdescriptionandapplyTofrontmatter - •Place reusable prompts in
.github/prompts/*.prompt.mdwithdescription,agent,tools - •Place custom agents in
.github/agents/*.agent.mdwithdescription,tools,model,target - •Place skills in
.github/skills/<skill-name>/SKILL.mdwithnamematching directory, anddescription
Reliability Checks
- •Use VS Code Chat Diagnostics (
Ctrl+Shift+P→ "GitHub Copilot: Diagnostics") to verify loaded files - •Ensure
applyToglob patterns match active files - •Ensure
namein SKILL.md frontmatter matches the parent directory name exactly - •Ensure agent
handoffsreference existing.agent.mdfilenames - •Keep descriptions explicit and keyword-rich so discovery triggers correctly
Common Failure Causes
| Symptom | Likely Cause |
|---|---|
| Skill not loading | name doesn't match directory name |
| Instructions not applying | applyTo glob doesn't match active file type |
| Agent handoff fails | Referenced agent file doesn't exist |
| Prompt not in / menu | File missing description frontmatter |
| Always-on instructions ignored | File not at exact path .github/copilot-instructions.md |