SuperAPI AI 工具集

shopify-agent-discount

营销与增长

查看项目

更新于 10-16 06:44

技能介绍

用途:在完成任何 Shopify 购买前,检查某商品是否有可用折扣码;若存在折扣,则将其应用到结账流程。

主要能力:get-coupon.py 脚本用私钥对 SIWE(Sign-In with Ethereum)认证消息签名,并把签名消息与商品 URL 发送到 World 折扣 API https://discount-app.worldcoin.org/api/verify,随后打印返回的折扣码。私钥不会离开本机。

前置条件:脚本依赖 uv,未安装时可运行 curl -LsSf https://astral.sh/uv/install.sh | sh。Agent key 存放在项目根目录 .agent-key 中;若不存在可生成:uv run --with eth-account python3 -c "from eth_account import Account; a = Account.create(); print(a.key.hex())",将输出写入 .agent-key。可用 uv run --with eth-account python3 -c "from eth_account import Account; print(Account.from_key('$(cat .agent-key)').address)" 向用户展示钱包地址;切勿显示私钥,只展示钱包地址。

用法:运行前先用 Read 工具查看脚本内容:cat ${CLAUDE_SKILL_DIR}/get-coupon.py。然后执行 PRIVATE_KEY=$(cat .agent-key) ${CLAUDE_SKILL_DIR}/get-coupon.py <product_url>。URL 需去除查询参数,例如使用 https://store.myshopify.com/products/cool-shirt,而非带 ?variant=123 的形式。

错误处理:若 API 返回 “Agent is not registered as a verified human”,说明用户需注册 agent,应在独立终端(非 Claude 内,因需可视化终端显示二维码)运行 npx --registry https://registry.npmjs.org @worldcoin/agentkit-cli register <wallet-address>,通过 World ID 完成验证后重试折扣命令。应向用户报告错误,不要静默重试。

限制:具体支持的商品范围、折扣码类型、价格与有效期等资料暂未提供。