autocrew 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HAMLETDEER.md +562 -0
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/README_CN.md +190 -0
- package/adapters/openclaw/index.ts +68 -0
- package/bin/autocrew.mjs +23 -0
- package/bin/autocrew.ts +13 -0
- package/openclaw.plugin.json +36 -0
- package/package.json +74 -0
- package/skills/_writing-style/SKILL.md +68 -0
- package/skills/audience-profiler/SKILL.md +241 -0
- package/skills/content-attribution/SKILL.md +128 -0
- package/skills/content-review/SKILL.md +257 -0
- package/skills/cover-generator/SKILL.md +93 -0
- package/skills/humanizer-zh/SKILL.md +75 -0
- package/skills/intel-digest/SKILL.md +57 -0
- package/skills/intel-pull/SKILL.md +74 -0
- package/skills/manage-pipeline/SKILL.md +63 -0
- package/skills/memory-distill/SKILL.md +89 -0
- package/skills/onboarding/SKILL.md +117 -0
- package/skills/pipeline-status/SKILL.md +51 -0
- package/skills/platform-rewrite/SKILL.md +125 -0
- package/skills/pre-publish/SKILL.md +142 -0
- package/skills/publish-content/SKILL.md +500 -0
- package/skills/remix-content/SKILL.md +77 -0
- package/skills/research/SKILL.md +127 -0
- package/skills/setup/SKILL.md +353 -0
- package/skills/spawn-batch-writer/SKILL.md +66 -0
- package/skills/spawn-planner/SKILL.md +72 -0
- package/skills/spawn-writer/SKILL.md +60 -0
- package/skills/teardown/SKILL.md +144 -0
- package/skills/title-craft/SKILL.md +234 -0
- package/skills/topic-ideas/SKILL.md +105 -0
- package/skills/video-timeline/SKILL.md +117 -0
- package/skills/write-script/SKILL.md +232 -0
- package/skills/xhs-cover-review/SKILL.md +48 -0
- package/src/adapters/browser/browser-cdp.ts +260 -0
- package/src/adapters/browser/browser-relay.ts +236 -0
- package/src/adapters/browser/gateway-client.ts +148 -0
- package/src/adapters/browser/types.ts +36 -0
- package/src/adapters/image/gemini.ts +219 -0
- package/src/adapters/research/tikhub.ts +19 -0
- package/src/cli/banner.ts +18 -0
- package/src/cli/bootstrap.ts +33 -0
- package/src/cli/commands/adapt.ts +28 -0
- package/src/cli/commands/advance.ts +28 -0
- package/src/cli/commands/assets.ts +24 -0
- package/src/cli/commands/audit.ts +18 -0
- package/src/cli/commands/contents.ts +18 -0
- package/src/cli/commands/cover.ts +58 -0
- package/src/cli/commands/events.ts +17 -0
- package/src/cli/commands/humanize.ts +27 -0
- package/src/cli/commands/index.ts +80 -0
- package/src/cli/commands/init.ts +28 -0
- package/src/cli/commands/intel.ts +55 -0
- package/src/cli/commands/learn.ts +34 -0
- package/src/cli/commands/memory.ts +18 -0
- package/src/cli/commands/migrate.ts +24 -0
- package/src/cli/commands/open.ts +21 -0
- package/src/cli/commands/pipelines.ts +18 -0
- package/src/cli/commands/pre-publish.ts +27 -0
- package/src/cli/commands/profile.ts +31 -0
- package/src/cli/commands/research.ts +36 -0
- package/src/cli/commands/restore.ts +28 -0
- package/src/cli/commands/review.ts +61 -0
- package/src/cli/commands/start.ts +28 -0
- package/src/cli/commands/status.ts +14 -0
- package/src/cli/commands/templates.ts +15 -0
- package/src/cli/commands/topics.ts +18 -0
- package/src/cli/commands/trash.ts +28 -0
- package/src/cli/commands/upgrade.ts +48 -0
- package/src/cli/commands/versions.ts +24 -0
- package/src/cli/index.ts +40 -0
- package/src/data/sensitive-words-builtin.json +114 -0
- package/src/data/source-presets.yaml +54 -0
- package/src/e2e.test.ts +596 -0
- package/src/modules/auth/cookie-manager.ts +113 -0
- package/src/modules/cards/template-engine.ts +74 -0
- package/src/modules/cards/templates/comparison-table.ts +71 -0
- package/src/modules/cards/templates/data-chart.ts +76 -0
- package/src/modules/cards/templates/flow-chart.ts +49 -0
- package/src/modules/cards/templates/key-points.ts +59 -0
- package/src/modules/cover/prompt-builder.test.ts +157 -0
- package/src/modules/cover/prompt-builder.ts +212 -0
- package/src/modules/cover/ratio-adapter.test.ts +122 -0
- package/src/modules/cover/ratio-adapter.ts +104 -0
- package/src/modules/filter/sensitive-words.test.ts +72 -0
- package/src/modules/filter/sensitive-words.ts +212 -0
- package/src/modules/humanizer/zh.test.ts +75 -0
- package/src/modules/humanizer/zh.ts +175 -0
- package/src/modules/intel/collector.ts +19 -0
- package/src/modules/intel/collectors/competitor.test.ts +71 -0
- package/src/modules/intel/collectors/competitor.ts +65 -0
- package/src/modules/intel/collectors/rss.test.ts +56 -0
- package/src/modules/intel/collectors/rss.ts +70 -0
- package/src/modules/intel/collectors/trends.test.ts +80 -0
- package/src/modules/intel/collectors/trends.ts +107 -0
- package/src/modules/intel/collectors/web-search.test.ts +85 -0
- package/src/modules/intel/collectors/web-search.ts +81 -0
- package/src/modules/intel/integration.test.ts +203 -0
- package/src/modules/intel/intel-engine.test.ts +103 -0
- package/src/modules/intel/intel-engine.ts +96 -0
- package/src/modules/intel/source-config.test.ts +113 -0
- package/src/modules/intel/source-config.ts +131 -0
- package/src/modules/learnings/diff-tracker.test.ts +144 -0
- package/src/modules/learnings/diff-tracker.ts +189 -0
- package/src/modules/learnings/rule-distiller.ts +141 -0
- package/src/modules/memory/distill.ts +208 -0
- package/src/modules/migrate/legacy-migrate.test.ts +169 -0
- package/src/modules/migrate/legacy-migrate.ts +229 -0
- package/src/modules/pro/api-client.ts +192 -0
- package/src/modules/pro/gate.test.ts +110 -0
- package/src/modules/pro/gate.ts +104 -0
- package/src/modules/profile/creator-profile.test.ts +178 -0
- package/src/modules/profile/creator-profile.ts +248 -0
- package/src/modules/publish/douyin-api.ts +34 -0
- package/src/modules/publish/wechat-mp.ts +320 -0
- package/src/modules/publish/xiaohongshu-api.ts +127 -0
- package/src/modules/research/free-engine.ts +360 -0
- package/src/modules/timeline/markup-generator.ts +63 -0
- package/src/modules/timeline/parser.ts +275 -0
- package/src/modules/workflow/templates.ts +124 -0
- package/src/modules/writing/platform-rewrite.ts +190 -0
- package/src/modules/writing/title-hashtag.ts +385 -0
- package/src/runtime/context.test.ts +97 -0
- package/src/runtime/context.ts +129 -0
- package/src/runtime/events.test.ts +83 -0
- package/src/runtime/events.ts +104 -0
- package/src/runtime/hooks.ts +174 -0
- package/src/runtime/tool-runner.test.ts +204 -0
- package/src/runtime/tool-runner.ts +282 -0
- package/src/runtime/workflow-engine.test.ts +455 -0
- package/src/runtime/workflow-engine.ts +391 -0
- package/src/server/index.ts +409 -0
- package/src/server/start.ts +39 -0
- package/src/storage/local-store.test.ts +304 -0
- package/src/storage/local-store.ts +704 -0
- package/src/storage/pipeline-store.test.ts +363 -0
- package/src/storage/pipeline-store.ts +698 -0
- package/src/tools/asset.ts +96 -0
- package/src/tools/content-save.ts +276 -0
- package/src/tools/cover-review.ts +221 -0
- package/src/tools/humanize.ts +54 -0
- package/src/tools/init.ts +133 -0
- package/src/tools/intel.ts +92 -0
- package/src/tools/memory.ts +76 -0
- package/src/tools/pipeline-ops.ts +109 -0
- package/src/tools/pipeline.ts +168 -0
- package/src/tools/pre-publish.ts +232 -0
- package/src/tools/publish.ts +183 -0
- package/src/tools/registry.ts +198 -0
- package/src/tools/research.ts +304 -0
- package/src/tools/review.ts +305 -0
- package/src/tools/rewrite.ts +165 -0
- package/src/tools/status.ts +30 -0
- package/src/tools/timeline.ts +234 -0
- package/src/tools/topic-create.ts +50 -0
- package/src/types/providers.ts +69 -0
- package/src/types/timeline.test.ts +147 -0
- package/src/types/timeline.ts +83 -0
- package/src/utils/retry.test.ts +97 -0
- package/src/utils/retry.ts +85 -0
- package/templates/AGENTS.md +99 -0
- package/templates/SOUL.md +31 -0
- package/templates/TOOLS.md +76 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: platform-rewrite
|
|
3
|
+
description: |
|
|
4
|
+
平台 native 改写 skill。把一个母稿改成不同平台的版本,强调"重写而不是裁剪"。支持单平台和多平台一键改写,自动生成各平台标题和 hashtag。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 平台改写
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
把一篇母稿改写成各平台原生版本。重写,不是裁剪。
|
|
12
|
+
|
|
13
|
+
支持平台:小红书 · 抖音 · 公众号 · 视频号 · B站
|
|
14
|
+
|
|
15
|
+
## 规则
|
|
16
|
+
|
|
17
|
+
0. **When adapting titles across platforms, do NOT just truncate. Re-craft using `skills/title-craft/SKILL.md` methodology fitted to the target platform's character limits and audience behavior.**
|
|
18
|
+
1. Never call a simple trim "adaptation".
|
|
19
|
+
2. Start from the strongest single angle in the source draft.
|
|
20
|
+
3. Generate the first structured platform version via `autocrew_rewrite`.
|
|
21
|
+
4. If the user asks for multiple platforms, use the **batch flow** (Step 2 below).
|
|
22
|
+
5. Run `humanizer-zh` before final delivery.
|
|
23
|
+
|
|
24
|
+
## 第一步 — 单平台改写
|
|
25
|
+
|
|
26
|
+
From an existing draft:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"action": "adapt_platform",
|
|
31
|
+
"content_id": "content-xxx",
|
|
32
|
+
"target_platform": "douyin",
|
|
33
|
+
"save_as_draft": true
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
From raw text:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"action": "adapt_platform",
|
|
42
|
+
"title": "原始标题",
|
|
43
|
+
"body": "原始正文",
|
|
44
|
+
"target_platform": "xiaohongshu"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
After rewrite completes:
|
|
49
|
+
|
|
50
|
+
1. **Generate title variants + hashtags** for the target platform:
|
|
51
|
+
- Use `title-hashtag.ts` → `generateForPlatform(topic, platform, { tags })`
|
|
52
|
+
- Pick the best title variant, show all alternatives to user.
|
|
53
|
+
- Attach hashtags to the saved draft via `autocrew_content` action="update":
|
|
54
|
+
```json
|
|
55
|
+
{ "action": "update", "id": "<new-content-id>", "hashtags": ["#tag1", "#tag2"] }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
2. **Run humanizer** on the adapted text if it reads too smooth or generic.
|
|
59
|
+
|
|
60
|
+
3. **Show output** to user: adapted title, body, hashtags, and notes.
|
|
61
|
+
|
|
62
|
+
## 第二步 — 多平台批量改写
|
|
63
|
+
|
|
64
|
+
When user says "帮我改成所有平台" or specifies 2+ platforms:
|
|
65
|
+
|
|
66
|
+
1. Determine target platforms. Default all 5 if user says "全平台":
|
|
67
|
+
`["xiaohongshu", "douyin", "wechat_mp", "wechat_video", "bilibili"]`
|
|
68
|
+
|
|
69
|
+
2. **Generate titles + hashtags for all platforms in one call:**
|
|
70
|
+
- Use `title-hashtag.ts` → `generateForAllPlatforms(baseTopic, platforms, { tags })`
|
|
71
|
+
- This returns `PlatformTitleResult[]` with titles, hashtags, and tips per platform.
|
|
72
|
+
|
|
73
|
+
3. **Rewrite each platform** sequentially via `autocrew_rewrite`:
|
|
74
|
+
```
|
|
75
|
+
for each platform:
|
|
76
|
+
1. autocrew_rewrite action="adapt_platform" → get adapted body
|
|
77
|
+
2. autocrew_content action="save" → save as new draft with platform-specific title + hashtags
|
|
78
|
+
3. autocrew_humanize (if needed)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
4. **Link siblings**: after all variants are saved, update each with sibling IDs:
|
|
82
|
+
```json
|
|
83
|
+
{ "action": "update", "id": "<content-id>", "siblings": ["id-1", "id-2", "id-3"] }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
5. **Summary table** — show user a comparison:
|
|
87
|
+
|
|
88
|
+
| 平台 | 标题 | 字数 | Hashtags | Content ID |
|
|
89
|
+
|------|------|------|----------|------------|
|
|
90
|
+
| 小红书 | ... | 800 | 8 | content-xxx |
|
|
91
|
+
| 抖音 | ... | 600 | 5 | content-yyy |
|
|
92
|
+
| ... | ... | ... | ... | ... |
|
|
93
|
+
|
|
94
|
+
## 第三步 — 改写后审核(可选)
|
|
95
|
+
|
|
96
|
+
If `creator-profile.json` has `styleCalibrated: true`:
|
|
97
|
+
|
|
98
|
+
- Auto-run `autocrew_review` action="full_review" on each adapted version.
|
|
99
|
+
- Flag any version that fails review.
|
|
100
|
+
- Offer to auto-fix or let user decide.
|
|
101
|
+
|
|
102
|
+
## 输出
|
|
103
|
+
|
|
104
|
+
Always tell the user:
|
|
105
|
+
|
|
106
|
+
- Which platform version(s) you created
|
|
107
|
+
- Whether each was saved as a new draft (with content ID)
|
|
108
|
+
- Title alternatives from title-hashtag
|
|
109
|
+
- Hashtags attached
|
|
110
|
+
- What still needs manual polish
|
|
111
|
+
- Sibling relationships (if batch)
|
|
112
|
+
|
|
113
|
+
## 错误处理
|
|
114
|
+
|
|
115
|
+
| 故障 | 处理 |
|
|
116
|
+
|------|------|
|
|
117
|
+
| 源内容未找到 | 向用户索要 content_id 或原始文本 |
|
|
118
|
+
| 不支持的平台 | 列出支持平台,让用户选择 |
|
|
119
|
+
| title-hashtag 返回空 | 回退到原始标题 + tags 基础标签 |
|
|
120
|
+
| 保存失败 | 在聊天中输出改写文本让用户复制,重试一次 |
|
|
121
|
+
|
|
122
|
+
## 变更日志
|
|
123
|
+
|
|
124
|
+
- 2026-04-01: v2 — Added multi-platform batch flow, title-hashtag integration, sibling linking, optional post-rewrite review.
|
|
125
|
+
- 2026-03-31: v1 — Initial single-platform rewrite skill.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pre-publish
|
|
3
|
+
description: |
|
|
4
|
+
发布前检查清单 skill。在内容发布前自动检查所有前置条件是否满足,输出 checklist 状态。只有全部通过才允许发布。
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 发布前检查
|
|
8
|
+
|
|
9
|
+
> 门控技能。在发布前拦截,确保内容质量和完整性。
|
|
10
|
+
|
|
11
|
+
## 触发时机
|
|
12
|
+
|
|
13
|
+
- User says "发布", "推送", "publish", "上线"
|
|
14
|
+
- User runs `autocrew_publish`
|
|
15
|
+
- Agent is about to transition content to `publishing` status
|
|
16
|
+
|
|
17
|
+
## 检查项
|
|
18
|
+
|
|
19
|
+
对目标内容运行以下检查,每项 pass/fail:
|
|
20
|
+
|
|
21
|
+
### 1. Content Review — 审核通过
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{ "action": "full_review", "content_id": "<id>", "platform": "<platform>" }
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- ✅ Pass: `passed === true` (no sensitive words, no AI traces, quality ≥ 60)
|
|
28
|
+
- ❌ Fail: show `summary` and `fixes`, offer auto-fix
|
|
29
|
+
|
|
30
|
+
### 2. Cover Review — 封面审核通过 (XHS/Douyin only)
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{ "action": "read", "content_id": "<id>" }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Check `cover-review.json` in the content's asset directory:
|
|
37
|
+
- ✅ Pass: `status === "approved"` and `approvedLabel` exists
|
|
38
|
+
- ⏭️ Skip: platform is `wechat_mp` or `bilibili` (cover optional)
|
|
39
|
+
- ❌ Fail: no cover review or status is `pending`/`reviewing`
|
|
40
|
+
|
|
41
|
+
### 3. Hashtags — 标签已生成
|
|
42
|
+
|
|
43
|
+
Check content metadata:
|
|
44
|
+
- ✅ Pass: `hashtags` array exists and has ≥ 1 item
|
|
45
|
+
- ❌ Fail: no hashtags → offer to generate via `title-hashtag.ts`
|
|
46
|
+
|
|
47
|
+
### 4. Title — 标题符合平台规范
|
|
48
|
+
|
|
49
|
+
Check title against platform rules from `title-hashtag.ts`:
|
|
50
|
+
- ✅ Pass: title length within `titleLengthRange` for the platform
|
|
51
|
+
- ⚠️ Warn: title exists but exceeds `maxTitleLength` → suggest trimming
|
|
52
|
+
- ❌ Fail: no title
|
|
53
|
+
|
|
54
|
+
### 5. Platform Set — 平台已指定
|
|
55
|
+
|
|
56
|
+
- ✅ Pass: `platform` field is set and is a supported value
|
|
57
|
+
- ❌ Fail: platform is empty or "unset"
|
|
58
|
+
|
|
59
|
+
### 6. Body Length — 正文字数达标
|
|
60
|
+
|
|
61
|
+
| Platform | Min chars |
|
|
62
|
+
|----------|-----------|
|
|
63
|
+
| xiaohongshu | 200 |
|
|
64
|
+
| douyin | 100 |
|
|
65
|
+
| wechat_mp | 800 |
|
|
66
|
+
| wechat_video | 100 |
|
|
67
|
+
| bilibili | 200 |
|
|
68
|
+
|
|
69
|
+
- ✅ Pass: body length ≥ platform minimum
|
|
70
|
+
- ❌ Fail: too short
|
|
71
|
+
|
|
72
|
+
## 执行流程
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
1. Load content via autocrew_content action="get"
|
|
76
|
+
2. Run checks 1-6
|
|
77
|
+
3. Build checklist output
|
|
78
|
+
4. If ALL pass → allow publish, transition to "publish_ready"
|
|
79
|
+
5. If ANY fail → block publish, show what needs fixing
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 输出格式
|
|
83
|
+
|
|
84
|
+
<output_template lang="zh-CN">
|
|
85
|
+
```
|
|
86
|
+
📋 发布前检查 — content-xxx (小红书)
|
|
87
|
+
|
|
88
|
+
✅ 内容审核:通过 (质量 78/100)
|
|
89
|
+
✅ 封面审核:已选定 A 方案
|
|
90
|
+
✅ Hashtags:8 个标签
|
|
91
|
+
✅ 标题规范:「标题内容」(16字,符合 10-18 范围)
|
|
92
|
+
✅ 平台设置:xiaohongshu
|
|
93
|
+
✅ 正文字数:856 字 (≥200)
|
|
94
|
+
|
|
95
|
+
🟢 全部通过,可以发布!
|
|
96
|
+
```
|
|
97
|
+
</output_template>
|
|
98
|
+
|
|
99
|
+
Or if something fails:
|
|
100
|
+
|
|
101
|
+
<output_template lang="zh-CN">
|
|
102
|
+
```
|
|
103
|
+
📋 发布前检查 — content-yyy (抖音)
|
|
104
|
+
|
|
105
|
+
✅ 内容审核:通过
|
|
106
|
+
❌ 封面审核:未完成 → 运行 autocrew_cover_review 创建候选
|
|
107
|
+
✅ Hashtags:5 个标签
|
|
108
|
+
⚠️ 标题规范:「标题太长了超过限制」(32字,超出 25 上限)
|
|
109
|
+
✅ 平台设置:douyin
|
|
110
|
+
✅ 正文字数:420 字
|
|
111
|
+
|
|
112
|
+
🔴 2 项未通过,请先修复再发布。
|
|
113
|
+
```
|
|
114
|
+
</output_template>
|
|
115
|
+
|
|
116
|
+
## 自动修复建议
|
|
117
|
+
|
|
118
|
+
检查失败时,提供具体修复方案:
|
|
119
|
+
|
|
120
|
+
| Failed Check | Suggested Action |
|
|
121
|
+
|-------------|-----------------|
|
|
122
|
+
| Content review | `autocrew_review` action="auto_fix" |
|
|
123
|
+
| Cover review | `autocrew_cover_review` action="create_candidates" |
|
|
124
|
+
| No hashtags | `generateHashtags(topic, platform, tags)` then update content |
|
|
125
|
+
| Title too long | `generateTitleVariants(topic, platform)` then pick shorter one |
|
|
126
|
+
| No platform | Ask user which platform |
|
|
127
|
+
| Body too short | Suggest expanding with more examples/data points |
|
|
128
|
+
|
|
129
|
+
## 与发布流程的集成
|
|
130
|
+
|
|
131
|
+
If all checks pass and user confirms:
|
|
132
|
+
|
|
133
|
+
1. Transition content to `publish_ready`:
|
|
134
|
+
```json
|
|
135
|
+
{ "action": "transition", "id": "<id>", "target_status": "publish_ready" }
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
2. Then proceed with the actual publish action (e.g. `autocrew_publish`).
|
|
139
|
+
|
|
140
|
+
## 变更日志
|
|
141
|
+
|
|
142
|
+
- 2026-04-01: v1 — Initial pre-publish checklist with 6 checks, auto-fix suggestions, and publish gate.
|