skills/chatlab-convert/SKILL.md
Convert unsupported local chat exports into validated ChatLab JSONL or JSON by inspecting their structure, writing and running a local Node.js or Python converter, and verifying record counts before import. Use when ChatLab cannot recognize a CSV, HTML, TXT, XML, SQLite/database, vendor-specific JSON/JSONL, archive, or other chat export format, or when a user asks an agent to adapt an unknown chat format for ChatLab.
npx skillsauth add hellodigua/chatlab chatlab-convertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convert an unsupported local export without modifying the source. Prefer a reproducible script and a validated JSONL result over a one-off rewritten file.
Install this skill with:
npx skills add ChatLab/ChatLab --skill chatlab-convert -g
99 and count the mapping explicitly.Resolve the exact source path. If several files could be the export, ask the user instead of guessing. Quote paths in every command.
chatlab --help
chatlab validate --help
chatlab formats
chatlab import "/absolute/path/to/source" --dry-run --json
If the dry run recognizes the source, do not convert it. Use chatlab-import for the supported file.
If chatlab is missing, or the installed version has no validate command:
npm install -g chatlab-cli@latest.scripts/validate-chatlab.mjs.chatlab formats and the source dry run, and state that native ChatLab support for the source format could not be checked.The bundled validator requires Node.js 20 or later. If node --version is also unavailable, the converter may still be written, but mark the result as “not yet validated” and guide the user to install Node.js and chatlab-cli. Do not install either without permission.
Do not replace either the CLI validator or bundled strict validator with visual inspection.
Start with file metadata, encoding, archive members, JSON keys, CSV headers, XML/HTML element names, or database table schemas. Do not run cat, unrestricted head, or SQL queries that print raw message columns.
When values must be sampled, write a short local inspector that outputs only:
<TEXT length=42>;For an archive, extract into the separate working directory and reject entries that escape it. For a database, open it read-only.
Read references/chatlab-format.md completely before writing the converter. Record the mapping from source fields to ChatLab fields, including:
Ask the user only when an ambiguity changes identity, conversation boundaries, timestamp meaning, or ownership. Do not guess those fields.
One ChatLab file represents one conversation. If the source contains multiple conversations, produce one output per conversation with collision-safe deterministic names; never merge them accidentally.
Prefer JSONL. Use JSON only for a small, naturally structured export where holding the full result in memory is clearly safe.
Choose the simplest installed runtime:
The converter must:
Default skipped to zero. Mapping an unknown message to type 99 is preservation, not a skipped record.
Run the converter on a bounded local sample or sample mode first. With the CLI available, validate that output with:
chatlab validate "/absolute/path/to/sample.jsonl" --json
Without the CLI, locate the directory containing this SKILL.md and use the bundled validator:
node "/absolute/path/to/chatlab-convert/scripts/validate-chatlab.mjs" "/absolute/path/to/sample.jsonl"
Fix every validation error before running the full conversion. Review warnings and explain why each is acceptable; do not ignore them automatically.
Run the full converter, then validate every generated file with the CLI or bundled validator. With the CLI available, also run the import dry run:
chatlab validate "/absolute/path/to/converted.jsonl" --json
chatlab import "/absolute/path/to/converted.jsonl" --dry-run --json
Without the CLI, run:
node "/absolute/path/to/chatlab-convert/scripts/validate-chatlab.mjs" "/absolute/path/to/converted.jsonl"
Keep the result levels distinct:
ok: true; converter and validator message counts match; source messages equal output messages plus explicitly accepted skipped records; and no source parse error was hidden.chatlab import --dry-run --json also returns ok: true.Without the CLI, report only “format validated.” Tell the user they can install the CLI later to run the dry-run or drag the result into ChatLab. Do not claim import validation passed.
Require all of the following before calling the result fully import validated:
ok: true;ok: true;If the user asked only to convert, stop after all validation available in the current environment. Report output and script paths, conversations, members, messages, skipped records, warnings, mapping limitations, and the validation level actually reached without quoting messages.
If the user explicitly asked to import, run the same validated file without --dry-run:
chatlab import "/absolute/path/to/converted.jsonl" --json
If the CLI is still unavailable, explain that automatic import requires chatlab-cli, recommend installation, and obtain permission before installing it. Never treat “format validated” as already imported.
For multiple outputs, preview and import each independently. Report every resulting session ID and count; do not delete the converter or converted files.
development
将 ChatLab 暂不支持的本地聊天导出转换为经过验证的 ChatLab JSONL 或 JSON:分析源文件结构,编写并运行本地 Node.js 或 Python 转换脚本,并在导入前核对记录数量。当 ChatLab 无法识别 CSV、HTML、TXT、XML、SQLite/数据库、厂商自定义 JSON/JSONL、压缩包等聊天导出,或用户要求 Agent 适配未知聊天格式时使用。
tools
Safely preview and import local chat export files into ChatLab through the chatlab CLI. Use when a user asks an external agent to import, re-import, or incrementally update ChatLab from a local QQ, WeChat, Telegram, WhatsApp, LINE, Discord, Instagram, Google Chat, ChatLab JSON/JSONL, or other supported chat export.
tools
通过 chatlab CLI 安全预览并将本地聊天导出文件导入 ChatLab。当用户要求外部 Agent 从本地 QQ、微信、Telegram、WhatsApp、LINE、Discord、Instagram、Google Chat、ChatLab JSON/JSONL 或其他受支持的聊天导出文件执行首次导入、重新导入或增量更新时使用。
tools
通过 chatlab CLI 分析本地 ChatLab 聊天记录。当用户要求外部 Agent 检查对话、查找证据、总结话题、比较成员,或基于已导入的 ChatLab 数据分析指定人物或群组关系时使用。