CO

copilotkit-develop

Development tools for building AI features using the CopilotKit v2 ecosystem.

Install

mkdir -p .claude/skills/copilotkit-develop && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17613" && unzip -o skill.zip -d .claude/skills/copilotkit-develop && rm skill.zip

Installs to .claude/skills/copilotkit-develop

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when building AI-powered features with CopilotKit v2 -- adding chat interfaces, registering frontend tools, sharing application context with agents, handling agent interrupts, and working with the CopilotKit runtime.
220 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Set up CopilotKit runtime on the server
  • Wrap client-side applications with `CopilotKitProvider`
  • Add chat interfaces using `<CopilotChat>`, `<CopilotPopup>`, or `<CopilotSidebar>`
  • Register frontend tools for agent interaction
  • Share application context with agents
  • Handle agent interrupts for human input

How it works

The skill guides the integration of CopilotKit v2, setting up the server-side runtime, wrapping the client application with a provider, adding chat UIs, registering frontend tools, and sharing application context with AI agents.

Inputs & outputs

You give it
A web application and a desire to add AI features
You get back
An AI-powered application with chat interfaces, tools, and context sharing

When to use copilotkit-develop

  • Adding an AI chat interface
  • Registering frontend tools
  • Implementing AI-powered agent features

About this skill

CopilotKit v2 Development Skill

Live Documentation (MCP)

This plugin includes an MCP server (copilotkit-docs) that provides search-docs and search-code tools for querying live CopilotKit documentation and source code.

  • Claude Code: Auto-configured by the plugin's .mcp.json -- no setup needed.
  • Codex: Requires manual configuration. See the copilotkit-debug skill for setup instructions.

Architecture Overview

CopilotKit v2 is built on the AG-UI protocol (@ag-ui/client / @ag-ui/core). The stack has three layers:

  1. Runtime (@copilotkit/runtime) -- Server-side. Hosts agents, handles SSE/Intelligence transport, middleware, transcription.
  2. Core (@copilotkit/core) -- Shared state management, tool registry, suggestion engine. Not imported directly by apps.
  3. React (@copilotkit/react) -- Provider, chat components, hooks. Re-exports everything from @ag-ui/client so apps need only one import.

Workflow

1. Set Up the Runtime (Server)

Create a CopilotRuntime (or the explicit CopilotSseRuntime / CopilotIntelligenceRuntime) and expose it via createCopilotEndpoint (Hono) or createCopilotEndpointExpress (Express).

import { CopilotRuntime, createCopilotEndpoint } from "@copilotkit/runtime";
import { LangGraphAgent } from "@ag-ui/langgraph";

const runtime = new CopilotRuntime({
  agents: {
    myAgent: new LangGraphAgent({ /* ... */ }),
  },
});

const app = createCopilotEndpoint({
  runtime,
  basePath: "/api/copilotkit",
});

2. Wrap Your App with the Provider (Client)

import { CopilotKitProvider } from "@copilotkit/react";

function App() {
  return (
    <CopilotKitProvider runtimeUrl="/api/copilotkit">
      <YourApp />
    </CopilotKitProvider>
  );
}

3. Add a Chat UI

Use <CopilotChat>, <CopilotPopup>, or <CopilotSidebar>:

import { CopilotChat } from "@copilotkit/react";

function ChatPage() {
  return <CopilotChat agentId="myAgent" />;
}

4. Register Frontend Tools

Let the agent call functions in the browser:

import { useFrontendTool } from "@copilotkit/react";
import { z } from "zod";

useFrontendTool({
  name: "highlightCell",
  description: "Highlight a spreadsheet cell",
  parameters: z.object({ row: z.number(), col: z.number() }),
  handler: async ({ row, col }) => {
    highlightCell(row, col);
    return "done";
  },
});

5. Share Application Context

Provide runtime data to the agent:

import { useAgentContext } from "@copilotkit/react";

useAgentContext({
  description: "The user's current shopping cart",
  value: cart, // any JSON-serializable value
});

6. Handle Agent Interrupts

When an agent pauses for human input:

import { useInterrupt } from "@copilotkit/react";

useInterrupt({
  render: ({ event, resolve }) => (
    <div>
      <p>{event.value.question}</p>
      <button onClick={() => resolve({ approved: true })}>Approve</button>
    </div>
  ),
});

7. Render Tool Calls in Chat

Show custom UI when tools execute:

import { useRenderTool } from "@copilotkit/react";
import { z } from "zod";

useRenderTool({
  name: "searchDocs",
  parameters: z.object({ query: z.string() }),
  render: ({ status, parameters, result }) => {
    if (status === "executing") return <Spinner>Searching {parameters.query}...</Spinner>;
    if (status === "complete") return <Results data={result} />;
    return <div>Preparing...</div>;
  },
}, []);

Quick Reference: Hooks

HookPurpose
useFrontendToolRegister a tool the agent can call in the browser
useComponentRegister a React component as a chat-rendered tool (convenience wrapper around useFrontendTool)
useAgentContextShare JSON-serializable application state with the agent
useAgentGet the AbstractAgent instance for an agent ID; subscribe to message/state/run-status changes
useInterruptHandle on_interrupt events from agents with render + optional handler/filter
useHumanInTheLoopRegister a tool that pauses execution until the user responds via a rendered UI
useRenderToolRegister a renderer for tool calls (by name or wildcard "*")
useDefaultRenderToolRegister a wildcard "*" renderer using the built-in expandable card UI
useRenderToolCallInternal hook returning a function to resolve the correct renderer for a given tool call
useRenderActivityMessageInternal hook for rendering activity messages by type
useRenderCustomMessagesInternal hook for rendering custom message decorators
useSuggestionsRead the current suggestion list and control reload/clear
useConfigureSuggestionsRegister static or dynamic (LLM-generated) suggestion configs
useThreadsList, rename, archive, and delete Intelligence platform threads

Quick Reference: Components

ComponentPurpose
CopilotKitProviderRoot provider -- configures runtime URL, headers, agents, error handler
CopilotChatFull chat interface connected to an agent (inline layout)
CopilotPopupChat in a floating popup with toggle button
CopilotSidebarChat in a collapsible sidebar with toggle button
CopilotChatViewHeadless chat view with slots for message view, input, scroll, suggestions
CopilotChatInputChat input textarea with send/stop/transcribe controls
CopilotChatMessageViewRenders the message list
CopilotChatSuggestionViewRenders suggestion pills

Quick Reference: Runtime

ExportPurpose
CopilotRuntimeAuto-detecting runtime (delegates to SSE or Intelligence)
CopilotSseRuntimeExplicit SSE-mode runtime
CopilotIntelligenceRuntimeIntelligence-mode runtime with durable threads
createCopilotEndpointCreate a Hono app with all CopilotKit routes
createCopilotEndpointExpressCreate an Express router with all CopilotKit routes
CopilotKitIntelligenceIntelligence platform client configuration

When not to use it

  • When not building AI-powered features
  • When not using CopilotKit v2
  • When not using the AG-UI protocol

Limitations

  • Specific to CopilotKit v2
  • Requires the AG-UI protocol
  • Focuses on AI-powered features

How it compares

This skill provides a structured workflow for integrating CopilotKit v2, enabling advanced AI features like tool registry and context sharing, unlike basic chat integrations.

Compared to similar skills

copilotkit-develop side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
copilotkit-develop (this skill)02moNo flagsIntermediate
nextjs-supabase-auth126moNo flagsIntermediate
app-specific-patterns41moNo flagsIntermediate
javascript-typescript-typescript-scaffold33moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

nextjs-supabase-auth

davila7

Expert integration of Supabase Auth with Next.js App Router Use when: supabase auth next, authentication next.js, login supabase, auth middleware, protected route.

1259

app-specific-patterns

growilabs

GROWI main application (apps/app) specific patterns for Next.js, Jotai, SWR, and testing. Auto-invoked when working in apps/app.

46

javascript-typescript-typescript-scaffold

sickn33

You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project structures with modern tooling (pnpm, Vite, N

31

server-actions

davepoon

This skill should be used when the user asks about "Server Actions", "form handling in Next.js", "mutations", "useFormState", "useFormStatus", "revalidatePath", "revalidateTag", or needs guidance on data mutations and form submissions in Next.js App Router.

11

web-frameworks

mrgoonie

Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.

10

zod-validation-expert

TJSNDHU

Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.

00

Search skills

Search the agent skills registry