APC 技術ブログ

株式会社エーピーコミュニケーションズの技術ブログです。

株式会社 エーピーコミュニケーションズの技術ブログです。

チームの GitHub Copilot CLI 環境をコマンド 1 つで統一するプラグイン機能の紹介

こんにちは、ACS 事業部の埜下です。

プライベートでは Claude Code を使っているのですが、仕事では GitHub Copilot CLI を使い始めました。 それぞれの CLI で共通した機能もあれば独自の進化をしている部分もあって、両方のアップデートを追いかけるのも大変ながら日々の機能追加にワクワクしています。

今回は、GitHub Copilot CLI で登場したプラグイン機能について紹介していきます。

github.com

プラグインとは

プラグインは GitHub Copilot CLI の機能を拡張するパッケージです。

プラグインを使うことで、以下のようなものを追加できます。

  • カスタムエージェント: 特定のタスクに特化した AI アシスタント
  • スキル: 繰り返し使う手順やワークフローを定義したもの
  • フック: CLI の動作にカスタム処理を差し込む仕組み
  • MCP サーバ設定: Model Context Protocol サーバの設定

プラグインはコミュニティや自社チームが作成・公開して、マーケットプレイスを通じて簡単に見つけてインストールできます。

プラグインを使うメリット

プラグインを使うメリットは大きく 3 つあります。

1. コミュニティの知見をすぐに取り込める

すでに公開されているプラグインを使うことで、自分でゼロから設定を書かなくても便利な機能をすぐに利用できます。 たとえば、セキュリティチェックやデータベース管理、フロントエンド開発支援など、さまざまなプラグインがマーケットプレイスに並んでいます。

2. 環境のセットアップが簡単になる

MCP サーバ設定やカスタムエージェント設定をプラグインとしてパッケージ化しておけば、チームメンバーはコマンド 1 つで同じ環境をセットアップできます。

3. 設定の属人化を防げる

「あの人の環境ではうまく動くのに」という属人化した設定をプラグインとして共有することで、チーム全員が同じ Copilot 環境を使えるようになります。

プラグインのインストール方法

マーケットプレイスを確認する

Copilot CLI にはデフォルトで copilot-pluginsawesome-copilot という 2 つのマーケットプレイスが登録されています。

まず、登録されているマーケットプレイスを確認してみましょう。

$ copilot plugin marketplace list
✨ Included with GitHub Copilot:
  ◆ copilot-plugins (GitHub: github/copilot-plugins)
  ◆ awesome-copilot (GitHub: github/awesome-copilot)

次に、マーケットプレイスに登録されているプラグインを一覧表示します。MARKETPLACE-NAME を確認したいマーケットプレイス名に置き換えてください。

copilot plugin marketplace browse MARKETPLACE-NAME

以下は awesome-copilot のプラグインを一覧表示した例です。

$ copilot plugin marketplace browse awesome-copilot
Plugins in "awesome-copilot":
  • awesome-copilot - Meta prompts that help you discover and generate curated GitHub Copilot agents, instructions, prompts, and skills.
  • azure-cloud-development - Comprehensive Azure cloud development tools including Infrastructure as Code, serverless functions, architecture patterns, and cost optimization for building scalable cloud applications.
  • cast-imaging - A comprehensive collection of specialized agents for software analysis, impact assessment, structural quality advisories, and architectural review using CAST Imaging.
  • clojure-interactive-programming - Tools for REPL-first Clojure workflows featuring Clojure instructions, the interactive programming chat mode and supporting guidance.
  • context-engineering - Tools and techniques for maximizing GitHub Copilot effectiveness through better context management. Includes guidelines for structuring code, an agent for planning multi-file changes, and prompts for context-aware development.
  • copilot-sdk - Build applications with the GitHub Copilot SDK across multiple programming languages. Includes comprehensive instructions for C#, Go, Node.js/TypeScript, and Python to help you create AI-powered applications.
  • csharp-dotnet-development - Essential prompts, instructions, and chat modes for C# and .NET development including testing, documentation, and best practices.
  • csharp-mcp-development - Complete toolkit for building Model Context Protocol (MCP) servers in C# using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
  • database-data-management - Database administration, SQL optimization, and data management tools for PostgreSQL, SQL Server, and general database development best practices.
  • dataverse-sdk-for-python - Comprehensive collection for building production-ready Python integrations with Microsoft Dataverse. Includes official documentation, best practices, advanced features, file operations, and code generation prompts.
  • devops-oncall - A focused set of prompts, instructions, and a chat mode to help triage incidents and respond quickly with DevOps tools and Azure resources.
  • edge-ai-tasks - Task Researcher and Task Planner for intermediate to expert users and large codebases - Brought to you by microsoft/edge-ai
  • frontend-web-dev - Essential prompts, instructions, and chat modes for modern frontend web development including React, Angular, Vue, TypeScript, and CSS frameworks.
  • gem-team - A modular multi-agent team for complex project execution with DAG-based planning, parallel execution, TDD verification, and automated testing.
  • go-mcp-development - Complete toolkit for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
  • java-development - Comprehensive collection of prompts and instructions for Java development including Spring Boot, Quarkus, testing, documentation, and best practices.
  • java-mcp-development - Complete toolkit for building Model Context Protocol servers in Java using the official MCP Java SDK with reactive streams and Spring Boot integration.
  • kotlin-mcp-development - Complete toolkit for building Model Context Protocol (MCP) servers in Kotlin using the official io.modelcontextprotocol:kotlin-sdk library. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
  • mcp-m365-copilot - Comprehensive collection for building declarative agents with Model Context Protocol integration for Microsoft 365 Copilot
  • openapi-to-application-csharp-dotnet - Generate production-ready .NET applications from OpenAPI specifications. Includes ASP.NET Core project scaffolding, controller generation, entity framework integration, and C# best practices.
  • openapi-to-application-go - Generate production-ready Go applications from OpenAPI specifications. Includes project scaffolding, handler generation, middleware setup, and Go best practices for REST APIs.
  • openapi-to-application-java-spring-boot - Generate production-ready Spring Boot applications from OpenAPI specifications. Includes project scaffolding, REST controller generation, service layer organization, and Spring Boot best practices.
  • openapi-to-application-nodejs-nestjs - Generate production-ready NestJS applications from OpenAPI specifications. Includes project scaffolding, controller and service generation, TypeScript best practices, and enterprise patterns.
  • openapi-to-application-python-fastapi - Generate production-ready FastAPI applications from OpenAPI specifications. Includes project scaffolding, route generation, dependency injection, and Python best practices for async APIs.
  • ospo-sponsorship - Tools and resources for Open Source Program Offices (OSPOs) to identify, evaluate, and manage sponsorship of open source dependencies through GitHub Sponsors, Open Collective, and other funding platforms.
  • partners - Custom agents that have been created by GitHub partners
  • pcf-development - Complete toolkit for developing custom code components using Power Apps Component Framework for model-driven and canvas apps
  • php-mcp-development - Comprehensive resources for building Model Context Protocol servers using the official PHP SDK with attribute-based discovery, including best practices, project generation, and expert assistance
  • polyglot-test-agent - Multi-agent pipeline for generating comprehensive unit tests across any programming language. Orchestrates research, planning, and implementation phases using specialized agents to produce tests that compile, pass, and follow project conventions.
  • power-apps-code-apps - Complete toolkit for Power Apps Code Apps development including project scaffolding, development standards, and expert guidance for building code-first applications with Power Platform integration.
  • power-bi-development - Comprehensive Power BI development resources including data modeling, DAX optimization, performance tuning, visualization design, security best practices, and DevOps/ALM guidance for building enterprise-grade Power BI solutions.
  • power-platform-mcp-connector-development - Complete toolkit for developing Power Platform custom connectors with Model Context Protocol integration for Microsoft Copilot Studio
  • project-planning - Tools and guidance for software project planning, feature breakdown, epic management, implementation planning, and task organization for development teams.
  • python-mcp-development - Complete toolkit for building Model Context Protocol (MCP) servers in Python using the official SDK with FastMCP. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
  • ruby-mcp-development - Complete toolkit for building Model Context Protocol servers in Ruby using the official MCP Ruby SDK gem with Rails integration support.
  • rug-agentic-workflow - Three-agent workflow for orchestrated software delivery with an orchestrator plus implementation and QA subagents.
  • rust-mcp-development - Build high-performance Model Context Protocol servers in Rust using the official rmcp SDK with async/await, procedural macros, and type-safe implementations.
  • security-best-practices - Security frameworks, accessibility guidelines, performance optimization, and code quality best practices for building secure, maintainable, and high-performance applications.
  • software-engineering-team - 7 specialized agents covering the full software development lifecycle from UX design and architecture to security and DevOps.
  • structured-autonomy - Premium planning, thrifty implementation
  • swift-mcp-development - Comprehensive collection for building Model Context Protocol servers in Swift using the official MCP Swift SDK with modern concurrency features.
  • technical-spike - Tools for creation, management and research of technical spikes to reduce unknowns and assumptions before proceeding to specification and implementation of solutions.
  • testing-automation - Comprehensive collection for writing tests, test automation, and test-driven development including unit tests, integration tests, and end-to-end testing strategies.
  • typescript-mcp-development - Complete toolkit for building Model Context Protocol (MCP) servers in TypeScript/Node.js using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance.
  • typespec-m365-copilot - Comprehensive collection of prompts, instructions, and resources for building declarative agents and API plugins using TypeSpec for Microsoft 365 Copilot extensibility.

Install with: copilot plugin install <plugin-name>@awesome-copilot

既にたくさんのプラグインが公開されていますね。 これらのプラグインは既存のカスタムエージェントやスキルへのリンクになっています。 awesome-copilot で公開された知見がプラグイン経由で簡単に使えるようになっているんですね。

対話モードを使っている場合はスラッシュコマンドでも同様の操作ができます。

/plugin marketplace list
/plugin marketplace browse MARKETPLACE-NAME

copilot-plugins のプラグインを見てみましょう。

❯ /plugin marketplace browse copilot-plugins

● Plugins in "copilot-plugins":
    • workiq
      WorkIQ plugin for GitHub Copilot.
    • spark
      Spark plugin for GitHub Copilot.

  To install a plugin: /plugin install workiq@copilot-plugins

こちらのマーケットプレイスで公開されているプラグインはまだ少ないようですね。

マーケットプレイスからインストールする

使いたいプラグインが見つかったら、以下のコマンドでインストールします。

copilot plugin install PLUGIN-NAME@MARKETPLACE-NAME

# 対話モード
/plugin install PLUGIN-NAME@MARKETPLACE-NAME

たとえば、awesome-copilot マーケットプレイスから awesome-copilot プラグインをインストールする場合はこうなります。

❯ /plugin install awesome-copilot@awesome-copilot

● Plugin "awesome-copilot" installed successfully.

GitHub リポジトリから直接インストールする

マーケットプレイスを経由せずに GitHub リポジトリから直接インストールすることもできます。

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

# 対話モード
/plugin install OWNER/REPO:PATH/TO/PLUGIN

例として、github/awesome-copilot リポジトリの plugins/security-best-practices をインストールする場合は以下です。

❯ /plugin install github/awesome-copilot:plugins/security-best-practices

● Plugin "security-best-practices" installed successfully.

ローカルパスからインストールする

自分で作成したプラグインや、手元にあるプラグインをローカルパスから直接インストールすることもできます。

copilot plugin install ./PATH/TO/PLUGIN

# 対話モード
/plugin install ./PATH/TO/PLUGIN

インストール済みプラグインを管理する

インストール済みのプラグインは以下のコマンドで管理できます。

copilot plugin list                     # インストール済みプラグインの一覧表示
copilot plugin update PLUGIN-NAME       # プラグインを最新バージョンに更新
copilot plugin uninstall PLUGIN-NAME    # プラグインをアンインストール

現在 2 つのプラグインをインストールしています。 コマンド上はマーケットプレイス経由かどうかは PLUGIN-NAME@MARKETPLACE-NAME という表記で判別できます。

❯ /plugin list

● Installed Plugins:

    • awesome-copilot@awesome-copilot v1.0.0
    • security-best-practices v1.0.0

プラグインのインストール先は以下のディレクトリです。

インストール方法 保存先
マーケットプレイス経由 ~/.copilot/installed-plugins/MARKETPLACE/PLUGIN-NAME/
直接インストール ~/.copilot/installed-plugins/_direct/PLUGIN-NAME/

プラグインを作るメリット

プラグインはマーケットプレイスなどからインストールするだけでなく作るメリットもあります。

1. チーム専用の Copilot 環境を標準化できる

自社・自チームのワークフローに合わせたプラグインを作ることで、「うちのチームでよく使う Copilot の設定」を 1 つのパッケージにまとめられます。 新メンバーのオンボーディングも copilot plugin install 1 コマンドで済みます。

2. ナレッジをコードとして管理できる

スキルやエージェントの定義はマークダウンファイルとして管理できるので、Git でバージョン管理したり、PR レビューで品質を担保したりできます。

3. 社内・コミュニティへの貢献になる

マーケットプレイスに公開すれば、社内外の人が簡単にプラグインを見つけてインストールできるようになります。

プラグインの作り方

それではプラグインを作ってみましょう。 今回は Copilot くんに作ってもらった旅行を計画をサポートしてくれるカスタムエージェントやスキルが入ったプラグインを作ります。

github.com

ディレクトリ構成

プラグインは特定の構造を持ったディレクトリです。 最低限、ルートに plugin.json ファイルがあれば OK です。

travel-planner/
├── plugin.json                    # 必須のマニフェストファイル
├── agents/                        # カスタムエージェント (任意)
│   └── trip-advisor.agent.md
├── skills/                        # スキル (任意)
│   ├── packing-list/
│   │   └── SKILL.md
│   └── itinerary/
│       └── SKILL.md
└── README.md

plugin.json の作成

プラグインのルートに plugin.json を作成します。

{
  "name": "travel-planner",
  "description": "旅行・おでかけの計画を立てるためのプラグインサンプル",
  "version": "1.0.0",
  "author": {
    "name": "apc-nonoshita",
    "email": "t_nonoshita@ap-com.co.jp"
  },
  "license": "MIT",
  "keywords": ["travel", "trip", "planning", "sample"],
  "agents": "agents/",
  "skills": ["skills/"]
}

コンポーネントの追加

agents/ ディレクトリに NAME.agent.md ファイルを作成してカスタムエージェントを追加します。

---
name: trip-advisor
description: 行き先・日程・予算をヒアリングして、旅行プランを提案するエージェントです。
tools: ["bash", "itinerary", "packing-list"]
---

あなたは旅行プランナーのアシスタントです。
行き先・日程・人数・予算・旅のスタイルをヒアリングして、
観光スポット・グルメ・宿泊先・費用概算を含む旅行プランを提案してください。

skills/NAME/ ディレクトリを作成し、その中に SKILL.md を置いてスキルを追加します。 たとえば "packing-list" スキルを作る場合は skills/packing-list/SKILL.md を作成します。

---
name: packing-list
description: 旅行先・期間・季節を元に、忘れ物なしの持ち物リストを生成します。
---

旅行先・旅行期間・季節・旅のスタイルをユーザーに確認し、
カテゴリ別(必需品・衣類・洗面用品・ガジェット)の持ち物チェックリストを生成してください。

ローカルでテストする

開発中はローカルパスからインストールしてテストできます。

# ローカルプラグインをインストール
❯ /plugin install ./travel-planner

● Plugin "travel-planner" installed successfully.

  Installed 2 skills. Use /skills list to see them.

# インストール確認
❯ /plugin list

● Installed Plugins:

    • awesome-copilot@awesome-copilot v1.0.0
    • security-best-practices v1.0.0
    • travel-planner v1.0.0
 

エージェントとスキルが正しくロードされているか確認します。

❯ /agent
Custom Agents

 Select Agent:
 ❯ 1. Default (current)
   2. trip-advisor · plugin

 Manage Agents:
   3. Create new agent...
   4. Learn more about custom agents

 ↑↓ to navigate · Enter to select · Esc to cancel

❯ /skills list

  Available Skills

  Personal (Copilot):
    (個人分は省略)
  Plugin:
    • itinerary
      行き先と日数を指定するだけで、観光スポット・グルメ・移動手段を含むタイムテーブル形式の旅
  程表を生成します。
    • packing-list
      旅行先・期間・季節・旅のスタイルを元に、忘れ物なしの持ち物リストを生成します。

  Found 12 skills. Use /skills info <name> to view details.
 

重要: プラグインをインストールするとコンポーネントがキャッシュされます。ローカルで変更を加えた場合は、再度インストールして変更を反映させる必要があります。

copilot plugin install ./travel-planner

テストが終わったら、ローカルのプラグインをアンインストールします。 アンインストールはプラグイン名(plugin.jsonname フィールド)で指定します。

❯ /plugin uninstall travel-planner

プラグインマーケットプレイスの作り方

自分で作ったプラグインを他のユーザーに配布するにはマーケットプレイスを作るのが便利です。

1. marketplace.json を作成する

マーケットプレイスのメタデータとプラグイン一覧を定義する marketplace.json ファイルを作成します。

{
  "name": "plugin-sample",
  "owner": {
    "name": "apc-nonoshita",
    "email": "t_nonoshita@ap-com.co.jp"
  },
  "metadata": {
    "description": "Sample plugin marketplace for GitHub Copilot CLI",
    "version": "1.0.0"
  },
  "plugins": [
    {
      "name": "travel-planner",
      "description": "旅行・おでかけの計画を立てるためのプラグインサンプル",
      "version": "1.0.0",
      "source": "plugins/travel-planner"
    }
  ]
}

2. リポジトリの .github/plugin/ に配置する

marketplace.json は GitHub リポジトリの .github/plugin/ ディレクトリに置きます。

apc-nonoshita/github-copilot-cli-plugin-sample/
├── .github/
│   └── plugin/
│       └── marketplace.json   ← ここ
└── plugins/
    └── travel-planner/
        └── plugin.json

3. ユーザーにマーケットプレイスを追加してもらう

リポジトリをホストしたら、以下のコマンドでマーケットプレイスを追加してもらいます。

❯ /plugin marketplace add apc-nonoshita/github-copilot-cli-plugin-sample

● Marketplace "plugin-sample" added successfully.

  Use /plugin marketplace browse plugin-sample to see available plugins.
 

追加後はいつものように browse でプラグインを確認し、インストールできます。

❯ /plugin marketplace browse plugin-sample

● Plugins in "plugin-sample":
    • travel-planner
      旅行・おでかけの計画を立てるためのプラグインサンプル

  To install a plugin: /plugin install travel-planner@plugin-sample

❯ /plugin install travel-planner@plugin-sample

● Plugin "travel-planner" installed successfully.

  Installed 2 skills. Use /skills list to see them.
 

まとめ

今回は GitHub Copilot CLI のプラグイン機能について紹介しました。

やりたいこと コマンド
マーケットプレイスを確認 copilot plugin marketplace list
プラグインを一覧表示 copilot plugin marketplace browse MARKETPLACE-NAME
マーケットプレイスからインストール copilot plugin install PLUGIN-NAME@MARKETPLACE-NAME
GitHub から直接インストール copilot plugin install OWNER/REPO:PATH/TO/PLUGIN
ローカルからインストール copilot plugin install ./PATH/TO/PLUGIN
インストール済みを確認 copilot plugin list
プラグインを更新 copilot plugin update PLUGIN-NAME
プラグインを削除 copilot plugin uninstall PLUGIN-NAME
マーケットプレイスを追加 copilot plugin marketplace add OWNER/REPO

プラグインを使えばコミュニティの知見をすぐに取り込めますし、プラグインを作ればチームの Copilot 環境を標準化できます。

一方で、GitHub Organization でカスタムエージェントを共有する仕組みも登場しています。 どちらの共有方法が組織に合っているかを検討が必要かもしれませんね。

techblog.ap-com.co.jp

ぜひ自分たちのワークフローに合った方法でカスタムエージェントやスキルを共有してみてください!

参考リンク