copilotkit-upgrade

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

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

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 are renamed or split, service adapters are removed, and React packages are consolidated. Doing this by hand means hunting down every deprecated API and guessing at its replacement. ## Core Features & Use Cases - Deprecation Mapping: Complete tables mapping every v1 hook, component, runtime class, and type to its v2 equivalent, including removed APIs with no replacement. - Guided Migration Workflow: A seven-step process covering usage audit, deprecated API identification, package updates, runtime reconfiguration, provider migration, and verification. - Before/After Code Examples: Side-by-side v1 and v2 code for hooks like useCopilotAction to useFrontendTool, useCoAgent to useAgent, and the CopilotRuntime service-adapter-to-agent pattern. - Use Case: A team with a production app using useCopilotAction, CopilotChat, and a Next.js runtime endpoint can follow the references to convert parameters to Zod schemas, switch to createCopilotEndpoint, and consolidate imports into @copilotkit/react. ## Quick Start Migrate my CopilotKit v1 codebase to v2 by replacing deprecated hooks, updating package imports, and converting the runtime to the AG-UI agent pattern.

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, consolidate @copilotkit/react-core and react-ui into @copilotkit/react, and reconfigure CopilotRuntime to accept AbstractAgent instances instead of service adapters. Verify by running the app and testing chat, tool calls, and interrupts.

What replaces useCopilotAction in CopilotKit v2?▼

useFrontendTool replaces useCopilotAction in v2. The parameter descriptor array is replaced by Zod schemas, the handler receives a typed args object, and the disabled boolean becomes an available prop accepting "enabled" or "disabled".

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 or popup for AI-assisted input.

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

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

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

Use createCopilotEndpoint from @copilotkit/runtime, which builds a Hono app with a configurable basePath and CORS. For Next.js App Router, export the app's fetch handler as the POST and GET route handlers instead of the removed copilotRuntimeNextJSAppRouterEndpoint.

Why does useCoAgent state management break after upgrading to v2?▼

useCoAgent is replaced by useAgent, which returns an AbstractAgent instance rather than a destructured state object. The initialState and setState APIs are removed because agent state now flows through AG-UI StateSnapshotEvent and StateDeltaEvent streams.