Borrowing it
Nothing to install: this file belongs to macromania/agentop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/macromania/agentop/main/.github/skills/copilot-sdk/SKILL.mdgit clone --depth 1 https://github.com/macromania/agentopWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/macromania/agentop/copilot-sdk)<a href="https://agentmods.dev/skills/macromania/agentop/copilot-sdk"><img src="https://agentmods.dev/badge/skills/macromania/agentop/copilot-sdk/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/macromania/agentop/copilot-sdk"><img src="https://agentmods.dev/badge/skills/macromania/agentop/copilot-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00064 | $0.04261 |
| Opus 5.5 | $0.00026 | $0.01704 |
| Sonnet 5.5 | $0.00013 | $0.00852 |
| Haiku 4.5 | $0.00006 | $0.00426 |
Grade A, and why
copilot-sdk scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
import { exec } from 'child_process'; How it starts
The opening of the file, as written. The whole thing — 730 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GitHub Copilot SDK Integration
Integrate @github/copilot-sdk for AI-powered agent sessions with streaming responses and tool calling.
When to Use This Skill
- Setting up Copilot SDK in Electron main process
- Implementing streaming chat completions
- Defining tools for agent function calling
- Managing conversation context
- Handling tool execution results
- Building decision points with user approval
SDK Setup
Installation and Authentication
// src/main/copilot/client.ts
import { CopilotClient } from '@github/copilot-sdk';
let client: CopilotClient | null = null;
export async function initializeCopilotClient(): Promise<CopilotClient> {
if (client) return client;
// The SDK handles GitHub authentication automatically
// User must be authenticated with GitHub Copilot
client = new CopilotClient({
// Optional: Custom endpoint for GitHub Enterprise
// baseUrl: 'https://api.github.com',
});
return client;
}
export function getCopilotClient(): CopilotClient {
if (!client) {
throw new Error('Copilot client not initialized. Call initializeCopilotClient first.');
}
return client;
}
Tool Definitions
// src/main/copilot/tools.ts
import type { Tool, ToolResult } from '@github/copilot-sdk';
// Define tools the agent can use
export const agentTools: Tool[] = [
{
name: 'create_file',
description: 'Create a new file with the specified content',
parameters: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'The file path relative to the project root',
},
content: {
type: 'string',
description: 'The content to write to the file',
},
},
required: ['path', 'content'],
},
},
{
name: 'edit_file',
description: 'Edit an existing file by replacing content',
parameters: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'The file path relative to the project root',
},
search: {
type: 'string',
description: 'The exact text to find and replace',
},
replace: {
type: 'string',
description: 'The replacement text',
},
},
required: ['path', 'search', 'replace'],
},
},
{
name: 'run_command',
description: 'Execute a shell command in the project directory',
parameters: {
type: 'object',
properties: {
command: {
type: 'string',
description: 'The shell command to execute',
},
cwd: {
type: 'string',
description: 'Working directory (optional)',
},
},
required: ['command'],
},
},
{
name: 'read_file',
description: 'Read the contents of a file',
parameters: {
type: 'object',
properties: {
path: {
type: 'string',
description: 'The file path to read',
},
},
required: ['path'],
},
},
{
name: 'request_approval',
description: 'Request user approval before proceeding with a sensitive action',
parameters: {
type: 'object',
properties: {
action: {
type: 'string',
description: 'Description of the action requiring approval',
},
details: {
type: 'string',
description: 'Detailed explanation of what will happen',
},
risk_level: {
type: 'string',
enum: ['low', 'medium', 'high'],
description: 'Risk level of the action',
},
},
required: ['action', 'details'],
},
},
];
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 730 lines · 64 tokens per session scan A 4c5370ce7914
copilot-sdk is a skill published in the GitHub repository macromania/agentop (11 stars, last pushed 7mo ago), licensed MIT. It adds 64 tokens to every session and 4,261 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
copilot-sdk compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| copilot-sdkmacromania/agentop | Skill | 11 | 7mo ago | MIT | A | 64 | Claude Code, Codex |
| eval-dataset-designbojieli/ai-agent-book | Skill | 57k | 29d ago | Apache-2.0 | A | 138 | Claude Code, Codex |
| aatmf-t10-confidentiality-breachPurpleAILAB/Decepticon | Skill | 6.5k | 8d ago | Apache-2.0 | A | 39 | Claude Code, Codex |
| mochi-remindkirodotdev/KiroCrew | Skill | 4.8k | yesterday | Apache-2.0 | A | 20 | Claude Code, Codex |
| ensembl-databasesynthetic-sciences/openscience | Skill | 4.3k | 2d ago | Apache-2.0 | A | 45 | Claude Code, Codex |
| ai-musicZJU-REAL/Easel | Skill | 4.5k | 4d ago | Apache-2.0 | A | 161 | Claude Code, Codex |
| skill-news-intelligenceZJU-REAL/Easel | Skill | 4.5k | 4d ago | Apache-2.0 | A | 104 | Claude Code, Codex |