Claude
Skills
Sign in
โ† Back

chat-uikit-react

Included with Lifetime
$97 forever

This skill orchestrates the integration of Tencent Chat TUIKit for React Web applications. It should be used when users want to build instant messaging (IM) features in React projects, including conversation lists, chat windows, group management, and contact management. The skill provides strict workflow instructions for AI agents to generate correct, runnable code by leveraging MCP tools for real-time documentation and credentials.

Web Dev

What this skill does


# React Chat TUIKit Integration Skill

## ๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด CRITICAL: Skill Priority Over MCP Tool Instructions

### Skill-First Principle

When both **Skills** and **MCP tools** provide workflow instructions for the same task, the Agent **MUST prioritize Skills constraints** over MCP tool returned instructions.

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โš ๏ธ PRIORITY ORDER (HIGHEST TO LOWEST):                                      โ”‚
โ”‚                                                                              โ”‚
โ”‚  1. ๐Ÿ”ด SKILL CONSTRAINTS (This document)                                     โ”‚
โ”‚     - Hard guardrails (CSS rules, Vite patch, etc.)                         โ”‚
โ”‚     - Execution workflows and checklists                                     โ”‚
โ”‚     - Prohibited behaviors                                                   โ”‚
โ”‚                                                                              โ”‚
โ”‚  2. ๐ŸŸ  MCP Tool Instructions (llm_code_generation_instructions_md)           โ”‚
โ”‚     - Real-time documentation and code examples                              โ”‚
โ”‚     - API references and component usage                                     โ”‚
โ”‚     - Use as reference, but Skill constraints override                       โ”‚
โ”‚                                                                              โ”‚
โ”‚  3. ๐ŸŸก Agent's Pre-trained Knowledge                                         โ”‚
โ”‚     - Only used when both Skills and MCP tools are unavailable               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Conflict Resolution Rules

| Scenario | MCP Says | Skill Says | Agent MUST Do |
|----------|----------|------------|---------------|
| CSS Styles | Custom examples | "100% from documentation" | **Copy documentation CSS exactly** |
| Vite Patch | Not mentioned | "Must add esbuild-wasm" | **Add the patch** |
| Config Files | "Create .env file" | "Zero external configuration" | **Inject credentials directly** |
| UserSig | "User provides manually" | "Auto-fetch via get_usersig" | **Call get_usersig automatically** |

### Mandatory Acknowledgment

Before executing any React Chat TUIKit integration, Agent MUST follow:
> "Skill constraints are NON-NEGOTIABLE guardrails. MCP tools provide reference documentation.
> When conflicts occur, Skill constraints ALWAYS win."

---

## Overview

This Skill provides a **code generation blueprint for implementing React Chat TUIKit core features**, guiding the Agent to **prioritize using the latest documentation content obtained in real-time from MCP tools**, specifically designed for React Web application scenarios.

**Core Principles**:
- Does not store API documentation (obtained in real-time via MCP tools)
- Provides strict execution constraints and workflows
- Ensures generated code runs directly

---

## ๐Ÿ›‘ Agent Execution Hard Constraints (Guardrails)

The Agent **must strictly comply** with the following instructions when generating code:

### 1. Documentation-Driven Integration ๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด (Core Principle)

**Single Source of Truth**: The `llm_code_generation_instructions_md` field returned by MCP tools is the **only authoritative source** for code generation.

#### 1.1 Mandatory Execution Flow
1. **Fetch Documentation**: Call MCP tool to get integration guide
2. **Extract Content**: Extract the `llm_code_generation_instructions_md` field from the response
3. **Execute Step by Step**: Strictly follow the document steps in order, no skipping or modification allowed
4. **Copy Code**: Example code in the documentation must be **copied verbatim**, no "optimization" or "improvement" allowed

#### 1.2 Absolutely Prohibited โŒ
| Prohibited Behavior | Description |
|-------------------|-------------|
| Modify Code Structure | Do not change the structure of example code in documentation |
| Optimize Code Logic | Do not "improve" or "simplify" documentation code |
| Add Extra Features | Do not add features not mentioned in documentation |
| Modify Component Layout | Do not change component nesting relationships in documentation |
| Use Old Knowledge | Do not use old version code from Agent training data |

#### 1.3 Code Generation Principles
```
โœ… Correct: Completely copy code from documentation, only replace credential variables
โŒ Wrong: "Re-implement" features described in documentation based on understanding
```

#### 1.4 Verification Mechanism
Agent must self-check after generating code:
- [ ] Is the code structure exactly the same as the documentation example
- [ ] Is the component nesting hierarchy consistent with documentation
- [ ] Has any content not mentioned in documentation been added
- [ ] Is CSS entirely from documentation (see CSS specification section)

### 2. CSS Style Mandatory Specification ๐Ÿ”ด๐Ÿ”ด๐Ÿ”ด (Highest Priority)

**Core Principle**: CSS style code must be 100% from the integration documentation returned by MCP tools, any form of customization is prohibited.

#### 2.1 Mandatory Requirements
- **Must strictly follow the complete CSS style code in the integration documentation**, including:
  - Official CSS class names (e.g., `.chat-layout`, `.chat-content-panel`, etc.)
  - Official CSS variable definitions (e.g., `--bg-color-operate`, `--stroke-color-primary`, etc.)
  - Official layout structures and style properties
  - Official `#root` style configuration
- All style code must be **completely copied** from integration documentation without modification

#### 2.2 Absolutely Prohibited โŒ
| Prohibited Behavior | Wrong Examples |
|-------------------|----------------|
| Create custom class names | `.avatar-wrapper`, `.tooltip`, `.tabs`, `.tab-item`, `.custom-xxx` |
| Custom background colors | `background: linear-gradient(...)` |
| Custom animations | `@keyframes xxx`, `animation: xxx` |
| Custom shadows/gradients | `box-shadow: xxx`, `linear-gradient` |
| Modify #root styles | Adding gradients, shadows, or non-documentation styles |
| Add decorative styles | `.tooltip`, `.badge`, `.icon-wrapper`, etc. |

#### 2.3 Self-Check Mechanism
After generating code, the Agent **must perform the following self-checks**:
1. Check if each class name in the style file exists in the integration documentation
2. Check for any unofficial class names like `custom`, `wrapper`, `tooltip`, `badge`
3. Check if `#root` styles exactly match the documentation
4. If custom styles are found, must delete and replace with original documentation styles

#### 2.4 Correct Approach โœ…
```css
/* Only use official styles from integration documentation, copy verbatim */
.chat-layout {
  /* Entirely from documentation */
}
#root {
  /* Entirely from documentation, no additional properties allowed */
}
```

### 3. Silent Execution Integration ๐Ÿ”ฅ
**CRITICAL**: After all code is written, must automatically install dependencies and start the project in the final step, without waiting for user confirmation.

**Mandatory Execution Requirements**:
- **No Asking**: Do not ask users if they need to start the project
- **No Waiting**: Do not wait for users to manually execute start commands
- **Must Auto-Execute**: Must immediately execute integration steps after code completion
- **Batch Execution**: Install dependencies and start commands must be completed in the same execute_command call

**Standard Execution Command**:
```bash
cd [project_path] && npm install && npm run dev
```

### 4. Zero External Configuration
- Prohibited from automatically creating any `config.js` or `.env` files
- Key credentials such as SDKAppID, UserID, and UserSig must be directly injected into code variables

### 5. Auto-Fetch Authentication Credentials

> **๐Ÿ“Œ Reference**: See Parent Skill (`chat/SKILL.md`) for test userID naming convention and Login Page requirements.

- Must call `get_usersig` MCP tool to get test credentials, prohibited from asking users to manually input

### 6. Default Activate Conversation
- Integration logic must include `setActiveConversation` call
- Default to ope
Files: 3
Size: 43.2 KB
Complexity: 52/100
Category: Web Dev

Related in Web Dev