copilotkit-develop

Implements CopilotKit v2 chat interfaces, frontend tools, and runtime endpoints in React applications.

7|3|Updated May 8, 2026
One-click install
npx skills add https://github.com/CopilotKit/Generative-UI-Global-Hackathon-Starter-Kit --skill copilotkit-develop-copilotkit
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: copilotkit-develop
Source: https://github.com/CopilotKit/Generative-UI-Global-Hackathon-Starter-Kit/tree/main/.cursor/skills/copilotkit-develop
Command: npx skills add https://github.com/CopilotKit/Generative-UI-Global-Hackathon-Starter-Kit --skill copilotkit-develop-copilotkit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @copilotkit/react, @copilotkit/runtime, @ag-ui/langgraph, zod, and includes references (resource) components.

What problem does it solve? Building AI-powered chat features with CopilotKit v2 requires knowing the correct hooks, components, and runtime setup across its three-layer architecture (runtime, core, React). This Skill provides the exact API patterns and workflow steps so you avoid misusing hooks, misconfiguring endpoints, or wiring providers incorrectly. ## Core Features & Use Cases - Chat UI Setup: Add CopilotChat, CopilotPopup, or CopilotSidebar components connected to an agent via CopilotKitProvider. - Agent Interaction: Register frontend tools with useFrontendTool, share app state with useAgentContext, handle interrupts with useInterrupt, and build approval flows with useHumanInTheLoop. - Runtime Configuration: Expose agents through createCopilotEndpoint (Hono/Next.js) or createCopilotEndpointExpress, with middleware, CORS, and transcription support. - Use Case: You are adding an AI assistant to a Next.js dashboard. Use this Skill to scaffold the runtime API route, wrap the app in CopilotKitProvider, render a sidebar chat, and register a setTheme frontend tool the agent can call. ## Quick Start Add a CopilotKit sidebar chat to my Next.js app, set up the runtime API route with a LangGraphAgent, and register a frontend tool the agent can call.

Frequently Asked Questions about copilotkit-develop

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a CopilotKit chat interface to a React app?▼

Wrap your app in CopilotKitProvider with a runtimeUrl, then render CopilotChat, CopilotPopup, or CopilotSidebar with an agentId. The provider connects to the runtime endpoint and the chat component handles message submission and suggestions.

How do I register a frontend tool the agent can call?▼

Use the useFrontendTool hook from @copilotkit/react with a name, description, a Zod parameters schema, and a handler function. The agent can then invoke the tool in the browser, and you can optionally add a render component for the tool call in chat.

How do I set up a CopilotKit runtime endpoint in Next.js?▼

Create a route at app/api/copilotkit/[[...path]]/route.ts that instantiates CopilotRuntime with your agents, calls createCopilotEndpoint with basePath /api/copilotkit, and exports app.fetch as the GET, POST, PATCH, and DELETE handlers.

Does CopilotKit v2 support Express servers?▼

Yes, createCopilotEndpointExpress returns an Express router with all CopilotKit routes mounted under the given basePath. Mount it with app.use() after creating a CopilotRuntime with your agents.

How do I handle agent interrupts for human approval?▼

Use useInterrupt with a render function that displays the interrupt event and calls resolve() with the user's decision. For tool-style approval flows, useHumanInTheLoop pauses execution and provides a respond callback during the executing status.

Can I customize CopilotChat text and labels?▼

Yes, pass a labels prop to CopilotChat with partial overrides such as chatInputPlaceholder, welcomeMessageText, and modalHeaderTitle. Layout slots like input, messageView, and welcomeScreen can also be replaced with custom components.