Claude Code用に作成し公開したPluginをCodexでもインストールできるように公開する

Claude Code用に作成し公開したPluginをCodexでもインストールできるように公開する

Claude CodeのプラグインをCodexに対応させるための設定変更について、実装例を交えて詳しく解説します。
2026.08.26

こんばんは、情報システム室の夏目です。

もともとClaude Codeを使っていたのですが、Codexも少し併用し始めました。

Claude Code用にPluginを作って使っていたのですが、Codexでも欲しくなりました。

なのでCodexでも使えるように公開しようと思います。

対応させるPlugin

https://github.com/sinofseven/luciferous-plugins-for-claude-code

Claude Codeに対する指示出しのために作成したプラグインとそれを配布するためのマーケットプレイスです。

二つのプラグインを配布しています。
kanban-kitreport-kit の二つで、どちらもマークダウンファイルでの指示出しとAIの実行ログを残すための機構です。
kanban-kit はコーディングのためのもので、 report-kit はローカルに置いたドキュメントを調査するためのものです。

こちらのリポジトリの構造はこんな感じになっています。

./
├── .claude-plugin/
│   └── marketplace.json
└── plugins/
    ├── kanban-kit/
    │   ├── .claude-plugin/
    │   │   └── plugin.json
    │   ├── hooks/
    │   │   ├── check-kanban.sh*
    │   │   └── hooks.json
    │   ├── README.md
    │   └── skills/
    │       ├── add-kanban/
    │       │   └── SKILL.md
    │       └── kanban/
    │           ├── references/
    │           │   └── kanban-workflow.md
    │           └── SKILL.md
    └── report-kit/
        ├── .claude-plugin/
        │   └── plugin.json
        ├── hooks/
        │   ├── check-report.sh
        │   └── hooks.json
        ├── README.md
        └── skills/
            ├── add-report/
            │   └── SKILL.md
            └── report/
                ├── references/
                │   └── report-workflow.md
                └── SKILL.md

Codexに対応させる

このマーケットプレイスとプラグインをCodexで利用できるようにしていきます。
マーケットプレイス用の marketplace.json と プラグイン用の plugin.json のスキーマはGithub上の plugin-json-spec.md に詳しくありました。

https://github.com/openai/codex/blob/main/codex-rs/skills/src/assets/samples/plugin-creator/references/plugin-json-spec.md

marketplace.json

Codexでプラグインを配布するためのマーケットプレイスの設定をします。
Codexでは $REPOSITORY_ROOT/.agents/plugins/marketplace.json に配置します。

Claude Codeの marketplace.json を参考に作成していきます。

.claude-plugin/marketplace.json
{
  "name": "luciferous-ca-plugins",
  "owner": {
    "name": "sinofseven"
  },
  "metadata": {
    "version": "0.1.0"
  },
  "plugins": [
    {
      "name": "kanban-kit",
      "source": "./plugins/kanban-kit",
      "description": "Kanban ワークフロー一式(タスク追加・実行スキル、未完了リマインド hook)を提供するプラグイン",
      "category": "development",
      "keywords": ["kanban", "task-management", "workflow"]
    },
    {
      "name": "report-kit",
      "source": "./plugins/report-kit",
      "description": "ローカルドキュメント調査用の report ワークフロー(タスク追加・実行スキル、未完了リマインド hook)を提供するプラグイン",
      "category": "productivity",
      "keywords": ["report", "research", "documentation", "workflow"]
    }
  ]
}
.agents/plugins/marketplace.json
{
  "name": "luciferous-ca-plugins",
  "plugins": [
    {
      "name": "kanban-kit",
      "source": {
        "source": "local",
        "path": "./plugins/kanban-kit"
      },
      "policy": {
        "installation": "AVAILABLE",
        "authentication": "ON_INSTALL"
      },
      "category": "Developer Tool"
    },
    {
      "name": "report-kit",
      "source": {
        "source": "local",
        "path": "./plugins/report-kit"
      },
      "policy": {
        "installation": "AVAILABLE",
        "authentication": "ON_INSTALL"
      },
      "category": "Producivity"
    }
  ]
}

Codexでは marketplace.json の内容は非常にシンプルでした。

plugins 配下のオブジェクトはClaude Codeとは違っていました。

特に重要そうなのは以下の項目です。

  • source.source
    • プラグインの実態がどこに置かれているかを指定するということ
    • 同一リポジトリにプラグインがあるので local を指定する
    • ここではGithubリポジトリのサブディレクトリに置いているので git-subdir を使用する
    • 他にも git-subdir, url, npm を指定することができる
  • policy.installation
    • プラグインをどうインストールさせるかを定義する
    • 使用できる値は3つのみ
      • AVAILABLE: ユーザーが任意でインストールできる
      • INSTALLED_BY_DEFAULT: マーケットプレイスを利用するユーザーにデフォルトでインストールする (特定条件下では自動インストールされないという Issue がGithubにある)
      • NOT_AVAILABLE: インストール不可
    • ここでは AVAILABLE としてユーザーがインストールするか選択できるようにする
  • policy.authentication
    • プラグインでは認証が必要なとき、いつ認証を要求するかを指定する
    • 使用できる値は2つのみ
      • ON_INSTALL: プラグインインストール時に認証する
      • ON_USE: プラグインを使用するときに認証する
    • OAuth等の認証が必要ない場合でも値を指定する必要がある

plugin.json

Codexで使用するプラグインの設定を作成します。
marketplace.json で指定したサブディレクトリから見て .codex-plugin/plugin.json に起きます。
今回は kanban-kit.codex-plugin/plugin.json をClaude Code版を参考に書いていきます。

plugins/kanban-kit/.claude-plugin/plugin.json
{
  "name": "kanban-kit",
  "version": "0.1.3",
  "description": "Kanban ワークフロー一式(タスク追加・実行スキル、未完了リマインド hook)を提供するプラグイン",
  "author": {
    "name": "sinofseven"
  },
  "homepage": "https://github.com/sinofseven/luciferous-plugins-for-claude-code",
  "repository": "https://github.com/sinofseven/luciferous-plugins-for-claude-code",
  "license": "MIT",
  "keywords": ["kanban", "task-management", "workflow"]
}
plugins/kanban-kit/.codex-plugin/plugin.json
{
  "name": "kanban-kit",
  "version": "0.1.3",
  "description": "Kanban ワークフロー一式(タスク追加・実行スキル、未完了リマインド hook)を提供するプラグイン",
  "author": {
    "name": "sinofseven"
  },
  "homepage": "https://github.com/sinofseven/luciferous-ca-plugins",
  "repository": "https://github.com/sinofseven/luciferous-ca-plugins",
  "license": "MIT",
  "keywords": [
    "kanban",
    "task-management",
    "workflow"
  ],
  "skills": "./skills/",
  "interface": {
    "displayName": "Kanban Kit",
    "shortDescription": "Kanban形式でタスクの追加・計画・実装を管理",
    "longDescription": "プロジェクト内のKanbanタスクを作成し、計画から実装、作業ログ、完了サマリーまで一貫したワークフローで管理します。",
    "developerName": "sinofseven",
    "category": "Developer Tool",
    "websiteURL": "https://github.com/sinofseven/luciferous-plugins-for-claude-code"
  }
}

メタデータとしては増えてはいますが、主な部分では違いは少なそうです。

一部重要そうな部分は "skills": "./skills/" です。
これはスキルを配置するディレクトリを指定する部分です。
Codexでは明示的にスキルを配置するディレクトリを指定する必要があります。

ちなみにフックの場合、 $PLUGIN_ROOT/hooks/hooks.json がある場合は "hooks": "./hooks/hooks.json"plugin.json に書く必要はありません。
Codexが自動的に確認します。

備考: hooks.json

今回は同一のhooks.jsonを使用していますが一部注意が必要です。

ClaudeもCodexもプラグインがインストールされたディレクトリなどを渡す環境変数があります。
しかし、ClaudeとCodexで使用できる値が異なるので表にまとめてみました。

Claude Codex 備考
CLAUDE_PROJECT_DIR o x プロジェクトルート。stdio MCPサーバーとプラグインLSPサーバーの環境にも設定される。
CLAUDE_PLIUGIN_ROOT o o プラグインのインストールディレクトリ。プラグインに同梱されたスクリプト用。プラグイン更新時に変更される。
CLAUDE_PLUGIN_DATA o o プラグインの永続データディレクトリ。プラグイン更新を通じて存続すべき依存関係と状態用
PLUGIN_ROOT x o インストール済みのプラグインのルートディレクトリを指す
PLUGIN_DATA x o プラグインの書き込み可能なデータディレクトリを指す

Codexでは既存のプラグインとの互換性のために、 CLAUDE_PLUGIN_ROOTCLAUDE_PLUGIN_DATA の環境変数をコマンドに渡してくれます。
そのため今回hooks.jsonは同一のものを使用しています。
(そうじゃなかったら、別のファイルに分ける必要がありました)

使ってみる

Codex対応まで行ったPluginは sinofseven/luciferous-ca-plugins にPushしています。

最近31 システムによるバンクロール管理を行うためのWebアプリを書いたので、kanban-kitでレビューさせようと思います。

インストールする

$ codex plugin marketplace add sinofseven/luciferous-ca-plugins
Added marketplace `luciferous-ca-plugins` from https://github.com/sinofseven/luciferous-ca-plugins.git.
Installed marketplace root: /Users/natsume.yuta/.codex/.tmp/marketplaces/luciferous-ca-plugins

$ codex plugin add kanban-kit@luciferous-ca-plugins
Added plugin `kanban-kit` from marketplace `luciferous-ca-plugins`.
Installed plugin root: /Users/natsume.yuta/.codex/plugins/cache/luciferous-ca-plugins/kanban-kit/0.1.4

Codexで使ってみる

$ codex
╭──────────────────────────────────────────────╮
 >_ OpenAI Codex (v0.149.1)                   │

 model:     gpt-5.6-sol   /model to change
 directory: ~/spaces/private/triple-31-system
╰──────────────────────────────────────────────╯

  Tip: Try the Desktop app. Run 'codex app' or visit https://chatgpt.com/codex?app-landing-page=true

 You have 1 usage limit reset available. Run /usage to use one.

 $kanban-kit:add-kanban
  要望: コードをレビューしてほしい
  目的: 自分一人で書いたコードだから、第三者の意見がほしい

 add-kanban スキルを使い、要望と目的からタイトルを補って新しいタスクを起票します。採番以外の既存ファイルは読みません。

 Ran 2 commands · ctrl + t to view transcript

 Added kanban/0001_code_review/0001_code_review.md (+7 -0)
    1 +# コードレビュー
    2 +
    3 +## 目的
    4 +自分一人で書いたコードだから、第三者の意見がほしい
    5 +
    6 +## 要望
    7 +コードをレビューしてほしい

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

 kanban/0001_code_review/0001_code_review.md を作成しました。

  続けて /kanban を実行しますか?

─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

 Ask Codex to do anything

$kanban-kit:add-kanban は動きました。
これでCodex対応できたことは確認できました。

一応、 $kanban-kit:kanban を実行させたログもあるのですが、非常に長い(5分程度)のでgifにしました。
(確認用のものなので無視しても構いません)

tmp

まとめ

以上、Claude Code用のPluginをCodexに対応させた話でした。

何かのお役に立てたら幸いです。

おまけ: hooksで出たエラー

当初Codexで動かすと、hooksでエラーが出ました。

• UserPromptSubmit hook (failed) error: hook returned invalid user prompt submit JSON output

しかし、スクリプトでの出力はJSONを想定していませんでした。

check-kanban.sh
if [ ${#incomplete[@]} -gt 0 ]; then
    echo "[kanban reminder] 未完了タスクがあります: ${incomplete[*]}"
    echo "作業が進んだら kanban/{xxxx}_{title}/log.md へ記録し、完了時は kanban ファイルへ完了サマリーを追記してください。"
fi

では、なぜJSON形式だとCodexが判断したかと言うと、一文字目が [ であったからです。
そのため、下記の様に修正したらCodexでエラーが出なくなりました。

check-kanban.sh
if [ ${#incomplete[@]} -gt 0 ]; then
    echo "kanban reminder: 未完了タスクがあります: ${incomplete[*]}"
    echo "作業が進んだら kanban/{xxxx}_{title}/log.md へ記録し、完了時は kanban ファイルへ完了サマリーを追記してください。"
fi

Claude Codeでは問題なく動いたものでも、Codexに移すと動かないものがないか注意は色々必要そうです。


Claudeならクラスメソッドにお任せください

クラスメソッドは、Anthropic社とリセラー契約を締結しています。各種製品ガイドから、業種別の活用法、フェーズごとのお悩み解決などサービス支援ページにまとめております。まずはご覧いただき、お気軽にご相談ください。

サービス詳細を見る

この記事をシェアする

AI白書

関連記事