copilotkit-upgrade

Migrates CopilotKit v1 applications to v2 by updating hooks, components, and runtime configuration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Upgrading a CopilotKit v1 application to v2 involves a ground-up rewrite: the GraphQL protocol is replaced by AG-UI, hooks and components are renamed or removed, and the runtime switches from service adapters to agent instances. This Skill guides that migration systematically so no deprecated API is missed. ## Core Features & Use Cases - Deprecation Mapping: Complete tables mapping every v1 hook, component, runtime class, and type to its v2 replacement, including removed APIs like CopilotTextarea and service adapters. - Step-by-Step Migration Workflow: Audits current v1 usage, updates package dependencies, rewrites the provider, converts hooks (e.g., useCopilotAction to useFrontendTool with Zod schemas), and reconfigures the runtime with createCopilotEndpoint. - Live Documentation Lookup: Includes an MCP server (copilotkit-docs) with search-docs and search-code tools for querying current v2 API signatures during migration. - Use Case: A team with a Next.js app using useCoAgent, CopilotChat, and an OpenAIAdapter runtime can follow the workflow to convert to useAgent, the consolidated @copilotkit/react package, and a BuiltInAgent-based CopilotRuntime. ## Quick Start Migrate my CopilotKit v1 app to v2 by scanning for deprecated hooks and updating the runtime configuration.

Frequently Asked Questions about copilotkit-upgrade

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

FAQPage Schema
How do I migrate from CopilotKit v1 to v2?▼

Audit your codebase for v1 imports, then update packages to @copilotkit/react, @copilotkit/runtime, and @copilotkit/agent. Replace the CopilotKit provider with CopilotKitProvider, rename hooks per the deprecation map, and rebuild the runtime around AbstractAgent instances with createCopilotEndpoint.

What replaces useCopilotAction in CopilotKit v2?▼

useFrontendTool replaces useCopilotAction in v2. Parameters are now defined with Zod schemas instead of the v1 descriptor array, the handler receives a typed args object, and the disabled boolean becomes an available prop set to "enabled" or "disabled".

Does CopilotKit v2 still support OpenAIAdapter and other service adapters?▼

No, all service adapters are removed in v2. Use BuiltInAgent from @copilotkit/agent with a model string like "openai:gpt-4o" or "anthropic:claude-sonnet-4-20250514", or implement a custom AbstractAgent for other providers.

What happened to CopilotTextarea in CopilotKit v2?▼

CopilotTextarea was removed with no v2 equivalent. Replace it with a standard textarea or rich text editor, add a useFrontendTool hook for AI writing assistance, or use CopilotChat in a sidebar or popup for inline help.

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

Create a CopilotRuntime with an agents record, then call createCopilotEndpoint with the runtime and a basePath. For the Next.js App Router, export the Hono app's fetch handler as the POST and GET route handlers.

Why does useCoAgent not work after upgrading to CopilotKit v2?▼

useCoAgent was replaced by useAgent, which returns an AbstractAgent instance instead of a destructured state object. The name prop becomes agentId, and initialState and setState are removed since state flows through AG-UI StateSnapshotEvent and StateDeltaEvent.