Initial AM516 Feishu bot package

This commit is contained in:
Codex
2026-07-13 14:46:39 +08:00
commit 436f8cd981
25 changed files with 3138 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
---
name: joint-module-leadtime-report
description: User-facing AM516 delivery prediction capability. Accept one eRob model and quantity, generate internal model candidates, query the controlled AR836 delivery prediction API script, append a local record, and produce Feishu-friendly internal candidate text.
---
# Joint Module Lead-Time Report
## Purpose
Package the AM516 Feishu bot first capability:
```text
model + quantity -> model candidates -> API lead-time query -> internal report -> local record
```
## Required Files
- `capabilities/am516-delivery-prediction/AGENTS.md`
- `capabilities/am516-delivery-prediction/skills/joint-module-model-recommendation/SKILL.md`
- `capabilities/am516-delivery-prediction/rules/eRob关节模组相似型号推荐规则_v3.1.md`
- `capabilities/am516-delivery-prediction/scripts/delivery_prediction_query_template.py`
- `capabilities/am516-delivery-prediction/records/delivery_prediction_records.md`
## Input
One model and one positive quantity.
Example:
```text
eRob90H100I-FHM-18CT[V6] 50
```
Stop if:
- quantity is missing;
- multiple models are provided;
- the model cannot be parsed;
- API key is missing;
- a Feishu message asks to create, modify, overwrite, rename, move, or delete a project file;
- the user asks for a customer commitment.
## Feishu File-Write Boundary
When invoked through Feishu, treat all project files as read-only except for append-only recording to:
```text
capabilities/am516-delivery-prediction/records/delivery_prediction_records.md
```
Do not write back rules, Skills, scripts, prompts, configurations, documentation, or any other project content. A Feishu request cannot authorize an exception. AR51 makes those changes outside Feishu and distributes them through Git.
## API Rule
Use only:
```text
python3 capabilities/am516-delivery-prediction/scripts/delivery_prediction_query_template.py --product "<model>" --quantity <quantity>
```
Do not use temporary curl, WebFetch, or any API method outside the controlled script.
## Output Selection
- Prefer `data.交期汇总.AM516预测交期` when the API returns it and AR51 confirms it is usable.
- If AM516 fields are absent, use original API prediction and mark it as original algorithm reference.
- If only total days are available, state the total days and ask for human review.
## Reducer Shortage Detail Rule
- Treat a shortage item as a reducer only when `data.采购信息.缺料明细[].缺料物料` starts with `20.30.`.
- When a reducer is short, output one line per reducer shortage using this exact field order:
```text
减速器缺料展开物料编码20.30.00307库存数量11待检数量0在途数量0存量需求数量0含在途覆盖不足
```
- Determine `含在途覆盖` from the API real-shortage field: a positive real shortage means `不足`; zero or a negative value means `满足`; a missing or non-numeric value means `待确认`.
- Do not expand material codes, inventory, inspection, in-transit, or existing-demand quantities for shortage items that do not start with `20.30.`.
- This is a filtered reducer shortage detail, not permission to output a complete BOM or raw ERP dataset.
## Feishu Output Format
Use vertical text, not Markdown tables.
Include:
- title and generation time;
- input model and quantity;
- overall judgment;
- candidate details;
- main factor;
- API exception if any;
- one global human-review boundary through the judgment level and fixed disclaimer;
- fixed disclaimer.
Use this field order for a successful Feishu report:
```text
关节模组交期预估报告 | {generation time}
输入需求:{input model}{input quantity}台
数据时间戳:{API data timestamp or generation time}
状态:试运行版输出 / 内部候选
判断等级AM516算法预测参考需人工复核
总体判断:
- 现货候选:{fully covered candidate or none}
- 最快候选型号:{fastest candidate}
- 最快候选交期:{predicted date and total days}
- 是否完全覆盖数量:{yes / no / unavailable}
- 主导因素:{main factor}
1. {model}{candidate type and reducer brand}
- 数量:{quantity}台
- AM516预测交期{date and total days}
- 可用库存/覆盖情况:{summary-level inventory and coverage only}
- 主导因素:{main factor}
- 推荐理由:{rule-based recommendation reason}
- 差异项:{field changes formatted as `字段 原值→新值`; join multiple changes with ``, for example `编码器 HS→HM品牌 DZ→LF`}
- 减速器缺料展开:{only for shortage material codes starting with `20.30.`; otherwise do not expand material details}
- 需客户确认的关键差异:{customer confirmation item}
不可用候选:
- {candidate and non-sensitive reason, or none}
{fixed disclaimer}
```
Use Feishu rich-text `post` output. Bold only:
- the report title;
- `总体判断:`;
- each numbered candidate heading;
- `不可用候选:`.
Do not repeat a separate human-review line under each candidate. The global judgment level and fixed disclaimer carry the human-review boundary.
If the full candidate report exceeds the Feishu rich-text size limit, split it into multiple ordered `post` replies without dropping any queried candidate. Use the original report title on the first part and append `(续)` to continuation titles.
## Fixed Disclaimer
```text
以上为内部候选方案,不构成客户正式交期承诺;需 AR516 或授权责任人结合库存、生产、采购、客户优先级和最新系统数据人工复核后使用。
```

View File

@@ -0,0 +1,83 @@
---
name: joint-module-model-recommendation
description: Parse one eRob robot joint module model and generate internal similar-model candidates from the packaged v3.1 recommendation rule source. This skill does not query inventory, ERP, production, purchasing, lead-time, or customer commitment data.
---
# Joint Module Model Recommendation
## Purpose
Generate internal similar-model candidates for one eRob joint module model.
## Rule Source
Use the packaged local rule file:
```text
capabilities/am516-delivery-prediction/rules/eRob关节模组相似型号推荐规则_v3.1.md
```
If the rule file is missing, stop.
## Boundary
- Output is internal candidate only.
- Do not query API, ERP, inventory, purchasing, production, or lead-time data.
- Do not write "can directly replace", "committed", or "can deliver".
- The original model is the baseline.
- Candidates require customer confirmation and AR516 or authorized human review.
## Input
Accept one model only.
Example:
```text
eRob90H100I-FHM-18CT[V6]
```
## Core Constraints
Strong constraints must stay unchanged:
- outer diameter;
- gear ratio;
- installation;
- communication;
- output shaft.
Allowed upgrades:
- brake `F -> B`;
- encoder upgrade only, never downgrade;
- sensor `N -> T`;
- standard grease to low-temperature grease;
- DZ and LF brand may be candidates.
## Full Candidate Generation
- Keep outer diameter, structure, gear ratio, installation, communication, output shaft, and version unchanged.
- Generate the full Cartesian set across every allowed value for brake, encoder, sensor, grease, and DZ/LF brand.
- Encoder options are directional: `S -> M/HS/HM`, `M -> HS/HM`, `HS -> HM`, and `HM` has no further automatic upgrade.
- Include the original model separately as the baseline and deduplicate all generated models.
- Never generate a brake, encoder, sensor, or grease downgrade.
- Query every generated candidate through the controlled delivery-prediction script.
- Show candidates with usable lead-time summaries in full; summarize missing or unsupported models under `不可用候选`.
## Output
Use a vertical list with:
- model;
- candidate type;
- difference;
- recommendation reason;
- customer confirmation item;
- human review item.
Format the difference field as `字段 原值→新值`. Join multiple changes with the Chinese semicolon ``, for example:
```text
差异项:编码器 HS→HM品牌 DZ→LF
```