{"id":2139,"date":"2026-02-23T10:41:22","date_gmt":"2026-02-22T21:41:22","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=2139"},"modified":"2026-02-23T10:42:40","modified_gmt":"2026-02-22T21:42:40","slug":"the-core-ai-primitives-in-github-copilot-in-vs-code","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=2139","title":{"rendered":"The Core GitHub Copilot AI Primitives in VS Code"},"content":{"rendered":"<p>The primitives in this ecosystem are the <strong>building blocks<\/strong> you compose to turn a generic model into a team\u2011specific coding assistant: instruction files, skills, prompts, custom agents (and sub\u2011agents), and hooks. Think of them as layers: always\u2011on rules at the bottom, on\u2011demand capabilities on top, and automation wrapped around the lifecycle.<\/p>\n<hr \/>\n<h2>1. Instruction files: Persistent rules and context<\/h2>\n<p>Instruction files are Markdown configurations that Copilot always includes in the context when working in your repo or specific files.<\/p>\n<ul>\n<li>They live alongside your code (for example <code>.instructions.md<\/code> or repo\u2011level instruction files) and often use glob patterns to target languages or folders.<\/li>\n<li>You capture architecture decisions, coding standards, naming conventions, security constraints, and \u201chow this codebase works\u201d so the agent doesn\u2019t guess.<\/li>\n<li>File\u2011 or pattern\u2011scoped instructions let you tune behavior per domain (e.g., frontend vs. backend vs. infra scripts).<\/li>\n<\/ul>\n<p><strong>Rationale:<\/strong> This is your \u201calways\u2011on brain\u201d for the codebase; you remove prompt repetition and make the agent opinionated in the same way your senior engineers are.<\/p>\n<hr \/>\n<h2>2. Skills: On\u2011demand specialized capabilities<\/h2>\n<p>Skills are folders (with <code>SKILL.md<\/code>) that define <strong>how<\/strong> to perform a specialized task, plus any helper scripts or examples.<\/p>\n<ul>\n<li><code>SKILL.md<\/code> contains YAML frontmatter (metadata) and instructions describing when and how to use the skill.<\/li>\n<li>Copilot decides when to inject a skill into context based on the user\u2019s request and the skill description\u2014for example \u201cdebug input handling for this game\u201d or \u201cmigrate legacy API calls.\u201d<\/li>\n<li>Skills are ideal for repeatable domain tasks: debugging patterns, migration playbooks, data\u2011access rules, or company\u2011specific frameworks.<\/li>\n<\/ul>\n<p><strong>Rationale:<\/strong> Instructions describe <strong>global rules<\/strong>, while skills encode <strong>detailed procedures<\/strong> that are only loaded when relevant, keeping the context window efficient.<\/p>\n<hr \/>\n<h2>3. Prompts: Reusable slash\u2011command workflows<\/h2>\n<p>Prompt files define named prompts that appear as slash commands (e.g., <code>\/test<\/code>, <code>\/document<\/code>, <code>\/refactor<\/code>) inside Copilot chat.<\/p>\n<ul>\n<li>They bundle a task pattern, guidance, and sometimes specific tools into a reusable command your team can trigger instantly.<\/li>\n<li>Typical uses: generate tests for the current file, summarize a diff, propose a refactor plan, or scaffold a feature implementation outline.<\/li>\n<li>Prompts can be tailored per repo so their behavior reflects local conventions and dependencies.<\/li>\n<\/ul>\n<p><strong>Rationale:<\/strong> Prompts are UX primitives for humans: they standardize how people ask for common operations, reducing prompt variability and making outcomes more predictable.<\/p>\n<hr \/>\n<h2>4. Custom agents and sub\u2011agents: Role\u2011based specialization<\/h2>\n<p>Custom agents are defined via agent config files (for example <code>.agent.md<\/code> under <code>.github\/agents<\/code>) that describe a persona, its tools, and its behavior.<\/p>\n<ul>\n<li>The frontmatter configures name, description, tools (built\u2011in tools and MCP servers), model, and where the agent is available.<\/li>\n<li>The Markdown body defines its role, expertise, boundaries, and how it should respond\u2014for example \u201cSolution Architect,\u201d \u201cSecurity Reviewer,\u201d or \u201cTest\u2011first Implementer.\u201d<\/li>\n<li>These agents appear in the chat agent dropdown and can be invoked directly for tasks that match their specialization.<\/li>\n<\/ul>\n<p>Sub\u2011agents are agents that run under an orchestrator agent to handle subtasks in parallel.<\/p>\n<ul>\n<li>The orchestrator can delegate subtasks like planning, implementation, accessibility review, and cleanup to different agents, each working in its own context.<\/li>\n<li>Only distilled results return to the orchestrator, preventing its context from being flooded with every intermediate step.<\/li>\n<\/ul>\n<p><strong>Rationale:<\/strong> This mirrors a real engineering team: you encode roles and responsibilities into agents, then let them collaborate while preserving clear separation of concerns and cleaner context windows.<\/p>\n<hr \/>\n<h2>5. Hooks: Lifecycle automation and policy enforcement<\/h2>\n<p>Hooks are shell commands that run at key lifecycle points of an agent session, configured via hook files described in the docs.<\/p>\n<ul>\n<li>They can trigger on events like session start\/stop, agent or sub\u2011agent start\/stop, before or after a tool call, or before\/after edits are applied.<\/li>\n<li>Hooks receive JSON input describing what the agent is doing, and can decide to log, transform, veto, or augment actions (for example enforce formatting, run linters, or perform security checks before committing changes).<\/li>\n<li>Output from hooks can influence whether the agent continues, rolls back, or adjusts its plan.<\/li>\n<\/ul>\n<p><strong>Rationale:<\/strong> Hooks move important practices (lint, tests, security, approvals) from \u201cplease remember\u201d into <strong>enforced automation<\/strong>, embedding your governance into the agent runtime itself.<\/p>\n<hr \/>\n<h2>6. How the primitives fit together<\/h2>\n<p>Taken together, these primitives give you a layered design:<\/p>\n<ul>\n<li>Instruction files: stable background knowledge and guardrails.<\/li>\n<li>Skills: contextual, task\u2011specific playbooks the agent loads when needed.<\/li>\n<li>Prompts: ergonomic entry points for common user workflows.<\/li>\n<li>Custom agents and sub\u2011agents: specialized roles and multi\u2011agent orchestration.<\/li>\n<li>Hooks: lifecycle glue for automation, quality, and compliance.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The primitives in this ecosystem are the building blocks you compose to turn a generic model into a team\u2011specific coding assistant: instruction files, skills, prompts, custom agents (and sub\u2011agents), and hooks. Think of them as layers: always\u2011on rules at the bottom, on\u2011demand capabilities on top, and automation wrapped around the lifecycle. 1. Instruction files: Persistent [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[86],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/2139"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2139"}],"version-history":[{"count":3,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/2139\/revisions"}],"predecessor-version":[{"id":2142,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/2139\/revisions\/2142"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}