Skip to content

handsomeng/Hskill-chatcut / skills/publish-video-three-platforms

publish-video-three-platforms

Verified

Prepare and upload an approved local video to Xiaohongshu, Douyin, and WeChat Channels through the user's logged-in browser. Analyze the actual video or transcript with AI, generate platform-specific titles, descriptions, and hashtags from the content, validate official topic selection, apply scheduling and original-content options when available, and stop before the final publish button unless the user explicitly authorizes publishing. Trigger when a user asks to publish or prepare one video for these three Chinese creator platforms.

FileKindSize
SKILL.mdskill md11.6 KB
references/content-generation.mdmarkdown2.3 KB
references/job-and-adapters.mdmarkdown6.3 KB
references/platform-interaction-signals.mdmarkdown1.8 KB
scripts/job_state.pyexecutablescript14.3 KB

references/job-and-adapters.md

View on GitHub
# 发布任务与平台适配器

## 任务对象

```json
{
  "job_id": "timestamp-content-slug",
  "video": {
    "path": "/absolute/path/video.mp4",
    "name": "video.mp4",
    "size_bytes": 0,
    "duration_seconds": 0,
    "content_brief": {}
  },
  "active_platform": null,
  "publish": {
    "mode": "scheduled",
    "final_action_owner": "user",
    "final_click_authorized_current_turn": false
  },
  "platforms": {
    "xiaohongshu": {
      "title": "",
      "body": "",
      "topics": [],
      "schedule": {"at": "2026-07-18T12:00:00", "timezone": "page"},
      "original_status": "not_checked",
      "declaration_status": "not_applicable",
      "state": "pending",
      "capabilities": {},
      "evidence": {"final_button_clicked": false},
      "last_verified_at": null,
      "error": null
    },
    "douyin": {
      "title": "",
      "body": "",
      "topics": [],
      "schedule": {"at": "2026-07-18T12:05:00", "timezone": "page"},
      "original_status": "not_applicable",
      "declaration_status": "not_checked",
      "state": "pending",
      "capabilities": {},
      "evidence": {"final_button_clicked": false},
      "last_verified_at": null,
      "error": null
    },
    "wechat_channels": {
      "title": "",
      "body": "",
      "topics": [],
      "schedule": {"at": "2026-07-18T12:10:00", "timezone": "page"},
      "original_status": "not_checked",
      "declaration_status": "not_applicable",
      "state": "pending",
      "capabilities": {},
      "evidence": {"final_button_clicked": false},
      "last_verified_at": null,
      "error": null
    }
  }
}
```

`publish.mode` 仅使用:

- `prepare_only`:上传并填写,停在最终按钮前。
- `scheduled`:设置定时,停在最终按钮前。
- `publish_now`:仅在当前任务明确授权代理点击最终按钮时使用。

默认值必须为 `final_action_owner: user` 和 `final_click_authorized_current_turn: false`。只有当前任务出现“现在直接点击发布”“现在直接点击发表”等明确指令时,才同时使用 `publish_now`、`final_action_owner: agent` 和 `final_click_authorized_current_turn: true`。历史授权和普通“发布到三平台”不能通过此门槛。

每个平台独立记录 `schedule`。`original_status` 表示原创能力,`declaration_status` 表示自主声明,两者禁止共用字段。状态值至少区分 `enabled`、`disabled`、`not_applicable`、`not_available`、`not_checked`,声明也可以记录平台读回的具体选项。

`schedule.at` 和非空的 `last_verified_at` 必须是可由标准库解析的 ISO 8601 日期时间,禁止使用 `tomorrow`、`yesterday` 等相对时间。状态对象禁止写入 Cookie、Token、Secret、Password、Credential、Authorization,以及 `api_key`、`private_key`、`client_key` 等凭证组合键。普通内容字段如 `keyboard_shortcut` 可以保留。

## 状态

- `pending`
- `page_ready`
- `upload_started`
- `media_ready`
- `copy_ready`
- `topics_ready`
- `options_ready`
- `review_ready`
- `published`
- `blocked`

## review_ready 证据门槛

平台进入 `review_ready` 前必须同时满足:

| 字段 | 必需证据 |
|---|---|
| `login_ready` | `true`,页面已登录并可编辑 |
| `media_ready` | `true`,视频预览、封面或完成提示存在 |
| `title_readback` | 非空字符串,等于任务标题 |
| `body_readback` | 字符串,等于任务正文 |
| `topic_elements` | 非空字符串数组,等于任务中的正式话题集合 |
| `schedule_readback` | `scheduled` 模式下为对象,时间和页面时区等于该平台 `schedule` |
| `original_readback` | 与 `original_status` 一致 |
| `declaration_readback` | 与 `declaration_status` 一致 |
| `final_button_visible` | 必须为 `true` |
| `final_button_clicked` | 必须为 `false` |
| `last_verified_at` | 非空 ISO 8601 时间 |

点击动作、视觉颜色和历史截图不能替代当前页面读回。任务状态写入后运行 `scripts/job_state.py validate`。

## published 证据门槛

只有 `publish.mode: publish_now`、`final_action_owner: agent`、`final_click_authorized_current_turn: true` 同时成立时,平台才可以从 `review_ready` 进入 `published`,并将 `final_button_clicked` 读回为 `true`。`job_state.py update` 要求旧状态严格等于 `review_ready`,禁止从 `media_ready` 或其他状态直接跃迁。其他模式和所有未发布状态必须明确记录 `final_button_clicked: false`。

## 上传与单平台串行状态机

上传阶段允许重叠:

```text
三平台预检 -> 依次触发三个上传 -> 分别读回 media_ready
```

任一平台达到 `media_ready` 后,收尾阶段严格串行:

```text
选择一个平台
  -> copy_ready
  -> topics_ready
  -> options_ready
  -> review_ready 或 blocked
  -> 当前任务已授权时可从 review_ready 进入 published
  -> 原子保存该平台状态
  -> 再选择下一个平台
```

`active_platform` 默认是 `null`。处于 `copy_ready`、`topics_ready`、`options_ready` 的平台最多一个,且必须与 `active_platform` 一致。`job_state.py update` 进入这些状态时自动设置活动平台,进入 `review_ready`、`blocked` 或 `published` 时自动清空。活动平台非空时,脚本拒绝对其他平台的任何更新。禁止在平台 A 填写正文期间切换到平台 B 设置话题或定时。当前平台卡住时,保存证据并标记 `blocked`,随后才处理下一平台。

## 恢复

1. 先读取状态文件,再读取 `browser.tabs.list()`。
2. 受控标签调用 `browser.tabs.get()` 复用。目标页不在受控列表时,才从 `user.openTabs()` 精确匹配并 claim。
3. 根据当前页面读回修正单个平台状态。页面已有视频预览时跳过上传,标题正文一致时跳过填写,正式话题不足时从第一个缺失话题继续。
4. 当前平台恢复到 `review_ready`、`published` 或 `blocked` 后,用 `job_state.py update` 原子保存,再切换下一平台。
5. 状态记录与页面冲突时以当前页面读取结果为准,更新 `last_verified_at`。
6. 页面结构无法识别时保存截图和错误,标记 `blocked`。禁止重置其他平台。

## 交付标签

finalize 前再次读取 `browser.tabs.list()`。只把当前仍受控的交付页标记 deliverable。用户原有且未受控的标签保持打开,不 claim、不关闭,也不加入 finalize 范围。
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall