copilotkit-upgrade
БесплатноБез исполняемых скриптовНе проверенUse when migrating a CopilotKit v1 application to v2 -- updating package imports, replacing deprecated hooks and components, switching from GraphQL runtime to…
от lza6★ 19 звёзд на GitHubОб этом скилле
CopilotKit v1 to v2 Migration Skill
Live Documentation (MCP)
This plugin includes an MCP server (copilotkit-docs) that provides search-docs and search-code tools for querying live CopilotKit documentation and source code. Useful for looking up current v2 API signatures during migration.
- Claude Code: Auto-configured by the plugin's
.mcp.json-- no setup needed. - Codex: Requires manual configuration. See the copilotkit-debug skill for setup instructions.
Overview
CopilotKit v2 is a ground-up rewrite built on the AG-UI protocol (@ag-ui/client / @ag-ui/core). Users continue to install and import @copilotkit/* packages -- the v2 changes are exposed through the same package names (under their /v2 subpaths) with updated APIs (new hook names, component names, runtime configuration). The underlying @ag-ui/* packages are an internal implementation detail re-exported through @copilotkit/react-core/v2, so users never need to install them directly.
Migration Workflow
1. Audit Current Usage
Scan the codebase for all v1 imports and API usage:
@copilotkit/react-core -> hooks, CopilotKit provider, types
@copilotkit/react-ui -> CopilotChat, CopilotPopup, CopilotSidebar
@copilotkit/react-textarea -> CopilotTextarea (removed in v2)
@copilotkit/runtime -> CopilotRuntime, service adapters, framework integrations
@copilotkit/runtime-client-gql -> GraphQL client, message types
@copilotkit/shared -> utility types, constants
@copilotkit/sdk-js -> LangGraph/LangChain SDK
2. Identify Deprecated APIs
Key hooks and components to find and replace:
| v1 API | v2 Replacement |
|---|---|
useCopilotAction |
useFrontendTool |
useCopilotReadable |
useAgentContext |
useCopilotChat |
useAgent |
useCoAgent |
useAgent |
useCoAgentStateRender |
useRenderTool / useRenderActivityMessage |
useCopilotContext |
useCopilotKit (from @copilotkit/react-core/v2/context) |
useLangGraphInterrupt |
useInterrupt |
useCopilotChatSuggestions |
useConfigureSuggestions + useSuggestions |
useCopilotAdditionalInstructions |
useAgentContext |
useMakeCopilotDocumentReadable |
useAgentContext |
CopilotKit (root import) |
CopilotKit (from @copilotkit/react-core/v2) |
CopilotTextarea |
Removed -- use standard textarea + useFrontendTool |
3. Map to v2 Equivalents
Refer to references/v1-to-v2-migration.md for detailed before/after code examples.
4. Update Package Dependencies
The @copilotkit/* package names stay the same. v2 does not introduce new package names -- the v2 APIs ship from the /v2 subpath of the existing packages (@copilotkit/react-core/v2, @copilotkit/runtime/v2). There is no @copilotkit/react or @copilotkit/agent package. Update to the latest v2 versions:
@copilotkit/react-core -> @copilotkit/react-core (v2 symbols under the /v2 subpath)
@copilotkit/react-ui -> chat components move to @copilotkit/react-core/v2; react-ui contributes only styles in v2
@copilotkit/react-textarea -> removed (no v2 equivalent)
@copilotkit/runtime -> @copilotkit/runtime (v2 symbols under the /v2 subpath)
@copilotkit/runtime-client-gql -> removed (replaced by AG-UI protocol; @ag-ui/client types are re-exported from @copilotkit/react-core/v2)
@copilotkit/shared -> @copilotkit/shared (same package)
@copilotkit/sdk-js -> removed (BuiltInAgent now ships from @copilotkit/runtime/v2)
5. Update Runtime Configuration
The v1 CopilotRuntime accepted service adapters (OpenAI, Anthropic, LangChain, etc.) and endpoint definitions. The v2 CopilotRuntime accepts AG-UI AbstractAgent instances directly.
v1 pattern (service adapter + endpoints):
import { CopilotRuntime, OpenAIAdapter } from "@copilotkit/runtime";
const runtime = new CopilotRuntime({ actions: [...] });
// used with framework handlers like copilotRuntimeNextJSAppRouterEndpoint() (Next.js), etc.
v2 pattern (agents + Hono endpoint):
import {
CopilotRuntime,
BuiltInAgent,
createCopilotHonoHandler,
} from "@copilotkit/runtime/v2";
const runtime = new CopilotRuntime({
agents: { myAgent: new BuiltInAgent({ model: "openai/gpt-4o" }) },
});
c
Установить copilotkit-upgrade в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл copilotkit-upgrade?
Use when migrating a CopilotKit v1 application to v2 -- updating package imports, replacing deprecated hooks and components, switching from GraphQL runtime to AG-UI protocol runtime, and resolving breaking API changes.
Как установить скилл copilotkit-upgrade?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл copilotkit-upgrade запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic