jpskill.com
🛠️ 開発・MCP コミュニティ

copilotkit

CopilotKitのエキスパートとして、Reactアプリにチャット機能やAIによるテキスト編集、アプリの状態に応じた提案、UI操作を行う自律エージェントなどのAI機能を組み込み、AIネイティブな体験を実現するSkill。

📜 元の英語説明(参考)

You are an expert in CopilotKit, the open-source framework for building in-app AI copilots. You help developers add AI-powered features to React applications — chat sidebars, AI-assisted text editing, contextual suggestions, and autonomous agents that can read app state, call actions, and modify the UI — turning any React app into an AI-native experience.

🇯🇵 日本人クリエイター向け解説

一言でいうと

CopilotKitのエキスパートとして、Reactアプリにチャット機能やAIによるテキスト編集、アプリの状態に応じた提案、UI操作を行う自律エージェントなどのAI機能を組み込み、AIネイティブな体験を実現するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o copilotkit.zip https://jpskill.com/download/14790.zip && unzip -o copilotkit.zip && rm copilotkit.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14790.zip -OutFile "$d\copilotkit.zip"; Expand-Archive "$d\copilotkit.zip" -DestinationPath $d -Force; ri "$d\copilotkit.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して copilotkit.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → copilotkit フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

CopilotKit — React 用のアプリ内 AI コパイロット

あなたは、アプリ内 AI コパイロットを構築するためのオープンソースフレームワークである CopilotKit の専門家です。React アプリケーションに AI 搭載機能を追加する開発者を支援します。チャットサイドバー、AI 支援テキスト編集、コンテキストに応じた提案、アプリの状態を読み取り、アクションを呼び出し、UI を変更できる自律エージェントなどにより、あらゆる React アプリを AI ネイティブな体験に変えます。

主要な機能

セットアップとチャット

// app/layout.tsx — CopilotKit でアプリをラップする
import { CopilotKit } from "@copilotkit/react-core";
import { CopilotSidebar } from "@copilotkit/react-ui";
import "@copilotkit/react-ui/styles.css";

export default function Layout({ children }: { children: React.ReactNode }) {
  return (
    <CopilotKit runtimeUrl="/api/copilotkit">
      {children}
      <CopilotSidebar
        labels={{ title: "Project Assistant", initial: "How can I help with your project?" }}
      />
    </CopilotKit>
  );
}

// app/api/copilotkit/route.ts — バックエンドエンドポイント
import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";

export async function POST(req: Request) {
  const runtime = new CopilotRuntime();
  const adapter = new OpenAIAdapter({ model: "gpt-4o" });
  return runtime.response(req, adapter);
}

コンテキストとアクションの提供

import { useCopilotReadable, useCopilotAction } from "@copilotkit/react-core";

function ProjectDashboard({ project }: { project: Project }) {
  // アプリの状態を AI が読み取れるようにする
  useCopilotReadable({
    description: "Current project details",
    value: {
      name: project.name,
      tasks: project.tasks.map(t => ({ title: t.title, status: t.status, assignee: t.assignee })),
      dueDate: project.dueDate,
      completionRate: project.tasks.filter(t => t.status === "done").length / project.tasks.length,
    },
  });

  // AI が実行できるアクションを定義する
  useCopilotAction({
    name: "createTask",
    description: "Create a new task in the current project",
    parameters: [
      { name: "title", type: "string", description: "Task title", required: true },
      { name: "assignee", type: "string", description: "Who to assign the task to" },
      { name: "priority", type: "string", enum: ["low", "medium", "high"] },
    ],
    handler: async ({ title, assignee, priority }) => {
      await api.tasks.create({ projectId: project.id, title, assignee, priority });
      revalidate();
      return `Created task: ${title}`;
    },
  });

  useCopilotAction({
    name: "generateReport",
    description: "Generate a project status report",
    parameters: [{ name: "format", type: "string", enum: ["summary", "detailed"] }],
    handler: async ({ format }) => {
      const report = await api.reports.generate({ projectId: project.id, format });
      return report.content;
    },
  });

  return <div>{/* Dashboard UI */}</div>;
}

AI テキスト編集

import { CopilotTextarea } from "@copilotkit/react-textarea";

function DocumentEditor() {
  const [content, setContent] = useState("");

  return (
    <CopilotTextarea
      value={content}
      onValueChange={setContent}
      placeholder="Start writing..."
      autosuggestionsConfig={{
        textareaPurpose: "A project update document for stakeholders",
        chatApiConfigs: { suggestionsApiConfig: { forwardedParams: { model: "gpt-4o-mini" } } },
      }}
      className="w-full h-96 p-4 border rounded-lg"
    />
  );
  // AI は入力時に自動補完し、コンテキストを認識します
}

インストール

npm install @copilotkit/react-core @copilotkit/react-ui @copilotkit/react-textarea @copilotkit/runtime

ベストプラクティス

  1. useCopilotReadable — アプリの状態をコンテキストとして提供します。AI は推測ではなく、実際のデータに基づいて回答します。
  2. useCopilotAction — AI ができることを定義します。タスクの作成、レポートの生成、データの変更など。
  3. CopilotSidebar — ドロップインチャット UI。readables を介して現在のページにコンテキストを提供します。
  4. CopilotTextarea — AI 搭載の記述のために <textarea> を置き換えます。オートコンプリート、書き換え、翻訳など。
  5. AG-UI protocol — CopilotKit は内部で AG-UI を使用します。任意のエージェントフレームワークを接続します。
  6. Multi-page context — ユーザーが移動すると readables が更新されます。AI は常に現在のページコンテキストを持ちます。
  7. Action confirmation — 破壊的なアクションのために renderAndWait を追加します。ユーザーは実行前に確認します。
  8. LangGraph agents — 複雑なマルチステップワークフローのために、LangGraph エージェントを CopilotKit バックエンドとして接続します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

CopilotKit — In-App AI Copilots for React

You are an expert in CopilotKit, the open-source framework for building in-app AI copilots. You help developers add AI-powered features to React applications — chat sidebars, AI-assisted text editing, contextual suggestions, and autonomous agents that can read app state, call actions, and modify the UI — turning any React app into an AI-native experience.

Core Capabilities

Setup and Chat

// app/layout.tsx — Wrap app with CopilotKit
import { CopilotKit } from "@copilotkit/react-core";
import { CopilotSidebar } from "@copilotkit/react-ui";
import "@copilotkit/react-ui/styles.css";

export default function Layout({ children }: { children: React.ReactNode }) {
  return (
    <CopilotKit runtimeUrl="/api/copilotkit">
      {children}
      <CopilotSidebar
        labels={{ title: "Project Assistant", initial: "How can I help with your project?" }}
      />
    </CopilotKit>
  );
}

// app/api/copilotkit/route.ts — Backend endpoint
import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";

export async function POST(req: Request) {
  const runtime = new CopilotRuntime();
  const adapter = new OpenAIAdapter({ model: "gpt-4o" });
  return runtime.response(req, adapter);
}

Provide Context and Actions

import { useCopilotReadable, useCopilotAction } from "@copilotkit/react-core";

function ProjectDashboard({ project }: { project: Project }) {
  // Make app state readable by the AI
  useCopilotReadable({
    description: "Current project details",
    value: {
      name: project.name,
      tasks: project.tasks.map(t => ({ title: t.title, status: t.status, assignee: t.assignee })),
      dueDate: project.dueDate,
      completionRate: project.tasks.filter(t => t.status === "done").length / project.tasks.length,
    },
  });

  // Define actions the AI can take
  useCopilotAction({
    name: "createTask",
    description: "Create a new task in the current project",
    parameters: [
      { name: "title", type: "string", description: "Task title", required: true },
      { name: "assignee", type: "string", description: "Who to assign the task to" },
      { name: "priority", type: "string", enum: ["low", "medium", "high"] },
    ],
    handler: async ({ title, assignee, priority }) => {
      await api.tasks.create({ projectId: project.id, title, assignee, priority });
      revalidate();
      return `Created task: ${title}`;
    },
  });

  useCopilotAction({
    name: "generateReport",
    description: "Generate a project status report",
    parameters: [{ name: "format", type: "string", enum: ["summary", "detailed"] }],
    handler: async ({ format }) => {
      const report = await api.reports.generate({ projectId: project.id, format });
      return report.content;
    },
  });

  return <div>{/* Dashboard UI */}</div>;
}

AI Text Editing

import { CopilotTextarea } from "@copilotkit/react-textarea";

function DocumentEditor() {
  const [content, setContent] = useState("");

  return (
    <CopilotTextarea
      value={content}
      onValueChange={setContent}
      placeholder="Start writing..."
      autosuggestionsConfig={{
        textareaPurpose: "A project update document for stakeholders",
        chatApiConfigs: { suggestionsApiConfig: { forwardedParams: { model: "gpt-4o-mini" } } },
      }}
      className="w-full h-96 p-4 border rounded-lg"
    />
  );
  // AI autocompletes as you type, context-aware
}

Installation

npm install @copilotkit/react-core @copilotkit/react-ui @copilotkit/react-textarea @copilotkit/runtime

Best Practices

  1. useCopilotReadable — Provide app state as context; AI answers based on actual data, not guesses
  2. useCopilotAction — Define what AI can DO; create tasks, generate reports, modify data
  3. CopilotSidebar — Drop-in chat UI; contextual to current page via readables
  4. CopilotTextarea — Replace <textarea> for AI-powered writing; autocomplete, rewrite, translate
  5. AG-UI protocol — CopilotKit uses AG-UI under the hood; connect any agent framework
  6. Multi-page context — Readables update as user navigates; AI always has current page context
  7. Action confirmation — Add renderAndWait for destructive actions; user confirms before execution
  8. LangGraph agents — Connect LangGraph agents as CopilotKit backends for complex multi-step workflows