Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
copilotkit avatar

Copilotkit Develop

  • 469 installs
  • 35 repo stars
  • Updated June 3, 2026
  • copilotkit/skills

This is a copy of copilotkit-develop by copilotkit - installs and ranking accrue to the original listing.

copilotkit-develop is an agent skill that implements CopilotKit v2 copilots—runtime, chat UI, frontend tools, and shared context—for developers embedding AG-UI agents in React apps.

About

copilotkit-develop is version 1.0.0 skill in copilotkit/skills for building AI-powered features with CopilotKit v2 on the AG-UI protocol. It documents a seven-step workflow: set up CopilotRuntime with createCopilotEndpoint or Express adapters, wrap apps in CopilotKitProvider, add CopilotChat or popup/sidebar UIs, register frontend tools via useFrontendTool, share JSON context with useAgentContext, handle interrupts with useInterrupt, and render tool calls through useRenderTool. Quick references list 14 React hooks—including useHumanInTheLoop, useSuggestions, and useThreads—and nine chat UI components from CopilotKitProvider through CopilotChatSuggestionView. The bundled copilotkit-docs MCP exposes search-docs and search-code for live references. Developers reach for copilotkit-develop when moving beyond scaffolds to production copilots with runtime routes, zod-validated tools, and agent-visible application state in Next.js or Express hosts. The skill also covers suggestion configuration, thread management on Intelligence runtimes, and custom tool renderers for richer in-chat UX during agent sessions.

  • Action and readable state design
  • Copilot runtime integration patterns
  • Prompt and context shaping
  • Tool-call orchestration in apps
  • Reusable copilot feature structure

Copilotkit Develop by the numbers

  • 469 all-time installs (skills.sh)
  • Data as of Jul 29, 2026 (Skillselion catalog sync)
npx skills add https://github.com/copilotkit/skills --skill copilotkit-develop

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs469
repo stars35
Last updatedJune 3, 2026
Repositorycopilotkit/skills

How do you build CopilotKit v2 copilot features?

Implement CopilotKit copilots end to end: define actions, readable state, prompts, runtime hooks, and app-specific agent behavior beyond initial scaffold and one-off integrations.

Who is it for?

React developers embedding CopilotKit v2 copilots who need runtime, hooks, and chat components wired beyond initial scaffold.

Skip if: Teams not using CopilotKit or AG-UI in React apps should skip copilotkit-develop.

When should I use this skill?

User adds CopilotKit chat, frontend tools, shared agent context, interrupts, or CopilotRuntime server routes.

What you get

CopilotRuntime endpoint, CopilotKitProvider setup, registered frontend tools, and chat UI with interrupt handling.

  • CopilotRuntime API route
  • CopilotKit chat UI integration
  • Registered frontend tools and shared context

By the numbers

  • Version 1.0.0 with a 7-step CopilotKit v2 development workflow
  • Documents 14 React hooks and 9 chat UI components

Files

SKILL.mdMarkdownGitHub ↗

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

Related skills

How it compares

Pick copilotkit-develop over copilotkit-integrations when building CopilotKit UI and runtime features rather than wiring external agent frameworks.

FAQ

What stack does copilotkit-develop cover?

copilotkit-develop covers CopilotKit v2 on AG-UI with @copilotkit/runtime server endpoints, @copilotkit/react providers, chat components, and hooks like useFrontendTool and useAgentContext.

Which hooks does copilotkit-develop document?

copilotkit-develop documents 14 React hooks—including useFrontendTool, useAgentContext, useInterrupt, useHumanInTheLoop, useRenderTool, and useThreads—for CopilotKit v2 agent UIs.

AI & Agent Buildingagentsllmautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.