Install
openclaw skills install rebate-assistant返利宝统一技能。只按 3 个用户场景工作:S01 授权与教程、S02 链接返利、S03 商品搜索。用户说“返利”“教程”“详细教程”“提现教程”“提现10元”“确认提现”“我已授权”“账户余额”等走 S01;发送淘宝、京东、拼多多商品链接走 S02;表达想买什么商品时走 S03。S03 的职责是提取商品搜索信息,...
openclaw skills install rebate-assistantM01 的职责是让用户知道返利宝是什么、怎么用、为什么要先做微信授权。M02 的职责是承接淘宝、京东、拼多多商品链接,进入返利链接生成链路。S03 的职责是识别“用户想买什么商品”,提取搜索信息并直接进入商品搜索链路。S03 不是为了展示分词,更不是为了做炫技式槽位输出。scripts/cli/rebate_assistant_router.js。rebate_assistant_router.js、m01_operation_guide.js、m02_platform_link.js、product_search.js 中任一脚本,脚本标准输出是什么,就向用户原样返回什么。tool output 折叠面板中。--format md。返利、返利教程、教程、详细教程、提现教程、提现10元、确认提现、我已授权、授权完成、账户余额 时,进入 S01。http:// 或 https:// 商品链接,进入 S02。S03。S03 统一走 product_search.js。rebate_assistant_router.js。S01 已是固定话术和固定流程。S02 当前已承接平台识别、单商品查询、租约申请和返利链接生成。S03 当前统一由 product_search.js 承接,输出 product_search_intent + search_request,并直接调用商品搜索接口。S03 的核心入参只有两个:尽量完整的 raw_text,以及可识别时才传的 platform。S02 完成返利链接生成。cd ~/.openclaw/workspace/skills/rebate-assistant
npm install
npm run build
构建产物输出到 scripts/,供 skill 直接调用。
scripts/cli/rebate_assistant_router.jsscripts/cli/m01_operation_guide.jsscripts/cli/m02_platform_link.jsscripts/cli/product_search.jsscripts/cli/recognize_platform_link.jsscripts/cli/recognize_precise_product_search.jssrc/productSearchProtocol.tssrc/common.ts用户第一次接触返利宝,或者不知道如何使用,或者需要完成微信授权,或者想看提现说明,或者想查询账户余额,或者要发起提现申请。
返利教程详细教程提现教程提现10元确认提现我已授权账户余额start_authconfirm_authdetailed_tutorialwithdraw_tutorialwithdraw_preparewithdraw_confirmaccount_balance提现教程、怎么提现、提现规则 只返回 withdraw_tutorial。我要提现、提现、全部提现 进入 withdraw_prepare,先查询账户余额;可提现金额低于 1.00 元时直接说明暂不可提现,可提现金额满足最低提现条件时再询问用户要提现多少钱。提现10元、申请提现10元 进入 withdraw_prepare,先校验金额和可提现余额,不直接提交提现。withdraw_prepare 在金额合法时必须返回固定二次确认话术,头部提醒用户先关注小马享生活公众号,否则无法顺利领取微信红包。确认提现 或 确定提现 后进入 withdraw_confirm,再调用 /v1/withdraw/apply。node ~/.openclaw/workspace/skills/rebate-assistant/scripts/cli/m01_operation_guide.js --action <action> --format md
withdraw_prepare 调试时需要带原始消息:
node ~/.openclaw/workspace/skills/rebate-assistant/scripts/cli/m01_operation_guide.js --action withdraw_prepare --raw-message '提现10元' --format md
可用 action:
start_authconfirm_authdetailed_tutorialwithdraw_tutorialwithdraw_preparewithdraw_confirmaccount_balance用户直接给淘宝、京东、拼多多商品链接,希望获得返利。
https://item.jd.com/100012043978.htmlhttps://e.tb.cn/...https://mobile.yangkeduo.com/...node ~/.openclaw/workspace/skills/rebate-assistant/scripts/cli/m02_platform_link.js --raw-message '<用户原始消息>' --format md
用户没有给链接,而是直接说自己想买什么。
raw_text。platform,识别不到就不传。李宁 行川2SE京东 iPhone 15 Pro Max 256G我想买一双袜子推荐个 300 左右的耳机适合送女朋友的礼物100 以内儿童水杯node ~/.openclaw/workspace/skills/rebate-assistant/scripts/cli/product_search.js --raw-message '<用户原始消息>' --format md
S03 当前统一输出两层结构:
product_search_intentsearch_request表示识别后的商品意图。
关键字段:
intent_modequery_textquery_tokensbrandseriesmodelskuproduct_namecategoryattributesspecsprice_minprice_maxprice_targetcrowdusage_scenegift_targetplatform_hintsort_hint表示可直接给后续商品搜索接口使用的统一入参。
结构如下:
{
"ready": true,
"intent_mode": "search",
"keyword": "袜子",
"search_terms": ["袜子"],
"filters": {
"brand": null,
"series": null,
"model": null,
"sku": null,
"product_name": "袜子",
"category": "袜子",
"attributes": [],
"specs": [],
"price_min": null,
"price_max": null,
"price_target": null,
"crowd": null,
"usage_scene": null,
"gift_target": null,
"platform_hint": null,
"sort_hint": null
}
}
正常对话只使用下面这个脚本:
node ~/.openclaw/workspace/skills/rebate-assistant/scripts/cli/rebate_assistant_router.js --raw-message '<用户原始消息>' --format md
路由结果:
S01 -> m01_operation_guide.jsS02 -> m02_platform_link.jsS03 -> product_search.jsS01 / S02 / S03 三个用户场景展开。search_request 对接方式,不推翻场景结构。