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/SebastienGt/LivingMargin-Google-Deepmind-Hackathon --skill copilotkit-upgrade-sebastiengt
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: copilotkit-upgrade
Source: https://github.com/SebastienGt/LivingMargin-Google-Deepmind-Hackathon/tree/main/.cursor/skills/copilotkit-upgrade
Command: npx skills add https://github.com/SebastienGt/LivingMargin-Google-Deepmind-Hackathon --skill copilotkit-upgrade-sebastiengt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? CopilotKit v2 is a ground-up rewrite built on the AG-UI protocol, so upgrading from v1 involves renamed hooks, consolidated packages, removed service adapters, and a new runtime architecture. This Skill guides that migration systematically so no deprecated API is missed. ## Core Features & Use Cases - API Deprecation Mapping: Maps every v1 hook, component, runtime class, and type to its v2 replacement, including renames like useCopilotAction to useFrontendTool and CopilotKit to CopilotKitProvider. - Runtime Migration Guidance: Converts v1 service-adapter-based CopilotRuntime setups to v2 agent-based configurations using BuiltInAgent, AbstractAgent, and createCopilotEndpoint. - Live Documentation Lookup: Includes an MCP server with search-docs and search-code tools for querying current CopilotKit v2 API signatures during migration. - Use Case: A team with a Next.js app using useCopilotAction, useCoAgent, and OpenAIAdapter can follow the step-by-step workflow to audit imports, replace deprecated hooks with Zod-based v2 equivalents, and reconfigure the runtime for the AG-UI protocol. ## Quick Start Migrate my CopilotKit v1 codebase to v2 by auditing all @copilotkit imports and replacing deprecated hooks and 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 (e.g., useCopilotAction becomes useFrontendTool), consolidate packages into @copilotkit/react, and reconfigure the runtime to accept AG-UI agent instances instead of service adapters.

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 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 combined with useFrontendTool for AI writing assistance, or use CopilotChat in a sidebar or popup.

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

Use createCopilotEndpoint from @copilotkit/runtime, which returns a Hono app. Pass your runtime with agents configured, set the basePath, and export the app's fetch handler as the POST and GET route handlers in your Next.js App Router.