SkillsGrove
SkillsGrove/Productividad/SuperDaLin/lark-fashion-cockpit/lark-fashion-cockpit-stock-replenishment

lark-fashion-cockpit-stock-replenishment

Instalación

$npx skills add https://github.com/SuperDaLin/lark-fashion-cockpit --skill lark-fashion-cockpit-stock-replenishment
$git clone --depth 1 https://github.com/SuperDaLin/lark-fashion-cockpit.git /tmp/lark-fashion-cockpit && mkdir -p ~/.claude/skills && cp -r /tmp/lark-fashion-cockpit/skills/stock-replenishment ~/.claude/skills/lark-fashion-cockpit-stock-replenishment
Instala por favor esta Agent Skill por mí: https://github.com/SuperDaLin/lark-fashion-cockpit/tree/8b037e3026e56cf81c4e1b4e2533699350190e63/skills/stock-replenishment. Lee primero su SKILL.md y sus scripts, y solo instálala en mi carpeta de skills cuando hayas confirmado que es segura.

Resumen

Descripción original · MIT库存补货决策 — 自动巡检低库存 SKU + AI 算补货量 + 平台库存分配建议 + IM 卡片告警。当用户说「看下哪些要补货」「库存预警」「售罄风险」「平台库存怎么分」时使用。属于 lark-fashion-cockpit 商品中心板块。
El SKILL.md siguiente se reproduce de SuperDaLin/lark-fashion-cockpit (commit 8b037e3) bajo la licencia MIT. El texto no se ha modificado; solo se omiten los metadatos de cabecera del archivo, las imágenes se muestran como enlaces y los archivos muy largos se truncan. Copyright 2026 冯兴龙. Licencia: LICENSE. Solo se muestra el archivo de instrucciones; consulta el repositorio original para ver los scripts.

库存补货决策

板块: 🅱 商品中心
调用: base + im + task + AI
多维表依赖: 01_产品库(读)/ 03_库存预警(写)/ 02_4平台销售(读销售速率)

一、前置条件

lark-cli auth login --scope "base:record:read base:record:create im:message:write task:task:write"

二、工作流

场景 A: 自动巡检低库存

触发语: "看下哪些要补货" / "巡检库存" / "低库存预警"

Step 1: 读 01_产品库 筛选 状态!=历史款 AND 库存 < 阈值
Step 2: 读 02_4平台销售 算每个 SKU 近 7 天日均销量
Step 3: AI 计算补货建议(覆盖未来 30 天 + 安全库存)
Step 4: 写入 03_库存预警 表
Step 5: IM 红色卡片告警 + task 建补货任务

Step 1: 筛选低库存款

lark-cli base +record-list \
  --base-token <APP> --table-id tblrKzymnPPQ98ZX \
  --filter '{"conjunction":"and","conditions":[
    {"field_name":"状态","operator":"isNot","value":"历史款"},
    {"field_name":"库存","operator":"isLess","value":50}
  ]}'

Step 2: 销售速率(近 7 天日均)

SEVEN_DAYS_AGO=$(date -d '-7 day' +%s)000

lark-cli base +data-query \
  --base-token <APP> --table-id tbll7UHbL6kDxZua \
  --json '{
    "table_name":"02_4平台销售",
    "series":[{"field_name":"订单数","rollup":"SUM"}],
    "group_by":[{"field_name":"关联款","mode":"enumerated"}],
    "filter":{"conjunction":"and","conditions":[
      {"field_name":"日期","operator":"isGreaterEqual","value":"'$SEVEN_DAYS_AGO'"}
    ]}
  }'

Step 3: AI 补货建议

提示词:

对每款低库存 SKU,基于以下数据给出补货建议:
- 当前库存:{库存}
- 安全线:50(建议覆盖 7 天)
- 近 7 天销量:{销量}
- 日均销量:{日均}
- 生产交期:21 天

输出:
- 紧急度:紧急 / 中 / 低
  - 紧急:当前库存 < 5 天日均销量
  - 中:5-15 天
  - 低:>15 天
- 建议补货量:覆盖 30 天 + 安全库存
- 平台分配:基于过去销量占比分配(如 淘宝50%/抖音30%/小红书15%/视频号5%)

Step 4: 写入预警表

lark-cli base +record-batch-create \
  --base-token <APP> --table-id tblq2jhCQiRFeDXh \
  --json @./stock-alerts.json

Step 5: IM 告警 + 建补货任务

# 红色卡片
lark-cli im chats messages create --user-id <老板> --msg-type interactive \
  --content '{"header":{"template":"red","title":{"tag":"plain_text","content":"🔴 库存预警 — 3 个紧急 SKU"}},"elements":[...]}'

# 给生产主管建补货任务(链 task-collaboration)
lark-cli task +create --summary "补货:DRS-0429-FL × 200 件" --assign "生产主管" --priority "high"

场景 B: 平台库存分配建议

按各平台销售占比 + 平台特点给出分配策略。

三、涉及多维表

表 操作
01_产品库 读(库存)
02_4平台销售 读(销量)
03_库存预警 写
05_任务清单 写(补货任务)

四、典型对话示例

用户:看下哪些要补货

agent:
✓ 巡检 01_产品库(25 款在售)
✓ 发现 3 款低库存:
  🔴 SKT-0328-A:5 件,售罄风险(紧急)
  🟡 PNT-0418-SU:35 件,10 天可用(中)
  🟡 KNT-0402-CD:28 件,12 天可用(中)

✓ 已写入 03_库存预警
✓ 已建 3 个补货任务给生产主管 @张三
✓ 已发红色 IM 卡片

五、与其他 skill 协作

  • task-collaboration:建补货任务
  • morning-report:晨报里展示库存预警数量
  • production-supplier:补货执行链路

六、参考

Ver el texto completo de la licencia (MIT)
MIT License

Copyright (c) 2026 冯兴龙

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.