Skip to content
Back to skills

Copilotkit Runtime Patterns

ASecurity

Server-side runtime patterns for CopilotKit. Use when setting up CopilotKit runtime endpoints (Express, Hono, Next.js), configuring remote agent endpoints, adding middleware, or securing the runtime. Triggers on backend tasks involving @copilotkit/runtime, CopilotRuntime, agent registration, or API endpoint configuration.

  • 14 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 7, 2026
ai-agentsgosqlnextjsexpressapifrontendbackendsecurityperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 18 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill copilotkit-runtime-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Copilotkit Runtime Patterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Copilotkit Runtime Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-copilotkit-runtime-patterns/badge)](https://www.skillsdirectory.com/skills/modbender-copilotkit-runtime-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: copilotkit-runtime-patterns
description: Server-side runtime patterns for CopilotKit. Use when setting up CopilotKit runtime endpoints (Express, Hono, Next.js), configuring remote agent endpoints, adding middleware, or securing the runtime. Triggers on backend tasks involving @copilotkit/runtime, CopilotRuntime, agent registration, or API endpoint configuration.
license: MIT
metadata:
  author: copilotkit
  version: "2.0.0"
---

# CopilotKit Runtime Patterns

Server-side runtime configuration patterns. Contains 15 rules across 5 categories.

## When to Apply

Reference these guidelines when:
- Setting up CopilotKit runtime endpoints (Express, Hono, Next.js API routes)
- Configuring CopilotRuntime with service adapters (OpenAIAdapter, etc.)
- Registering agents via remote endpoints (LangGraph, CrewAI)
- Adding middleware for logging, auth, or request modification
- Securing the runtime (CORS, auth, rate limiting)
- Optimizing runtime performance

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Endpoint Setup | CRITICAL | `endpoint-` |
| 2 | Agent Configuration | HIGH | `runner-` |
| 3 | Middleware | MEDIUM | `middleware-` |
| 4 | Security | HIGH | `security-` |
| 5 | Performance | MEDIUM | `perf-` |

## Quick Reference

### 1. Endpoint Setup (CRITICAL)

- `endpoint-express-setup` - Configure Express endpoint with CopilotRuntime and CORS
- `endpoint-hono-setup` - Configure Hono endpoint for edge runtimes
- `endpoint-nextjs-route` - Set up Next.js API route with copilotRuntimeNextJSAppRouterEndpoint

### 2. Agent Configuration (HIGH)

- `runner-inmemory-vs-sqlite` - Use persistent storage for production thread management
- `runner-agent-registration` - Register agents via remoteEndpoints
- `runner-multiple-agents` - Configure routing for multi-agent setups

### 3. Middleware (MEDIUM)

- `middleware-before-request` - Use onBeforeRequest for auth, logging, context injection
- `middleware-after-request` - Use onAfterRequest for response logging and cleanup
- `middleware-error-handling` - Handle errors in middleware without crashing the runtime

### 4. Security (HIGH)

- `security-cors-config` - Configure CORS for your specific frontend origin
- `security-auth-middleware` - Authenticate requests before agent execution
- `security-rate-limiting` - Rate limit by user or API key

### 5. Performance (MEDIUM)

- `perf-streaming-response` - Ensure streaming is not buffered by proxies

## Full Compiled Document

For the complete guide with all rules expanded: `AGENTS.md`

Files in this skill

  • AGENTS.md19.7 KB
  • README.md860 B
  • SKILL.md2.6 KB
  • rules/_sections.md1.1 KB
  • rules/_template.md361 B
  • rules/endpoint-express-setup.md1.4 KB
  • rules/endpoint-hono-setup.md1.3 KB
  • rules/endpoint-nextjs-route.md1.6 KB
  • rules/middleware-after-request.md1.3 KB
  • rules/middleware-before-request.md1.4 KB
  • rules/middleware-error-handling.md1.4 KB
  • rules/perf-streaming-response.md1.2 KB
  • rules/runner-agent-registration.md1.2 KB
  • rules/runner-inmemory-vs-sqlite.md1.4 KB
  • rules/runner-multiple-agents.md1.4 KB
  • rules/security-auth-middleware.md1.9 KB
  • rules/security-cors-config.md908 B
  • rules/security-rate-limiting.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…