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

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: hooks are renamed, packages are consolidated, the GraphQL protocol is replaced by AG-UI, and service adapters are removed. 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 (e.g., useCopilotAction to useFrontendTool, CopilotKit to CopilotKitProvider). - Before/After Code Examples: Detailed migration patterns for providers, hooks, runtime configuration, and endpoint setup, including the shift from service adapters to BuiltInAgent and Hono-based createCopilotEndpoint. - Breaking Changes Reference: Documents protocol changes (GraphQL to AG-UI/SSE), Zod-based parameter schemas replacing v1 parameter descriptors, and removed packages like @copilotkit/react-textarea. - Use Case: A team with a production Next.js app using useCoAgent, CopilotChat, and OpenAIAdapter can follow the workflow to audit imports, replace deprecated APIs, and reconfigure the runtime for v2. ## 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, 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 are now defined with Zod schemas instead of the v1 parameter descriptor array, and the handler receives a typed args object.

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

Why does my v1 CopilotRuntime configuration break in v2?▼

The v2 CopilotRuntime constructor no longer accepts actions, remoteEndpoints, or service adapters. It requires an agents record of AbstractAgent instances and uses createCopilotEndpoint (Hono-based) instead of framework-specific endpoint functions.

How do I replace useCoAgent in CopilotKit v2?▼

Use useAgent with an agentId prop, which returns an AbstractAgent instance. The v1 initialState and setState APIs are removed; agent state flows through AG-UI StateSnapshotEvent and StateDeltaEvent instead.