What problem does it solve? Building AI-powered chat features with CopilotKit v2 requires knowing the correct hooks, components, and runtime setup across its three-layer architecture (runtime, core, React). This Skill provides the exact API patterns and workflow steps so you avoid misusing hooks, misconfiguring endpoints, or wiring providers incorrectly. ## Core Features & Use Cases - Chat UI Setup: Add CopilotChat, CopilotPopup, or CopilotSidebar components connected to an agent via CopilotKitProvider. - Agent Interaction: Register frontend tools with useFrontendTool, share app state with useAgentContext, handle interrupts with useInterrupt, and build approval flows with useHumanInTheLoop. - Runtime Configuration: Expose agents through createCopilotEndpoint (Hono/Next.js) or createCopilotEndpointExpress, with middleware, CORS, and transcription support. - Use Case: You are adding an AI assistant to a Next.js dashboard. Use this Skill to scaffold the runtime API route, wrap the app in CopilotKitProvider, render a sidebar chat, and register a setTheme frontend tool the agent can call. ## Quick Start Add a CopilotKit sidebar chat to my Next.js app, set up the runtime API route with a LangGraphAgent, and register a frontend tool the agent can call.