li-stats
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese数据批量同步系统
Batch Data Sync System
扫描 ,把 YAML 数据齐全的视频统一写入数据统计表 + 归档到已发布目录。
待发布的内容/中短视频/Scan , uniformly write all videos with complete YAML data to the stats sheet + archive them to the published directory.
Pending Content/Short & Mid-length Videos/设计前提
Design Premises
- 数据源:每个脚本文件的 YAML frontmatter(用户在发布后已手动填好平台数据)
- 不询问用户数字:所有数据从 YAML 读取,缺字段就跳过那一条并告知用户去补
- 批量、幂等:可重复运行,已归档的不会被重复处理
- Data Source: YAML frontmatter of each script file (users have manually filled in platform data after publishing)
- No User Number Requests: All data is read from YAML; skip entries with missing fields and inform users to supplement them
- Batch & Idempotent: Can be run repeatedly; already archived items will not be processed again
工作流程
Workflow
第一步:扫描目录
Step 1: Scan Directory
Glob ,得到候选文件列表。
01-内容生产/待发布的内容/中短视频/*.md无文件 → 输出 后结束。
📭 没有待同步的视频Glob to get the list of candidate files.
01-Content Production/Pending Content/Short & Mid-length Videos/*.mdNo files found → Output and terminate.
📭 No videos pending sync第二步:逐个文件读取并校验 YAML
Step 2: Read and Validate YAML for Each File
对每个文件 Read 其 YAML,按以下规则分类:
完整(同时满足):
- 非空
发布时间 - 、
点赞数、收藏数、观看数全部非空完播率 - (允许为空)
涨粉数
缺字段:发布时间空,或任一关键数据字段空 → 加入 ,记录缺失字段名。
跳过列表完整组进入第三步处理;跳过组留到第六步统一汇报。
Read the YAML of each file, classify them according to the following rules:
Complete (meet all conditions):
- is not empty
Publish Time - ,
Likes,Bookmarks,Viewsare all non-emptyCompletion Rate - (is allowed to be empty)
New Followers
Missing Fields: Publish Time is empty, or any key data field is empty → Add to and record the names of missing fields.
Skip ListComplete Group proceeds to Step 3; Skip Group is reported uniformly in Step 6.
第三步:处理每个完整文件
Step 3: Process Each Complete File
对完整组里的每个文件,依次执行 3.1 → 3.5:
For each file in the Complete Group, execute 3.1 → 3.5 in order:
3.1 计算指标
3.1 Calculate Metrics
收/赞比 = 收藏 ÷ 点赞(保留 2 位小数)
爆款等级(按点赞数):
- 5000+:✈️
- 2000-4999:🚗
- 1000-1999:🛵
- 500-999:🚲
- <500:🚶
Bookmark/Like Ratio = Bookmarks ÷ Likes (retain 2 decimal places)
Viral Level (based on likes):
- 5000+: ✈️
- 2000-4999: 🚗
- 1000-1999: 🛵
- 500-999: 🚲
- <500: 🚶
3.2 写入统计表
3.2 Write to Stats Sheet
Read ,用标题模糊匹配找到对应行:
03-数据统计/数据统计表.md- 找到且为 → Edit 替换为:
待填入| N | YYYY-MM-DD | 标题 | 分类 | [等级] | [点赞] | [收藏] | [收赞比] | [观看] | [涨粉] | [完播率]% | - 找到但已有数据 → 跳过该行(避免覆盖),在汇报里标注
已存在数据,未覆盖 - 找不到对应行 → 在表格末尾追加新行
涨粉数缺失填 。完播率统一存为 格式。
-8.1%Read , find the corresponding row via fuzzy title matching:
03-Data Statistics/Stats Sheet.md- Found and marked as → Edit and replace with:
To be filled| N | YYYY-MM-DD | Title | Category | [Level] | [Likes] | [Bookmarks] | [Bookmark/Like Ratio] | [Views] | [New Followers] | [Completion Rate]% | - Found but already has data → Skip the row (to avoid overwriting), mark in the report
Data already exists, not overwritten - Corresponding row not found → Append a new row at the end of the table
Fill if new followers data is missing. Store completion rate uniformly in the format .
-8.1%3.3 同步选题记录
3.3 Sync Topic Records
Read ,找到对应条目。
01-内容生产/选题管理/00-选题记录.md若为 状态,更新为:
已完成- [x] [标题] - 已发布(YYYY-MM-DD)Read and find the corresponding entry.
01-Content Production/Topic Management/00-Topic Records.mdIf the status is , update it to:
Completed- [x] [Title] - Published (YYYY-MM-DD)3.4 归档文件(带幂等检查)
3.4 Archive Files (with Idempotency Check)
按 CLAUDE.md 分类规则判断分类:
- AI工具深度考察:工具测评、商单种草、功能介绍类
- AI应用开发学习:教程、开发经验、技术科普类
- 一人公司养成记:个人经历、vlog、工作流分享类
目标路径:( 取自 YAML 的 )
02-已发布内容/短视频/[分类]/[YYYY年MM月]/[名].mdYYYY年MM月发布时间幂等检查:目标路径已存在同名文件 → 不覆盖,标注 ,跳到 3.5。
已归档过,跳过否则创建目标目录并移动文件。
Determine the category according to CLAUDE.md classification rules:
- In-depth AI Tool Review: Tool reviews, sponsored content, feature introductions
- AI Application Development Learning: Tutorials, development experience, technical popularization
- Solo Entrepreneurship Journey: Personal experiences, vlogs, workflow sharing
Target Path: (where is taken from the in YAML)
02-Published Content/Short Videos/[Category]/[YYYY年MM月]/[Name].mdYYYY年MM月Publish TimeIdempotency Check: If a file with the same name already exists in the target path → Do not overwrite, mark , and proceed to 3.5.
Already archived, skippedOtherwise, create the target directory and move the file.
3.5 删除深化报告
3.5 Delete Deep Dive Report
在 里查找同名深化报告,存在则删除。
01-内容生产/待深化的选题/Search for a deep dive report with the same name in and delete it if it exists.
01-Content Production/Pending Deep Dive Topics/第四步:批量汇报
Step 4: Batch Reporting
处理完所有文件后,统一输出(不要逐个文件碎片化输出):
✅ 同步完成:N 条
【已归档】
1. [标题1] · [等级] 点赞X 收藏X · 收/赞比X · 观看X · 完播率X%
→ 02-已发布内容/短视频/[分类]/[年月]/
2. [标题2] · ...
【已存在跳过】
- [标题3]:02-已发布内容/... 已存在同名文件
【缺字段跳过】
- [标题4]:YAML 缺 [发布时间, 点赞数]
- [标题5]:YAML 缺 [完播率]
请补齐 YAML 后重跑本 skill。某一组为空时省略对应小节。
After processing all files, output uniformly (do not output fragmented information for each file):
✅ Sync completed: N entries
【Archived】
1. [Title1] · [Level] LikesX BookmarksX · Bookmark/Like RatioX · ViewsX · Completion RateX%
→ 02-Published Content/Short Videos/[Category]/[Year-Month]/
2. [Title2] · ...
【Skipped for Existing Data】
- [Title3]: A file with the same name already exists in 02-Published Content/...
【Skipped for Missing Fields】
- [Title4]: YAML missing [Publish Time, Likes]
- [Title5]: YAML missing [Completion Rate]
Please supplement the YAML and re-run this skill.Omit the corresponding section if a group is empty.