Sticker Manager: AI 驱动的多媒体库管理 - Openclaw Skills

作者:互联网

2026-04-19

AI教程

什么是 Sticker Manager?

Sticker Manager 是一个强大的实用工具,旨在处理表情包库的整个生命周期。作为 Openclaw Skills 更广泛生态系统的一部分,它允许用户捕获传入的媒体,使用智能元数据对其进行组织,并在对话中即时检索。它支持包括 JPG, PNG, WEBP 和 GIF 在内的多种格式,确保您的本地存储库兼具通用性和高质量。

除了基础存储,此技能还利用视觉模型来理解图像内容。通过分析情绪、场景和描述,它提供了一个语义层,支持上下文感知推荐等高级功能。无论您是在构建个人表情收藏还是为智能体管理资产,此技能都能通过自动化质量检查和批量处理工作流简化流程。

下载入口:https://github.com/openclaw/skills/tree/main/skills/zhuwenzhuang/sticker-manager

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install sticker-manager

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 sticker-manager。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Sticker Manager 应用场景

  • 将聊天会话中传入的图像或 GIF 直接保存到结构化库中。
  • 使用关键词、部分匹配或模糊包含搜索表情图像。
  • 使用 AI 视觉规划自动为海量图像集合标记语义描述。
  • 根据当前聊天记录的情绪推荐完美的表情包。
  • 从本地目录或远程 URL 批量导入表情包,并进行去重和质量过滤。
Sticker Manager 工作原理
  1. 该技能识别来自环境或用户提供的特定聊天记录索引的传入媒体。
  2. 媒体经过质量感知的保存过程,根据可配置的阈值检查文件大小,以防止库杂乱。
  3. 文件存储在指定的库路径中,通常默认位于 Openclaw Skills 工作区内的用户主目录。
  4. 使用 Kimi 或 GPT-5-mini 等视觉模型生成语义元数据,创建情绪和场景的可搜索数据库。
  5. 在交互期间,智能体查询库或使用推荐引擎解析文件路径,以便通过集成的消息传递工具立即发送。

Sticker Manager 配置指南

要在 Openclaw Skills 环境中开始使用此技能,请确保您的目录已配置。您可以使用环境变量来覆盖默认路径。

# 可选:设置自定义库目录
export STICKER_MANAGER_DIR="~/.openclaw/workspace/stickers/library/"

# 从最近的传入图像保存表情包
python3 scripts/save_sticker.py "my_new_sticker"

# 按关键词搜索表情包
python3 scripts/get_sticker.py "happy"

Sticker Manager 数据架构与分类体系

该技能结合使用文件系统层级和语义元数据标记来组织数据。它根据文件大小对质量进行分类,以维护高标准库。

质量等级 文件大小阈值 操作
High >= 50KB 直接保存
Good >= 20KB 直接保存
Medium >= 10KB 直接保存
Low >= 5KB 低置信度保存
Too Low < 5KB 除非强制否则拒绝

支持格式:JPG, JPEG, PNG, WEBP, GIF。默认库路径:~/.openclaw/workspace/stickers/library/

name: sticker-manager
description: |
  Sticker library management for OpenClaw.

  Use this skill to save, search, tag, rename, clean up, collect, import, and recommend stickers or reaction images.
  It supports local inventory management for JPG / JPEG / PNG / WEBP / GIF files.

  Default library path: ~/.openclaw/workspace/stickers/library/
  Override with: STICKER_MANAGER_DIR

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
  2. Save a specific image from recent ch@t/media history
  3. Search stickers by keyword
  4. Rename or delete existing stickers
  5. Clean very low-quality files
  6. Tag stickers with emotions / scenes / keywords / descriptions
  7. Recommend a sticker based on direct text context or recent ch@t history
  8. Batch-collect stickers toward a target count with dedupe and low-quality filtering
  9. Batch-import stickers from local directories
  10. Prepare vision-model plans for semantic tagging and image understanding
  11. Return resolved file paths so the assistant can send matched media with the message tool

Supported formats

  • JPG
  • JPEG
  • PNG
  • WEBP
  • GIF

Default paths

  • Sticker library: ~/.openclaw/workspace/stickers/library/
  • Inbound media: ~/.openclaw/media/inbound/

Environment overrides:

  • STICKER_MANAGER_DIR
  • STICKER_MANAGER_INBOUND_DIR
  • STICKER_MANAGER_LANG
  • STICKER_MANAGER_VISION_MODELS

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 ch@t history"

Basic save:

python3 scripts/save_sticker.py "custom_name"

Save from recent media history:

python3 scripts/save_sticker.py --list-history
python3 scripts/save_sticker.py --history-index=2 "saved_from_history"
python3 scripts/save_sticker.py --source=file_39---example.jpg "saved_by_source"

Quality-aware save:

python3 scripts/save_sticker_auto.py "custom_name"
python3 scripts/save_sticker_auto.py --history-index=3 "quality_checked_name"

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:

python3 scripts/get_sticker.py "keyword"

List all stickers:

python3 scripts/get_sticker.py

Matching order:

  • exact filename match
  • partial filename match
  • fuzzy containment match

3. Rename / delete / clean

Rename:

python3 scripts/manage_sticker.py rename "old_name" "new_name"

Delete:

python3 scripts/manage_sticker.py delete "name"

Clean very small files:

python3 scripts/manage_sticker.py clean

4. Tag and recommend

Add tags:

python3 scripts/sticker_semantic.py tag "sticker_name" "happy,calm" "meeting,celebration" "thumbs-up,approved" "A calm approval reaction image."

Suggest for direct context:

python3 scripts/sticker_semantic.py suggest "we finally fixed it"
python3 scripts/sticker_semantic.py suggest "we finally fixed it" --strategy=model

List tag database:

python3 scripts/sticker_semantic.py list

Prepare model payload only:

python3 scripts/sticker_semantic.py prepare-model "the user is nervous but pretending to be calm"

Recommend from ch@t history:

python3 scripts/sticker_semantic.py context-recommend ./ch@t_history.json --top=5

5. Batch collect / import / discover

Collect from URLs or local files:

python3 scripts/collect_stickers.py --sources-file ./sources.txt --out-dir ./stickers/batch --prefix sticker --target-count 15

If the final count is below target, the command exits with code 2 and prints NEED_MORE=....

Import from local directories:

python3 scripts/batch_import.py ./stickers --target-dir ~/.openclaw/workspace/stickers/library/
python3 scripts/batch_import.py ./stickers --auto-tag

Discover sources from directories, URLs, or pages:

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

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

6. Auto-tagging and vision planning

Generate a vision plan for a single file:

python3 scripts/sticker_semantic.py auto-tag ./sticker.gif

Generate plans for a directory:

python3 scripts/sticker_semantic.py auto-tag-dir ./stickers/

Standalone vision fallback plan:

python3 scripts/sticker_semantic.py vision-plan ./sample.png "find a doubtful or suspicious emotion"

This returns a JSON plan with:

  • image path
  • candidate vision models
  • prompt goal
  • fallback failure message

Suggested default model order:

  1. bailian/kimi-k2.5
  2. openai/gpt-5-mini

Sending workflow

After resolving a file path, send it with the message tool.

Example:

message(
    action="send",
    channel="telegram",
    target="",
    media="/absolute/path/to/sticker.gif",
    caption="Here you go"
)

If you need to reply to a specific message, pass replyTo="".

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:

python3 scripts/save_sticker_auto.py "low_quality_name" --force

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 STICKER_MANAGER_VISION_MODELS
  • 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
  • scripts/get_sticker.py - keyword lookup and inventory list
  • scripts/manage_sticker.py - rename, delete, and cleanup
  • scripts/save_sticker.py - basic save from inbound or history media
  • scripts/save_sticker_auto.py - quality-aware save flow
  • scripts/sticker_semantic.py - tagging, recommendation, auto-tag planning, and context analysis
  • scripts/collect_stickers.py - batch collection with dedupe and semantic-plan output
  • scripts/batch_import.py - local-directory import with optional auto-tag planning
  • scripts/discover_sources.py - discovery from URLs, directories, and static pages
  • scripts/check_sensitive.py - publish-safety scan for sensitive-looking content
  • tests/ - pytest coverage for CLI and workflow behaviors

相关推荐