Overview
This skill supports two modes:
- 1. Regular daily draft creation
- - Start time can vary
- Must ensure mail is sent by 08:30 local time
- Orders up to 07:00 must be included
- Orders from 07:00 to 08:00 should be included as much as feasible while still guaranteeing mail send by 08:30
- If any critical failure occurs, stop immediately and notify via Telegram
- 2. Ad hoc range creation
- - Triggered when the operator requests a specific order-number range
- Example: 123450~123470
- Complete the draft for that range
- Notify via Telegram immediately after completion
- Send mail immediately after completion
Core rules
- - Always use Chrome default profile for BUYMA and Naver Mail
- Use the latest delivered workbook first; otherwise use the latest automation-created workbook
- Start from the last order number in the most recently delivered file from the operator. If no new delivered file exists, continue from the last workbook previously created by the automation
- If BUYMA CSV download fails, allow operator-provided CSV as fallback input
- If mail sending fails, notify and attach the result file in Telegram fallback
- Follow MEMORY.md and recent memory logs before acting
Base file selection
Select the base order workbook in this order:
- 1. latest file in INLINECODE0
- latest file in INLINECODE1
- INLINECODE2
Output file naming
Always save output as:
INLINECODE3
Example:
INLINECODE4
Receipt memo numbering
Always check memo state for target orders.
- - If memo already contains a valid 6-digit order number, do not rewrite it
- If memo contains text or a number shorter than 6 digits, prepend the 6-digit order number before the existing memo content
- In ad hoc range mode, always perform the memo check/input step
See references/memo-rules.md.
Workflow
- 1. Determine run mode: regular daily or ad hoc range
- Select base workbook
- Access BUYMA in Chrome default profile
- Check and input receipt memo numbers for target orders
- Download shipping CSV (or use provided CSV fallback)
- Parse CSV using INLINECODE6
- Build draft workbook using INLINECODE7
- Fill F using Chrome auto-translated Korean product names (browser placeholder step)
- Enrich I/J/M from prior workbook history using INLINECODE8
- Validate output using INLINECODE9
- Save output using INLINECODE10
- Send by Naver Mail in Chrome (browser placeholder step)
- Update state using INLINECODE11
- On BUYMA/CSV/mail failure, stop immediately and notify via Telegram with file attachment if available
Browser placeholder steps
This package intentionally leaves browser-only steps as placeholders:
- - BUYMA login and page navigation
- Receipt memo editing in BUYMA UI
- BUYMA CSV download click-flow
- Product page Korean name capture from Chrome auto-translation
- Naver Mail compose/send
- Telegram file attachment send from browser/channel tool path
Use these references:
- - INLINECODE12
- INLINECODE13
- INLINECODE14
Script entrypoints
- - INLINECODE15
- INLINECODE16
- INLINECODE17
- INLINECODE18
- INLINECODE19
- INLINECODE20
- INLINECODE21
概述
本技能支持两种模式:
- 1. 常规每日草稿创建
- 开始时间可灵活调整
- 必须确保在当地时间08:30前发送邮件
- 必须包含截至07:00的订单
- 在保证08:30前发送邮件的前提下,尽可能包含07:00至08:00的订单
- 若发生任何严重故障,立即停止并通过Telegram通知
- 2. 临时范围创建
- 当操作员请求特定订单编号范围时触发
- 示例:123450~123470
- 完成该范围的草稿
- 完成后立即通过Telegram通知
- 完成后立即发送邮件
核心规则
- - 始终使用Chrome默认配置文件访问BUYMA和Naver Mail
- 优先使用最新交付的工作簿;否则使用最新自动化创建的工作簿
- 从操作员最近交付文件中的最后一个订单编号开始。若无新交付文件,则从自动化上次创建的工作簿继续
- 若BUYMA CSV下载失败,允许使用操作员提供的CSV作为备用输入
- 若邮件发送失败,通过Telegram通知并附上结果文件作为备用
- 执行前需参考MEMORY.md及近期记忆日志
基础文件选择
按以下顺序选择基础订单工作簿:
- 1. ~/.openclaw/workspace/buymaorder/orders/incoming/中的最新文件
- ~/.openclaw/workspace/buymaorder/orders/current/中的最新文件
- ~/.openclaw/workspace/buymaorder/templates/tmazonORDERLISTtemplate.xlsx
输出文件命名
始终按以下格式保存输出:
tmazonORDERLISTYYMMDD_起始编号-结束编号.xlsx
示例:
tmazonORDERLIST260307_123450-123470.xlsx
收据备注编号
始终检查目标订单的备注状态。
- - 若备注中已包含有效的6位订单编号,则不重写
- 若备注包含文本或少于6位的数字,则在现有备注内容前添加6位订单编号
- 在临时范围模式下,始终执行备注检查/输入步骤
详见references/memo-rules.md。
工作流程
- 1. 确定运行模式:常规每日或临时范围
- 选择基础工作簿
- 在Chrome默认配置文件中访问BUYMA
- 检查并输入目标订单的收据备注编号
- 下载发货CSV(或使用提供的备用CSV)
- 使用scripts/parsebuymacsv.py解析CSV
- 使用scripts/buildordersheet.py构建草稿工作簿
- 使用Chrome自动翻译的韩语产品名称填充F列(浏览器占位步骤)
- 使用scripts/enrichfromhistory.py从先前工作簿历史中丰富I/J/M列
- 使用scripts/validateoutput.py验证输出
- 使用scripts/composeoutputfilename.py保存输出
- 在Chrome中通过Naver Mail发送(浏览器占位步骤)
- 使用scripts/updatestate.py更新状态
- 若BUYMA/CSV/邮件失败,立即停止并通过Telegram通知,附上可用文件
浏览器占位步骤
本包有意将仅限浏览器的步骤设为占位符:
- - BUYMA登录和页面导航
- 在BUYMA界面中编辑收据备注
- BUYMA CSV下载点击流程
- 通过Chrome自动翻译获取产品页面韩语名称
- Naver Mail撰写/发送
- 通过浏览器/频道工具路径发送Telegram文件附件
请参考以下资料:
- - references/workflow.md
- references/failure-rules.md
- references/run-modes.md
脚本入口
- - scripts/selectbasefile.py
- scripts/parsebuymacsv.py
- scripts/buildordersheet.py
- scripts/enrichfromhistory.py
- scripts/validateoutput.py
- scripts/composeoutputfilename.py
- scripts/updatestate.py