Sticker Manager
Manage a local sticker / reaction-image library with keyword lookup, quality checks, semantic tags, batch import/collection workflows, and media sending support.
Authors:
- - Wenzhuang Zhu
- TetraClaw (丁蟹)
Repository / backup source:
- - GitHub: https://github.com/TetraClaw/sticker-manager
- If ClawHub is unavailable, use GitHub as the fallback download source.
What this skill does
- 1. Save the latest inbound image or GIF into a local library
- Save a specific image from recent chat/media history
- Search stickers by keyword
- Rename or delete existing stickers
- Clean very low-quality files
- Tag stickers with emotions / scenes / keywords / descriptions
- Recommend a sticker based on direct text context or recent chat history
- Batch-collect stickers toward a target count with dedupe and low-quality filtering
- Batch-import stickers from local directories
- Prepare vision-model plans for semantic tagging and image understanding
- Return resolved file paths so the assistant can send matched media with the
message tool
Supported formats
Default paths
- - Sticker library: INLINECODE1
- Inbound media: INLINECODE2
Environment overrides:
- - INLINECODE3
- INLINECODE4
- INLINECODE5
- INLINECODE6
Typical use cases
1. Save a sticker
When the user sends an image/GIF and says things like:
- - "save sticker"
- "store this"
- "save this image"
- "save the previous image"
- "save that image from chat history"
Basic save:
CODEBLOCK0
Save from recent media history:
CODEBLOCK1
Quality-aware save:
CODEBLOCK2
If no name is provided, save_sticker_auto.py exits with code 2 and returns analysis markers so the assistant can ask a model to name the image.
2. Search a sticker
Command:
CODEBLOCK3
List all stickers:
CODEBLOCK4
Matching order:
- - exact filename match
- partial filename match
- fuzzy containment match
3. Rename / delete / clean
Rename:
CODEBLOCK5
Delete:
CODEBLOCK6
Clean very small files:
CODEBLOCK7
4. Tag and recommend
Add tags:
CODEBLOCK8
Suggest for direct context:
CODEBLOCK9
List tag database:
CODEBLOCK10
Prepare model payload only:
CODEBLOCK11
Recommend from chat history:
CODEBLOCK12
5. Batch collect / import / discover
Collect from URLs or local files:
CODEBLOCK13
If the final count is below target, the command exits with code 2 and prints NEED_MORE=....
Import from local directories:
CODEBLOCK14
Discover sources from directories, URLs, or pages:
CODEBLOCK15
Default discovery is lightweight:
- - local directories are scanned immediately
- remote image URLs are returned as
pending unless --fetch-urls is used - page discovery only counts successfully extracted image URLs
Animation rule (mandatory):
- - If the source is originally animated, prefer downloading the animated asset itself.
- Use a generic decision path: file suffix → HTTP Content-Type → downloaded file content validation.
- Do not silently downgrade animated sources to static WEBP/PNG previews.
- If a source looks animated by reference/content-type but the downloaded file validates as static, reject it from the animated batch instead of pretending it is a GIF.
- Before sending or importing a GIF batch, verify the saved file is actually animated-capable rather than a static preview.
6. Auto-tagging and vision planning
Generate a vision plan for a single file:
CODEBLOCK16
Generate plans for a directory:
CODEBLOCK17
Standalone vision fallback plan:
CODEBLOCK18
This returns a JSON plan with:
- - image path
- candidate vision models
- prompt goal
- fallback failure message
Suggested default model order:
- 1. INLINECODE13
- INLINECODE14
Sending workflow
After resolving a file path, send it with the message tool.
Example:
CODEBLOCK19
If you need to reply to a specific message, pass replyTo="<message_id>".
Quality rules
The auto-save flow checks media size before saving.
| Level | File size | Action |
|---|
| High | >= 50KB | save directly |
| Good |
>= 20KB | save directly |
| Medium | >= 10KB | save directly |
| Low | >= 5KB | usable, but lower confidence |
| Too low | < 5KB | reject unless forced |
Force-save example:
CODEBLOCK20
Notes for agents
- - Prefer semantic names over timestamp-heavy names
- Avoid platform-specific hardcoding in skill logic
- Use environment variables for library location overrides
- Keep send logic in the assistant/tool layer, not inside raw scripts when possible
- Validate file existence before sending
- For image meaning extraction, try the configured vision-capable model chain in INLINECODE17
- If the primary image model fails, try fallback models before giving up
- If all vision models fail, explicitly tell the user that image meaning, semantic tagging, and quality validation could not be completed reliably
- Treat
__MODEL_MATCH__, __AUTO_TAG__, __SEMANTIC_BATCH__, __ANALYZE_HISTORY__, and __CONTEXT_RECOMMEND__ markers as structured handoff payloads for the outer assistant layer
Files
- -
scripts/common.py - shared path, i18n, and vision-plan helpers - INLINECODE24 - keyword lookup and inventory list
- INLINECODE25 - rename, delete, and cleanup
- INLINECODE26 - basic save from inbound or history media
- INLINECODE27 - quality-aware save flow
- INLINECODE28 - tagging, recommendation, auto-tag planning, and context analysis
- INLINECODE29 - batch collection with dedupe and semantic-plan output
- INLINECODE30 - local-directory import with optional auto-tag planning
- INLINECODE31 - discovery from URLs, directories, and static pages
- INLINECODE32 - publish-safety scan for sensitive-looking content
- INLINECODE33 - pytest coverage for CLI and workflow behaviors
贴纸管理器
通过关键词查找、质量检查、语义标签、批量导入/收集工作流以及媒体发送支持,管理本地贴纸/反应图库。
作者:
仓库/备份源:
- - GitHub:https://github.com/TetraClaw/sticker-manager
- 若ClawHub不可用,则使用GitHub作为备用下载源。
该技能的功能
- 1. 将最新的入站图片或GIF保存到本地图库
- 从最近的聊天/媒体历史中保存特定图片
- 通过关键词搜索贴纸
- 重命名或删除现有贴纸
- 清理质量极低的文件
- 为贴纸添加情感/场景/关键词/描述标签
- 基于直接文本上下文或最近聊天历史推荐贴纸
- 批量收集贴纸至目标数量,并去重和低质量过滤
- 从本地目录批量导入贴纸
- 为语义标签和图片理解准备视觉模型方案
- 返回解析后的文件路径,以便助手使用message工具发送匹配的媒体
支持的格式
默认路径
- - 贴图库:~/.openclaw/workspace/stickers/library/
- 入站媒体:~/.openclaw/media/inbound/
环境变量覆盖:
- - STICKERMANAGERDIR
- STICKERMANAGERINBOUNDDIR
- STICKERMANAGERLANG
- STICKERMANAGERVISIONMODELS
典型用例
1. 保存贴纸
当用户发送图片/GIF并说出类似以下内容时:
- - 保存贴纸
- 存储这个
- 保存这张图片
- 保存上一张图片
- 从聊天历史中保存那张图片
基本保存:
bash
python3 scripts/save_sticker.py 自定义名称
从最近的媒体历史中保存:
bash
python3 scripts/save_sticker.py --list-history
python3 scripts/save_sticker.py --history-index=2 从历史保存
python3 scripts/savesticker.py --source=file39---example.jpg 按来源保存
质量感知保存:
bash
python3 scripts/savestickerauto.py 自定义名称
python3 scripts/savestickerauto.py --history-index=3 质量检查过的名称
如果未提供名称,savestickerauto.py会以代码2退出并返回分析标记,以便助手请求模型为图片命名。
2. 搜索贴纸
命令:
bash
python3 scripts/get_sticker.py 关键词
列出所有贴纸:
bash
python3 scripts/get_sticker.py
匹配顺序:
3. 重命名/删除/清理
重命名:
bash
python3 scripts/manage_sticker.py rename 旧名称 新名称
删除:
bash
python3 scripts/manage_sticker.py delete 名称
清理非常小的文件:
bash
python3 scripts/manage_sticker.py clean
4. 标签和推荐
添加标签:
bash
python3 scripts/sticker_semantic.py tag 贴纸名称 开心,平静 会议,庆祝 点赞,已批准 一个平静的认可反应图。
为直接上下文建议:
bash
python3 scripts/sticker_semantic.py suggest 我们终于修好了
python3 scripts/sticker_semantic.py suggest 我们终于修好了 --strategy=model
列出标签数据库:
bash
python3 scripts/sticker_semantic.py list
仅准备模型负载:
bash
python3 scripts/sticker_semantic.py prepare-model 用户很紧张但假装冷静
从聊天历史推荐:
bash
python3 scripts/stickersemantic.py context-recommend ./chathistory.json --top=5
5. 批量收集/导入/发现
从URL或本地文件收集:
bash
python3 scripts/collect_stickers.py --sources-file ./sources.txt --out-dir ./stickers/batch --prefix sticker --target-count 15
如果最终数量低于目标,命令以代码2退出并打印NEED_MORE=...。
从本地目录导入:
bash
python3 scripts/batch_import.py ./stickers --target-dir ~/.openclaw/workspace/stickers/library/
python3 scripts/batch_import.py ./stickers --auto-tag
从目录、URL或页面发现来源:
bash
python3 scripts/discover_sources.py ./stickers
python3 scripts/discover_sources.py https://example.com/image1.gif
python3 scripts/discover_sources.py https://example.com/gallery
python3 scripts/discover_sources.py --fetch-urls https://example.com/image1.gif
默认发现是轻量级的:
- - 本地目录立即扫描
- 远程图片URL返回为pending,除非使用--fetch-urls
- 页面发现仅计数成功提取的图片URL
动画规则(强制):
- - 如果源文件原本是动画,优先下载动画资产本身。
- 使用通用决策路径:文件后缀 → HTTP Content-Type → 下载文件内容验证。
- 不要将动画源静默降级为静态WEBP/PNG预览。
- 如果源文件通过引用/content-type看起来是动画,但下载的文件验证为静态,则将其从动画批次中拒绝,而不是假装它是GIF。
- 在发送或导入GIF批次之前,验证保存的文件实际支持动画,而不是静态预览。
6. 自动标签和视觉规划
为单个文件生成视觉方案:
bash
python3 scripts/sticker_semantic.py auto-tag ./sticker.gif
为目录生成方案:
bash
python3 scripts/sticker_semantic.py auto-tag-dir ./stickers/
独立的视觉后备方案:
bash
python3 scripts/sticker_semantic.py vision-plan ./sample.png 寻找怀疑或可疑的情绪
返回包含以下内容的JSON方案:
建议的默认模型顺序:
- 1. bailian/kimi-k2.5
- openai/gpt-5-mini
发送工作流
解析文件路径后,使用message工具发送。
示例:
python
message(
action=send,
channel=telegram,
target=,
media=/absolute/path/to/sticker.gif,
caption=给你
)
如果需要回复特定消息,传递replyTo=。
质量规则
自动保存流程在保存前检查媒体大小。
>= 20KB | 直接保存 |
| 中等 | >= 10KB | 直接保存 |
| 低 | >= 5KB | 可用,但置信度较低 |
| 过低 | < 5KB | 拒绝,除非强制保存 |
强制保存示例:
bash
python3 scripts/savestickerauto.py 低质量名称 --force
给助手的提示
- - 优先使用语义名称而非时间戳繁重的名称
- 避免在技能逻辑中硬编码平台特定内容
- 使用环境变量覆盖图库位置
- 尽可能将发送逻辑保留在助手/工具层,而非原始脚本内部
- 发送前验证文件是否存在
- 对于图片含义提取,尝试STICKERMANAGERVISIONMODELS中配置的视觉能力模型链
- 如果主要图片模型失败,在放弃前尝试后备模型
- 如果所有视觉模型都失败,明确告知用户图片含义、语义标签和质量验证无法可靠完成
- 将MODELMATCH、AUTOTAG、SEMANTICBATCH、ANALYZEHISTORY和CONTEXTRECOMMEND标记视为外部助手层的结构化交接负载
文件
- - scripts/common.py - 共享路径、国际化及视觉方案辅助函数
- scripts/getsticker.py - 关键词查找和库存列表
- scripts/managesticker.py - 重命名、删除和清理
- scripts/savesticker.py - 从入站或历史媒体基本保存
- scripts/savestickerauto.py - 质量感知保存流程
- scripts/stickersemantic.py - 标签、推荐、自动标签规划和上下文分析
- scripts/collectstickers.py - 批量收集,带去重和语义方案输出
- scripts/batchimport.py - 本地目录导入,可选自动标签规划
-