# Your codebase, your rules: Customizing Copilot with context engineering

Source: https://www.youtube.com/watch?v=0jEzUhU8bLc
Recap page: https://rapidrecap.app/video/0jEzUhU8bLc
Generated: 2025-11-12T15:34:40.781+00:00

---
## Quick Overview

Customizing GitHub Copilot involves using Context Engineering primitives—Custom Instructions, Reusable Prompts, and Custom Agents—to tailor the AI's behavior precisely to the codebase, enabling capabilities like running specific tests or accessing custom documentation without relying on external tools or exhaustive context in every query.

**Key Points:**
- Context Engineering in Copilot is achieved using three primitives: Custom Instructions (.instructions.md), Reusable Prompts (.prompts.md), and Custom Agents (.agents.md).
- Custom Instructions provide always-on guidelines for AI interactions, best for coding standards and documentation guidelines, and are automatically applied to all requests (09:58).
- Reusable Prompts define specific tasks or executable commands (tools) that agents can use when needed, such as running specific test suites or performing atomic commits (10:00, 11:36).
- Custom Agents define specific personas and workflows, allowing for specialized contexts like an API Architect or SRE Debugger, which users can switch between (11:05).
- The presentation demonstrated how these primitives allow for greater control, such as agents knowing exactly which documentation or tests to access based on the required context (11:17, 12:28).
- The speaker showed a TDD workflow example where the agent adhered to red/green phases and used specific tools defined in the agent's prompt file (12:28).
- Context Engineering allows for more complex, multi-step workflows that operate with tighter constraints, leading to more reliable and focused AI assistance (13:33, 14:48).

![Screenshot at 00:07: The title slide for the talk "Customizing Copilot with Context Engineering" introduces the theme of controlling AI behavior within the developer's codebase, featuring speaker Harald Kirschner from Microsoft.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-00-07.png)

**Context:** The presentation, titled "Your codebase, your rules: Customizing Copilot with context engineering," was delivered by Harald Kirschner, Principal Product Manager at Microsoft, at GitHub Universe 25 (00:07). The core focus is on how developers can move beyond Copilot's default behavior by explicitly engineering the context provided to the language model (LLM) agent, ensuring it operates according to specific project rules, access tools, and workflows.

## Detailed Analysis

The presentation details the concept of Context Engineering as a way to customize GitHub Copilot's behavior using three main primitives: Custom Instructions, Reusable Prompts, and Custom Agents. Custom Instructions (.instructions.md) are always-on guidelines influencing all AI interactions, covering coding standards and documentation rules, and are automatically applied (09:58). Reusable Prompts (.prompts.md) define executable commands or specific tasks that can be invoked when needed, such as running specific test suites or performing atomic commits (10:00, 11:36). Custom Agents (.agents.md) define specialized personas and workflows, like an 'API Architect' or 'SRE Debugger,' allowing the agent to operate in different working contexts (11:05). The speaker demonstrated this control by showing the structure of a custom agent prompt file, including defined tools and handoffs between steps (08:48). This context-aware approach means the agent follows project-specific rules and uses only the necessary context, such as running specific TDD phases or accessing specific documentation files, resulting in more reliable and less verbose interactions compared to relying on broad, out-of-the-box context (13:33, 14:48). The speaker emphasized that this level of control is crucial for complex, multi-step workflows.

### Context Engineering Primitives

- Custom Instructions (.instructions.md) define rules of engagement/always-on guidelines
- Reusable Prompts (.prompts.md) define executable commands/specific tasks
- Custom Agents (.agents.md) define personas and workflows (10:55)

### Custom Instructions Usage

- Best for coding standards, language-specific rules, and documentation guidelines
- Usage is automatically applied to all requests (10:58)

### Reusable Prompts Usage

- Best for specific tasks like generating components, increasing test coverage, or atomic commits
- Usage is user-run via slash command (soon auto-run) (11:36)

### Custom Agents Usage

- Best for different working contexts like API Architect, SRE Debugger, or Security Review
- Usage involves the user switching agents (soon auto-suggested) (11:05)

### Real-World Context Example (Data Queries)

- Agents can be instructed to use specific tools like 'kusto_query' and 'Azure MCP' to answer telemetry questions using specific, domain-specific documentation (07:39)

### Real-World Context Example (TDD Workflow)

- A custom agent was shown following TDD (Red/Green/Refactor) phases, using specific tools like 'runSubagent' and 'runTests' defined in its prompt, ensuring steps are followed precisely (12:28, 13:34)

### Plan Agent Example

- The 'plan-prompt.md' demonstrates defining an agent's role (PLANNING AGENT, NOT implementation agent) with specific tools and handoffs, emphasizing that the agent's sole responsibility is planning (08:50)

![Screenshot at 00:07: The title slide for the talk "Customizing Copilot with Context Engineering" introduces the theme of controlling AI behavior within the developer's codebase, featuring speaker Harald Kirschner from Microsoft.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-00-07.png)
![Screenshot at 00:50: The initial agenda outlines the talk structure: Out-of-the-box Agent Context, Engineering Context in Action, and Beyond Basic Rules.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-00-50.png)
![Screenshot at 01:15: A slide detailing the capabilities of VS Code's integrated agent context, covering Codebase/Repo Search, Terminal Commands, Symbol/Pattern Search, Tests, Tasks, and Problems.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-01-15.png)
![Screenshot at 04:22: A slide showcasing performance metrics for a "Smarter workspace and cross-repo search" using a custom code search embedding model, highlighting +37.6% Retrieval Quality and +113% Acceptance Rate.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-04-22.png)
![Screenshot at 04:58: The transition slide to the second section, "Real-world Context Engineering in Action," provides the GitHub link for the VS Code repository.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-04-58.png)
![Screenshot at 07:27: The screen switches to VS Code showing the observables.instructions.md file, detailing guidelines for writing code using observables, which the agent should follow.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-07-27.png)
![Screenshot at 09:54: A view of the plan-agent.md file open in VS Code, detailing the agent's role as a PLANNING AGENT with specific tools and handoffs, illustrating the use of Custom Agents.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-09-54.png)
![Screenshot at 10:54: A key slide summarizing the Context Engineering Primitives: Custom Instructions, Reusable Prompts, and Custom Agents, detailing their primary purpose, best use cases, and usage patterns.](https://ss.rapidrecap.app/screens/0jEzUhU8bLc/00-10-54.png)
