Agent skill

Copilot SDK

by intellectronica in intellectronica/agent-skills

This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java.

CC0-1.0Auto-check passedAgent Workflows

Install Copilot SDK

skills CLI
$ npx skills add intellectronica/agent-skills --skill copilot-sdk -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install intellectronica/agent-skills copilot-sdk --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/intellectronica/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/copilot-sdk .claude/skills/copilot-sdk && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
copilot-sdk
GitHub stars
295
Token cost
~3.2k tokens
SKILL.md length
1,087 words
Files
5 (incl. references)
Skills in repo
21
Repo updated
First seen
Licence
CC0-1.0

At a glance

This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java.

  • Works in 5 steps: Prefer the official docs index and the… → Treat the top-level SDK README plus… → Call out preview status when stability… → …
  • Tasks that involve Authentication
  • SKILL.md covers Overview, How to use this skill, Current source of truth and High-value facts, plus 7 more sections
  • Calls go, npm and pip

What it does

Copilot SDK is an agent skill from intellectronica/agent-skills. This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java. It covers setup, authentication, permissions, streaming events, custom tools, custom agents, MCP servers, hooks, skills, and session persistence.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/cli-agents-mcp.md`, `references/event-system.md` and `references/troubleshooting.md`).

It sits in Agent Workflows, covering Authentication and MCP servers. It works with TypeScript, Java, .NET and Node.js. The repository describes itself as: @intellectronica's agent skills. The licence is CC0-1.0.

When your agent uses it

  • Tasks that involve Authentication
  • Tasks that involve MCP servers

Example prompts

  • “/copilot-sdk”

Requirements

  • Python 3
  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Prefer the official docs index and the language-specific README over memory.
  2. Treat the top-level SDK README plus docs/ as the source of truth for shared behavior.
  3. Call out preview status when stability or breaking changes matter.
  4. Avoid hardcoding model lists when runtime discovery via listModels() is available.
  5. Watch for stale guidance around permissions, lifecycle methods, and event names.

What it can do on your machine

Read from SKILL.md and the folder at commit 9b0e00a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go
    • npm
    • pip
    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • docs.github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Copilot SDK loads about 3.2k tokens when it runs, and up to ~9.7k if it reads all its reference files. Until then it costs about 65 tokens; SKILL.md has 1,087 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from intellectronica/agent-skills at commit 9b0e00a, republished under its CC0-1.0 licence (© intellectronica). 1,087 words, ~3,160 tokens.

Download SKILL.mdSave it as .claude/skills/copilot-sdk/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
copilot-sdk
description
This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java. It covers setup, authentication, permissions, streaming events, custom tools, custom agents, MCP servers, hooks, skills, and session persistence.

GitHub Copilot SDK

Overview

The GitHub Copilot SDK exposes the same Copilot CLI agent runtime over JSON-RPC, so apps can drive Copilot programmatically instead of building their own orchestration layer.

Status: Public preview
SDKs: Node.js/TypeScript, Python, Go, .NET, Java
Architecture: Application -> SDK client -> JSON-RPC -> Copilot CLI

How to use this skill

When helping with the Copilot SDK:

  1. Prefer the official docs index and the language-specific README over memory.
  2. Treat the top-level SDK README plus docs/ as the source of truth for shared behavior.
  3. Call out preview status when stability or breaking changes matter.
  4. Avoid hardcoding model lists when runtime discovery via listModels() is available.
  5. Watch for stale guidance around permissions, lifecycle methods, and event names.

Current source of truth

Core SDK docs
Language-specific docs
Copilot CLI and GitHub Docs
Recipes and examples

High-value facts

Authentication and prerequisites
  • A GitHub Copilot subscription is required for normal SDK use.
  • BYOK is supported and does not require GitHub Copilot authentication.
  • Node.js, Python, and .NET bundle the Copilot CLI automatically.
  • Go can use an installed CLI or embed/bundle one with the go tool bundler workflow.
  • Java currently lives in github/copilot-sdk-java and expects the CLI to be installed separately.
  • Azure Managed Identity / Entra auth is supported as a documented BYOK pattern by passing short-lived bearer tokens from DefaultAzureCredential.
Permissions
  • The SDK uses a deny-by-default permission model.
  • In practice, create/resume flows should provide an explicit permission handler such as:
    • TypeScript: approveAll
    • Python: PermissionHandler.approve_all
    • Go: copilot.PermissionHandler.ApproveAll
    • .NET: PermissionHandler.ApproveAll
    • Java: PermissionHandler.APPROVE_ALL
Session lifecycle
  • Preferred cleanup method: disconnect()
  • Deprecated cleanup method: destroy()
  • To resume sessions reliably, provide your own sessionId when creating them.
  • BYOK provider configuration must be provided again when resuming because keys are not persisted.
Transport and deployment
  • Default transport is stdio with an SDK-managed CLI process.
  • You can connect to an external headless CLI server via cliUrl.
  • Current external server docs use:
bash
copilot --headless --port 4321
Models
  • Do not hardcode model support unless the user specifically needs a fixed list.
  • Prefer client.listModels() and the official supported-models page.
  • reasoningEffort exists for models that support it.

Installation

SDKInstall
Node.js / TypeScriptnpm install @github/copilot-sdk
Pythonpip install github-copilot-sdk
Gogo get github.com/github/copilot-sdk/go
.NETdotnet add package GitHub.Copilot.SDK
JavaMaven/Gradle package com.github:copilot-sdk-java

Setup and deployment choices

Pick the setup that matches the application shape:

  • Local CLI - simplest path for personal tools and development.
  • Bundled CLI - ship a CLI binary with your app for desktop/distributable tooling.
  • Backend services - run the CLI in headless mode and connect with cliUrl.
  • Scaling and multi-tenancy - shared CLI vs CLI-per-user, shared storage, and session locking.
  • Azure Managed Identity - use BYOK with short-lived bearer tokens instead of static API keys when Azure auth is the real requirement.

Quick start pattern

Use the same mental model in every language:

  1. Create/start the client.
  2. Create a session with a permission handler.
  3. Register event handlers before send() if you need streaming or progress.
  4. Send with send() or sendAndWait().
  5. Wait for session.idle or the returned final message.
  6. disconnect() the session and stop/dispose the client.
TypeScript example
typescript
import { CopilotClient, approveAll } from "@github/copilot-sdk";

const client = new CopilotClient();
await client.start();

const session = await client.createSession({
  model: "gpt-5",
  streaming: true,
  onPermissionRequest: approveAll,
});

session.on("assistant.message_delta", (event) => {
  process.stdout.write(event.data.deltaContent ?? "");
});

await session.sendAndWait({ prompt: "What is 2+2?" });

await session.disconnect();
await client.stop();

Core capabilities to remember

Client and session APIs

Common operations across SDKs:

  • Client lifecycle: start(), stop(), forceStop()
  • Session lifecycle: createSession(), resumeSession(), disconnect()
  • Messaging: send(), sendAndWait(), abort(), getMessages()
  • Discovery: listModels(), listSessions(), getStatus() / ping()
Events and streaming
  • Final assistant output arrives in assistant.message.
  • Streaming text arrives in assistant.message_delta.
  • session.idle is the reliable "turn complete" signal.
  • The event system now includes reasoning, tool progress, permission, elicitation, sub-agent, and skill events.

See references/event-system.md.

Show full SKILL.md (434 more words)Show less
Custom tools
  • Node uses defineTool(...) with Zod or raw JSON Schema.
  • Python uses @define_tool with Pydantic models.
  • Go prefers DefineTool(...).
  • .NET uses AIFunctionFactory.Create(...).
  • Overriding built-ins always requires explicit opt-in:
    • TypeScript: overridesBuiltInTool: true
    • Python: overrides_built_in_tool=True
    • Go: OverridesBuiltInTool = true
    • .NET: AdditionalProperties["is_override"] = true
  • Custom tools can also opt into skipPermission.
Custom agents, MCP, hooks, and skills
  • customAgents lets you define sub-agents per session.
  • mcpServers attaches local or remote MCP servers.
  • Hooks provide control points such as onPreToolUse, onPostToolUse, onUserPromptSubmitted, and lifecycle/error hooks.
  • Skills are loaded with skillDirectories; disable selectively with disabledSkills.

See references/cli-agents-mcp.md.

Attachments, commands, and interaction
  • Sessions can send file, directory, and image attachments.
  • Image input supports both file and blob attachments, and vision should be checked through model capabilities.
  • In-flight messaging supports mode: "immediate" for steering and mode: "enqueue" for queueing.
  • The SDK can register custom slash commands.
  • Apps can answer user questions with onUserInputRequest.
  • Rich UI prompts are available through elicitation handlers and session.ui when the connected client supports them.
Telemetry and observability
  • The SDK supports OpenTelemetry configuration through TelemetryConfig.
  • Trace context propagation is built in, with Node using an explicit onGetTraceContext callback for outbound propagation.
Persistence and long-running work
  • Use a stable sessionId for resumable sessions.
  • Use infiniteSessions for long-running workflows that may need compaction.
  • Session state is stored under ~/.copilot/session-state/ unless configuration overrides it.
SDK vs. CLI-only features
  • The SDK exposes programmatic surfaces for sessions, models, plans, mode switching, workspace files, custom agents, hooks, MCP, skills, and telemetry.
  • Many terminal UX features remain CLI-only, such as most slash-command workflows, interactive pickers, and export/share commands.
  • When translating a CLI workflow into app code, check the compatibility guide before assuming a slash command has an SDK equivalent.

Language conventions

ConceptTypeScriptPythonGo.NETJava
Create sessioncreateSession()create_session()CreateSession()CreateSessionAsync()createSession()
Resume sessionresumeSession()resume_session()ResumeSession()ResumeSessionAsync()resumeSession()
Final contentevent.data.contentevent.data.content*event.Data.Contentevt.Data.Contentevent.getData().content()
Delta contentevent.data.deltaContentevent.data.delta_content*event.Data.DeltaContentevt.Data.DeltaContentevent.getData().deltaContent()
Skills fieldskillDirectoriesskill_directoriesSkillDirectoriesSkillDirectoriessetSkillDirectories(...)

Common gotchas

  • The SDK is public preview, so older examples drift quickly.
  • Hardcoded model tables get stale; prefer runtime discovery.
  • destroy() still appears in older examples but disconnect() is the current method.
  • A missing permission handler causes confusion fast; treat it as required for real sessions.
  • assistant.message and assistant.message_delta use event.data.*, not top-level event.content.
  • Streaming/event subscriptions should be attached before send().
  • Session resumption without a caller-provided sessionId is awkward to operationalize.

Local reference files in this skill

  • references/working-examples.md - current starter examples, including tools and resume patterns
  • references/event-system.md - event names, lifecycle, and language access patterns
  • references/cli-agents-mcp.md - custom agents, skills, MCP, headless CLI, and config locations
  • references/troubleshooting.md - common failures, debug logging, auth, permissions, and transport issues

© intellectronica, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/copilot-sdk of intellectronica/agent-skills.

  • SKILL.md
  • references/cli-agents-mcp.md
  • references/event-system.md
  • references/troubleshooting.md
  • references/working-examples.md

Open the folder on GitHubat commit 9b0e00a

Compare with similar skills

Copilot SDK next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Copilot SDK compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Copilot SDK this skillintellectronica/agent-skills295—~3.2kAutomated safety check: PassCC0-1.0
Copilot SDKmicrosoft/skills3.1k—~7.1kAutomated safety check: PassMIT
Copilot SDKaiskillstore/marketplace4305 repos~3.8kAutomated safety check: PassNone
Copilot SDKgithub/awesome-copilot40k5 repos~6.3kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k62 repos~2.3kAutomated safety check: PassApache-2.0
MCP Server BuildershareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT

Similar skills

  • Copilot SDK

    microsoft/skills

    Official

    Build applications powered by GitHub Copilot using the Copilot SDK.

    3.1k GitHub stars~7.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Copilot SDK

    aiskillstore/marketplace

    Build applications that programmatically interact with GitHub Copilot.

    430 GitHub starsUsed in 5 repos~3.8k tokens
    Agent WorkflowsAuto-check passed
  • Copilot SDK

    github/awesome-copilot

    Official

    Build agentic applications with GitHub Copilot SDK. An agent skill from github/awesome-copilot.

    40k GitHub starsUsed in 5 repos~6.3k tokens
    AI & LLM EngineeringAuto-check passed
  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 62 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Builds, modifies, debugs, migrates and verifies TypeScript MCP servers and MCP Apps with the mcp-use framework, treating the installed package's types as the source of truth.

    11k GitHub stars~923 tokensUpdated today
    Agent WorkflowsAuto-check passed

More from intellectronica/agent-skills

All 21 skills in this repo
  • Beautiful Mermaid

    intellectronica/agent-skills

    Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library.

    295 GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check passed
  • Gpt Image 1 5

    intellectronica/agent-skills

    Generate and edit images using OpenAI's GPT Image 1.5 model.

    295 GitHub stars~1.5k tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana 2

    intellectronica/agent-skills

    Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API.

    295 GitHub stars~972 tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana Pro

    intellectronica/agent-skills

    Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API.

    295 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Notion API

    intellectronica/agent-skills

    This skill provides comprehensive instructions for interacting with the Notion API via REST calls.

    295 GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Markdown Converter

    intellectronica/agent-skills

    Convert documents and files to Markdown using markitdown. An agent skill from intellectronica/agent-skills.

    295 GitHub starsUsed in 4 repos~492 tokens
    Auto-check passed

Questions about Copilot SDK

What does Copilot SDK do?

This skill helps with GitHub Copilot SDK work across Node.js/TypeScript, Python, Go, .NET, and Java. Copilot SDK is an agent skill from intellectronica/agent-skills.NET, and Java.

When should I use Copilot SDK?

Copilot SDK fits situations like: tasks that involve Authentication; tasks that involve MCP servers.

How do I install Copilot SDK in Claude Code?

Run `npx skills add intellectronica/agent-skills --skill copilot-sdk -a claude-code`. Or copy the skill folder (skills/copilot-sdk in intellectronica/agent-skills) into .claude/skills/copilot-sdk in your project. Claude Code loads it when a task matches its description.

How do I install Copilot SDK in Codex?

Run `npx skills add intellectronica/agent-skills --skill copilot-sdk -a codex`. Or copy the skill folder (skills/copilot-sdk in intellectronica/agent-skills) into .agents/skills/copilot-sdk in your project. Codex loads it when a task matches its description.

Can I use Copilot SDK in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add intellectronica/agent-skills --skill copilot-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/copilot-sdk, .gemini/skills/copilot-sdk, .github/skills/copilot-sdk and .opencode/skills/copilot-sdk in your project.

What does Copilot SDK need to run?

Going by SKILL.md and its folder, Copilot SDK needs the command-line tools its instructions call (go, npm, pip and dotnet). Our summary lists: Python 3; Node.js.

Does Copilot SDK access the network?

SKILL.md names 2 domains. As links in the text: github.com and docs.github.com. This is read from the text; nothing was executed.

Is Copilot SDK safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Copilot SDK use?

Copilot SDK is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Copilot SDK use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.5k tokens, read only when the agent opens those files.

What are the alternatives to Copilot SDK?

Skills that share tags, products or a category with Copilot SDK: Copilot SDK (microsoft/skills, 3.1k stars), Copilot SDK (aiskillstore/marketplace, 430 stars), Copilot SDK (github/awesome-copilot, 40k stars) and MCP Server Builder (anthropics/skills, 180k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Copilot SDK?

intellectronica (a GitHub user) maintains it in intellectronica/agent-skills, which has 295 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on April 25, 2026.

Source: intellectronica/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.