Your codebase, your rules: Customizing Copilot with context engineering
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).
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.