Copilot Cli Plugin Builder: Install, Source and Security

Copilot Cli Plugin Builder

Published by arisng in github-copilot-fc

No known issues3 installs

What this skill does

Author, scaffold, test, and distribute GitHub Copilot CLI plugins. Use when the user wants to: (1) create a new Copilot CLI plugin, (2) add skills, agents, hooks, or MCP servers to a plugin, (3) write a plugin.json manifest, (4) use the Copilot SDK to build programmable plugins, (5) publish a plugin to a marketplace, (6) scaffold plugin boilerplate, (7) migrate from legacy Copilot Extensions, or (8) bump or update a plugin's version. Covers the Agent Plugins 1.0 format (agent-plugins.org) and th

Add Copilot Cli Plugin Builder to your agent

Review the source and files first. When you are ready, copy the prompt instruction or use the CLI command supported by your environment.

Install with a prompt

Paste this into a compatible coding agent:

add this skill "copilot-cli-plugin-builder" from https://github.com/arisng/github-copilot-fc

Install with the CLI

Run this command in a controlled environment after reviewing the repository:

npx skills add https://github.com/arisng/github-copilot-fc --skill copilot-cli-plugin-builder

Skill instructions

Copilot CLI Plugin Builder

Author GitHub Copilot CLI plugins — packages of skills, agents, hooks, and MCP servers distributed via marketplaces.

Plugin Architecture

Plugins are file-based (markdown + JSON). No compilation required. Two formats exist:

FormatSchemaUse
Agent Plugins 1.0https://agent-plugins.org/schemas/1.0.0/plugin.schema.jsonRecommended — portable across Copilot CLI, Cursor, VS Code
LegacyNo $schemaStill supported but not recommended for new plugins

Always use Agent Plugins 1.0 unless the user has a specific reason for legacy format.

Directory Layout (Agent Plugins 1.0)

my-plugin/
├── plugin.json                    # Required manifest
├── skills/                        # Portable skills
│   └── skill-name/
│       └── SKILL.md               # Skill definition
├── mcp.json                       # MCP server configs
└── com.github.copilot/            # Copilot-specific components
    ├── agents/
    │   └── my-agent.agent.md
    ├── commands/
    ├── rules/
    ├── hooks/
    │   └── hooks.json
    └── lsp.json

Minimal plugin: just plugin.json + one component (skill, agent, hook, or MCP server).

Workflow

Phase 1: Gather Requirements

Ask the user these questions (one at a time, skip if already specified):

  1. What should the plugin do? — Get a clear purpose statement
  2. Which components? — Skills, agents, hooks, MCP servers, or a combination?
  3. Plugin name? — 1–64 chars, lowercase ASCII, digits, hyphens, periods

If unsure about components, suggest the simplest approach: a single skill.

Phase 2: Scaffold the Plugin

Create the directory structure with plugin.json:

{
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
  "name": "my-plugin",
  "version": "1.0.0",
  "description": "What this plugin does",
  "author": { "name": "Your Name" },
  "license": "MIT",
  "keywords": ["relevant", "tags"]
}

Then create each component. See the Component Guides below.

Phase 3: Author Components

Skills

Skills inject context/instructions into the agent via SKILL.md:

---
name: my-skill
description: When and why to use this skill
---

# Instructions

Be concise. Use imperative form. Include only what Claude doesn't already know.

Skills follow the same conventions as workspace skills (scripts/, references/, assets/ subdirectories). For skill authoring best practices, follow the skill-creator patterns.

Custom Agents

Agents are scoped sub-agents with isolated tools and prompts. Define as .agent.md files in com.github.copilot/agents/:

---
name: my-agent
displayName: My Agent
description: What this agent does (used by runtime for intent matching)
tools:
  - grep
  - glob
  - view
---

You are a specialized agent. Your role is to...

Or programmatically via the SDK — see references/sdk-examples.md.

Hooks

Hooks fire at lifecycle points. Create com.github.copilot/hooks/hooks.json:

{
  "version": 1,
  "hooks": {
    "sessionStart": [
      { "type": "command", "command": "./scripts/init.sh", "timeout": 10 }
    ],
    "preToolUse": [
      { "type": "command", "command": "./scripts/validate.sh", "timeout": 5 }
    ]
  }
}

Available hooks: sessionStart, sessionEnd, userPromptSubmitted, preToolUse, postToolUse, postToolUseFailure, errorOccurred, subagentStart, subagentStop. For full details, see references/hook-lifecycle.md.

MCP Servers

External tool providers. Create mcp.json at plugin root:

{
  "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
  "mcpServers": {
    "my-server": {
      "type": "stdio",
      "command": "node",
      "args": ["${PLUGIN_ROOT}/server/index.js"],
      "env": { "DATA_DIR": "${PLUGIN_DATA}" }
    }
  }
}

Transports: stdio, streamable-http, sse (deprecated). Variables: ${PLUGIN_ROOT}, ${PLUGIN_DATA}.

Phase 4: Install and Test

# Install locally
copilot plugin install ./my-plugin

# Verify
copilot plugin list

# Test in interactive session
copilot
# Then: /skills list, /agent, /plugin list

Plugins are cached — re-run copilot plugin install ./my-plugin after edits.

Phase 5: Distribute

Local development:

copilot plugin install ./my-plugin

From GitHub repo:

copilot plugin install OWNER/REPO
copilot plugin install OWNER/REPO:PATH/TO/PLUGIN

Via marketplace: See references/marketplace-guide.md for creating and distributing through marketplaces.

Version Bump

When bumping a plugin's version, always update both files atomically:

  1. plugin.json → version (source of truth)
  2. marketplace.json → plugins[name=X].version (must mirror plugin.json)

These MUST match. Drift causes users to miss updates or install unexpected versions. See references/marketplace-guide.md → "Bump Procedure" for the full checklist including verification and commit steps.

SDK Usage

The @github/copilot-sdk provides programmatic control via JSON-RPC. Supports 6 languages: TypeScript, Python, Go, .NET, Rust, Java.

Quick start (TypeScript):

import { CopilotClient, approveAll } from "@github/copilot-sdk";

const client = new CopilotClient();
await client.start();
const session = await client.createSession({
    model: "auto",
    onPermissionRequest: approveAll,
});
const response = await session.sendAndWait({ prompt: "Hello" });
console.log(response?.data.content);
await client.stop();

For SDK examples in all languages, custom tools, streaming, and MCP configuration, see references/sdk-examples.md.

Component Reference

ComponentFormatLocation (Agent Plugins 1.0)Purpose
SkillSKILL.mdskills/<name>/SKILL.mdInject context/instructions
Agent.agent.mdcom.github.copilot/agents/*.agent.mdScoped sub-agents
Hookhooks.jsoncom.github.copilot/hooks/hooks.jsonLifecycle callbacks
MCP Servermcp.jsonmcp.jsonExternal tool providers

Key Concepts

  • Agent Plugins 1.0 is the portable, cross-client standard from agent-plugins.org
  • Legacy Copilot Extensions (GitHub App–based) were sunset November 10, 2025 — do not reference them
  • The old gh copilot extension was deprecated October 25, 2025 — replaced by standalone copilot CLI
  • Plugins are file-based — no compilation or build step required
  • The SDK manages CLI process lifecycle automatically

References

  • references/plugin-manifest.md — Full manifest schema, fields, and validation
  • references/sdk-examples.md — SDK usage in all 6 languages with custom tools, streaming, MCP
  • references/hook-lifecycle.md — All 9 hook types with input/output signatures
  • references/marketplace-guide.md — Creating and distributing through marketplaces

Files included

  • references/hook-lifecycle.md
  • references/marketplace-guide.md
  • references/plugin-manifest.md
  • references/sdk-examples.md
  • scripts/verify-version-sync.py
  • SKILL.md

More skills