copilot-sdk
Helps developers create and configure agents using the GitHub Copilot SDK across multiple programming languages.
Install
mkdir -p .claude/skills/copilot-sdk-vivi3172 && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12784" && unzip -o skill.zip -d .claude/skills/copilot-sdk-vivi3172 && rm skill.zipInstalls to .claude/skills/copilot-sdk-vivi3172
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
This skill provides guidance for creating agents and applications with the GitHub Copilot SDK. IMPORTANT - When using the SDK with TypeScript/Node.js, the project MUST use ESM (ECMAScript Modules). CommonJS (require/module.exports) is NOT supported. It should be used when the user wants to create, modify, or work on software that uses the GitHub Copilot SDK in TypeScript (ESM only), Python, Go, or .NET. The skill covers SDK usage patterns, ESM-based project configuration, CLI configuration, custom tools, MCP servers, and custom agents.Key capabilities
- →Create agents with the GitHub Copilot SDK
- →Configure projects for the GitHub Copilot SDK
- →Build custom tools for Copilot agents
- →Manage MCP servers for Copilot agents
- →Handle session creation and message sending
- →Process events from Copilot SDK sessions
How it works
The skill provides guidance and examples for using the GitHub Copilot SDK, which is a multi-platform agent runtime embedding Copilot's agentic workflows into applications. It covers SDK usage patterns, project configuration, and custom tool building.
Inputs & outputs
When to use copilot-sdk
- →Create a custom Copilot agent
- →Configure MCP servers
- →Debug Copilot SDK integration
About this skill
GitHub Copilot SDK
Overview
The GitHub Copilot SDK is a multi-platform agent runtime that embeds Copilot's agentic workflows into applications. It exposes the same engine behind Copilot CLI, enabling programmatic invocation without requiring custom orchestration development.
Critical Constraint (TypeScript / Node.js):
- The Copilot SDK for Node.js is ESM-only
- Projects MUST use ECMAScript Modules
- CommonJS (
require,module.exports) is not supported
Status: Technical Preview (suitable for development and testing)
Supported Languages: TypeScript/Node.js (ESM only), Python, Go, .NET
Primary Documentation
Language-Specific SDK Docs
CLI and Configuration Docs
- About GitHub Copilot CLI
- Using GitHub Copilot CLI
- Creating Custom Agents
- Custom Agents Configuration Reference
- Enhancing Agent Mode with MCP
- Supported AI Models
Prerequisites
-
GitHub Copilot Subscription - Pro, Pro+, Business, or Enterprise
-
GitHub Copilot CLI - Installed and authenticated (
copilot --version) -
Runtime:
- Node.js 18+ (ESM required)
- Python 3.8+
- Go 1.21+
- .NET 8.0+
-
TypeScript / Node.js Project Requirements
package.jsonMUST include:{ "type": "module" }- Use
import/export - Do NOT use
require()ormodule.exports
Installation
| Language | Command |
|---|---|
| TypeScript/Node.js (ESM) | npm install @github/copilot-sdk |
| Python | pip install github-copilot-sdk |
| Go | go get github.com/github/copilot-sdk/go |
| .NET | dotnet add package GitHub.Copilot.SDK |
Architecture
Application (ESM) → SDK Client → JSON-RPC → Copilot CLI (server mode)
The SDK manages CLI lifecycle automatically. External server connections supported via cliUrl / cli_url.
Quick Start (TypeScript – ESM REQUIRED)
// package.json MUST include: { "type": "module" }
import { CopilotClient } from "@github/copilot-sdk";
const client = new CopilotClient();
await client.start();
const session = await client.createSession({ model: "gpt-5" });
// Register handler BEFORE send()
session.on((event) => {
if (event.type === "assistant.message") {
console.log(event.data.content);
}
});
await session.send({ prompt: "What is 2 + 2?" });
await session.destroy();
await client.stop();
Critical:
- ESM only (
import) - No CommonJS
- Register event handlers before calling
send()
For complete examples in all languages, see references/working-examples.md.
Core Concepts
Client
Main entry point. Manages CLI server lifecycle and session creation.
Operations: start(), stop(), createSession(), resumeSession()
Config: cliPath, cliUrl, port, useStdio, autoStart, autoRestart
Session
Individual conversation context with message history.
Operations: send(), sendAndWait(), on(), abort(), getMessages(), destroy()
Config: model, streaming, tools, systemMessage
Events
Key events during processing:
| Event | Purpose |
|---|---|
assistant.message | Complete response |
assistant.message_delta | Streaming chunk |
session.idle | Ready for next prompt |
tool.execution_start/end | Tool invocations |
For full event lifecycle and SessionEvent structure, see references/event-system.md.
Streaming
streaming: false(default) - Content arrives all at oncestreaming: true- Content arrives incrementally viaassistant.message_delta
Final assistant.message always fires regardless of streaming setting.
Available Models
See Supported AI Models for full list.
| Provider | Model ID | Notes |
|---|---|---|
| OpenAI | gpt-4.1, gpt-5, gpt-5-mini | Included |
| OpenAI | gpt-5.1, gpt-5.1-codex, gpt-5.2 | Premium |
| Anthropic | claude-sonnet-4.5 | Premium (CLI default) |
| Anthropic | claude-opus-4.5 | Premium (3× multiplier) |
gemini-3-pro-preview | Premium |
Custom Tools
TypeScript (ESM + Zod):
const tool = defineTool("lookup_issue", {
description: "Fetch issue details",
parameters: z.object({ id: z.string() }),
handler: async ({ id }) => fetchIssue(id),
});
Python (Pydantic):
@define_tool(description="Fetch issue details")
async def lookup_issue(params: IssueParams) -> dict:
return fetch_issue(params.id)
For complete tool examples in all languages, see references/working-examples.md.
Language Conventions
| Concept | TypeScript (ESM) | Python | Go | .NET |
|---|---|---|---|---|
| Create session | createSession() | create_session() | CreateSession() | CreateSessionAsync() |
| Delta content | deltaContent | delta_content | DeltaContent | DeltaContent |
For full conventions table, see references/event-system.md.
CLI Configuration
Config stored in ~/.copilot/:
config.json- General configurationmcp-config.json- MCP server definitions
For custom agents and MCP setup, see references/cli-agents-mcp.md.
Troubleshooting
| Problem | Solution |
|---|---|
| Import errors | Ensure ESM ("type": "module") |
| Events fire but content empty | Use event.data.content, not event.content |
| Handler never fires | Register before send() |
| Python enum issues | Use event.type.value |
| Go nil pointer | Check != nil before dereferencing |
For debugging techniques, see references/troubleshooting.md.
Skill References
Detailed documentation in this skill:
references/working-examples.md- Complete examples for all languages, custom toolsreferences/event-system.md- Event lifecycle, SessionEvent structure, language conventionsreferences/troubleshooting.md- Common issues, debugging techniquesreferences/cli-agents-mcp.md- CLI configuration, custom agents, MCP server setup
Additional Resources
When not to use it
- →When using CommonJS modules in a TypeScript/Node.js project
- →When a GitHub Copilot subscription is not available
- →When the GitHub Copilot CLI is not installed or authenticated
Prerequisites
Limitations
- →TypeScript/Node.js projects must use ESM; CommonJS is not supported
- →The SDK is in Technical Preview status
- →Event handlers must be registered before calling send()
How it compares
This skill provides specific guidance and enforces constraints for using the GitHub Copilot SDK, unlike general programming documentation.
Compared to similar skills
copilot-sdk side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| copilot-sdk (this skill) | 0 | 6mo | No flags | Intermediate |
| langsmith-evaluator | 0 | 4mo | Review | Intermediate |
| mcp-builder | 136 | 3mo | Review | Advanced |
| copilot-sdk | 7 | 4mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
langsmith-evaluator
dhar174
INVOKE THIS SKILL when building evaluation pipelines for LangSmith. Covers three core components: (1) Creating Evaluators - LLM-as-Judge, custom code; (2) Defining Run Functions - how to capture outputs and trajectories from your agent; (3) Running Evaluations - locally with evaluate() or auto-run v
mcp-builder
anthropics
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
copilot-sdk
github
Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.
llm-application-dev
skillcreatorai
Building applications with Large Language Models - prompt engineering, RAG patterns, and LLM integration. Use for AI-powered features, chatbots, or LLM-based automation.
honcho-integration
plastic-labs
Integrate Honcho memory and social cognition into existing Python or TypeScript codebases. Use when adding Honcho SDK, setting up peers, configuring sessions, or implementing the dialectic chat endpoint for AI agents.
genkit-production-expert
jeremylongshore
Build production Firebase Genkit applications including RAG systems, multi-step flows, and tool calling for Node.js/Python/Go. Deploy to Firebase Functions or Cloud Run with AI monitoring. Use when asked to "create genkit flow" or "implement RAG". Trigger with relevant phrases based on skill purpose.