copilotkit-upgrade

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

Updated May 9, 2026
One-click install
npx skills add https://github.com/23wj1a0541/L.E.N.S --skill copilotkit-upgrade-23wj1a0541
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: copilotkit-upgrade
Source: https://github.com/23wj1a0541/L.E.N.S/tree/main/.cursor/skills/copilotkit-upgrade
Command: npx skills add https://github.com/23wj1a0541/L.E.N.S --skill copilotkit-upgrade-23wj1a0541

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 v1-to-v2 tables for hooks (useCopilotAction to useFrontendTool, useCoAgent to useAgent), components (CopilotKit to CopilotKitProvider), and runtime classes. - Runtime Migration: Converts service-adapter-based CopilotRuntime setups to the v2 agent-based pattern with createCopilotEndpoint and BuiltInAgent. - Breaking Change Reference: Detailed before/after code examples covering Zod parameter schemas, AG-UI event types, and removed packages like @copilotkit/react-textarea. - Use Case: A team with a Next.js app using useCopilotAction and CopilotChat on v1 can follow the workflow to audit imports, replace deprecated hooks, update the runtime endpoint, and verify the migration. ## Quick Start Migrate my CopilotKit v1 codebase 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, replace deprecated hooks using the deprecation map (useCopilotAction becomes useFrontendTool), consolidate packages into @copilotkit/react, and rewrite the runtime to pass AbstractAgent instances to CopilotRuntime with createCopilotEndpoint.

What replaces useCopilotAction in CopilotKit v2?▼

useFrontendTool replaces useCopilotAction in v2. Parameters switch from the v1 descriptor array format to Zod schemas, the handler receives a typed args object, and the disabled boolean becomes an available prop with enabled or disabled values.

Does CopilotKit v2 still support CopilotTextarea?▼

No, CopilotTextarea and the @copilotkit/react-textarea package are removed in v2 with no direct equivalent. Replace it with a standard textarea combined with useFrontendTool, or use CopilotChat in a sidebar for AI writing assistance.

What happened to OpenAIAdapter and other service adapters in v2?▼

All service adapters are removed in v2. Model selection moves into agents: use BuiltInAgent with a model string like openai:gpt-4o, or implement a custom AbstractAgent for providers without built-in support.

Why does my v1 CopilotRuntime endpoint setup break in v2?▼

v1 framework integrations like copilotRuntimeNextJSAppRouterEndpoint are removed. v2 uses Hono-based createCopilotEndpoint or createCopilotEndpointExpress, and the runtime constructor takes an agents record instead of actions and remoteEndpoints.

How do I replace useCoAgent in CopilotKit v2?▼

useAgent replaces useCoAgent, with the name prop renamed to agentId. It returns an AbstractAgent instance rather than a state object, and agent state flows through AG-UI StateSnapshotEvent and StateDeltaEvent instead of setState.