{
  "schemaVersion": "1.0",
  "item": {
    "slug": "addtocartfrombitable",
    "name": "Add to Cart from Bitable",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/Lorpha/addtocartfrombitable",
    "canonicalUrl": "https://clawhub.ai/Lorpha/addtocartfrombitable",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/addtocartfrombitable",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=addtocartfrombitable",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "scripts/index.js",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/addtocartfrombitable"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/addtocartfrombitable",
    "agentPageUrl": "https://openagent3.xyz/skills/addtocartfrombitable/agent",
    "manifestUrl": "https://openagent3.xyz/skills/addtocartfrombitable/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/addtocartfrombitable/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "从 Bitable 加入购物车",
        "body": "从飞书多维表格读取商品信息，自动添加到淘宝/天猫购物车。"
      },
      {
        "title": "Bitable 表格要求",
        "body": "默认表格：https://somo-tech.feishu.cn/base/UIdIbPe2RaOQ1tsNIhlcB5ilngc\n\napp_token: UIdIbPe2RaOQ1tsNIhlcB5ilngc\ntable_id: tblwMnggn0CuboHs\n\n必需字段：\n\n字段名类型说明链接URL商品链接（从 field.link 取值）采购规格Text要选择的规格文本，必须与页面上的规格选项完全匹配数量Number购买数量"
      },
      {
        "title": "1. 获取待处理记录",
        "body": "feishu_bitable_list_records(app_token, table_id, page_size=20)\n\n筛选出有完整 链接、采购规格、数量 的记录。"
      },
      {
        "title": "2. 逐个处理商品",
        "body": "对每条记录执行：\n\n2.1 提取信息\n\nproductUrl = record.fields.链接.link\nproductSpec = record.fields.采购规格\nproductQuantity = record.fields.数量\n\n2.2 打开商品页面\n\nbrowser.open(profile='openclaw', targetUrl=productUrl)\n\n等待页面加载完成（约 3-5 秒）。\n\n2.3 使用 evaluate 查找并点击规格\n\n由于页面元素可能动态加载，直接使用 snapshot 可能无法找到。建议优先使用 evaluate 查找包含规格文本的元素并点击。\n\nbrowser.act(profile='openclaw', request={\n    kind: 'evaluate',\n    fn: `(specText) => {\n        // XPath 查找包含文本的元素\n        const xpath = \"//*[contains(text(), '\" + specText + \"')]\";\n        const result = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n        for (let i = 0; i < result.snapshotLength; i++) {\n            const node = result.snapshotItem(i);\n            // 尝试点击，如果失败则向上找 clickable 的父元素\n            let target = node;\n            while (target && target !== document.body) {\n                // 检查常见的可点击标签或属性\n                if (['A', 'BUTTON', 'LI'].includes(target.tagName) || target.getAttribute('role') === 'button' || target.className.includes('sku')) {\n                    target.click();\n                    return true;\n                }\n                target = target.parentElement;\n            }\n            // 实在不行点击节点本身\n            node.click();\n            return true;\n        }\n        return false;\n    }`,\n    args: [productSpec]\n})\n\n2.4 设置数量\n\n同理，使用 evaluate 找到输入框并修改值：\n\nbrowser.act(profile='openclaw', request={\n    kind: 'evaluate',\n    fn: `(qty) => {\n        const inputs = document.querySelectorAll('input.text-amount, input.mui-amount-input, input[type=number]');\n        for (let input of inputs) {\n             // 简单的启发式规则：value 是 1 或不为空\n             if (input.value) {\n                input.value = qty;\n                input.dispatchEvent(new Event('input', { bubbles: true }));\n                input.dispatchEvent(new Event('change', { bubbles: true }));\n                return true;\n            }\n        }\n        return false;\n    }`,\n    args: [productQuantity]\n})\n\n2.5 点击加入购物车\n\n找到\"加入购物车\"按钮并点击：\n\nbrowser.act(profile='openclaw', request={\n    kind: 'evaluate',\n    fn: `() => {\n        const buttons = document.querySelectorAll('a, button, div[role=button]');\n        for (let btn of buttons) {\n            const text = btn.innerText || btn.textContent;\n            if (text && (text.includes('加入购物车') || text.includes('加入购物袋'))) {\n                btn.click();\n                return true;\n            }\n        }\n        return false;\n    }`\n})\n\n2.6 确认添加\n\n等待 2-3 秒，检查是否出现成功提示或购物车数量变化。"
      },
      {
        "title": "3. 汇报结果",
        "body": "完成后通过 message 工具发送 Telegram 通知：\n\nmessage(action='send', channel='telegram', to='telegram:1642489086', message='采购商品已加入购物车：\\n- 商品1: ✅\\n- 商品2: ✅\\n...')\n\n改进点：\n\n不再仅依赖 browser.snapshot 返回的静态文本 ref，而是利用 evaluate 在浏览器上下文中直接执行 DOM 操作，提高对动态页面和复杂结构的适应性。\n增加了针对规格选择、数量设置和加购按钮的具体 DOM 查找策略。"
      },
      {
        "title": "示例调用",
        "body": "用户说：\"帮我把采购表格里的商品加入购物车\"\n\n读取 Bitable 记录\n对每个有效记录执行加购流程 (优先使用 evaluate 策略)\n汇报结果"
      }
    ],
    "body": "从 Bitable 加入购物车\n\n从飞书多维表格读取商品信息，自动添加到淘宝/天猫购物车。\n\nBitable 表格要求\n\n默认表格：https://somo-tech.feishu.cn/base/UIdIbPe2RaOQ1tsNIhlcB5ilngc\n\napp_token: UIdIbPe2RaOQ1tsNIhlcB5ilngc\ntable_id: tblwMnggn0CuboHs\n\n必需字段：\n\n字段名\t类型\t说明\n链接\tURL\t商品链接（从 field.link 取值）\n采购规格\tText\t要选择的规格文本，必须与页面上的规格选项完全匹配\n数量\tNumber\t购买数量\n操作流程\n1. 获取待处理记录\nfeishu_bitable_list_records(app_token, table_id, page_size=20)\n\n\n筛选出有完整 链接、采购规格、数量 的记录。\n\n2. 逐个处理商品\n\n对每条记录执行：\n\n2.1 提取信息\nproductUrl = record.fields.链接.link\nproductSpec = record.fields.采购规格\nproductQuantity = record.fields.数量\n2.2 打开商品页面\nbrowser.open(profile='openclaw', targetUrl=productUrl)\n\n\n等待页面加载完成（约 3-5 秒）。\n\n2.3 使用 evaluate 查找并点击规格\n\n由于页面元素可能动态加载，直接使用 snapshot 可能无法找到。建议优先使用 evaluate 查找包含规格文本的元素并点击。\n\nbrowser.act(profile='openclaw', request={\n    kind: 'evaluate',\n    fn: `(specText) => {\n        // XPath 查找包含文本的元素\n        const xpath = \"//*[contains(text(), '\" + specText + \"')]\";\n        const result = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n        for (let i = 0; i < result.snapshotLength; i++) {\n            const node = result.snapshotItem(i);\n            // 尝试点击，如果失败则向上找 clickable 的父元素\n            let target = node;\n            while (target && target !== document.body) {\n                // 检查常见的可点击标签或属性\n                if (['A', 'BUTTON', 'LI'].includes(target.tagName) || target.getAttribute('role') === 'button' || target.className.includes('sku')) {\n                    target.click();\n                    return true;\n                }\n                target = target.parentElement;\n            }\n            // 实在不行点击节点本身\n            node.click();\n            return true;\n        }\n        return false;\n    }`,\n    args: [productSpec]\n})\n\n2.4 设置数量\n\n同理，使用 evaluate 找到输入框并修改值：\n\nbrowser.act(profile='openclaw', request={\n    kind: 'evaluate',\n    fn: `(qty) => {\n        const inputs = document.querySelectorAll('input.text-amount, input.mui-amount-input, input[type=number]');\n        for (let input of inputs) {\n             // 简单的启发式规则：value 是 1 或不为空\n             if (input.value) {\n                input.value = qty;\n                input.dispatchEvent(new Event('input', { bubbles: true }));\n                input.dispatchEvent(new Event('change', { bubbles: true }));\n                return true;\n            }\n        }\n        return false;\n    }`,\n    args: [productQuantity]\n})\n\n2.5 点击加入购物车\n\n找到\"加入购物车\"按钮并点击：\n\nbrowser.act(profile='openclaw', request={\n    kind: 'evaluate',\n    fn: `() => {\n        const buttons = document.querySelectorAll('a, button, div[role=button]');\n        for (let btn of buttons) {\n            const text = btn.innerText || btn.textContent;\n            if (text && (text.includes('加入购物车') || text.includes('加入购物袋'))) {\n                btn.click();\n                return true;\n            }\n        }\n        return false;\n    }`\n})\n\n2.6 确认添加\n\n等待 2-3 秒，检查是否出现成功提示或购物车数量变化。\n\n3. 汇报结果\n\n完成后通过 message 工具发送 Telegram 通知：\n\nmessage(action='send', channel='telegram', to='telegram:1642489086', message='采购商品已加入购物车：\\n- 商品1: ✅\\n- 商品2: ✅\\n...')\n\n\n改进点：\n\n不再仅依赖 browser.snapshot 返回的静态文本 ref，而是利用 evaluate 在浏览器上下文中直接执行 DOM 操作，提高对动态页面和复杂结构的适应性。\n增加了针对规格选择、数量设置和加购按钮的具体 DOM 查找策略。\n示例调用\n\n用户说：\"帮我把采购表格里的商品加入购物车\"\n\n读取 Bitable 记录\n对每个有效记录执行加购流程 (优先使用 evaluate 策略)\n汇报结果"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Lorpha/addtocartfrombitable",
    "publisherUrl": "https://clawhub.ai/Lorpha/addtocartfrombitable",
    "owner": "Lorpha",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/addtocartfrombitable",
    "downloadUrl": "https://openagent3.xyz/downloads/addtocartfrombitable",
    "agentUrl": "https://openagent3.xyz/skills/addtocartfrombitable/agent",
    "manifestUrl": "https://openagent3.xyz/skills/addtocartfrombitable/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/addtocartfrombitable/agent.md"
  }
}