SuperAPI AI Directory

li-stats

Office & productivity

View repository

Updated 10-15 23:32

About this skill

Data Batch Sync System

Scan 待发布的内容/中短视频/, and write all videos with complete YAML data into the data stats table + archive them to the published directory.

Design Premises

  • Data source: each script file's YAML frontmatter (the user has already manually filled in the platform data after publishing)
  • Do not ask the user for numbers: all data is read from YAML; if a field is missing, skip that entry and tell the user to fill it in
  • Batch, idempotent: can be run repeatedly; already-archived items will not be processed again

Workflow

Step 1: Scan the directory

Glob 01-内容生产/待发布的内容/中短视频/*.md, to get the list of candidate files.

No files → output 📭 没有待同步的视频 and end.

Step 2: Read and validate the YAML of each file one by one

For each file, Read its YAML and classify it according to the following rules:

Complete(all satisfied):

  • 发布时间 non-empty
  • 点赞数、收藏数、观看数、完播率 all non-empty
  • (涨粉数 allowed to be empty)

Missing fields: publish time is empty, or any key data field is empty → add to 跳过列表, record the names of the missing fields.

Complete groupproceeds to step 3;Skip groupis left for the unified report in step 6.

Step 3: Process each complete file

For each file in the complete group, execute 3.1 → 3.5 in order:

3.1 Calculate metrics

Save/like ratio = saves ÷ likes (keep 2 decimal places)

Hit level(by number of likes):

  • 5000+:✈️
  • 2000-4999:🚗
  • 1000-1999:🛵
  • 500-999:🚲
  • <500:🚶

3.2 Write to the stats table

Read 03-数据统计/数据统计表.md, use fuzzy title matching to find the corresponding row:

  • Found and is 待填入 → Edit to replace with:
    | N | YYYY-MM-DD | 标题 | 分类 | [等级] | [点赞] | [收藏] | [收赞比] | [观看] | [涨粉] | [完播率]% |
    
  • Found but already has data → skip that row (to avoid overwriting), mark in the report 已存在数据,未覆盖
  • No corresponding row found → append a new row at the end of the table

If follower growth is missing, fill in -. Completion rate is uniformly stored as 8.1% format.

3.3 Sync the topic record

Read 01-内容生产/选题管理/00-选题记录.md, find the corresponding entry.

If it is 已完成 status, update to:

- [x] [标题] - 已发布(YYYY-MM-DD)

3.4 Archive the file (with idempotency check)

Determine the category according to the classification rules in CLAUDE.md:

  • AI Tool In-Depth Review: tool reviews, sponsored recommendations, feature introduction types
  • AI Application Development Learning: tutorials, development experience, technical popularization types
  • One-Person Company Growth Diary: personal experiences, vlogs, workflow sharing types

Target path:02-已发布内容/短视频/[分类]/[YYYY年MM月]/[名].md(YYYY年MM月 taken from the YAML's 发布时间)

Idempotency check: if a file with the same name already exists at the target path → do not overwrite, mark 已归档过,跳过, skip to 3.5.

Otherwise create the target directory and move the file.

3.5 Delete the deep-dive report

In 01-内容生产/待深化的选题/ , look for a deep-dive report with the same name; if it exists, delete it.

Step 4: Batch Report

After processing all files, output in a unified manner (do not output fragmented results file by file):

✅ 同步完成:N 条

【已归档】
1. [标题1] · [等级] 点赞X 收藏X · 收/赞比X · 观看X · 完播率X%
   → 02-已发布内容/短视频/[分类]/[年月]/

2. [标题2] · ...

【已存在跳过】
- [标题3]:02-已发布内容/... 已存在同名文件

【缺字段跳过】
- [标题4]:YAML 缺 [发布时间, 点赞数]
- [标题5]:YAML 缺 [完播率]

请补齐 YAML 后重跑本 skill。

When a group is empty, omit the corresponding subsection.