Install
openclaw skills install copilotkit-agent-patternsPatterns for building AI agents that integrate with CopilotKit. Use when designing agent architecture, implementing AG-UI event streaming, managing shared st...
openclaw skills install copilotkit-agent-patternsArchitecture and implementation patterns for building AI agents that connect to CopilotKit. Contains 20 rules across 5 categories, prioritized by impact.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Agent Architecture | CRITICAL | architecture- |
| 2 | AG-UI Protocol | HIGH | agui- |
| 3 | State Management | HIGH | state- |
| 4 | Human-in-the-Loop | MEDIUM | hitl- |
| 5 | Generative UI Emission | MEDIUM | genui- |
architecture-built-in-agent - Use BuiltInAgent from @copilotkit/runtime/v2 for simple agentsarchitecture-model-resolution - Use provider/model string format for model selectionarchitecture-max-steps - Set maxSteps to prevent infinite tool call loopsarchitecture-mcp-servers - Configure MCP endpoints for external tool accessagui-event-ordering - Emit events in correct order (start -> content -> end)agui-text-streaming - Stream text incrementally, not as single blocksagui-tool-call-lifecycle - Follow the complete tool call event lifecycleagui-state-snapshot - Emit STATE_SNAPSHOT events for frontend syncagui-error-events - Always emit error events on failurestate-snapshot-frequency - Emit state snapshots at meaningful checkpointsstate-minimal-payload - Keep state snapshots minimal and serializablestate-conflict-resolution - Handle bidirectional state conflicts gracefullystate-thread-isolation - Isolate state per thread, not per agenthitl-approval-gates - Use tool calls for approval gates, not custom eventshitl-timeout-fallback - Always set timeouts with fallback behaviorhitl-context-in-prompt - Include sufficient context for user decisionshitl-resume-state - Preserve full state when resuming after approvalgenui-tool-call-render - Emit tool calls that map to frontend useRenderToolgenui-streaming-args - Stream tool args incrementally for real-time UIgenui-activity-messages - Use text messages for non-tool status updatesRead individual rule files for detailed explanations and code examples:
rules/architecture-built-in-agent.md
rules/agui-event-ordering.md
For the complete guide with all rules expanded: AGENTS.md