搜索

PythonReactSEOPDF
OpenClaw

copilotkit-react-patterns

CopilotKit React best practices for agentic applications. Use when writing, reviewing, or refactoring React code that uses CopilotKit hooks (useAgent, useFrontendTool, useRenderTool, useCopilotAction, useCopilotReadable), providers (CopilotKit), or chat UI components (CopilotChat, CopilotSidebar, CopilotPopup). Triggers on tasks involving agent integration, tool rendering, shared state, or generative UI in React.

generaljerel0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install generaljerel/copilotkit-react

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

CopilotKit React Patterns

Best practices for building agentic React applications with CopilotKit. Contains 25 rules across 6 categories, prioritized by impact to guide code generation and refactoring. Covers both v1 (@copilotkit/react-core) and v2 (@copilotkit/react-core/v2) APIs.

When to Apply

Reference these guidelines when:

  • Setting up CopilotKit provider in a React application
  • Using agent hooks (useAgent, useFrontendTool, useCopilotAction)
  • Rendering tool calls or custom messages from agents
  • Managing shared state between UI and agents via useCopilotReadable or useCoAgent
  • Building chat interfaces with CopilotChat, CopilotSidebar, or CopilotPopup
  • Configuring suggestions for proactive agent assistance

Rule Categories by Priority

Priority Category Impact Prefix
1 Provider Setup CRITICAL provider-
2 Agent Hooks HIGH agent-
3 Tool Rendering HIGH tool-
4 Context & State MEDIUM state-
5 Chat UI MEDIUM ui-
6 Suggestions LOW suggestions-

Quick Reference

1. Provider Setup (CRITICAL)
  • provider-runtime-url - Always configure runtimeUrl to connect to your agent backend
  • provider-single-endpoint - Configure the agent prop for CoAgent routing
  • provider-nested-providers - Scope agent configurations with nested CopilotKit providers
  • provider-tool-registration - Register tools via hooks inside provider, not as props when possible
2. Agent Hooks (HIGH)
  • agent-use-agent-updates - Specify update subscriptions to avoid unnecessary re-renders
  • agent-agent-id - Always pass agentId when running multiple agents
  • agent-context-description - Write descriptive context values for useCopilotReadable
  • agent-frontend-tool-deps - Declare dependency arrays for useFrontendTool
  • agent-stable-tool-handlers - Use useCallback for tool handler functions
3. Tool Rendering (HIGH)
  • tool-typed-args - Defin...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/generaljerel/copilotkit-react
Version
—
Commit
ca3e9428a3a71d4eea774943349e07571192e22f
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

CopilotKit React Patterns

A structured skill for CopilotKit React best practices, optimized for agents and LLMs.

Structure

  • rules/ - Individual rule files (one per rule)
    • _sections.md - Section metadata (titles, impacts, descriptions)
    • _template.md - Template for creating new rules
    • {prefix}-{name}.md - Individual rule files
  • metadata.json - Document metadata (version, organization, abstract)
  • AGENTS.md - Compiled output (generated)

Categories

# Category Rules Prefix
1 Provider Setup 4 provider-
2 Agent Hooks 5 agent-
3 Tool Rendering 5 tool-
4 Context & State 4 state-
5 Chat UI 4 ui-
6 Suggestions 3 suggestions-

Getting Started

pnpm install
pnpm build
pnpm validate

来源内容

SKILL.md
# CopilotKit React Patterns

Best practices for building agentic React applications with CopilotKit. Contains 25 rules across 6 categories, prioritized by impact to guide code generation and refactoring. Covers both v1 (`@copilotkit/react-core`) and v2 (`@copilotkit/react-core/v2`) APIs.

## When to Apply

Reference these guidelines when:
- Setting up `CopilotKit` provider in a React application
- Using agent hooks (useAgent, useFrontendTool, useCopilotAction)
- Rendering tool calls or custom messages from agents
- Managing shared state between UI and agents via useCopilotReadable or useCoAgent
- Building chat interfaces with CopilotChat, CopilotSidebar, or CopilotPopup
- Configuring suggestions for proactive agent assistance

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Provider Setup | CRITICAL | `provider-` |
| 2 | Agent Hooks | HIGH | `agent-` |
| 3 | Tool Rendering | HIGH | `tool-` |
| 4 | Context & State | MEDIUM | `state-` |
| 5 | Chat UI | MEDIUM | `ui-` |
| 6 | Suggestions | LOW | `suggestions-` |

## Quick Reference

### 1. Provider Setup (CRITICAL)

- `provider-runtime-url` - Always configure runtimeUrl to connect to your agent backend
- `provider-single-endpoint` - Configure the agent prop for CoAgent routing
- `provider-nested-providers` - Scope agent configurations with nested CopilotKit providers
- `provider-tool-registration` - Register tools via hooks inside provider, not as props when possible

### 2. Agent Hooks (HIGH)

- `agent-use-agent-updates` - Specify update subscriptions to avoid unnecessary re-renders
- `agent-agent-id` - Always pass agentId when running multiple agents
- `agent-context-description` - Write descriptive context values for useCopilotReadable
- `agent-frontend-tool-deps` - Declare dependency arrays for useFrontendTool
- `agent-stable-tool-handlers` - Use useCallback for tool handler functions

### 3. Tool Rendering (HIGH)

- `tool-typed-args` - Defin...
README
# CopilotKit React Patterns

A structured skill for CopilotKit React best practices, optimized for agents and LLMs.

## Structure

- `rules/` - Individual rule files (one per rule)
  - `_sections.md` - Section metadata (titles, impacts, descriptions)
  - `_template.md` - Template for creating new rules
  - `{prefix}-{name}.md` - Individual rule files
- `metadata.json` - Document metadata (version, organization, abstract)
- __`AGENTS.md`__ - Compiled output (generated)

## Categories

| # | Category | Rules | Prefix |
|---|----------|-------|--------|
| 1 | Provider Setup | 4 | `provider-` |
| 2 | Agent Hooks | 5 | `agent-` |
| 3 | Tool Rendering | 5 | `tool-` |
| 4 | Context & State | 4 | `state-` |
| 5 | Chat UI | 4 | `ui-` |
| 6 | Suggestions | 3 | `suggestions-` |

## Getting Started

```bash
pnpm install
pnpm build
pnpm validate
```

相关技能

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.