autocrew 0.2.0 → 0.3.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/package.json +1 -1
- package/skills/configure/SKILL.md +228 -0
- package/skills/spawn-writer/SKILL.md +2 -1
- package/skills/teardown/SKILL.md +9 -6
- package/skills/write-script/SKILL.md +330 -114
- package/src/modules/config/migrate.test.ts +111 -0
- package/src/modules/config/migrate.ts +83 -0
- package/src/modules/config/service-config.test.ts +140 -0
- package/src/modules/config/service-config.ts +139 -0
- package/src/modules/intel/integration.test.ts +2 -1
- package/src/storage/pipeline-store.test.ts +3 -0
- package/src/storage/pipeline-store.ts +37 -0
- package/src/tools/content-save.ts +53 -0
package/package.json
CHANGED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: configure
|
|
3
|
+
description: |
|
|
4
|
+
Guided service configuration — detects unconfigured tools, shows feature impact,
|
|
5
|
+
walks users through setup module by module. Stores configs in services.json.
|
|
6
|
+
Triggers: "配置" / "configure" / "设置工具" / "config" / "设置" / "setup tools".
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Configure
|
|
10
|
+
|
|
11
|
+
> Orchestrator skill. Scans current service configuration state, reports gaps with
|
|
12
|
+
> feature impact, guides users through setup one module at a time. Configs stored
|
|
13
|
+
> in `~/.autocrew/services.json`, separate from creator identity (creator-profile.json).
|
|
14
|
+
|
|
15
|
+
## Step 1: Scan configuration state
|
|
16
|
+
|
|
17
|
+
Read `~/.autocrew/services.json`. If it doesn't exist, all modules are unconfigured.
|
|
18
|
+
|
|
19
|
+
For each of the 6 configurable modules, check status:
|
|
20
|
+
|
|
21
|
+
| Module | Check | Feature | Impact when missing |
|
|
22
|
+
|--------|-------|---------|-------------------|
|
|
23
|
+
| omni | `omni.apiKey` exists | 视频分析 | 视频拆解功能不可用 |
|
|
24
|
+
| coverGen | `coverGen.apiKey` exists | 封面生成 | AI 封面生成不可用 |
|
|
25
|
+
| videoCrawler | `videoCrawler.type` != "manual" | 视频采集器 | 视频链接下载需手动操作 |
|
|
26
|
+
| tts | `tts.apiKey` exists | TTS 语音合成 | 视频配音不可用 |
|
|
27
|
+
| platforms | any platform `configured: true` | 发布平台 | 自动发布不可用 |
|
|
28
|
+
| intelSources | any source configured | 情报源 | RSS/趋势/竞品监控为空 |
|
|
29
|
+
|
|
30
|
+
## Step 2: Display configuration report
|
|
31
|
+
|
|
32
|
+
Present to the user:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
AutoCrew 服务配置状态
|
|
36
|
+
|
|
37
|
+
✅ 已配置:
|
|
38
|
+
{list configured modules, or "暂无" if none}
|
|
39
|
+
|
|
40
|
+
❌ 未配置:
|
|
41
|
+
1. {module} — {impact}
|
|
42
|
+
2. {module} — {impact}
|
|
43
|
+
...
|
|
44
|
+
|
|
45
|
+
推荐先配置:{top 2 most impactful — typically omni and coverGen}
|
|
46
|
+
|
|
47
|
+
输入数字选择要配置的模块,或者说"全部"一次配完。
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Step 3: User selects a module
|
|
51
|
+
|
|
52
|
+
User says a number, module name, or "全部".
|
|
53
|
+
|
|
54
|
+
If "全部" → run each module's guided flow in order (omni → coverGen → videoCrawler → tts → platforms → intelSources). User can skip any module by saying "跳过".
|
|
55
|
+
|
|
56
|
+
## Step 4: Run the selected module's guided flow
|
|
57
|
+
|
|
58
|
+
### Module: 视频分析 (omni)
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
视频分析让你可以用 AI 拆解对标账号的视频 — 分析内容结构、画面语言、传播策略。
|
|
62
|
+
|
|
63
|
+
支持的 provider:
|
|
64
|
+
1. 小米 MiMo(推荐,性价比高)
|
|
65
|
+
注册地址:platform.xiaomimimo.com
|
|
66
|
+
模型:mimo-v2-omni
|
|
67
|
+
|
|
68
|
+
2. OpenAI GPT-4o
|
|
69
|
+
|
|
70
|
+
3. Google Gemini
|
|
71
|
+
|
|
72
|
+
4. 自定义(OpenAI 兼容 API)
|
|
73
|
+
|
|
74
|
+
你用哪个?
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
User selects → ask for API Key → save to `services.json`:
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"omni": {
|
|
81
|
+
"provider": "xiaomi",
|
|
82
|
+
"baseUrl": "https://api.xiaomimimo.com/v1",
|
|
83
|
+
"model": "mimo-v2-omni",
|
|
84
|
+
"apiKey": "<user input>"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Provider defaults:
|
|
90
|
+
- xiaomi: baseUrl `https://api.xiaomimimo.com/v1`, model `mimo-v2-omni`
|
|
91
|
+
- openai: baseUrl `https://api.openai.com/v1`, model `gpt-4o`
|
|
92
|
+
- google: baseUrl `https://generativelanguage.googleapis.com/v1beta`, model `gemini-2.0-flash`
|
|
93
|
+
- custom: ask for baseUrl and model
|
|
94
|
+
|
|
95
|
+
### Module: 封面生成 (coverGen)
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
封面生成用 AI 自动为你的内容创建封面图。
|
|
99
|
+
|
|
100
|
+
支持的 provider:
|
|
101
|
+
1. Google Gemini(推荐,支持 Imagen)
|
|
102
|
+
2. OpenAI DALL-E
|
|
103
|
+
3. 自定义
|
|
104
|
+
|
|
105
|
+
请选择并输入 API Key:
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Save to `services.json → coverGen`.
|
|
109
|
+
|
|
110
|
+
### Module: 视频采集器 (videoCrawler)
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
视频采集器用于从抖音/小红书等平台自动下载视频进行拆解。
|
|
114
|
+
|
|
115
|
+
1. MediaCrawl(需要本地安装)
|
|
116
|
+
请输入执行命令,例如:python3 /path/to/media_crawler/main.py
|
|
117
|
+
|
|
118
|
+
2. Playwright 浏览器自动化(需要已登录的浏览器会话)
|
|
119
|
+
|
|
120
|
+
3. 手动下载(不配置采集器,每次自己下载视频)
|
|
121
|
+
|
|
122
|
+
你选哪个?
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
If MediaCrawl → ask for command path.
|
|
126
|
+
Save to `services.json → videoCrawler`.
|
|
127
|
+
|
|
128
|
+
### Module: TTS 语音合成 (tts)
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
TTS 用于为视频脚本自动生成配音。
|
|
132
|
+
|
|
133
|
+
1. MiMo TTS(推荐,和视频分析同一个平台)
|
|
134
|
+
2. ElevenLabs
|
|
135
|
+
3. Azure Speech
|
|
136
|
+
4. 自定义
|
|
137
|
+
|
|
138
|
+
请选择并输入 API Key:
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Save to `services.json → tts`.
|
|
142
|
+
|
|
143
|
+
### Module: 发布平台 (platforms)
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
发布平台需要通过浏览器登录来获取授权。
|
|
147
|
+
|
|
148
|
+
你要配置哪个平台?
|
|
149
|
+
1. 小红书
|
|
150
|
+
2. 抖音
|
|
151
|
+
3. 微信公众号
|
|
152
|
+
4. B站
|
|
153
|
+
|
|
154
|
+
选择后会打开浏览器,你登录一次就行,cookie 会自动保存。
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
After browser login → mark platform as `configured: true` in `services.json → platforms`.
|
|
158
|
+
|
|
159
|
+
### Module: 情报源 (intelSources)
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
情报源为你的内容调研提供数据。有三类可配置:
|
|
163
|
+
|
|
164
|
+
1. RSS 订阅 — 输入你关注的博客/媒体的 RSS 链接
|
|
165
|
+
2. 趋势热榜 — 选择要监控的平台(微博/知乎/抖音/B站/HN/Reddit)
|
|
166
|
+
3. 竞品账号 — 输入你要关注的对标账号链接
|
|
167
|
+
|
|
168
|
+
先配哪个?
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
RSS → write to `~/.autocrew/data/pipeline/intel/_sources/rss.yaml`
|
|
172
|
+
Trends → write to `_sources/trends.yaml`
|
|
173
|
+
Competitors → write to `_sources/accounts.yaml`
|
|
174
|
+
Then update `services.json → intelSources` marking which are configured.
|
|
175
|
+
|
|
176
|
+
## Step 5: Save and verify
|
|
177
|
+
|
|
178
|
+
After each module:
|
|
179
|
+
|
|
180
|
+
1. Save config to `services.json` using `saveServiceConfig()`
|
|
181
|
+
2. Read it back to verify save succeeded
|
|
182
|
+
3. If the module has an API key, attempt a minimal test request:
|
|
183
|
+
- omni/tts: send a simple text completion ("hi") to verify the key works
|
|
184
|
+
- coverGen: send a minimal image generation test
|
|
185
|
+
- If test fails: show error, let user re-enter key or skip
|
|
186
|
+
- If test succeeds: confirm with ✅
|
|
187
|
+
|
|
188
|
+
4. Report:
|
|
189
|
+
```
|
|
190
|
+
✅ {module} 配置完成。
|
|
191
|
+
|
|
192
|
+
还有 {N} 个模块未配置。要继续吗?
|
|
193
|
+
1. 继续配置下一个
|
|
194
|
+
2. 先到这里,后面需要了再说
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Step 6: Completion
|
|
198
|
+
|
|
199
|
+
When user is done or all modules configured:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
配置完成。当前状态:
|
|
203
|
+
|
|
204
|
+
✅ 已配置:{list}
|
|
205
|
+
❌ 未配置:{list, or "无"}
|
|
206
|
+
|
|
207
|
+
随时可以说"配置"重新进入这个流程。
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Storage Rules
|
|
211
|
+
|
|
212
|
+
- **NEVER store API keys in creator-profile.json.** All service configs go to services.json.
|
|
213
|
+
- **NEVER store API keys in MEMORY.md or any memory file.** services.json is the only location.
|
|
214
|
+
- After saving, ALWAYS read back services.json to confirm the save succeeded.
|
|
215
|
+
|
|
216
|
+
## Error Handling
|
|
217
|
+
|
|
218
|
+
| Situation | Action |
|
|
219
|
+
|-----------|--------|
|
|
220
|
+
| services.json doesn't exist | Create it with empty config on first save |
|
|
221
|
+
| API key validation fails | Show error message, let user retry or skip |
|
|
222
|
+
| User wants to skip a module | Mark as skipped, continue to next |
|
|
223
|
+
| User says "全部" | Run all modules in order, allow skipping each |
|
|
224
|
+
| User reconfigures an existing module | Overwrite the old config, keep other modules |
|
|
225
|
+
|
|
226
|
+
## Changelog
|
|
227
|
+
|
|
228
|
+
- 2026-04-07: v1 — Initial version. 6 configurable modules with guided setup.
|
|
@@ -41,7 +41,8 @@ description: |
|
|
|
41
41
|
- Follow all steps in the `write-script` skill **including Step 5.5 (research → references)**.
|
|
42
42
|
Do not skip research for "simple" topics — the references folder must have ≥3 relevant
|
|
43
43
|
source files before writing begins. A draft without references is a bug.
|
|
44
|
-
- Save the result using `autocrew_content` tool
|
|
44
|
+
- Save the result using `autocrew_content` tool — **绝对禁止用 Write 工具直接写 draft.md**。
|
|
45
|
+
只有 `autocrew_content` save action 才能正确创建 meta.yaml + pipeline 结构 + 版本记录。
|
|
45
46
|
- Link to topic_id if available
|
|
46
47
|
|
|
47
48
|
5. Present the draft to user and offer next steps:
|
package/skills/teardown/SKILL.md
CHANGED
|
@@ -21,7 +21,8 @@ trigger: 当用户说"拆解"、"teardown"、"分析这条"、"对标分析"、"
|
|
|
21
21
|
## 前置加载
|
|
22
22
|
|
|
23
23
|
- `HAMLETDEER.md` — HKRR 框架、Clock Theory、Micro-Retention Techniques、Bang Moment Types
|
|
24
|
-
- `~/.autocrew/creator-profile.json` — 用于对比自己的定位
|
|
24
|
+
- `~/.autocrew/creator-profile.json` — 用于对比自己的定位
|
|
25
|
+
- `~/.autocrew/services.json` — 读取 videoCrawler 和 omni 配置(服务配置已迁移到此文件)
|
|
25
26
|
|
|
26
27
|
## Step 0: 输入类型检测
|
|
27
28
|
|
|
@@ -102,7 +103,7 @@ trigger: 当用户说"拆解"、"teardown"、"分析这条"、"对标分析"、"
|
|
|
102
103
|
|
|
103
104
|
**如果输入是本地文件路径:** 直接使用,跳到 Step V3。
|
|
104
105
|
|
|
105
|
-
**如果输入是视频链接:** 读取
|
|
106
|
+
**如果输入是视频链接:** 读取 `~/.autocrew/services.json` → `videoCrawler` 配置:
|
|
106
107
|
|
|
107
108
|
```
|
|
108
109
|
if videoCrawler.type == "mediacrawl":
|
|
@@ -136,10 +137,12 @@ elif videoCrawler.type == "manual" (或未配置):
|
|
|
136
137
|
|
|
137
138
|
### Step V3: Omni API 视频分析
|
|
138
139
|
|
|
139
|
-
**前置检查:** 读取
|
|
140
|
-
> "
|
|
140
|
+
**前置检查:** 读取 `~/.autocrew/services.json` → `omni` 配置。如果未配置:
|
|
141
|
+
> "视频拆解需要先配置 Omni API。请运行 `配置` 命令(configure skill)选择"视频分析"模块,
|
|
142
|
+
> 或手动在 `~/.autocrew/services.json` 中添加:
|
|
141
143
|
> ```json
|
|
142
|
-
> "
|
|
144
|
+
> "omni": {
|
|
145
|
+
> "provider": "xiaomi",
|
|
143
146
|
> "baseUrl": "https://api.xiaomimimo.com/v1",
|
|
144
147
|
> "model": "mimo-v2-omni",
|
|
145
148
|
> "apiKey": "your-api-key"
|
|
@@ -340,7 +343,7 @@ write-script 在创作时会自动搜索 `pipeline/intel/_teardowns/` 目录,
|
|
|
340
343
|
| 失败场景 | 处理 |
|
|
341
344
|
|---------|------|
|
|
342
345
|
| videoCrawler 未配置 | 降级到 manual 模式,提示用户手动下载 |
|
|
343
|
-
|
|
|
346
|
+
| omni 未配置 | 提示用户运行 configure skill 或手动编辑 services.json |
|
|
344
347
|
| 视频文件过大(>200MB)| 提示压缩或裁剪 |
|
|
345
348
|
| 视频时长过长(>30min)| 提示裁剪关键片段 |
|
|
346
349
|
| 采集器下载失败 | 降级到 manual 模式 |
|