<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arjun</title>
    <description>The latest articles on DEV Community by Arjun (@arjun_c_615745c0e95e8f459).</description>
    <link>https://dev.to/arjun_c_615745c0e95e8f459</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3697545%2F4adca399-0ee0-4e65-b254-582272ceae9d.png</url>
      <title>DEV Community: Arjun</title>
      <link>https://dev.to/arjun_c_615745c0e95e8f459</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arjun_c_615745c0e95e8f459"/>
    <language>en</language>
    <item>
      <title>Working with GitHub Copilot: Custom Instructions &amp; Agents</title>
      <dc:creator>Arjun</dc:creator>
      <pubDate>Wed, 07 Jan 2026 05:44:41 +0000</pubDate>
      <link>https://dev.to/arjun_c_615745c0e95e8f459/working-with-github-copilot-custom-instructions-agents-n4f</link>
      <guid>https://dev.to/arjun_c_615745c0e95e8f459/working-with-github-copilot-custom-instructions-agents-n4f</guid>
      <description>&lt;h1&gt;
  
  
  GitHub Copilot Custom Instructions &amp;amp; Custom Agents: A Practical Developer's Guide
&lt;/h1&gt;

&lt;p&gt;I recently explored &lt;strong&gt;Custom Instructions&lt;/strong&gt; and &lt;strong&gt;Custom Agents&lt;/strong&gt; in GitHub Copilot. While these features seem simple at first, they fundamentally change how Copilot behaves in real-world codebases—especially when used intentionally.&lt;br&gt;
This guide reflects my current understanding and practical takeaways, based entirely on &lt;strong&gt;GitHub Copilot Chat in Visual Studio Code&lt;/strong&gt; (unless explicitly stated otherwise).&lt;/p&gt;

&lt;h2&gt;
  
  
  Terminology Clarification
&lt;/h2&gt;

&lt;p&gt;To avoid confusion:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code Agent mode&lt;/strong&gt; refers to GitHub Copilot's built-in Agent Mode in Visual Studio Code—the mode that can plan and apply multi-file code changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom agents&lt;/strong&gt; refer to user-defined agent profiles created via .github/agents and invoked explicitly (for example, @security-reviewer).
Both use the word "agent," but they serve very different purposes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Custom Instructions vs. Custom Agents (Mental Model)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Custom Instructions&lt;/strong&gt; provide &lt;strong&gt;persistent project context&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Agents&lt;/strong&gt; provide &lt;strong&gt;specialized behavior&lt;/strong&gt; for a specific chat interaction.
Think of instructions as the project's &lt;strong&gt;rulebook&lt;/strong&gt;, and custom agents as &lt;strong&gt;specialized reviewers&lt;/strong&gt; you invoke deliberately.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Custom Instructions
&lt;/h2&gt;

&lt;p&gt;Repository-level instructions are the &lt;strong&gt;most reliable and widely supported&lt;/strong&gt; customization mechanism today.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Repository-wide instructions
&lt;/h3&gt;

&lt;p&gt;Create a file at:&lt;br&gt;
.github/copilot-instructions.md&lt;br&gt;
This file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Applies across the repository.&lt;/li&gt;
&lt;li&gt;Acts as Copilot's &lt;strong&gt;persistent project context&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Serves as a &lt;strong&gt;shared rulebook&lt;/strong&gt; (not an enforcement mechanism).&lt;/li&gt;
&lt;li&gt;VS Code can generate this file automatically by analyzing the codebase. Treat it as a &lt;strong&gt;starting point&lt;/strong&gt;, not an authoritative specification — human review is still required.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Path-specific instructions
&lt;/h3&gt;

&lt;p&gt;You can create &lt;strong&gt;scoped instruction files&lt;/strong&gt; using apply-to globs, e.g.:&lt;br&gt;
.github/instructions/&lt;strong&gt;/*.instructions.md&lt;br&gt;
These instructions are **loaded only when files matching the path are in context&lt;/strong&gt;, so frontend rules don't leak into backend code and vice versa.&lt;br&gt;
&lt;strong&gt;Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.github/instructions/csharp-coding-standards.instructions.md -&amp;gt; C# backend files&lt;/li&gt;
&lt;li&gt;.github/instructions/typescript-coding-standards.instructions.md -&amp;gt; TypeScript frontend files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All instructions—repository-wide or path-specific—are &lt;strong&gt;guidance, not hard constraints.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: Instructions "Never use any in Typescript"

&lt;ul&gt;
&lt;li&gt;Copilot usually avoids any&lt;/li&gt;
&lt;li&gt;But it may still insert it if types are ambiguous or for brevity
Human review or custom agents are still needed for enforcement.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to Include in Instruction files
&lt;/h2&gt;

&lt;p&gt;Include only information Copilot cannot infer from code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tech stack choices: "We use Tailwind CSS for styling and Vitest for testing."&lt;/li&gt;
&lt;li&gt;Naming conventions: "Always prefix interfaces with I (e.g., IUser)."&lt;/li&gt;
&lt;li&gt;Strict restrictions: "Never use any in TypeScript."&lt;/li&gt;
&lt;li&gt;Project context: "This is a legacy monolithic project; prioritize compatibility over new features."&lt;/li&gt;
&lt;li&gt;Avoid duplicating rules already enforced by compilers, linters, or CI.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Awesome Copilot repository
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://github.com/github/awesome-copilot" rel="noopener noreferrer"&gt;Awesome Copilot repository&lt;/a&gt; contains a lot of:&lt;br&gt;
suggest-awesome-github-7_prompt.md&lt;br&gt;
prompts for exploring community-sourced &lt;strong&gt;instruction files, agents, and templates.&lt;/strong&gt; Pasting a prompt into VS Code Copilot Chat lets the AI recommend items relevant to your repository.&lt;br&gt;
&lt;strong&gt;Example: the agent prompt at:&lt;/strong&gt;&lt;br&gt;
github-prompts/suggest-awesome-github-copilot-agents.prompt.md&lt;br&gt;
can suggest which agent profiles could be useful. It is a powerful way to discover ready-to-use templates and workflows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Personal &amp;amp; Organization Instructions
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot also supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Personal instructions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Organization instructions&lt;/strong&gt;
These now sync &lt;strong&gt;with VS Code via Settings Sync&lt;/strong&gt;, so rules defined on GitHub.com apply in your IDE as well.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Instruction Priority
&lt;/h2&gt;

&lt;p&gt;When multiple sources exist, Copilot combines them and generally follows this precedence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Personal/User instructions&lt;/li&gt;
&lt;li&gt;Repository instructions (.github/copilot-instructions.md)&lt;/li&gt;
&lt;li&gt;Organization instructions
Conflict resolution is probabilistic—behavior is not strictly deterministic.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Instruction File Strategy (Avoid Instruction Bloat)
&lt;/h2&gt;

&lt;p&gt;Instead of one massive file, split instructions by &lt;strong&gt;domain and technology&lt;/strong&gt;:&lt;br&gt;
.github/&lt;br&gt;
— copilot-instructions.md&lt;br&gt;
— instructions/&lt;br&gt;
    — frontend.instructions.md&lt;br&gt;
    — backend.instructions.md&lt;br&gt;
    — security-iam.instructions.md&lt;br&gt;
    — dotnet-framework-legacy.instructions.md&lt;/p&gt;

&lt;h3&gt;
  
  
  Global Playbook (.github/copilot-instructions.md)
&lt;/h3&gt;

&lt;p&gt;Include non-negotiables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture: Prefer composition over inheritance. Follow Zero Trust for public APIs.&lt;/li&gt;
&lt;li&gt;Security: Never log PII, raw tokens, or secrets.&lt;/li&gt;
&lt;li&gt;Performance: Prefer O(n) or better; explicitly mark async I/O.&lt;/li&gt;
&lt;li&gt;Documentation: Document public contracts and complex logic only.
Keep this file small and stable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scoped Instruction Examples:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Frontend instructions: Framework conventions, reactivity, typing rules.&lt;/li&gt;
&lt;li&gt;Backend instructions: naming, error handling, formatting.&lt;/li&gt;
&lt;li&gt;IAM instructions: authentication/authorization rules.&lt;/li&gt;
&lt;li&gt;Legacy framework instructions: safe modernization within constraints.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Custom Agents
&lt;/h2&gt;

&lt;p&gt;Custom agents move Copilot from:&lt;br&gt;
"AI that writes code" -&amp;gt; "AI that applies a specific engineering lens"&lt;br&gt;
They can be defined:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For workspace: .github/agents&lt;/li&gt;
&lt;li&gt;For user profile: shared across workspaces
Custom agents are not more powerful than VS Code Agent mode — they are &lt;strong&gt;more focused and opinionated.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Practical Use of Custom Agents
&lt;/h2&gt;

&lt;p&gt;A Lightweight Team Pattern&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VS Code Agent mode&lt;/strong&gt; -&amp;gt; implementation only&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom agents&lt;/strong&gt; -&amp;gt; required reviewers (by team convention, not enforced by Copilot)
Treat custom agent output like &lt;strong&gt;PR review feedback&lt;/strong&gt;, not suggestions.
&lt;strong&gt;Example Workflow&lt;/strong&gt;
Recommended: Repository-wide and path-specific instructions are configured to improve results.&lt;/li&gt;
&lt;li&gt;Use @plan mode in VS Code Copilot to outline the feature or changes&lt;/li&gt;
&lt;li&gt;Implement feature/functionality using &lt;strong&gt;VS Code Agent mode&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Run @dotnet-security-reviewer -&amp;gt; flags missing authorization policy&lt;/li&gt;
&lt;li&gt;Fix issue&lt;/li&gt;
&lt;li&gt;Run @typescript-api-contract-reviewer -&amp;gt; flags nullable mismatch&lt;/li&gt;
&lt;li&gt;Fix issue&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why Not Bake All of This Into VS Code Agent Mode?
&lt;/h2&gt;

&lt;p&gt;You can't bake everything into VS Code Agent mode because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Goals conflict (speed vs. caution)&lt;/li&gt;
&lt;li&gt;Rules dilute as constraints grow&lt;/li&gt;
&lt;li&gt;Context matters—most checks aren't always relevant&lt;/li&gt;
&lt;li&gt;Humans bypass friction when slowed down&lt;/li&gt;
&lt;li&gt;LLMs average; they don't arbitrate&lt;/li&gt;
&lt;li&gt;Completion bias beats prevention&lt;/li&gt;
&lt;li&gt;Silent violations are worse than explicit reviews
&lt;strong&gt;VS Code Agent mode builds. Custom agents judge.&lt;/strong&gt;
That separation is the difference between AI that helps and AI you can trust.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Notes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Personal and organization instructions now &lt;strong&gt;sync with VS Code&lt;/strong&gt; for most users.&lt;/li&gt;
&lt;li&gt;Custom agents can be linked with tools, subject to Copilot feature availability and workspace permissions.&lt;/li&gt;
&lt;li&gt;GitHub Copilot Chat is open source:

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/microsoft/vscode-copilot-chat" rel="noopener noreferrer"&gt;VS Code Copilot Chat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Built-in agents (like Plan mode) visible here: &lt;a href="https://github.com/microsoft/vscode-copilot-release/blob/main/plan-agent.md" rel="noopener noreferrer"&gt;Plan-agent.md&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/copilot/customization/custom-agents" rel="noopener noreferrer"&gt;Creating custom agents in VS Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/github/awesome-copilot" rel="noopener noreferrer"&gt;Awesome Copilot&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>github</category>
      <category>tutorial</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
