building-chat-widgets

Build interactive ChatKit chat widgets with client and server action handlers.

9|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill building-chat-widgets-abdullahmalik17
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: building-chat-widgets
Source: https://github.com/AbdullahMalik17/Hacathan_5/tree/main/.claude/skills/building-chat-widgets
Command: npx skills add https://github.com/AbdullahMalik17/Hacathan_5 --skill building-chat-widgets-abdullahmalik17

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Building interactive AI chat interfaces requires coordinating widget templates, action handlers, entity tagging, and backend event streaming, and small mistakes like using action.arguments instead of action.payload cause runtime errors that are hard to diagnose. ## Core Features & Use Cases - Widget Action Handling: Implement client-side onAction callbacks for navigation and local state, plus server-side action() methods that replace widgets, stream assistant messages, and emit client effects. - Entity Tagging and Composer Tools: Add @mention entity search with onTagSearch and mode-switching composer tools routed to different backend agents. - Error Prevention Guidance: Documents common pitfalls such as missing UserMessageItem fields, wrong content types, and RequestContext wrapping mistakes. - Use Case: You are building a support chat where the agent shows a list of articles as clickable widgets; this Skill shows how to render the ListView, handle item selection on the server, and update the widget state. ## Quick Start Ask the AI to build an interactive chat widget with clickable buttons and a server-handled selection action using the ChatKit patterns in this Skill.

Frequently Asked Questions about building-chat-widgets

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle widget button clicks in ChatKit?▼

Widget button clicks are dispatched through the onClickAction defined in the widget template. Actions with handler "client" are processed in the frontend onAction callback, while handler "server" actions go to the backend action() method on ChatKitServer.

How do I add @mention entity tagging to a chat interface?▼

Entity tagging uses the entities configuration in useChatKit with an onTagSearch callback that returns matching Entity objects for a query. You can also define an onClick handler to navigate when a user clicks a tagged entity.

Why does my ChatKit action handler throw AttributeError on arguments?▼

The Action object has no attribute named arguments; the correct field is action.payload, which holds the action data dictionary. This is one of the most common implementation mistakes documented in the references.

What is the difference between client and server widget action handlers?▼

Client handlers run in the frontend onAction callback and suit navigation or local state updates. Server handlers run in the backend action() method and are used for data mutation, widget replacement, and streaming assistant messages or client effects.

Why does creating a UserMessageItem fail with validation errors?▼

UserMessageItem requires id, thread_id, created_at, content, and inference_options fields, and the content must use type "input_text" rather than "text". Omitting any required field or using the wrong content type triggers ValidationError.