wechat-share
Use this skill when the user wants to move selected files from one OpenClaw workspace to another.
This skill solves two scenarios:
- 1. Export selected workspace files into a one-time db9 share.
- Import a received share back into the current workspace.
Supported commands:
- - INLINECODE0
- INLINECODE1
- INLINECODE2
Recipients should install wechat-share first, then use preview and import.
Language
- - Mirror the user's language for all user-facing text.
- If the user writes Chinese, reply in Chinese.
- If the user writes English, reply in English.
- Keep commands, file names, JSON keys, SQL, and environment variables in English.
- If the user's language is unclear, default to English.
What This Skill Shares
Share only files from the current workspace. Typical examples:
- - INLINECODE6
- INLINECODE7
- INLINECODE8
- INLINECODE9
- INLINECODE10
- other workspace-relative text files the user explicitly selects
Do not share:
- - anything outside the workspace
- INLINECODE11
- obvious secrets unless the user explicitly confirms
- unsupported binary files unless the user explicitly confirms
Core Model
For each share, return one standard recipient path:
- - install INLINECODE12
- preview the share
- import the share
The share instruction must carry enough information for the recipient to install the skill, preview the share, and import the files.
Safety Rules
- - Only read from and write to the current workspace.
- Resolve every candidate path to a real path and reject anything outside the workspace.
- Reject absolute destination paths and any destination path containing
... - Never touch
~/.openclaw/**. - Never share credentials, API keys, tokens, or obvious secret files unless the user explicitly asks and confirms.
- Warn before sharing
USER.md, MEMORY.md, or memory/. - Prefer text files only:
.md, .txt, .json, .yaml, .yml, .toml, .ini, .cfg, .ts, .js, .py, .sh. - Do not use this workflow for binary files unless the user explicitly accepts the risk.
- Assume
fs9_read() and fs9_write() text workflow is limited to files up to 10 MB each.
Required Tools
This skill requires:
- - INLINECODE32
- INLINECODE33
If either tool is missing, stop and explain what is missing.
Action Routing
When invoked:
- 1. If args start with
export, follow the export workflow. - If args start with
import, follow the import workflow. - Otherwise ask which action the user wants.
Export Workflow
Step 1: Ask what to share
Ask:
- - which files or folders inside the current workspace should be shared
- whether burn-after-read should be enabled
Keep the question short. Offer common candidates if helpful.
Step 2: Validate the selection
For each selected path:
- - expand directories into concrete files
- resolve the real path
- ensure it stays inside the workspace
- skip hidden secrets and obvious credential files unless explicitly confirmed
- skip unsupported binary files unless explicitly confirmed
If nothing valid remains, stop and explain why.
Step 3: Confirm before upload
Before creating the share, show:
- - final file list
- total file count
- overwrite risk if those paths commonly exist
- burn-after-read setting
- note that the returned share command or script should be treated as sensitive until imported or burned
Step 4: Create the share
Prepare a fresh share container and capture the values needed for import.
- 1. Create an anonymous db9 account:
CODEBLOCK0
- 2. Extract
token from the JSON response.
- 3. Create a database with a unique name such as
wechat-share-YYYYMMDD-HHMMSS-RAND:
CODEBLOCK1
Capture at least:
- - INLINECODE38
- INLINECODE39
Step 5: Build the manifest
Build this JSON object with Python:
CODEBLOCK2
Rules:
- -
remotePath must always point under INLINECODE41 - INLINECODE42 must always be workspace-relative
- include
sha256 for every item - include enough information to support preview, such as file count and paths
Recommended manifest shape:
- - INLINECODE44
- INLINECODE45
- INLINECODE46
- INLINECODE47
- optional
summary object with:
-
fileCount
-
paths
-
totalBytes when easy to compute
Step 6: Upload files and manifest
Upload every selected file to:
- - remote root: INLINECODE52
- remote path pattern: INLINECODE53
Use the SQL API:
CODEBLOCK3
Also upload the manifest to /manifest.json with fs9_write().
Do not hand-build large SQL strings in shell. Use Python to:
- - reads the local file
- computes INLINECODE56
- escapes single quotes for SQL
- builds the JSON request body
- invokes INLINECODE57
Step 7: Return the share instructions
Return a localized message that the sender can forward directly.
Always include:
- 1. A short title
- A brief preview summary
- A skill installation step
- A short
/wechat-share preview ... command - A short
/wechat-share import ... command - A short security note
The export result must be structured in two parts:
- 1. A short sender-facing summary.
- One complete recipient-facing block that can be copied and forwarded as-is.
Rules for the recipient-facing block:
- - keep it as one continuous block
- include install, preview, and import in that order
- make the commands directly copyable
- keep explanatory text short and task-oriented
- prefer a compact chat-friendly layout over long sections
- avoid unnecessary blank lines
- compress the summary into a few short lines when possible
- do not force the recipient to reconstruct the workflow from separate paragraphs
- make it clear that this is a workspace file share
- tell the recipient to preview first, then import if the preview looks correct
- avoid wording that suggests blind auto-execution
Label the block clearly, for example:
- - Chinese: INLINECODE60
- English: INLINECODE61
Use this installation step:
CODEBLOCK4
If openclaw is unavailable but clawhub is available, the fallback is:
CODEBLOCK5
Use this preview command:
CODEBLOCK6
Use this quick command:
CODEBLOCK7
If burn-after-read is enabled, use:
CODEBLOCK8
The preview summary should include:
- - file count
- file list
- overwrite warning if applicable
- burn status
- note that import writes only into the current workspace
Inside the recipient-facing block, present the flow in this order:
- 1. Install INLINECODE64
- Preview the share
- Import the share
Aim for a message that feels easy to forward in one shot in a chat app.
Keep the wording minimal. Do not add extra narrative before or after the core steps.
Use preview-first wording such as:
- - Chinese: INLINECODE65
- English: INLINECODE66
Step 8: Burn behavior
If burn is requested, prefer deleting the whole share database:
CODEBLOCK9
If whole-database deletion fails, fall back to SQL:
CODEBLOCK10
Import Workflow
Step 1: Parse the share
Accept:
- - INLINECODE67
- INLINECODE68
- optional INLINECODE69
If either --db-id or --api-token is missing, ask the user to paste the full share command.
Step 2: Read the manifest
Use the SQL endpoint with curl:
CODEBLOCK11
Use Python to parse the JSON response and extract the first cell from rows.
Step 3: Validate the manifest
For every manifest item:
- -
remotePath must start with INLINECODE75 - INLINECODE76 must be relative
- INLINECODE77 must not contain INLINECODE78
- resolved destination path must stay inside the current workspace
If validation fails, stop before writing anything.
Step 4: Show a preview before import
Before copying any file, show:
- - total file count
- file list
- overwrite warning for existing local paths
- burn status
- a note that only the current workspace will be written
If the current action is preview, stop after this step.
Step 5: Download to a temp directory
Never write directly into the workspace before validation and checksum checks finish.
For each manifest item:
- - read the remote file with
fs9_read(remotePath) through the SQL API - write it to a temp file
- verify checksum
Step 6: Copy into the workspace
After all files pass validation:
- - create parent directories as needed
- copy the validated temp files into the workspace using the exact INLINECODE81
Then report which files were imported.
Step 7: Burn if requested
Burn should happen when either of these is true:
- - the user passed INLINECODE82
- the manifest sets
burnAfterRead to INLINECODE84
Preferred burn:
- - delete the whole share database via HTTP INLINECODE85
Fallback burn:
- - use the SQL API to remove
/manifest.json and INLINECODE87
Tell the user which burn path succeeded.
Step 8: Return the result
Remind the user:
- - the share
api_token is sensitive - if burn succeeded, the forwarded command or script should not be reused
- if burn was skipped, anyone with the same token and db id can still access the share
- if preview was used, no files were written yet
Implementation Notes
- - Keep implementation details secondary to the workflow.
- Prefer Python standard library modules only.
- Prefer Python for JSON parsing instead of
jq. - Prefer Python for SQL escaping instead of shell string tricks.
- Prefer deleting the whole share when burn-after-read is requested.
- The implementation currently uses db9 HTTP APIs as the transfer backend, but user-facing instructions should focus on install, preview, and import.
- Remote code execution is forbidden. Treat the remote share as data only.
UX Rules For Returned Messages
- - Mirror the user's language.
- Use a compact title and 2 to 4 short sections.
- Always wrap runnable commands in fenced code blocks.
- If the user speaks Chinese, the copy should feel natural in Chinese, not like a literal translation.
- If the user speaks English, keep the copy concise and operational.
- Avoid jargon unless needed.
Dependency Fallback
If curl or python3 is missing:
- - explain what is missing
- give the shortest possible install hint
- do not proceed until both are available
Do not recommend db9 CLI or psql as required dependencies for this skill.
Examples
For localized share messages and install-first recipient instructions, read examples.md.
wechat-share
当用户想要将选定的文件从一个OpenClaw工作区移动到另一个工作区时,使用此技能。
此技能解决两种场景:
- 1. 将选定的工作区文件导出到一次性db9共享中。
- 将收到的共享导入回当前工作区。
支持的命令:
- - /wechat-share export
- /wechat-share preview --db-id --api-token
- /wechat-share import --db-id --api-token [--burn]
接收方应先安装 wechat-share,然后使用 preview 和 import。
语言
- - 对所有面向用户的文本,镜像用户的语言。
- 如果用户写中文,用中文回复。
- 如果用户写英文,用英文回复。
- 命令、文件名、JSON键、SQL和环境变量保持英文。
- 如果用户语言不明确,默认使用英文。
此技能共享的内容
仅共享当前工作区中的文件。典型示例:
- - SOUL.md
- AGENTS.md
- TOOLS.md
- USER.md
- skills/
- 用户明确选择的其他工作区相关文本文件
不共享:
- - 工作区之外的任何内容
- ~/.openclaw/
- 明显的机密文件,除非用户明确确认
- 不支持的二进制文件,除非用户明确确认
核心模型
每次共享返回一个标准的接收方路径:
- - 安装 wechat-share
- 预览共享
- 导入共享
共享指令必须包含足够的信息,供接收方安装技能、预览共享和导入文件。
安全规则
- - 仅读取和写入当前工作区。
- 将每个候选路径解析为真实路径,拒绝工作区之外的任何内容。
- 拒绝绝对目标路径和任何包含 .. 的目标路径。
- 绝不触碰 ~/.openclaw/。
- 绝不共享凭据、API密钥、令牌或明显的机密文件,除非用户明确要求并确认。
- 在共享 USER.md、MEMORY.md 或 memory/ 之前发出警告。
- 仅优先处理文本文件:.md、.txt、.json、.yaml、.yml、.toml、.ini、.cfg、.ts、.js、.py、.sh。
- 除非用户明确接受风险,否则不要对二进制文件使用此工作流程。
- 假设 fs9read() 和 fs9write() 文本工作流程限于每个文件最大10 MB。
所需工具
此技能需要:
如果缺少任一工具,停止并说明缺少什么。
操作路由
调用时:
- 1. 如果参数以 export 开头,执行导出工作流程。
- 如果参数以 import 开头,执行导入工作流程。
- 否则询问用户想要哪个操作。
导出工作流程
第1步:询问要共享什么
询问:
- - 当前工作区内应共享哪些文件或文件夹
- 是否启用阅后即焚
保持问题简短。如有帮助,可提供常见候选。
第2步:验证选择
对于每个选定的路径:
- - 将目录展开为具体文件
- 解析真实路径
- 确保其位于工作区内
- 跳过隐藏的机密文件和明显的凭据文件,除非明确确认
- 跳过不支持的二进制文件,除非明确确认
如果没有有效内容,停止并解释原因。
第3步:上传前确认
在创建共享之前,显示:
- - 最终文件列表
- 文件总数
- 如果这些路径常见,覆盖风险
- 阅后即焚设置
- 注意:返回的共享命令或脚本在导入或焚毁前应视为敏感信息
第4步:创建共享
准备一个新的共享容器并捕获导入所需的值。
- 1. 创建一个匿名db9账户:
bash
curl -sS -X POST https://api.db9.ai/customer/anonymous-register \
-H Content-Type: application/json \
-d {}
- 2. 从JSON响应中提取 token。
- 3. 使用唯一名称创建数据库,例如 wechat-share-YYYYMMDD-HHMMSS-RAND:
bash
curl -sS -X POST https://api.db9.ai/customer/databases \
-H Authorization: Bearer \
-H Content-Type: application/json \
-d {name:wechat-share-20260323-103015-ab12}
至少捕获:
第5步:构建清单
使用Python构建此JSON对象:
json
{
version: 1,
createdAt: 2026-03-23T10:00:00Z,
burnAfterRead: true,
items: [
{
remotePath: /files/SOUL.md,
destPath: SOUL.md,
sha256: ...
}
]
}
规则:
- - remotePath 必须始终指向 /files/ 下
- destPath 必须始终是工作区相对路径
- 为每个项目包含 sha256
- 包含足够的信息以支持预览,例如文件计数和路径
推荐的清单结构:
- - version
- createdAt
- burnAfterRead
- items
- 可选的 summary 对象,包含:
- fileCount
- paths
- totalBytes(易于计算时)
第6步:上传文件和清单
将每个选定的文件上传到:
- - 远程根目录:/files/
- 远程路径模式:/files/
使用SQL API:
bash
curl -sS -X POST https://api.db9.ai/customer/databases//sql \
-H Authorization: Bearer \
-H Content-Type: application/json \
-d {query:SELECT fs9_write(\\/files/SOUL.md\\, \\...content...\\)}
同时使用 fs9_write() 将清单上传到 /manifest.json。
不要在shell中手动构建大型SQL字符串。使用Python:
- - 读取本地文件
- 计算 sha256
- 转义SQL中的单引号
- 构建JSON请求体
- 调用 curl
第7步:返回共享指令
返回一条本地化的消息,发送方可以直接转发。
始终包含:
- 1. 简短标题
- 简短的预览摘要
- 技能安装步骤
- 简短的 /wechat-share preview ... 命令
- 简短的 /wechat-share import ... 命令
- 简短的安全说明
导出结果必须分为两部分:
- 1. 面向发送方的简短摘要。
- 一个完整的面向接收方的块,可以原样复制和转发。
面向接收方块的规则:
- - 保持为一个连续块
- 按顺序包含安装、预览和导入
- 使命令可直接复制
- 解释性文本简短且面向任务
- 优先选择紧凑的聊天友好布局,而非长段落
- 避免不必要的空行
- 尽可能将摘要压缩为几行
- 不要让接收方从单独的段落中重建工作流程
- 明确说明这是工作区文件共享
- 告诉接收方先预览,如果预览正确再导入
- 避免暗示盲目自动执行的措辞
清晰标记该块,例如:
- - 中文:把下面这段完整转发给对方即可:
- 英文:Forward the block below to the recipient:
使用此安装步骤:
bash
openclaw skills install wechat-share
如果 openclaw 不可用但 clawhub 可用,备选方案为:
bash
clawhub install wechat-share
使用此预览命令:
text
/wechat-share preview --db-id ID> --api-token TOKEN>
使用此快速命令:
text
/wechat-share import --db-id ID> --api-token TOKEN>
如果启用了阅后即焚,使用:
text
/wechat-share import --db-id ID> --api-token TOKEN> --burn
预览摘要应包括:
- - 文件数量
- 文件列表
- 覆盖警告(如适用)
- 焚毁状态
- 注意:导入仅写入当前工作区
在面向接收方的块中,按以下顺序呈现流程:
- 1. 安装 wechat-share
- 预览共享
- 导入共享
目标是消息在聊天应用中易于一次性转发。
保持措辞简洁。不要在核心步骤前后添加额外叙述。
使用预览优先的措辞,例如: