Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
Version History
**Major update: Clarifies agent configuration and runtime setup, updates endpoints, and simplifies performance guidelines.** - Updated to reference CopilotRuntime and @copilotkit/runtime throughout. - Expanded guidance for agent registration via remote endpoints (e.g., LangGraph, CrewAI). - Renamed and refocused "Agent Runners" to "Agent Configuration", emphasizing persistent storage and remote agent management. - Updated endpoint setup examples for Express and Next.js to use latest CopilotRuntime patterns. - Middleware hooks renamed (`beforeRequest` → `onBeforeRequest`, etc.) and clarified in usage. - Simplified performance section, focusing on streaming best practices. - Document version bumped from 1.0.0 to 2.0.0.
What This Skill Does
A collection of 15 server-side configuration rules for CopilotKit's runtime layer, organized across endpoint setup, agent registration, middleware, security, and performance. Covers Express, Hono, and Next.js integration patterns with service adapters and remote agent endpoints.
Having prioritized, categorized rules in one place prevents common misconfigurations like buffered streaming responses or missing CORS headers that are easy to overlook when assembling the runtime manually.
When to use it
- Setting up a CopilotKit endpoint in an existing Express API
- Registering a LangGraph agent via remote endpoint configuration
- Adding auth middleware to gate copilot requests by user token
- Configuring CORS to allow only a specific frontend origin
- Switching from in-memory to SQLite thread storage for production
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: how do I add authentication to my CopilotKit Express endpoint?
- 1Identifies the security-auth-middleware rule as the relevant reference
- 2Retrieves the onBeforeRequest middleware pattern for request interception
- 3Generates Express middleware code that validates a token before agent execution
- 4Adds the middleware to the CopilotRuntime configuration block
- 5Notes the security-cors-config rule for locking down allowed origins
A working Express endpoint with auth middleware that rejects unauthenticated requests before they reach the copilot runtime
Requirements
Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.