Live Chat
Skill Profile
(Select at least one profile to enable specific modules)
Overview
Live chat implementation enables real-time communication between users and support agents, providing instant customer support and improving user satisfaction. Effective live chat systems handle real-time messaging, typing indicators, file sharing, chat history, and agent assignment.
Why This Matters
Core Concepts
Inputs / Outputs / Contracts
- Inputs:
- <e.g., env vars, request payload, file paths, schema>
- Entry Conditions:
- <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>
- Outputs:
- <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>
- Artifacts Required (Deliverables):
- <e.g., Code Diff, Unit Tests, Migration Script, API Docs>
- Acceptance Evidence:
- <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>
- Success Criteria:
- <e.g., p95 < 300ms, coverage ≥ 80%>
Skill Composition
- Depends on: None
- Compatible with: None
- Conflicts with: None
- Related Skills: None
Quick Start
Assumptions / Constraints / Non-goals
- Assumptions:
- Development environment is properly configured
- Required dependencies are available
- Team has basic understanding of domain
- Constraints:
- Must follow existing codebase conventions
- Time and resource limitations
- Compatibility requirements
- Non-goals:
- This skill does not cover edge cases outside scope
- Not a replacement for formal training
Compatibility & Prerequisites
- Supported Versions:
- Python 3.8+
- Node.js 16+
- Modern browsers (Chrome, Firefox, Safari, Edge)
- Required AI Tools:
- Code editor (VS Code recommended)
- Testing framework appropriate for language
- Version control (Git)
- Dependencies:
- Language-specific package manager
- Build tools
- Testing libraries
- Environment Setup:
.env.example keys: API_KEY, DATABASE_URL (no values)
Test Scenario Matrix (QA Strategy)
| Type |
Focus Area |
Required Scenarios / Mocks |
| Unit |
Core Logic |
Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |
| Integration |
DB / API |
All external API calls or database connections must be mocked during unit tests |
| E2E |
User Journey |
Critical user flows to test |
| Performance |
Latency / Load |
Benchmark requirements |
| Security |
Vuln / Auth |
SAST/DAST or dependency audit |
| Frontend |
UX / A11y |
Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |
Technical Guardrails & Security Threat Model
1. Security & Privacy (Threat Model)
- Top Threats: Injection attacks, authentication bypass, data exposure
2. Performance & Resources
3. Architecture & Scalability
4. Observability & Reliability
Agent Directives & Error Recovery
(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)
- Thinking Process: Analyze root cause before fixing. Do not brute-force.
- Fallback Strategy: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.
- Self-Review: Check against Guardrails & Anti-patterns before finalizing.
- Output Constraints: Output ONLY the modified code block. Do not explain unless asked.
Definition of Done (DoD) Checklist
Anti-patterns
Reference Links & Examples
- Internal documentation and examples
- Official documentation and best practices
- Community resources and discussions
Versioning & Changelog
- Version: 1.0.0
- Changelog:
- 2026-02-22: Initial version with complete template structure
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: live-chat3description: Live chat implementation enables real-time communication between users Use when this capability is needed.4---56# Live Chat78## Skill Profile9*(Select at least one profile to enable specific modules)*10- [ ] **DevOps**11- [x] **Backend**12- [ ] **Frontend**13- [ ] **AI-RAG**14- [ ] **Security Critical**1516## Overview17Live chat implementation enables real-time communication between users and support agents, providing instant customer support and improving user satisfaction. Effective live chat systems handle real-time messaging, typing indicators, file sharing, chat history, and agent assignment.1819---2021---2223## Why This Matters24- **<Benefit>**: <short explanation>25- **<Benefit>**: <short explanation>26- **<Benefit>**: <short explanation>2728## Core Concepts29#3031## Inputs / Outputs / Contracts32* **Inputs**:33 - <e.g., env vars, request payload, file paths, schema>34* **Entry Conditions**:35 - <Pre-requisites: e.g., Repo initialized, DB running, specific branch checked out>36* **Outputs**:37 - <e.g., artifacts (PR diff, docs, tests, dashboard JSON)>38* **Artifacts Required (Deliverables)**:39 - <e.g., Code Diff, Unit Tests, Migration Script, API Docs>40* **Acceptance Evidence**:41 - <e.g., Test Report (screenshot/log), Benchmark Result, Security Scan Report>42* **Success Criteria**:43 - <e.g., p95 < 300ms, coverage ≥ 80%>4445## Skill Composition46* **Depends on**: None47* **Compatible with**: None48* **Conflicts with**: None49* **Related Skills**: None5051## Quick Start52#5354## Assumptions / Constraints / Non-goals5556* **Assumptions**:57 - Development environment is properly configured58 - Required dependencies are available59 - Team has basic understanding of domain60* **Constraints**:61 - Must follow existing codebase conventions62 - Time and resource limitations63 - Compatibility requirements64* **Non-goals**:65 - This skill does not cover edge cases outside scope66 - Not a replacement for formal training676869## Compatibility & Prerequisites7071* **Supported Versions**:72 - Python 3.8+73 - Node.js 16+74 - Modern browsers (Chrome, Firefox, Safari, Edge)75* **Required AI Tools**:76 - Code editor (VS Code recommended)77 - Testing framework appropriate for language78 - Version control (Git)79* **Dependencies**:80 - Language-specific package manager81 - Build tools82 - Testing libraries83* **Environment Setup**:84 - `.env.example` keys: `API_KEY`, `DATABASE_URL` (no values)858687## Test Scenario Matrix (QA Strategy)8889| Type | Focus Area | Required Scenarios / Mocks |90| :--- | :--- | :--- |91| **Unit** | Core Logic | Must cover primary logic and at least 3 edge/error cases. Target minimum 80% coverage |92| **Integration** | DB / API | All external API calls or database connections must be mocked during unit tests |93| **E2E** | User Journey | Critical user flows to test |94| **Performance** | Latency / Load | Benchmark requirements |95| **Security** | Vuln / Auth | SAST/DAST or dependency audit |96| **Frontend** | UX / A11y | Accessibility checklist (WCAG), Performance Budget (Lighthouse score) |979899## Technical Guardrails & Security Threat Model100101### 1. Security & Privacy (Threat Model)102* **Top Threats**: Injection attacks, authentication bypass, data exposure103- [ ] **Data Handling**: Sanitize all user inputs to prevent Injection attacks. Never log raw PII104- [ ] **Secrets Management**: No hardcoded API keys. Use Env Vars/Secrets Manager105- [ ] **Authorization**: Validate user permissions before state changes106107### 2. Performance & Resources108- [ ] **Execution Efficiency**: Consider time complexity for algorithms109- [ ] **Memory Management**: Use streams/pagination for large data110- [ ] **Resource Cleanup**: Close DB connections/file handlers in finally blocks111112### 3. Architecture & Scalability113- [ ] **Design Pattern**: Follow SOLID principles, use Dependency Injection114- [ ] **Modularity**: Decouple logic from UI/Frameworks115116### 4. Observability & Reliability117- [ ] **Logging Standards**: Structured JSON, include trace IDs `request_id`118- [ ] **Metrics**: Track `error_rate`, `latency`, `queue_depth`119- [ ] **Error Handling**: Standardized error codes, no bare except120- [ ] **Observability Artifacts**:121 - **Log Fields**: timestamp, level, message, request_id122 - **Metrics**: request_count, error_count, response_time123 - **Dashboards/Alerts**: High Error Rate > 5%124125126## Agent Directives & Error Recovery127*(ข้อกำหนดสำหรับ AI Agent ในการคิดและแก้ปัญหาเมื่อเกิดข้อผิดพลาด)*128129- **Thinking Process**: Analyze root cause before fixing. Do not brute-force.130- **Fallback Strategy**: Stop after 3 failed test attempts. Output root cause and ask for human intervention/clarification.131- **Self-Review**: Check against Guardrails & Anti-patterns before finalizing.132- **Output Constraints**: Output ONLY the modified code block. Do not explain unless asked.133134135## Definition of Done (DoD) Checklist136137- [ ] Tests passed + coverage met138- [ ] Lint/Typecheck passed139- [ ] Logging/Metrics/Trace implemented140- [ ] Security checks passed141- [ ] Documentation/Changelog updated142- [ ] Accessibility/Performance requirements met (if frontend)143144145## Anti-patterns146#147148## Reference Links & Examples149150* Internal documentation and examples151* Official documentation and best practices152* Community resources and discussions153154155## Versioning & Changelog156157* **Version**: 1.0.0158* **Changelog**:159 - 2026-02-22: Initial version with complete template structure160161---162> Converted and distributed by [TomeVault](https://tomevault.io/claim/amnadtaowsoam) — claim your Tome and manage your conversions.163<!-- tomevault:4.0:skill_md:2026-04-13 -->