{
  "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": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/copilotkit-agent-patterns",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=copilotkit-agent-patterns",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "metadata.json",
      "README.md",
      "SKILL.md",
      "rules/state-conflict-resolution.md",
      "rules/_template.md",
      "rules/agui-tool-call-lifecycle.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/copilotkit-agent-patterns",
    "agentPageUrl": "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"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "CopilotKit Agent Patterns",
        "body": "Architecture and implementation patterns for building AI agents that connect to CopilotKit. Contains 20 rules across 5 categories, prioritized by impact."
      },
      {
        "title": "When to Apply",
        "body": "Reference these guidelines when:\n\nDesigning agent architecture for CopilotKit integration\nImplementing AG-UI protocol event streaming\nManaging state synchronization between agent and frontend\nAdding human-in-the-loop checkpoints to agent workflows\nEmitting tool calls that render generative UI in the frontend"
      },
      {
        "title": "Rule Categories by Priority",
        "body": "PriorityCategoryImpactPrefix1Agent ArchitectureCRITICALarchitecture-2AG-UI ProtocolHIGHagui-3State ManagementHIGHstate-4Human-in-the-LoopMEDIUMhitl-5Generative UI EmissionMEDIUMgenui-"
      },
      {
        "title": "1. Agent Architecture (CRITICAL)",
        "body": "architecture-built-in-agent - Use BuiltInAgent from @copilotkit/runtime/v2 for simple agents\narchitecture-model-resolution - Use provider/model string format for model selection\narchitecture-max-steps - Set maxSteps to prevent infinite tool call loops\narchitecture-mcp-servers - Configure MCP endpoints for external tool access"
      },
      {
        "title": "2. AG-UI Protocol (HIGH)",
        "body": "agui-event-ordering - Emit events in correct order (start -> content -> end)\nagui-text-streaming - Stream text incrementally, not as single blocks\nagui-tool-call-lifecycle - Follow the complete tool call event lifecycle\nagui-state-snapshot - Emit STATE_SNAPSHOT events for frontend sync\nagui-error-events - Always emit error events on failure"
      },
      {
        "title": "3. State Management (HIGH)",
        "body": "state-snapshot-frequency - Emit state snapshots at meaningful checkpoints\nstate-minimal-payload - Keep state snapshots minimal and serializable\nstate-conflict-resolution - Handle bidirectional state conflicts gracefully\nstate-thread-isolation - Isolate state per thread, not per agent"
      },
      {
        "title": "4. Human-in-the-Loop (MEDIUM)",
        "body": "hitl-approval-gates - Use tool calls for approval gates, not custom events\nhitl-timeout-fallback - Always set timeouts with fallback behavior\nhitl-context-in-prompt - Include sufficient context for user decisions\nhitl-resume-state - Preserve full state when resuming after approval"
      },
      {
        "title": "5. Generative UI Emission (MEDIUM)",
        "body": "genui-tool-call-render - Emit tool calls that map to frontend useRenderTool\ngenui-streaming-args - Stream tool args incrementally for real-time UI\ngenui-activity-messages - Use text messages for non-tool status updates"
      },
      {
        "title": "How to Use",
        "body": "Read individual rule files for detailed explanations and code examples:\n\nrules/architecture-built-in-agent.md\nrules/agui-event-ordering.md"
      },
      {
        "title": "Full Compiled Document",
        "body": "For the complete guide with all rules expanded: AGENTS.md"
      }
    ],
    "body": "CopilotKit Agent Patterns\n\nArchitecture and implementation patterns for building AI agents that connect to CopilotKit. Contains 20 rules across 5 categories, prioritized by impact.\n\nWhen to Apply\n\nReference these guidelines when:\n\nDesigning agent architecture for CopilotKit integration\nImplementing AG-UI protocol event streaming\nManaging state synchronization between agent and frontend\nAdding human-in-the-loop checkpoints to agent workflows\nEmitting tool calls that render generative UI in the frontend\nRule Categories by Priority\nPriority\tCategory\tImpact\tPrefix\n1\tAgent Architecture\tCRITICAL\tarchitecture-\n2\tAG-UI Protocol\tHIGH\tagui-\n3\tState Management\tHIGH\tstate-\n4\tHuman-in-the-Loop\tMEDIUM\thitl-\n5\tGenerative UI Emission\tMEDIUM\tgenui-\nQuick Reference\n1. Agent Architecture (CRITICAL)\narchitecture-built-in-agent - Use BuiltInAgent from @copilotkit/runtime/v2 for simple agents\narchitecture-model-resolution - Use provider/model string format for model selection\narchitecture-max-steps - Set maxSteps to prevent infinite tool call loops\narchitecture-mcp-servers - Configure MCP endpoints for external tool access\n2. AG-UI Protocol (HIGH)\nagui-event-ordering - Emit events in correct order (start -> content -> end)\nagui-text-streaming - Stream text incrementally, not as single blocks\nagui-tool-call-lifecycle - Follow the complete tool call event lifecycle\nagui-state-snapshot - Emit STATE_SNAPSHOT events for frontend sync\nagui-error-events - Always emit error events on failure\n3. State Management (HIGH)\nstate-snapshot-frequency - Emit state snapshots at meaningful checkpoints\nstate-minimal-payload - Keep state snapshots minimal and serializable\nstate-conflict-resolution - Handle bidirectional state conflicts gracefully\nstate-thread-isolation - Isolate state per thread, not per agent\n4. Human-in-the-Loop (MEDIUM)\nhitl-approval-gates - Use tool calls for approval gates, not custom events\nhitl-timeout-fallback - Always set timeouts with fallback behavior\nhitl-context-in-prompt - Include sufficient context for user decisions\nhitl-resume-state - Preserve full state when resuming after approval\n5. Generative UI Emission (MEDIUM)\ngenui-tool-call-render - Emit tool calls that map to frontend useRenderTool\ngenui-streaming-args - Stream tool args incrementally for real-time UI\ngenui-activity-messages - Use text messages for non-tool status updates\nHow to Use\n\nRead individual rule files for detailed explanations and code examples:\n\nrules/architecture-built-in-agent.md\nrules/agui-event-ordering.md\n\nFull Compiled Document\n\nFor the complete guide with all rules expanded: AGENTS.md"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/GeneralJerel/copilotkit-agent-patterns",
    "publisherUrl": "https://clawhub.ai/GeneralJerel/copilotkit-agent-patterns",
    "owner": "GeneralJerel",
    "version": "1.0.2",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "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"
  }
}