# Send CopilotKit-agent-patterns to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "copilotkit-agent-patterns",
    "name": "CopilotKit-agent-patterns",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/GeneralJerel/copilotkit-agent-patterns",
    "canonicalUrl": "https://clawhub.ai/GeneralJerel/copilotkit-agent-patterns",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/copilotkit-agent-patterns",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=copilotkit-agent-patterns",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "metadata.json",
      "README.md",
      "SKILL.md",
      "rules/state-conflict-resolution.md",
      "rules/_template.md",
      "rules/agui-tool-call-lifecycle.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "copilotkit-agent-patterns",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T20:36:49.047Z",
      "expiresAt": "2026-05-07T20:36:49.047Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=copilotkit-agent-patterns",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=copilotkit-agent-patterns",
        "contentDisposition": "attachment; filename=\"copilotkit-agent-patterns-1.0.2.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "copilotkit-agent-patterns"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/copilotkit-agent-patterns"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/copilotkit-agent-patterns",
    "downloadUrl": "https://openagent3.xyz/downloads/copilotkit-agent-patterns",
    "agentUrl": "https://openagent3.xyz/skills/copilotkit-agent-patterns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/copilotkit-agent-patterns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/copilotkit-agent-patterns/agent.md"
  }
}
```
## Documentation

### CopilotKit Agent Patterns

Architecture and implementation patterns for building AI agents that connect to CopilotKit. Contains 20 rules across 5 categories, prioritized by impact.

### When to Apply

Reference these guidelines when:

Designing agent architecture for CopilotKit integration
Implementing AG-UI protocol event streaming
Managing state synchronization between agent and frontend
Adding human-in-the-loop checkpoints to agent workflows
Emitting tool calls that render generative UI in the frontend

### Rule Categories by Priority

PriorityCategoryImpactPrefix1Agent ArchitectureCRITICALarchitecture-2AG-UI ProtocolHIGHagui-3State ManagementHIGHstate-4Human-in-the-LoopMEDIUMhitl-5Generative UI EmissionMEDIUMgenui-

### 1. Agent Architecture (CRITICAL)

architecture-built-in-agent - Use BuiltInAgent from @copilotkit/runtime/v2 for simple agents
architecture-model-resolution - Use provider/model string format for model selection
architecture-max-steps - Set maxSteps to prevent infinite tool call loops
architecture-mcp-servers - Configure MCP endpoints for external tool access

### 2. AG-UI Protocol (HIGH)

agui-event-ordering - Emit events in correct order (start -> content -> end)
agui-text-streaming - Stream text incrementally, not as single blocks
agui-tool-call-lifecycle - Follow the complete tool call event lifecycle
agui-state-snapshot - Emit STATE_SNAPSHOT events for frontend sync
agui-error-events - Always emit error events on failure

### 3. State Management (HIGH)

state-snapshot-frequency - Emit state snapshots at meaningful checkpoints
state-minimal-payload - Keep state snapshots minimal and serializable
state-conflict-resolution - Handle bidirectional state conflicts gracefully
state-thread-isolation - Isolate state per thread, not per agent

### 4. Human-in-the-Loop (MEDIUM)

hitl-approval-gates - Use tool calls for approval gates, not custom events
hitl-timeout-fallback - Always set timeouts with fallback behavior
hitl-context-in-prompt - Include sufficient context for user decisions
hitl-resume-state - Preserve full state when resuming after approval

### 5. Generative UI Emission (MEDIUM)

genui-tool-call-render - Emit tool calls that map to frontend useRenderTool
genui-streaming-args - Stream tool args incrementally for real-time UI
genui-activity-messages - Use text messages for non-tool status updates

### How to Use

Read individual rule files for detailed explanations and code examples:

rules/architecture-built-in-agent.md
rules/agui-event-ordering.md

### Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: GeneralJerel
- Version: 1.0.2
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T20:36:49.047Z
- Expires at: 2026-05-07T20:36:49.047Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/copilotkit-agent-patterns)
- [Send to Agent page](https://openagent3.xyz/skills/copilotkit-agent-patterns/agent)
- [JSON manifest](https://openagent3.xyz/skills/copilotkit-agent-patterns/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/copilotkit-agent-patterns/agent.md)
- [Download page](https://openagent3.xyz/downloads/copilotkit-agent-patterns)