{"id":"a955feea-793f-4c0b-b152-4bc0260d06d6","entityType":"agent","slug":"clawhub-dlazyai-cross-border-localize","name":"跨境本地化 Cross-border Localize","canonicalUrl":"https://www.xpersona.co/agent/clawhub-dlazyai-cross-border-localize","canonicalPath":"/agent/clawhub-dlazyai-cross-border-localize","generatedAt":"2026-10-11T11:24:25.203Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T08:53:27.071Z","emptyReason":null},"description":"跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。 Skill: 跨境本地化 Cross-border Localize Owner: dlazyai Summary: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。 Tags: latest:1.0.16 Version history: v1.0.16 | 2026-10-10T01:48:54.588Z | user 例行版本更新 2026-10-10 v1.0.15 | 2026-10-08T01:41:35.113Z | user 例行版本更新 2026-10-08 v1.0.14 | 2026-10-04T01:41:50.339Z | user 例行版本更新 2026-10-04 v1.0.13 | 2026-10-02T05:15:00.190Z | user 例行版本更新 2026-10-02 v1.0.","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s170j1ymymrxasgd00dsk7tckx84cf45:cross-border-localize","sourceUrl":"https://clawhub.ai/dlazyai/cross-border-localize","homepage":"https://clawhub.ai/dlazyai/skills/cross-border-localize","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/dlazyai/cross-border-localize","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/dlazyai/skills/cross-border-localize","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。 Skill: 跨境本地化 Cross-border Localize Owner: dlazyai Summary: 跨境一套素材多区域本地化。一套素材 → 多语"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:53:27.071Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:53:27.071Z","emptyReason":null},"stars":null,"forks":null,"downloads":1107,"packageName":null,"latestVersion":"1.0.16","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:53:26.999Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T08:53:27.071Z","lastCrawledAt":"2026-10-11T08:53:26.999Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T08:53:26.999Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.16","createdAt":"2026-10-10T01:48:54.588Z","changelog":"例行版本更新 2026-10-10","fileCount":12,"zipByteSize":29613},{"version":"1.0.15","createdAt":"2026-10-08T01:41:35.113Z","changelog":"例行版本更新 2026-10-08","fileCount":12,"zipByteSize":29804},{"version":"1.0.14","createdAt":"2026-10-04T01:41:50.339Z","changelog":"例行版本更新 2026-10-04","fileCount":12,"zipByteSize":29694},{"version":"1.0.13","createdAt":"2026-10-02T05:15:00.190Z","changelog":"例行版本更新 2026-10-02","fileCount":12,"zipByteSize":29599},{"version":"1.0.12","createdAt":"2026-09-30T01:44:56.594Z","changelog":"例行版本更新 2026-09-30","fileCount":12,"zipByteSize":29669},{"version":"1.0.11","createdAt":"2026-09-28T02:35:08.926Z","changelog":"例行版本更新 2026-09-28","fileCount":12,"zipByteSize":29629},{"version":"1.0.10","createdAt":"2026-09-24T02:36:15.377Z","changelog":"例行版本更新 2026-09-24","fileCount":12,"zipByteSize":29602},{"version":"1.0.9","createdAt":"2026-09-22T01:39:15.036Z","changelog":"例行版本更新 2026-09-22","fileCount":12,"zipByteSize":29759}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s170j1ymymrxasgd00dsk7tckx84cf45:cross-border-localize","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T11:24:25.199Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-dlazyai-cross-border-localize/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T08:53:27.071Z","emptyReason":null},"readme":"Skill: 跨境本地化 Cross-border Localize\n\nOwner: dlazyai\n\nSummary: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n\nTags: latest:1.0.16\n\nVersion history:\n\nv1.0.16 | 2026-10-10T01:48:54.588Z | user\n\n例行版本更新 2026-10-10\n\nv1.0.15 | 2026-10-08T01:41:35.113Z | user\n\n例行版本更新 2026-10-08\n\nv1.0.14 | 2026-10-04T01:41:50.339Z | user\n\n例行版本更新 2026-10-04\n\nv1.0.13 | 2026-10-02T05:15:00.190Z | user\n\n例行版本更新 2026-10-02\n\nv1.0.12 | 2026-09-30T01:44:56.594Z | user\n\n例行版本更新 2026-09-30\n\nv1.0.11 | 2026-09-28T02:35:08.926Z | user\n\n例行版本更新 2026-09-28\n\nv1.0.10 | 2026-09-24T02:36:15.377Z | user\n\n例行版本更新 2026-09-24\n\nv1.0.9 | 2026-09-22T01:39:15.036Z | user\n\n例行版本更新 2026-09-22\n\nv1.0.8 | 2026-09-20T01:49:04.996Z | user\n\n例行版本更新 2026-09-20\n\nv1.0.7 | 2026-09-18T02:10:22.179Z | user\n\n例行版本更新 2026-09-18\n\nv1.0.6 | 2026-09-10T01:33:26.941Z | user\n\n例行版本更新 2026-09-10\n\nv1.0.5 | 2026-09-08T01:40:09.220Z | user\n\n例行版本更新 2026-09-08\n\nv1.0.4 | 2026-09-07T01:48:08.781Z | user\n\n例行版本更新 2026-09-07\n\nv1.0.3 | 2026-09-04T01:41:23.022Z | user\n\n例行版本更新 2026-09-04\n\nv1.0.2 | 2026-09-02T01:36:54.995Z | user\n\n例行版本更新 2026-09-02\n\nv1.0.1 | 2026-08-31T07:03:25.657Z | user\n\n源码仓库迁移至 github.com/dlazy-ai/ecommerce-skills\n\nv1.0.0 | 2026-08-29T04:00:14.005Z | user\n\nSync from GitHub\n\nArchive index:\n\nArchive v1.0.16: 12 files, 29613 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2168b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.16:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.16\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.16:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.16\",\n  \"publishedAt\": 1791596934588\n}\n\nFile v1.0.16:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.16:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.16:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.16:skill-card.md\n\n## Description:\n\nHelps cross-border sellers adapt product copy, size charts, listing images, and labeling reminders for different markets.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nCross-border sellers and listing teams use this skill to prepare market-specific product copy, size conversions, images, and preliminary platform and labeling checks before publishing.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product prompts and reference images may be sent to a configured cloud image-generation provider.\n\nMitigation: Run a dry-run when possible, select an approved provider, and review its data-handling requirements before sending assets.\n\nRisk: Generated foreign-language image text or localized size conversions may be inaccurate.\n\nMitigation: Have a native speaker review visible text and confirm size charts against the brand's measurements before publication.\n\nRisk: Automated listing and labeling checks do not establish legal compliance or marketplace approval.\n\nMitigation: Verify current platform rules and regional labeling requirements through official or qualified channels before listing.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](artifact/references/platform-specs.md)\n- [Image generation provider guide](artifact/references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Images, Shell commands, Guidance]\n\n**Output Format:** [Markdown guidance and generated image files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Market-specific copy, size charts, image files, and listing precheck results.]\n\n## Skill Version(s):\n\n1.0.16 (source: release evidence and skill frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.16:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.15: 12 files, 29804 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2514b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.15:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.15\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.15:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.15\",\n  \"publishedAt\": 1791423695113\n}\n\nFile v1.0.15:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.15:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.15:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.15:skill-card.md\n\n## Description:\n\nHelps sellers adapt product listings for different markets with localized copy, size conversions, regional image variants, and labeling reminders.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and listing teams use this skill to prepare region-specific product copy, size guides, and listing images for marketplaces. It offers platform checks and labeling reminders, not legal or translation certification.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and supplied images may be sent to the selected AI provider.\n\nMitigation: Choose the provider explicitly and submit only images and product information approved for external processing.\n\nRisk: Untrusted image URLs could point to internal or sensitive resources.\n\nMitigation: Use trusted local images or approved public URLs; avoid untrusted internal URLs.\n\nRisk: Generated images and automatic fixes write to output paths, while localized text, sizes, and listing requirements can be inaccurate.\n\nMitigation: Review target paths and retain originals; have a native speaker check important copy, verify measurements, and confirm current marketplace and labeling rules before listing.\n\nRisk: Shared tooling exposes unrelated tasks, including watermark removal.\n\nMitigation: Invoke only the intended localization tasks and use other tasks only with a lawful, deliberate purpose.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](artifact/references/platform-specs.md)\n- [Provider CLI and data flow](artifact/references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Guidance, Shell commands, Image files]\n\n**Output Format:** [Localized copy and size tables in text or Markdown; generated marketplace images and image-check results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Image variants and checks depend on the chosen market, platform, provider, and supplied reference images.]\n\n## Skill Version(s):\n\n1.0.15 (source: skill frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.15:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.14: 12 files, 29694 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2298b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.14:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.14\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.14:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1791078110339\n}\n\nFile v1.0.14:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.14:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.14:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.14:skill-card.md\n\n## Description:\n\nLocalizes ecommerce product assets into regional listing copy, size guides, images, and compliance-label reminders.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nEcommerce sellers and listing teams use the skill to adapt product copy, sizing information, and listing imagery for different markets and marketplaces. It also flags region-specific labeling considerations for human review.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product prompts and referenced images may be sent to a selected cloud generation provider.\n\nMitigation: Confirm the provider and data-sharing terms before submitting sensitive product assets.\n\nRisk: Generated images, non-English text, and sizing or labeling guidance may not be suitable for a marketplace listing as-is.\n\nMitigation: Review output files and translations, check current platform rules, and independently confirm sizes and required labels before listing.\n\nRisk: Running an unpinned CLI recovery command could execute an unreviewed package version or write files unexpectedly.\n\nMitigation: Verify the package source and version; use a dry run or explicit output paths when tighter control is needed.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](artifact/references/platform-specs.md)\n- [Generation provider guide](artifact/references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Images, Shell commands]\n\n**Output Format:** [Localized listing copy and size tables in text or Markdown; generated image files when image generation is used]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Image generation can save files to a selected path; listing-image checks report platform-specific issues.]\n\n## Skill Version(s):\n\n1.0.14 (source: release metadata and skill frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.14:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.13: 12 files, 29599 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2084b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.13\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790918100190\n}\n\nFile v1.0.13:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.13:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.13:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.13:skill-card.md\n\n## Description:\n\nAdapts e-commerce product materials into region-specific listing copy, size charts, images, and compliance-label reminders.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and listing teams use this skill to adapt product copy, size information, and marketplace images for target regions and to identify labels requiring review before publication.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product prompts and supplied images may be shared with the selected generation provider.\n\nMitigation: Use dry-run or doctor modes first, supply only trusted image sources, and avoid confidential launch assets unless provider terms permit sharing.\n\nRisk: Generated non-English copy, size conversions, and compliance labels may be inaccurate or unsuitable for the target marketplace.\n\nMitigation: Have a fluent reviewer check localized text, verify dimensions against the product's measurements, and confirm labeling and platform requirements before listing.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](references/platform-specs.md)\n- [Generation provider guide](references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Images, Shell commands, Guidance]\n\n**Output Format:** [Localized listing copy and size tables in Markdown; generated image files and listing-check results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Image generation requires a configured third-party provider; listings require human review.]\n\n## Skill Version(s):\n\n1.0.13 (source: skill frontmatter and server release)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.13:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.12: 12 files, 29669 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2268b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.12\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1790732696594\n}\n\nFile v1.0.12:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.12:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.12:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nHelps sellers adapt product listings for different markets with localized copy, size guidance, region-specific images, and platform checks.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nE-commerce sellers and listing teams use this skill to prepare market-specific product copy, size charts, and listing imagery, then check images against selected marketplace specifications.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Product prompts and reference images may be shared with the configured AI provider.\n\nMitigation: Use dry-run or doctor mode to inspect the selected provider before submitting sensitive material.\n\nRisk: Generated non-English text and size conversions may be inaccurate.\n\nMitigation: Have a fluent reviewer check localized copy and verify measurements against the brand's size chart.\n\nRisk: Image checks do not establish current marketplace or legal compliance.\n\nMitigation: Confirm current platform requirements and required labeling independently before publishing.\n\nRisk: Automatic image fixes can create derived image files.\n\nMitigation: Run --fix only when edited copies are intended, and inspect them before use.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](references/platform-specs.md)\n- [Image generation provider guide](references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Guidance, Shell commands, Images]\n\n**Output Format:** [Localized listing copy and size guidance in text or Markdown; generated image files and image-check reports]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Image generation uses a configured AI provider; listing checks can report results as text or JSON.]\n\n## Skill Version(s):\n\n1.0.12 (source: release evidence and skill frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.12:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.11: 12 files, 29629 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2184b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.11\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790562908926\n}\n\nFile v1.0.11:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.11:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.11:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nHelps ecommerce sellers adapt product copy, sizing guidance, listing images, and labeling reminders for different regional markets.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nEcommerce sellers and listing teams use this skill to prepare region-specific product copy, size comparisons, images, and labeling reminders for cross-border listings.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Generation may send prompts and product images to an external AI provider.\n\nMitigation: Confirm the selected provider and permission to share product assets; use --dry-run or --provider for greater control.\n\nRisk: Generated foreign-language text, size conversions, or labeling suggestions may be inaccurate.\n\nMitigation: Have a native speaker check important copy, use product-specific centimeter measurements, and confirm labeling requirements before listing.\n\nRisk: Platform image requirements can change and automated checks cannot detect every issue.\n\nMitigation: Check current platform rules and manually review text, watermarks, and final images before publishing.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](references/platform-specs.md)\n- [Image provider usage and data flow](references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Image files, Guidance]\n\n**Output Format:** [Markdown guidance and tables, shell commands, and generated listing images]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Image generation requires a configured cloud provider; listing checks cover only machine-checkable image rules.]\n\n## Skill Version(s):\n\n1.0.11 (source: frontmatter and release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.11:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.10: 12 files, 29602 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2087b), SKILL.md (5773b), _meta.json (141b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.10\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790217375377\n}\n\nFile v1.0.10:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.10:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.10:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nHelps agents turn one ecommerce product asset set into localized regional listing copy, size conversion tables, marketplace-specific image prompts, and compliance-label reminders.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nEcommerce operators, marketers, and developers use this skill to prepare cross-border product listings for different regions, including localized copy, sizing guidance, image generation commands, and pre-publish platform checks.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and product or reference images may be sent to the configured image provider.\n\nMitigation: Review the selected provider's data handling terms before using confidential catalog assets.\n\nRisk: Generated foreign-language text, legal labels, and marketplace compliance cues may be incorrect or incomplete.\n\nMitigation: Manually verify translated text, sizing, legal compliance, and platform rules before publishing listings.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](references/platform-specs.md)\n- [Provider CLI reference](references/provider-cli.md)\n- [dLazy CLI source](https://github.com/dlazy-ai/cli)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands, tables, and optional JSON command output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save generated ecommerce image files when the configured image provider is invoked.]\n\n## Skill Version(s):\n\n1.0.10 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.10:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.9: 12 files, 29759 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2490b), SKILL.md (5772b), _meta.json (140b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.9\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1790041155036\n}\n\nFile v1.0.9:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.9:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.9:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nHelps agents localize e-commerce listing assets for multiple regions with market-aware copy, size conversion tables, platform image specifications, and compliance-label reminders.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers, marketplace operators, and e-commerce content teams use this skill to turn one product asset set into localized listing guidance and generation commands for regions such as North America, Japan, Southeast Asia, and global marketplaces.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and selected product images can be sent to cloud generation providers.\n\nMitigation: Use only approved providers and credentials, and do not submit confidential, regulated, or customer-identifying images unless organizational policy allows it.\n\nRisk: Generated foreign-language text and compliance markings may be incorrect or unsuitable for publication.\n\nMitigation: Review localized text, size tables, and compliance-label suggestions with qualified reviewers before publishing listings.\n\nRisk: Marketplace image rules and platform requirements can change.\n\nMitigation: Check the current official platform requirements and use updated rule overrides before relying on automated listing checks.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Publisher profile](https://clawhub.ai/user/dlazyai)\n- [Platform image specifications](artifact/references/platform-specs.md)\n- [Provider CLI reference](artifact/references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with bash command examples, brand configuration inputs, validation output, and generated image-file paths when provider scripts are run]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May call cloud generation providers and may write localized listing images to user-specified output paths.]\n\n## Skill Version(s):\n\n1.0.9 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.9:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.8: 12 files, 29733 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2391b), SKILL.md (5772b), _meta.json (140b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.8\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1789868944996\n}\n\nFile v1.0.8:references/platform-specs.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。\n\nFile v1.0.8:references/provider-cli.md\n\n<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTTP status code error (500)` |\n| 504 | 异步任务失败 | `=== Generation Failed ===` / `Prompt violates safety policy` |\n\n**给 Agent 的硬性要求**\n\n1. 命中 `insufficient_balance` → 明确告诉用户算力不足，并给出充值入口\n   <https://dlazy.com/dashboard/organization/settings?tab=credits>\n2. 命中 `unauthorized` / 缺 key → 告诉用户去 <https://dlazy.com/dashboard/organization/api-key>\n   取 key，用 `dlazy auth set <key>` 存好再继续。\n3. 用 `gen.mjs` 时，429 与 5xx 已自动重试；仍失败才向用户报错。\n4. **不要**为了「跑通」而偷偷降级参数（尺寸、档位、批量），先问用户。\n\nFile v1.0.8:scripts/lib/tasks.json\n\n{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-video-ad\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"ugc-testimonial\":         { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true }\r\n  }\r\n}\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nHelps agents adapt one ecommerce product asset set into region-specific listing copy, size conversion tables, compliance-label reminders, and marketplace image variants.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[dlazyai](https://clawhub.ai/user/dlazyai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal marketplace sellers, ecommerce operators, and developers use this skill to localize product assets for cross-border listings, including regional copy, image-generation prompts, size conversions, and platform checks.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Selected product images and prompts may be uploaded to configured generation providers.\n\nMitigation: Use dry-run mode to inspect requests first, avoid sensitive images, and choose only providers acceptable for the product data.\n\nRisk: Compliance and marketplace-fit checks are review aids, not final legal or platform approval.\n\nMitigation: Confirm regional requirements against current official marketplace rules and professional compliance guidance before publishing.\n\nRisk: Generated non-English listing text or image text can contain localization errors.\n\nMitigation: Have native speakers or qualified reviewers check customer-facing copy and prefer generating no-text base images before final layout.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/dlazyai/skills/cross-border-localize)\n- [Platform image specifications](artifact/references/platform-specs.md)\n- [Provider CLI reference](artifact/references/provider-cli.md)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Text, Markdown, Shell commands, Configuration, Files]\n\n**Output Format:** [Markdown guidance with inline shell commands; scripts can emit JSON status and generated image files.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May upload selected prompts and product images to configured generation providers and write generated assets to local output paths.]\n\n## Skill Version(s):\n\n1.0.8 (source: SKILL.md frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:examples/brand.yaml\n\n# ⚠️ 由 scripts/build-skills.mjs 从 shared/examples/brand.yaml 同步生成，不要直接改这里。\r\n# 店铺品牌视觉规范 —— 所有生图技能读这一份，保证几百个 SKU 看起来像同一家店。\r\n#   node scripts/brand.mjs --brand brand.yaml --for flat-lay\r\n#   node scripts/gen.mjs --task flat-lay --brand brand.yaml --prompt '...'\r\n\r\nbrand:\r\n  name: 示例品牌\r\n  # 一句话概括调性，会原样进 prompt\r\n  tone: quiet minimalist, warm and lived-in, never glossy or commercial\r\n\r\nmodel:\r\n  # 锁模特：给一张脸的参考图，所有技能都会把它作为最后一张参考图传入\r\n  reference: assets/model/face-a.jpg\r\n  description: East Asian woman, late twenties, natural makeup, shoulder-length black hair\r\n  body: slim, height around 168cm\r\n\r\nphotography:\r\n  background: seamless off-white studio backdrop, RGB 248 248 246\r\n  lighting: soft large softbox from camera left, gentle fill, no hard shadows\r\n  camera: 85mm equivalent, eye level, shallow depth of field\r\n  grade: neutral white balance around 5200K, low contrast, slightly lifted blacks\r\n  crop: full body with headroom, product centered\r\n\r\nlayout:\r\n  # 给带排版的技能（主图 / 详情页）用\r\n  margin: at least 8% empty margin on all sides\r\n  typeface: clean sans-serif, no decorative fonts\r\n  text_color: near-black on light background\r\n\r\nforbid:\r\n  - no visible brand logos other than the product's own\r\n  - no text or watermark\r\n  - no exaggerated poses or dramatic wind effects\r\n  - no oversaturated colors\r\n\r\n# 可选：把这些直接写进合规目标，生成时就按平台要求出图\r\ncompliance:\r\n  platform: amazon\n\nArchive v1.0.7: 12 files, 29836 bytes\n\nFiles: examples/brand.yaml (1655b), references/platform-specs.md (2180b), references/provider-cli.md (4802b), scripts/brand.mjs (4516b), scripts/check_listing.py (16313b), scripts/gen.mjs (9733b), scripts/lib/miniyaml.mjs (2901b), scripts/lib/providers.mjs (12510b), scripts/lib/tasks.json (3234b), skill-card.md (2610b), SKILL.md (5772b), _meta.json (140b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: cross-border-localize\nversion: 1.0.7\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示用户该区域常见的必需标识（成分标、原产地、认证标等），\n   并明确说明这只是提示，正式上架前需自行确认。\n\n---\n\n## 七、常见问题\n\n| 现象 | 原因 | 怎么办 |\n| --- | --- | --- |\n| 生成的外文有错字 | 模型对非拉丁文字支持弱 | 生成无文字底图，文字后期排 |\n| 中文主图直接翻译后被驳回 | 目标平台主图禁文字 | 出无文字版本 |\n| 退货率高 | 只给了字母码 | 补厘米数与模特试穿尺码 |\n| 一套图打天下被多个平台拒 | 各平台规格不同 | 按区域各出一版，逐个过校验 |\n\n---\n\n## Tips\n\n- **无文字底图是资产**。先做好它，各区域再派生，比每个区域从头生成省得多。\n- **模特选型跟着市场走**。北美站需要多元面孔，这不是政治正确，是转化率问题。\n- **厘米数比什么文案都管用**。跨境退货成本高，尺码信息越具体越省钱。\n\nFile v1.0.7:_meta.json\n\n{","readmeExcerpt":"Skill: 跨境本地化 Cross-border Localize Owner: dlazyai Summary: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。 Tags: latest:1.0.16 Version history: v1.0.16 | 2026-10-10T01:48:54.588Z | user 例行版本更新 2026-10-10 v1.0.15 | 2026-10-08T01:41:35.113Z | user 例行版本更新 2026-10-08 v1.0.14 | 2026-10-04T01:41:50.339Z | user 例行版本更新 2026-10-04 v1.0.13 | 2026-10-02T05:15:00.190Z | user 例行版本更新 2026-10-02 v1.0.","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop"},{"language":"bash","snippet":"node scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon"},{"language":"bash","snippet":"node scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg"},{"language":"bash","snippet":"dlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入"},{"language":"bash","snippet":"node scripts/gen.mjs --doctor     # 看当前哪个后端可用"},{"language":"bash","snippet":"node scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: cross-border-localize\nversion: 1.0.16\ndescription: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。\n---\n\n# cross-border-localize — 跨境本地化\n\n同一件商品卖去不同国家，**不是把中文文案翻译一遍就完事**。\n\n尺码体系不同、合规标识不同、审美偏好不同、平台规格也不同。\n这个技能把一套素材铺成多个区域可直接上架的版本。\n\n---\n\n## 一、能力边界\n\n| 能做 | 说明 |\n| --- | --- |\n| 文案本地化 | 不是直译，是按当地表达习惯重写 |\n| 尺码换算 | CN / US / UK / EU / JP 对照表 |\n| 区域版主图 | 带当地语言文案排版的主图 |\n| 平台规格适配 | 各区域主流平台的图片规格 |\n| 合规标识提示 | 提示该区域常见的必需标识 |\n\n| 不能做 | 说明 |\n| --- | --- |\n| 法律意见 | 合规标识只做提示，正式上架前请咨询专业渠道 |\n| 保证翻译无误 | 重要文案请母语者过一遍 |\n\n---\n\n## 二、本地化不等于翻译\n\n| 维度 | 中国站 | 北美站 | 日本站 |\n| --- | --- | --- | --- |\n| 文案风格 | 卖点密集、数字多 | 简洁、强调场景与个性 | 礼貌、克制、细节详尽 |\n| 主图信息量 | 可带较多文字 | 主图通常禁文字 | 信息密度中等 |\n| 尺码 | S/M/L + 具体厘米 | XS–XXL，需换算 | 号数体系不同，偏小 |\n| 模特 | 亚洲面孔 | 需要多元面孔 | 亚洲面孔 |\n| 促销表达 | 直给折扣 | 强调价值与保障 | 强调品质与售后 |\n\n**最常见的错误**：把中文主图的密集文案直译贴到 Amazon 主图上——\n主图禁文字，直接驳回。\n\n---\n\n## 三、尺码换算\n\n上装（女装，仅供参考，具体以品牌尺码表为准）：\n\n| CN | US | UK | EU | JP |\n| --- | --- | --- | --- | --- |\n| S / 155-160 | 2-4 | 6-8 | 34-36 | 7-9 |\n| M / 160-165 | 6-8 | 10-12 | 38-40 | 11-13 |\n| L / 165-170 | 10-12 | 14-16 | 42-44 | 15-17 |\n| XL / 170-175 | 14-16 | 18-20 | 46-48 | 19-21 |\n\n**永远同时给具体厘米数。** 各品牌版型差异大，字母码不可靠，\n胸围/肩宽/衣长的厘米数才是买家真正要的，也是降低退货率最有效的一项。\n\n---\n\n## 四、区域平台规格\n\n| 区域 | 主流平台 | 图片规则要点 |\n| --- | --- | --- |\n| 北美 | Amazon | 主图纯白 RGB(255,255,255)、商品占 ≥85%、禁文字水印 |\n| 东南亚 | Shopee / Lazada | 方图，体积限制紧（≤2MB） |\n| 全球 | TikTok Shop | 1:1 或 3:4，禁边框水印 |\n| 全球 | Temu | 方图、干净背景、主图禁促销文字 |\n| 独立站 | Shopify | 无硬性限制，2048 方图便于放大镜 |\n\n各区域版本出完，逐个过校验：\n\n```bash\npython3 scripts/check_listing.py out/us/*.jpg --platform amazon\npython3 scripts/check_listing.py out/sea/*.jpg --platform shopee\npython3 scripts/check_listing.py out/global/*.jpg --platform tiktok-shop\n```\n\n---\n\n## 五、工具调用\n\n**北美版主图（无文字，走合规路线）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce main image of an olive cable-knit crewneck sweater on a model. Diverse casting suitable for the North American market. Pure seamless white background, RGB 255,255,255. Product fills 88% of the frame. No text, no logo, no watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg docs/flat-lay/pose-reference.jpg \\\n  --save out/us/A001-main.jpg\n\npython3 scripts/check_listing.py out/us/A001-main.jpg --platform amazon\n```\n\n**日本站详情图（带日文排版）**\n\n```bash\nnode scripts/gen.mjs --task cross-border-localize --brand examples/brand.yaml \\\n  --prompt 'E-commerce detail module for a Japanese marketplace listing. Olive cable-knit sweater. Clean vertical layout with generous margins, restrained typography. Japanese text overlay reading: 「厚手ケーブルニット」「三層構造で暖かい」. Soft neutral background. No watermark.' \\\n  --images docs/flat-lay/garment-flatlay.jpg \\\n  --save out/jp/A001-detail.jpg\n```\n\n⚠️ **模型生成的非英文文字经常出错**（尤其日文汉字与假名混排）。\n带文字的版本一律要人工核对，或改用「生成无文字底图 + 后期排版」的路子。\n\n---\n\n## 六、执行流程\n\n1. **问清楚卖去哪些区域**，别默认「全球」。\n2. **先做无文字版本**。无文字主图能通行大多数平台，是最省事的公共底座。\n3. **按区域派生**：需要文字的单独出，出完人工核对文字。\n4. **逐区域过合规校验**，规格不同不能混用。\n5. **尺码表单独出一张**，同时给字母码和厘米数。\n6. **合规标识**：提示"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7c5wgeajfcfvdfb5ceemvdb984cjpd\",\n  \"slug\": \"cross-border-localize\",\n  \"version\": \"1.0.16\",\n  \"publishedAt\": 1791596934588\n}"},{"path":"references/platform-specs.md","content":"<!-- 由 scripts/build-skills.mjs 从 shared/references/platform-specs.md 同步生成，不要直接改这里。 -->\r\n# 平台图片规格（可机检子集）\r\n\r\n`scripts/check_listing.py` 内置的规则来源与口径。**平台规则会变，以各平台最新官方文档为准**；\r\n需要覆盖时写一份 JSON 用 `--rules` 传入，结构与下表字段一一对应。\r\n\r\n---\r\n\r\n## 字段含义\r\n\r\n| 字段 | 含义 |\r\n| --- | --- |\r\n| `pure_white_bg` | 是否要求纯白 RGB(255,255,255) 背景 |\r\n| `bg_tolerance` | 判定「纯白」允许的单通道偏差 |\r\n| `bg_coverage` | 边缘一圈需要有多大比例落在容差内 |\r\n| `min_long_side` / `recommend_long_side` / `max_long_side` | 最长边像素 |\r\n| `min_occupancy` | 商品包围盒面积 ÷ 画面面积 的下限 |\r\n| `allow_alpha` | 是否允许透明通道 |\r\n| `allow_border` | 是否允许描边 / 外框 |\r\n| `formats` / `max_bytes` / `aspect` | 允许格式、体积上限、允许比例 |\r\n\r\n---\r\n\r\n## 内置规则\r\n\r\n| 平台 | 纯白底 | 最长边（下限 / 建议） | 主体占比 | 比例 | 体积上限 |\r\n| --- | --- | --- | --- | --- | --- |\r\n| `amazon` | 是 | 1000 / 1600 | ≥ 85% | 不限 | 10 MB |\r\n| `tiktok-shop` | 否 | 800 / 1600 | ≥ 60% | 1:1 或 3:4 | 5 MB |\r\n| `temu` | 是 | 800 / 1350 | ≥ 70% | 1:1 | 3 MB |\r\n| `shopee` | 否 | 500 / 1024 | ≥ 55% | 1:1 | 2 MB |\r\n| `shopify` | 否 | 1024 / 2048 | 不限 | 不限 | 20 MB |\r\n| `taobao` | 是 | 800 / 1200 | ≥ 70% | 1:1 | 3 MB |\r\n\r\n---\r\n\r\n## 几个容易踩的点\r\n\r\n- **透明 PNG**：Amazon 会把透明像素转成黑色。永远压平成白底 JPEG 再传。\r\n- **「白底」不等于「看起来是白的」**：棚拍的浅灰墙（约 RGB 208）肉眼像白，机检直接判不合格。\r\n- **主体占比**：留白过多是最常见的驳回原因之一，比分辨率不够更常见。\r\n- **文字 / 水印 / 拼图**：像素层测不了，交给 `detect-task` 的视觉模型或人工。\r\n- **自动修复的边界**：`--fix` 能压白底、按占比重构画布、补分辨率、压体积；\r\n  它**不会**修图，也不会去水印——那是 `item-repair` 和 `remove-watermark` 的活。"},{"path":"references/provider-cli.md","content":"<!-- 由 scripts/build-skills.mjs 从 shared/references/provider-cli.md 同步生成，不要直接改这里。 -->\n# 后端调用参考\n\n技能正文只写「要生成什么」。认证、计费、错误码、输出结构这些每个技能都一样的东西放在这里，\n**用到时再读**，不占技能的常驻上下文。\n\n---\n\n## 一、认证\n\n### 默认后端 dLazy\n\n```bash\ndlazy login            # 设备码流程，远程 shell 也能用，自动写入本地配置\ndlazy auth set <KEY>   # 已有 key 时直接写入\n```\n\nkey 存在用户配置目录（macOS/Linux `~/.dlazy/config.json`，Windows `%USERPROFILE%\\.dlazy\\config.json`），\n权限限本机用户。也可以每次调用用环境变量 `DLAZY_API_KEY` 传入。\n\n手动获取：登录 [dlazy.com](https://dlazy.com) → [API Key 页面](https://dlazy.com/dashboard/organization/api-key)。\nkey 按组织隔离，可随时轮换或吊销。\n\n### 其他后端\n\n本技能库不锁定单一厂商。配好任意一家的 key 即可跑：\n\n| 后端 | 环境变量 | 说明 |\n| --- | --- | --- |\n| `dlazy` | `dlazy login` 或 `DLAZY_API_KEY` | 默认，最省事 |\n| `openai` | `OPENAI_API_KEY` | 走 `/v1/images/edits` 与 `/v1/images/generations` |\n| `gemini` | `GEMINI_API_KEY` | Nano Banana 系列 |\n| `fal` | `FAL_KEY` | |\n| `replicate` | `REPLICATE_API_TOKEN` | |\n| `ark` | `ARK_API_KEY` + `ARK_MODEL` | 火山方舟，模型 ID 需按开通情况填 |\n\n选路优先级：`--provider` 参数 > `PROVIDER` 环境变量 > 第一个配了 key 的 > `dlazy`。\n\n```bash\nnode scripts/gen.mjs --doctor     # 看当前哪个后端可用\n```\n\n各后端的模型 ID 可用 `GEN_MODEL_OPENAI` / `GEN_MODEL_GEMINI` / `GEN_MODEL_FAL` /\n`GEN_MODEL_REPLICATE` / `GEN_MODEL_ARK` 覆盖。**厂商目录会变，以各家最新文档为准。**\n\n---\n\n## 二、两种调用方式\n\n### 方式 A：统一入口（推荐）\n\n```bash\nnode scripts/gen.mjs --task <技能名> --prompt '...' --images a.jpg b.jpg --save out.jpg\n```\n\n它负责：后端选路、默认尺寸档位、失败重试（429/5xx 指数退避）、落盘建目录、成本估算。\n\n```bash\nnode scripts/gen.mjs --task flat-lay --prompt '...' --dry-run   # 不调用不计费，只看要发什么\nnode scripts/gen.mjs --help\n```\n\n### 方式 B：直接用 dLazy CLI\n\n不想引入 Node 依赖时，技能正文里的 `dlazy ...` 命令可以原样执行，效果等价。\n\n```bash\nnpx @dlazy/cli@1.2.3 <command>     # 不装全局二进制\n```\n\n- CLI 源码：[github.com/dlazy-ai/cli](https://github.com/dlazy-ai/cli) · npm 包 `@dlazy/cli`\n\n---\n\n## 三、数据流向\n\n调用 dLazy 时：提示词与参数发往 `api.dlazy.com`；传入的本地图片会上传到 `files.dlazy.com`\n供模型读取；产出 URL 同样托管在 `files.dlazy.com`。这是云端生成 API 的通用形态。\n换成其他后端时，数据流向对应厂商，不经过 dLazy。\n\n---\n\n## 四、输出结构\n\n`gen.mjs`（加 `--json`）：\n\n```json\n{\n  \"ok\": true,\n  \"task\": \"flat-lay\",\n  \"provider\": \"dlazy\",\n  \"model\": \"gpt-image-2\",\n  \"files\": [\"docs/flat-lay/output-sku001.jpg\"],\n  \"texts\": [],\n  \"estimatedCredits\": 60,\n  \"elapsedMs\": 58213\n}\n```\n\ndLazy CLI 原生：\n\n```json\n{\n  \"ok\": true,\n  \"result\": {\n    \"tool\": \"gpt-image-2\",\n    \"data\": { \"urls\": [\"https://files.dlazy.com/data/ai/....jpg\"] },\n    \"savedPath\": \"docs/flat-lay/example-output.jpg\"\n  }\n}\n```\n\n加 `--no-wait` 的异步任务不返回 `data`，返回 `task: { generateId, status }`，\n用 `dlazy status <generateId> --wait` 轮询。\n\n文本类模型（如质检）产出在 `result.data.texts[0]`：\n\n```bash\ndlazy claude-sonnet-5 --prompt '...' --images x.jpg \\\n  | python3 -c 'import sys,json;print(json.load(sys.stdin)[\"result\"][\"data\"][\"texts\"][0])'\n```\n\n---\n\n## 五、错误处理\n\n| Code | 类型 | 示例 |\n| --- | --- | --- |\n| 401 | 未授权 / 无 key | `ok: false, code: \"unauthorized\"` |\n| 501 | 缺必填参数 | `error: required option '--prompt <prompt>' not specified` |\n| 502 | 本地文件读不到 | `Error: Image file not found: ...` |\n| 503 | 余额不足 | `ok: false, code: \"insufficient_balance\"` |\n| 503 | 服务端错误 | `HTT"},{"path":"scripts/lib/tasks.json","content":"{\r\n  \"_note\": \"技能 → 默认模型与参数。dlazy 列为默认后端的模型名；其他后端走 providers.mjs 的通用映射，可用 GEN_MODEL_<PROVIDER> 覆盖。\",\r\n  \"_credits\": { \"gpt-image-2\": 60, \"seedream-5.0\": 30, \"seedream-5.0-pro\": 45, \"banana-pro\": 25, \"claude-sonnet-5\": 3 },\r\n  \"tasks\": {\r\n    \"flat-lay\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"wear-everything\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"image-fusion\":            { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"one-shot\":                { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"fission-pattern\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-detail\":             { \"model\": \"seedream-5.0-pro\", \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"creative-scene\":          { \"model\": \"banana-pro\",       \"size\": \"1024x1536\", \"format\": \"jpeg\" },\r\n    \"batch-image\":             { \"model\": \"seedream-5.0\",     \"size\": \"3:4\",       \"resolution\": \"2k\" },\r\n    \"to-3d\":                   { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-extraction\":     { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"fabric-on-body\":          { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-detail\":         { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"clothing-grass-planting\": { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"medium\", \"format\": \"jpeg\" },\r\n    \"item-selling-point\":      { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"item-change-background\":  { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"remove-watermark\":        { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"material-enhancement\":    { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"item-repair\":             { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"detect-task\":             { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"listing-optimizer\":       { \"model\": \"gpt-image-2\",      \"size\": \"1024x1024\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"cross-border-localize\":   { \"model\": \"seedream-5.0-pro\", \"size\": \"1:1\",       \"resolution\": \"2k\" },\r\n    \"brand-kit\":               { \"model\": \"gpt-image-2\",      \"size\": \"1024x1536\", \"quality\": \"high\",   \"format\": \"jpeg\" },\r\n    \"platform-compliance\":     { \"model\": \"claude-sonnet-5\",  \"text\": true },\r\n    \"main-image-video\":        { \"model\": \"$DLAZY_VIDEO_MODEL\", \"video\": true },\r\n    \"product-"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。 Skill: 跨境本地化 Cross-border Localize Owner: dlazyai Summary: 跨境一套素材多区域本地化。一套素材 → 多语言文案、尺码换算表、区域合规标识。当用户说「跨境本地化」「多语言」「翻译上架」「海外版本」「英文版主图」时使用。 Tags: latest:1.0.16 Version history: v1.0.16 | 2026-10-10T01:48:54.588Z | user 例行版本更新 2026-10-10 v1.0.15 | 2026-10-08T01:41:35.113Z | user 例行版本更新 2026-10-08 v1.0.14 | 2026-10-04T01:41:50.339Z | user 例行版本更新 2026-10-04 v1.0.13 | 2026-10-02T05:15:00.190Z | user 例行版本更新 2026-10-02 v1.0.","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1008,"uniquenessScore":51,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T08:53:27.071Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T08:53:27.071Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T11:24:25.203Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}