| Editor’s note: A version of this blog was originally published in The GitHub Insider newsletter. Sign up now for more technical content > |
Developers often sense that GitHub Copilot could deliver better results with a bit more surrounding context. That instinct is the basis of context engineering, a practice gaining traction as a way to shape AI-assisted development. It moves beyond prompt engineering's focus on phrasing, concentrating instead on supplying the LLM with the right information in the right format, as Braintrust CEO Ankur Goyal describes.
At GitHub Universe, Microsoft principal product manager Harald Kirschner outlined three practical techniques developers can apply today: custom instructions, reusable prompts, and custom agents. Each method gives Copilot more of the information it needs to align its output with your architecture, coding standards, and team expectations.
Defining Rules with Custom Instructions
Custom instruction files let you document coding conventions, language preferences, naming standards, and documentation style so Copilot applies them automatically. You can set global rules in .github/copilot-instructions.md or define task-specific rules in .github/instructions/*.instructions.md. For example, you might specify how React components should be structured, how errors should be handled in a Node service, or how API documentation should be formatted. Copilot then follows these rules as it works.
Standardizing Workflows with Reusable Prompts
For repeatable tasks such as code reviews, scaffolding components, generating tests, or initializing projects, reusable prompt files offer a consistent approach. Place them in .github/prompts/*.prompts.md and trigger them with slash commands like /create-react-form. This approach enforces team consistency, speeds up onboarding, and ensures common workflows execute identically every time.
Building Task-Specific Personas with Custom Agents
Custom agents let you create specialized AI assistants with well-defined responsibilities and scopes. You might configure an API design agent to review interfaces, a security agent for static analysis, or a documentation agent to rewrite comments and generate examples. Agents can carry their own tools, instructions, constraints, and behavior models, and handoff between agents is supported for more complex workflows.
Why Context Engineering Matters
The payoff of context engineering is not just better output, but a more accurate understanding by Copilot of what you are trying to build. Clear context yields more reliable code, fewer back-and-forth prompting cycles, and greater consistency across files and repositories. Developers also stay in flow longer, spending less time rewriting or correcting generated results.
As you experiment with supplying more context, the effects on your development experience become more apparent. For further guidance, explore resources on context engineering for developers, building reliable AI workflows with agentic primitives, and crafting effective agents.md files.



