Custom Gift — Leewow
这个 skill 的收益很直接:
- - 帮用户快速找到心仪的可定制商品
- 把图片、照片或创意做成礼物、周边和个人用品
- 提供非常灵活的个性化定制服务,从浏览到效果图预览一条链路完成
Leewow 在这个 skill 里的角色很简单:
- - 向用户展示真实可定制商品
- 帮用户选择模板
- 生成效果图并进入下单链路
所以当用户在问“能定制什么”“有哪些商品/模板可以选”时,默认应该先进入商品浏览流程,而不是先回答公司层面的泛化能力介绍。
When to Use
- - User wants to send a gift or create something personalized
- User says "browse products", "show me what I can customize", "gift ideas"
- User says in Chinese: "看看有啥能定制的", "看看有什么可以定制的", "有哪些可定制产品", "有什么模板", "看看定制品", "能做哪些定制品"
- User asks what physical products / items / templates are available to customize
- User provides an image and wants to turn it into a product
- User says "make this into a mug/bag/shirt", "customize this design"
Trigger Priority
For browse-style requests, browse_templates is the default first step.
Use a broad Leewow capability summary only if browse_templates fails.
ClawHub rate-limited? Install directly from GitHub:
INLINECODE2
Install Fallback
If ClawHub is rate-limited, install this skill directly from GitHub:
- - Repository: INLINECODE3
- Skill path: INLINECODE4
Manual fallback:
CODEBLOCK0
Create personalized gifts and custom products powered by AI. This skill provides:
| Tool | Purpose |
|---|
| INLINECODE5 | Discover customizable product templates (bags, accessories, home decor, apparel, etc.) |
| INLINECODE6 |
Upload a design image and trigger AI generation |
|
get_generation_status | Check generation status and download preview image |
What the agent does (keep it minimal)
Browse — browse_templates sends product cards directly from Python and returns only send results. If the tool succeeds, reply with NO_REPLY. In normal chat usage, pass the current Feishu conversation target as feishu_target.
Preview — get_generation_status sends the generated preview result directly to Feishu from Python and returns only send results. If the tool succeeds, reply with NO_REPLY. Preview result cards intentionally use a different layout from browse cards.
Prerequisites
- -
CLAW_SK — Leewow Secret Key (format: sk-leewow-{keyId}-{secret}) - Obtain it from: INLINECODE15
- INLINECODE16 — Feishu App ID (often referred to together with App Secret as app AK/SK)
- INLINECODE17 — Feishu App Secret
- Obtain them from your Feishu Open Platform app settings page
- INLINECODE18 — fallback Feishu target for this skill
- INLINECODE19 — optional, defaults to INLINECODE20
- INLINECODE21 — API base URL (default:
https://leewow.com) - INLINECODE23 — Path prefix (default:
/v2 for leewow.com) - INLINECODE25 — Base URL for COS STS credentials (default:
https://leewow.com) - Python 3.10+ with
requests and INLINECODE28
Configuration
Environment variables are loaded from ~/.openclaw/.env:
CODEBLOCK1
Prefer runtime target passing:
- - when the current Feishu conversation target is already known, pass it as INLINECODE30
- INLINECODE31 is only a fallback
Image Requirements (IMPORTANT)
For Input Images (User Upload)
- - Must be in workspace directory: INLINECODE32
- Supported formats: JPG, PNG, WebP
- Recommended: Clear, well-lit images for best results
For Preview Images (Generated Output)
- - Automatically saved to: INLINECODE33
- Filename format: INLINECODE34
- The agent can directly display these images to users
COS Presigned URLs
For private COS buckets, you may need to generate
presigned URLs for accessing images:
CODEBLOCK2
Note: Most Leewow COS buckets are public, so presigned URLs are optional.
Typical Flow (Generator Pattern)
- 1. Browse —
browse_templates → Python sends Feishu product cards directly → agent replies NO_REPLY → user picks a Template ID when ready - Upload — User provides an image (must be in workspace
~/.openclaw/workspace/) - Generate — Call
generate_preview → get taskId → immediately proceed to step 4 - Poll — Call
get_generation_status with poll=true → wait for COMPLETED - Display —
get_generation_status → Python sends preview result directly → final assistant reply is INLINECODE43
Tool Reference
browse_templates
Browse available product templates.
CODEBLOCK3
Options:
- -
--category: Filter by category (bag, accessory, home, apparel) - INLINECODE45 : Number of products to return (1-10, default 5)
- INLINECODE46 : Direct-send to Feishu and return send result JSON
- INLINECODE47 : Current Feishu conversation target. In normal use, treat this as required.
- INLINECODE48 : Debug mode that returns raw template data
generate_preview
Upload image and trigger generation.
CODEBLOCK4
Options:
- -
--image-path: Required. Path to design image (must be in workspace) - INLINECODE50 : Required. Product template ID from browse_templates
- INLINECODE51 : Optional style description
- INLINECODE52 : Image ratio (3:4, 1:1, 4:3, default 3:4)
- INLINECODE53 : Output JSON format
Returns: Task ID for status polling. Generation is async (~30-60s).
getgenerationstatus
Check generation status and download preview image.
CODEBLOCK5
Options:
- -
task_id: Task ID from generate_preview - INLINECODE55 : Wait until generation completes
- INLINECODE56 : Poll timeout in seconds (default 120)
- INLINECODE57 : Skip downloading preview image
- INLINECODE58 : Output JSON format
- INLINECODE59 : Current Feishu conversation target. In normal use, treat this as required.
Returns: Generation status and, in direct-send mode, send result JSON.
Safety Rules
- - Never expose or log the
CLAW_SK value. When confirming configuration, only show the last 4 characters. - Input images must be in workspace directory for the agent to access them
- Preview images are automatically saved to INLINECODE61
- Limit browse results to 10 templates maximum per request
Examples
CODEBLOCK6
Output Structure
browse_templates --json
CODEBLOCK7
→ Python sends product cards directly to Feishu. Agent returns NO_REPLY.
generate_preview --json
CODEBLOCK8
getgenerationstatus --json (completed)
{
"taskId": "task_xxx",
"status": "COMPLETED",
"mode": "direct_feishu_send",
"messageCount": 1,
"messageIds": ["om_card_xxx"],
"feishuImagesResolved": true,
"finalAssistantReply": "NO_REPLY"
}
→ Python sends one preview result card directly. Agent returns
NO_REPLY.
Version Marker: custom-gift-leewow@1.0.24
Custom Gift — Leewow
这个 skill 的收益很直接:
- - 帮用户快速找到心仪的可定制商品
- 把图片、照片或创意做成礼物、周边和个人用品
- 提供非常灵活的个性化定制服务,从浏览到效果图预览一条链路完成
Leewow 在这个 skill 里的角色很简单:
- - 向用户展示真实可定制商品
- 帮用户选择模板
- 生成效果图并进入下单链路
所以当用户在问能定制什么有哪些商品/模板可以选时,默认应该先进入商品浏览流程,而不是先回答公司层面的泛化能力介绍。
何时使用
- - 用户想要送礼物或制作个性化物品
- 用户说浏览商品、展示我可以定制什么、礼物创意
- 用户用中文说:看看有啥能定制的、看看有什么可以定制的、有哪些可定制产品、有什么模板、看看定制品、能做哪些定制品
- 用户询问有哪些实体产品/物品/模板可以定制
- 用户提供图片并希望将其制作成产品
- 用户说把这个做成杯子/包/T恤、定制这个设计
触发优先级
对于浏览类请求,browse_templates 是默认的第一步。
仅在 browse_templates 失败时才使用宽泛的 Leewow 能力概述。
ClawHub 限流?直接从 GitHub 安装:
https://github.com/AIDiyTeams/claw-skill/tree/main/custom-gift-leewow
安装备用方案
如果 ClawHub 限流,直接从 GitHub 安装此 skill:
- - 仓库:https://github.com/AIDiyTeams/claw-skill
- Skill 路径:custom-gift-leewow
手动安装:
bash
cd /path/to/your/openclaw-workspace
mkdir -p skills
git clone https://github.com/AIDiyTeams/claw-skill.git /tmp/claw-skill
cp -R /tmp/claw-skill/custom-gift-leewow ./skills/custom-gift-leewow
创建由 AI 驱动的个性化礼物和定制产品。此 skill 提供:
| 工具 | 用途 |
|---|
| browsetemplates | 浏览可定制的产品模板(包、配饰、家居、服装等) |
| generatepreview |
上传设计图片并触发 AI 生成 |
| get
generationstatus | 检查生成状态并下载预览图片 |
代理做什么(保持简洁)
浏览 — browsetemplates 直接从 Python 发送产品卡片,仅返回发送结果。如果工具成功,回复 NOREPLY。在正常聊天使用中,将当前飞书会话目标作为 feishu_target 传入。
预览 — getgenerationstatus 直接从 Python 将生成的预览结果发送到飞书,仅返回发送结果。如果工具成功,回复 NO_REPLY。预览结果卡片有意使用与浏览卡片不同的布局。
前提条件
- - CLAWSK — Leewow 密钥(格式:sk-leewow-{keyId}-{secret})
- 获取地址:https://leewow.com/profile/secret-keys
- FEISHUAPPID — 飞书应用 ID(通常与应用密钥一起称为 app AK/SK)
- FEISHUAPPSECRET — 飞书应用密钥
- 从飞书开放平台应用设置页面获取
- FEISHURECEIVEID — 此 skill 的备用飞书目标
- FEISHURECEIVEIDTYPE — 可选,默认为 chatid
- CLAWBASEURL — API 基础 URL(默认:https://leewow.com)
- CLAWPATHPREFIX — 路径前缀(leewow.com 默认为 /v2)
- LEEWOWAPI_BASE — COS STS 凭证的基础 URL(默认:https://leewow.com)
- Python 3.10+,需安装 requests 和 cos-python-sdk-v5
配置
环境变量从 ~/.openclaw/.env 加载:
bash
CLAW_SK=sk-leewow-xxxx-xxxx
飞书应用 ID / 应用密钥(app AK/SK)
FEISHU
APPID=cli_xxx
FEISHU
APPSECRET=xxx
直接飞书发送的默认目标
FEISHU
RECEIVEID=oc
xxxor
openid
FEISHU
RECEIVEID
TYPE=chatid
CLAW
BASEURL=https://leewow.com
CLAW
PATHPREFIX=/v2
LEEWOW
APIBASE=https://leewow.com
优先使用运行时目标传递:
- - 当当前飞书会话目标已知时,将其作为 feishutarget 传入
- FEISHURECEIVE_ID 仅作为备用
图片要求(重要)
输入图片(用户上传)
- - 必须在工作目录中:~/.openclaw/workspace/
- 支持的格式:JPG、PNG、WebP
- 建议:清晰、光线良好的图片以获得最佳效果
预览图片(生成的输出)
- - 自动保存到:~/.openclaw/workspace/previews/
- 文件名格式:leewowpreview{taskId}.{ext}
- 代理可以直接向用户展示这些图片
COS 预签名 URL
对于私有 COS 存储桶,可能需要生成
预签名 URL 来访问图片:
bash
为 COS 图片生成预签名 URL
python3 scripts/cos_presign.py https://bucket.cos.region.myqcloud.com/key.png --json
自定义过期时间(例如,1 小时 = 3600 秒)
python3 scripts/cos
presign.py COSURL --expired 3600
与 getgenerationstatus 配合使用获取预签名预览 URL
python3 scripts/get_status.py {taskId} --presign --json
注意:大多数 Leewow COS 存储桶是公开的,因此预签名 URL 是可选的。
典型流程(生成器模式)
- 1. 浏览 — browsetemplates → Python 直接发送飞书产品卡片 → 代理回复 NOREPLY → 用户准备好后选择 Template ID
- 上传 — 用户提供图片(必须在工作目录 ~/.openclaw/workspace/ 中)
- 生成 — 调用 generatepreview → 获取 taskId → 立即进入步骤 4
- 轮询 — 使用 poll=true 调用 getgenerationstatus → 等待 COMPLETED
- 展示 — getgenerationstatus → Python 直接发送预览结果 → 最终助手回复为 NOREPLY
工具参考
browse_templates
浏览可用的产品模板。
bash
python3 scripts/browse.py --count 5 --json
选项:
- - --category:按类别筛选(bag、accessory、home、apparel)
- --count:返回的产品数量(1-10,默认 5)
- --json:直接发送到飞书并返回发送结果 JSON
- --feishu-target:当前飞书会话目标。正常使用时视为必填。
- --raw-json:调试模式,返回原始模板数据
generate_preview
上传图片并触发生成。
bash
python3 scripts/generate.py --image-path ./workspace/my_design.png --template-id 3 --json
选项:
- - --image-path:必填。设计图片路径(必须在工作目录中)
- --template-id:必填。来自 browse_templates 的产品模板 ID
- --design-theme:可选样式描述
- --aspect-ratio:图片比例(3:4、1:1、4:3,默认 3:4)
- --json:输出 JSON 格式
返回:用于状态轮询的任务 ID。生成为异步(约 30-60 秒)。
getgenerationstatus
检查生成状态并下载预览图片。
bash
python3 scripts/get_status.py {taskId} --poll
选项:
- - taskid:来自 generatepreview 的任务 ID
- --poll:等待直到生成完成
- --timeout:轮询超时时间(秒,默认 120)
- --no-download:跳过下载预览图片
- --json:输出 JSON 格式
- --feishu-target:当前飞书会话目标。正常使用时视为必填。
返回:生成状态,以及在直接发送模式下的发送结果 JSON。
安全规则