Feishu Backup Skill
Backup directory: INLINECODE0
Strict rules (must be followed — violations are treated as critical errors):
- - Do not use write/edit tools to create or modify any files
- Do not create Python scripts, test scripts, or any auxiliary files
- Do not generate, guess, or fabricate file contents and write them to disk — even if the filename is known
- Only run
feishu_backup.sh via exec to download real files - Must verify that the script outputs
SUCCESS: /path/to/file and that the file exists with size > 0 - If the script reports
ERROR, inform the user honestly — do not fabricate a success status
Smart Matching: Interpret Intent → Set Variables → Call Script
The agent interprets the user's natural language, determines intent, sets the corresponding environment variables, then calls the script.
| User says | Environment variables |
|---|
| "Back up the latest file" / "Back up this file" | (default, no variables needed) |
| "Back up the last two files" / "Back up these two files" |
LIMIT=2 |
| "Back up files starting with report" |
NAME_PREFIX=report |
| "Back up files with contract in the name" |
NAME_CONTAINS=contract |
| "Back up the PDF I just uploaded" / "Back up the PDF from just now" |
MINUTES=5 FILE_TYPE=pdf |
| "Back up the video I just uploaded" |
MINUTES=5 FILE_TYPE=video |
| "Back up the image I just uploaded" |
MINUTES=5 FILE_TYPE=image |
| "Back up the last three files" |
LIMIT=3 MINUTES=10 |
| "Back up all PDFs from the last 5 minutes" |
MINUTES=5 FILE_TYPE=pdf LIMIT=5 |
FILE_TYPE values: pdf / image / video / doc / file (default — matches all)
Invocation
CODEBLOCK0
Script prints SUCCESS: /path/to/file for each file on success.
Important: The script downloads real binary files from the Feishu API. The downloaded file size should match the original. If a backup file is unexpectedly small (e.g. a few KB), something went wrong — report the error to the user honestly.
List Backups
CODEBLOCK1
Feishu 备份技能
备份目录:~/.openclaw/doc/backup/
严格规则(必须遵守——违反将被视为严重错误):
- - 不得使用写入/编辑工具创建或修改任何文件
- 不得创建 Python 脚本、测试脚本或任何辅助文件
- 不得生成、猜测或捏造文件内容并写入磁盘——即使文件名已知
- 仅能通过 exec 运行 feishu_backup.sh 来下载真实文件
- 必须验证脚本输出 SUCCESS: /path/to/file,且文件存在且大小大于 0
- 如果脚本报告 ERROR,请如实告知用户——不得捏造成功状态
智能匹配:解析意图 → 设置变量 → 调用脚本
代理解析用户的自然语言,确定意图,设置相应的环境变量,然后调用脚本。
| 用户表述 | 环境变量 |
|---|
| 备份最新文件 / 备份这个文件 | (默认,无需变量) |
| 备份最近两个文件 / 备份这两个文件 |
LIMIT=2 |
| 备份以 report 开头的文件 | NAME_PREFIX=report |
| 备份名称中包含 contract 的文件 | NAME_CONTAINS=contract |
| 备份我刚上传的 PDF / 备份刚才的 PDF | MINUTES=5 FILE_TYPE=pdf |
| 备份我刚上传的视频 | MINUTES=5 FILE_TYPE=video |
| 备份我刚上传的图片 | MINUTES=5 FILE_TYPE=image |
| 备份最近三个文件 | LIMIT=3 MINUTES=10 |
| 备份最近 5 分钟内的所有 PDF | MINUTES=5 FILE_TYPE=pdf LIMIT=5 |
FILE_TYPE 取值:pdf / image / video / doc / file(默认——匹配所有类型)
调用方式
bash
默认:备份最新文件
DIR>/feishubackup.sh
备份最近 2 个文件
LIMIT=2 DIR>/feishubackup.sh
备份名称以 report 开头的文件
NAMEPREFIX=report DIR>/feishu_backup.sh
备份最近 5 分钟内上传的 PDF
MINUTES=5 FILETYPE=pdf DIR>/feishu_backup.sh
备份最近 10 分钟内最多 3 个文件
LIMIT=3 MINUTES=10 DIR>/feishubackup.sh
脚本成功时,每个文件会输出 SUCCESS: /path/to/file。
重要:脚本从飞书 API 下载真实的二进制文件。下载的文件大小应与原始文件一致。如果备份文件意外很小(例如几 KB),说明出了问题——请如实向用户报告错误。
列出备份
bash
ls -lht ~/.openclaw/doc/backup/