li-stats

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

数据批量同步系统

Batch Data Sync System

扫描
待发布的内容/中短视频/
,把 YAML 数据齐全的视频统一写入数据统计表 + 归档到已发布目录。
Scan
Pending Content/Short & Mid-length Videos/
, uniformly write all videos with complete YAML data to the stats sheet + archive them to the published directory.

设计前提

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
01-Content Production/Pending Content/Short & Mid-length Videos/*.md
to get the list of candidate files.
No files found → Output
📭 No videos pending sync
and terminate.

第二步:逐个文件读取并校验 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):
  • Publish Time
    is not empty
  • Likes
    ,
    Bookmarks
    ,
    Views
    ,
    Completion Rate
    are all non-empty
  • (
    New Followers
    is allowed to be empty)
Missing Fields: Publish Time is empty, or any key data field is empty → Add to
Skip List
and record the names of missing fields.
Complete 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
03-Data Statistics/Stats Sheet.md
, find the corresponding row via fuzzy title matching:
  • Found and marked as
    To be filled
    → Edit and replace with:
    | 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
    Data already exists, not overwritten
    in the report
  • 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
01-Content Production/Topic Management/00-Topic Records.md
and find the corresponding entry.
If the status is
Completed
, update it to:
- [x] [Title] - Published (YYYY-MM-DD)

3.4 归档文件(带幂等检查)

3.4 Archive Files (with Idempotency Check)

按 CLAUDE.md 分类规则判断分类:
  • AI工具深度考察:工具测评、商单种草、功能介绍类
  • AI应用开发学习:教程、开发经验、技术科普类
  • 一人公司养成记:个人经历、vlog、工作流分享类
目标路径:
02-已发布内容/短视频/[分类]/[YYYY年MM月]/[名].md
YYYY年MM月
取自 YAML 的
发布时间
幂等检查:目标路径已存在同名文件 → 不覆盖,标注
已归档过,跳过
,跳到 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:
02-Published Content/Short Videos/[Category]/[YYYY年MM月]/[Name].md
(where
YYYY年MM月
is taken from the
Publish Time
in YAML)
Idempotency Check: If a file with the same name already exists in the target path → Do not overwrite, mark
Already archived, skipped
, and proceed to 3.5.
Otherwise, 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
01-Content Production/Pending Deep Dive Topics/
and delete it if it exists.

第四步:批量汇报

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.