@geoly-ai/social-hub-cli 0.0.2 → 0.0.4

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.
Files changed (93) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +2 -0
  3. package/dist/index.js.map +1 -1
  4. package/dist/register-skills.d.ts +3 -0
  5. package/dist/register-skills.d.ts.map +1 -0
  6. package/dist/register-skills.js +321 -0
  7. package/dist/register-skills.js.map +1 -0
  8. package/dist/skills/agent-targets.d.ts +7 -0
  9. package/dist/skills/agent-targets.d.ts.map +1 -0
  10. package/dist/skills/agent-targets.js +367 -0
  11. package/dist/skills/agent-targets.js.map +1 -0
  12. package/dist/skills/agent-targets.test.d.ts +2 -0
  13. package/dist/skills/agent-targets.test.d.ts.map +1 -0
  14. package/dist/skills/agent-targets.test.js +19 -0
  15. package/dist/skills/agent-targets.test.js.map +1 -0
  16. package/dist/skills/doctor.d.ts +23 -0
  17. package/dist/skills/doctor.d.ts.map +1 -0
  18. package/dist/skills/doctor.js +112 -0
  19. package/dist/skills/doctor.js.map +1 -0
  20. package/dist/skills/github-source.d.ts +34 -0
  21. package/dist/skills/github-source.d.ts.map +1 -0
  22. package/dist/skills/github-source.js +198 -0
  23. package/dist/skills/github-source.js.map +1 -0
  24. package/dist/skills/github-source.test.d.ts +2 -0
  25. package/dist/skills/github-source.test.d.ts.map +1 -0
  26. package/dist/skills/github-source.test.js +46 -0
  27. package/dist/skills/github-source.test.js.map +1 -0
  28. package/dist/skills/install-planner.d.ts +18 -0
  29. package/dist/skills/install-planner.d.ts.map +1 -0
  30. package/dist/skills/install-planner.js +91 -0
  31. package/dist/skills/install-planner.js.map +1 -0
  32. package/dist/skills/install-planner.test.d.ts +2 -0
  33. package/dist/skills/install-planner.test.d.ts.map +1 -0
  34. package/dist/skills/install-planner.test.js +41 -0
  35. package/dist/skills/install-planner.test.js.map +1 -0
  36. package/dist/skills/installer.d.ts +10 -0
  37. package/dist/skills/installer.d.ts.map +1 -0
  38. package/dist/skills/installer.js +108 -0
  39. package/dist/skills/installer.js.map +1 -0
  40. package/dist/skills/manifest.d.ts +9 -0
  41. package/dist/skills/manifest.d.ts.map +1 -0
  42. package/dist/skills/manifest.js +105 -0
  43. package/dist/skills/manifest.js.map +1 -0
  44. package/dist/skills/marketplace-adapters/claude-plugin.d.ts +6 -0
  45. package/dist/skills/marketplace-adapters/claude-plugin.d.ts.map +1 -0
  46. package/dist/skills/marketplace-adapters/claude-plugin.js +39 -0
  47. package/dist/skills/marketplace-adapters/claude-plugin.js.map +1 -0
  48. package/dist/skills/marketplace-adapters/skills-sh.d.ts +14 -0
  49. package/dist/skills/marketplace-adapters/skills-sh.d.ts.map +1 -0
  50. package/dist/skills/marketplace-adapters/skills-sh.js +24 -0
  51. package/dist/skills/marketplace-adapters/skills-sh.js.map +1 -0
  52. package/dist/skills/paths.d.ts +3 -0
  53. package/dist/skills/paths.d.ts.map +1 -0
  54. package/dist/skills/paths.js +13 -0
  55. package/dist/skills/paths.js.map +1 -0
  56. package/dist/skills/source-resolver.d.ts +16 -0
  57. package/dist/skills/source-resolver.d.ts.map +1 -0
  58. package/dist/skills/source-resolver.js +79 -0
  59. package/dist/skills/source-resolver.js.map +1 -0
  60. package/dist/skills/state-store.d.ts +9 -0
  61. package/dist/skills/state-store.d.ts.map +1 -0
  62. package/dist/skills/state-store.js +39 -0
  63. package/dist/skills/state-store.js.map +1 -0
  64. package/dist/skills/target-detector.d.ts +13 -0
  65. package/dist/skills/target-detector.d.ts.map +1 -0
  66. package/dist/skills/target-detector.js +132 -0
  67. package/dist/skills/target-detector.js.map +1 -0
  68. package/dist/skills/tui.d.ts +10 -0
  69. package/dist/skills/tui.d.ts.map +1 -0
  70. package/dist/skills/tui.js +140 -0
  71. package/dist/skills/tui.js.map +1 -0
  72. package/dist/skills/types.d.ts +94 -0
  73. package/dist/skills/types.d.ts.map +1 -0
  74. package/dist/skills/types.js +2 -0
  75. package/dist/skills/types.js.map +1 -0
  76. package/dist/update-check.d.ts.map +1 -1
  77. package/dist/update-check.js +6 -1
  78. package/dist/update-check.js.map +1 -1
  79. package/package.json +7 -5
  80. package/skills/README.md +113 -0
  81. package/skills/manifest.json +68 -0
  82. package/skills/social-hub-accounts/SKILL.md +25 -0
  83. package/skills/social-hub-admin/SKILL.md +36 -0
  84. package/skills/social-hub-calendar-jobs/SKILL.md +25 -0
  85. package/skills/social-hub-cli/SKILL.md +363 -0
  86. package/skills/social-hub-cli/evals/evals.json +23 -0
  87. package/skills/social-hub-intelligence/SKILL.md +25 -0
  88. package/skills/social-hub-migration/SKILL.md +32 -0
  89. package/skills/social-hub-openclaw-context/SKILL.md +45 -0
  90. package/skills/social-hub-ops-runtime/SKILL.md +40 -0
  91. package/skills/social-hub-posts/SKILL.md +20 -0
  92. package/skills/social-hub-publishing/SKILL.md +31 -0
  93. package/skills/social-hub-shared/SKILL.md +41 -0
@@ -0,0 +1,363 @@
1
+ ---
2
+ name: social-hub-cli
3
+ description: >-
4
+ Social Ops Hub 命令行 social-hub:账号、事件、日历、调度任务、Reddit 帖、报告、API Key、OpenClaw 回填等。
5
+ 只要用户提到 social-hub、Social Ops Hub、Hub 写数据、查账号、发帖计划、permalink 回填、openclaw、
6
+ 调度任务、团队 API Key、互动事件,或要在 Hub 里查/改运营数据,就应使用本 skill(即使用户没说 CLI)。
7
+ 先读本 skill 做路由,再打开对应领域 skill(ops-runtime、openclaw-context 等)。
8
+ metadata:
9
+ cliVersion: ">=0.0.4"
10
+ homepage: https://github.com/your-org/social-ops-hub/tree/main/skills
11
+ ---
12
+
13
+ # Social Hub CLI
14
+
15
+ `social-hub` 封装 Social Ops Hub REST API,供人工与 Agent 使用。配套领域 skill 与本目录同级(`skills/social-hub-*`)。
16
+
17
+ ## 安装 Skill
18
+
19
+ - **推荐(CLI)**:`social-hub skills tui` 或 `social-hub skills install --agent cursor --global --yes`
20
+ - **免全局安装**:`npx @geoly-ai/social-hub-cli skills bootstrap`
21
+ - **GitHub 最新**:`social-hub skills install --source github --repo geoly-ai/geoly-reddit --yes`
22
+ - **更新已装 skill**:`social-hub skills update --all --yes`(可加 `--source github`)
23
+ - **检查状态**:`social-hub skills doctor`
24
+ - **同仓开发**:`pnpm skills:install`(或 `pnpm --filter @geoly-ai/social-hub-cli run build` 后使用内置 bundle)
25
+ - **skill.sh / 公开市场**:从 [skill.sh](https://skill.sh) 导入本仓库 `skills/` 子目录(见 `skills/README.md`)
26
+
27
+ ## 领域 Skill 路由(先读子 skill)
28
+
29
+ | 场景 | Skill |
30
+ |------|--------|
31
+ | 配置 / doctor / auth | `social-hub-shared` |
32
+ | OpenClaw 领任务 / 回填 | `social-hub-ops-runtime` |
33
+ | 账号/任务上下文(DB) | `social-hub-openclaw-context` |
34
+ | 账号 CRUD | `social-hub-accounts` |
35
+ | Reddit 帖 | `social-hub-posts` |
36
+ | 日历 / jobs | `social-hub-calendar-jobs` |
37
+ | 发布闭环 | `social-hub-publishing` |
38
+ | settings / invites | `social-hub-admin` |
39
+ | 情报 | `social-hub-intelligence` |
40
+ | 导入导出 replay | `social-hub-migration` |
41
+
42
+ `social-hub` 是 Social Ops Hub 的命令行工具,封装了全部 REST API。
43
+
44
+ ## 配置(环境变量)
45
+
46
+ 使用前需设置以下环境变量:
47
+
48
+ ```bash
49
+ export SOCIAL_HUB_API_URL="http://localhost:3000" # Hub API 地址,默认 localhost:3000
50
+ export SOCIAL_HUB_API_KEY="soh_..." # API Key(除 health 外均必需)
51
+ export SOCIAL_HUB_TEAM_ID="<uuid>" # 当前操作的 Team UUID(命令中用 $SOCIAL_HUB_TEAM_ID)
52
+ ```
53
+
54
+ `health` 命令不需要 API Key。其他所有命令必须设置 `SOCIAL_HUB_API_KEY`。
55
+
56
+ ## 前置步骤:Build
57
+
58
+ 在 **本 monorepo 根目录** 首次使用或更新代码后,需先 build:
59
+
60
+ ```bash
61
+ cd "$(git rev-parse --show-toplevel)"
62
+ pnpm --filter @geoly-ai/social-hub-sdk run build
63
+ pnpm --filter @geoly-ai/social-hub-cli run build
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 初始化工作流(新环境冷启动)
69
+
70
+ ### 步骤 0:部署前置
71
+
72
+ ```bash
73
+ # 1. 复制并填写环境变量
74
+ cp .env.example .env
75
+ # 至少填写:DATABASE_URL、REDIS_URL、API_KEY_PEPPER、JWT_SECRET
76
+
77
+ # 2. 执行数据库迁移
78
+ pnpm run db:migrate
79
+
80
+ # 3. 初始化最小管理员种子(自动创建 moss team + admin 用户 + seed-cli API Key)
81
+ SOCIAL_OPS_SEED_MODE=minimal-admin pnpm run db:seed
82
+ # 控制台输出:
83
+ # admin@local.test / password123
84
+ # SOCIAL_HUB_TEAM_ID=<uuid>
85
+ # SOCIAL_HUB_API_KEY=soh_...
86
+
87
+ # 4. 导出环境变量(或写入 .env)
88
+ export SOCIAL_HUB_API_URL="http://localhost:3000"
89
+ export SOCIAL_HUB_API_KEY="soh_..." # 从上面控制台复制
90
+ export SOCIAL_HUB_TEAM_ID="<moss-team-uuid>" # 从上面控制台复制
91
+
92
+ # 5. 验证 Hub 是否正常
93
+ social-hub health
94
+ ```
95
+
96
+ ### 步骤 1:创建新团队(若需要独立 team)
97
+
98
+ ```bash
99
+ # 使用 admin API Key 创建新团队
100
+ NEW_TEAM=$(social-hub agent-teams create --slug javis --name "Javis Agent Team" | jq -r '.id')
101
+ export T=$NEW_TEAM
102
+
103
+ # 创建运营用户(密码直接设置,不需要 set-password 额外操作)
104
+ social-hub users create -t $T -j '{"email":"ops@javis.local","password":"Ops2026!","name":"Javis Ops","role":"manager"}'
105
+
106
+ # 为新团队创建 API Key(Web 登录后进入 API Keys 页面,或用 admin key)
107
+ social-hub api-keys create -t $T -j '{"name":"javis-ops","role":"manager"}'
108
+ # → 记录返回的 rawKey,后续操作换用该 Key
109
+
110
+ export SOCIAL_HUB_TEAM_ID=$T
111
+ export SOCIAL_HUB_API_KEY="soh_..." # 上面新建的 Key
112
+
113
+ # 确认团队列表
114
+ social-hub agent-teams list
115
+ ```
116
+
117
+ ### 步骤 2:创建业务数据(Brand → Campaign → Account → Plan)
118
+
119
+ ```bash
120
+ T=$SOCIAL_HUB_TEAM_ID
121
+
122
+ # 创建品牌
123
+ BRAND_ID=$(social-hub brands create -t $T -j '{"name":"My Brand","slug":"my-brand"}' | jq -r '.id')
124
+
125
+ # 创建 Campaign
126
+ CAMP_ID=$(social-hub campaigns create -t $T -j \
127
+ "{\"brandId\":\"$BRAND_ID\",\"name\":\"2026 Q3 Launch\"}" | jq -r '.id')
128
+
129
+ # 添加 Reddit 账号
130
+ ACCOUNT_ID=$(social-hub accounts create -t $T -j \
131
+ "{\"platform\":\"reddit\",\"handle\":\"u/my_ops_account\",\"credentialsRef\":\"vault:javis/main\"}" | jq -r '.id')
132
+
133
+ # 创建内容草稿
134
+ DRAFT_ID=$(social-hub drafts create -t $T -j \
135
+ "{\"campaignId\":\"$CAMP_ID\",\"title\":\"Launch Post\",\"body\":\"...\"}" | jq -r '.id')
136
+
137
+ # 创建发布计划(自动生成 scheduled_jobs)
138
+ social-hub plans create -t $T -j "{
139
+ \"campaignId\": \"$CAMP_ID\",
140
+ \"name\": \"Q3 Week 1\",
141
+ \"entries\": [{
142
+ \"socialAccountId\": \"$ACCOUNT_ID\",
143
+ \"subreddit\": \"LocalLLaMA\",
144
+ \"plannedAt\": \"2026-07-01T09:00:00Z\",
145
+ \"contentDraftId\": \"$DRAFT_ID\"
146
+ }]
147
+ }"
148
+
149
+ # 验证:查看日历和任务
150
+ social-hub calendar list -t $T --status scheduled
151
+ social-hub jobs list -t $T --status scheduled
152
+ ```
153
+
154
+ ---
155
+
156
+ ## 命令速查表
157
+
158
+ ### health & dashboard
159
+
160
+ ```bash
161
+ social-hub health
162
+ social-hub dashboard summary -t $T
163
+ social-hub dashboard summary -t $T # 支持 campaignId 过滤(通过 API 传参)
164
+ ```
165
+
166
+ ### 互动事件
167
+
168
+ ```bash
169
+ social-hub events append -t $T --type comment --payload '{"permalink":"https://..."}'
170
+ social-hub events list -t $T -n 20 # 简单列表
171
+ social-hub events list-full -t $T --account <uuid> # 按账号过滤
172
+ social-hub events list-full -t $T --type comment --result succeeded --from 2026-05-01T00:00:00Z
173
+ social-hub events export-csv -t $T > events.csv
174
+ social-hub events export-csv -t $T --account <uuid> --from 2026-05-01T00:00:00Z > filtered.csv
175
+ ```
176
+
177
+ ### 发布日历
178
+
179
+ ```bash
180
+ social-hub calendar list -t $T --status scheduled
181
+ social-hub calendar list-full -t $T --account <accountId> --status scheduled
182
+ social-hub calendar patch -t $T -e <entryId> --body '{"status":"succeeded","permalink":"https://..."}'
183
+ ```
184
+
185
+ ### 调度任务
186
+
187
+ ```bash
188
+ social-hub jobs list -t $T --status scheduled
189
+ social-hub jobs list-full -t $T --account <accountId>
190
+ social-hub jobs create -t $T -j '{"socialAccountId":"<uuid>","action":"engage","subreddit":"LocalLLaMA","runAt":"2026-05-07T09:00:00Z"}'
191
+ social-hub jobs agent-status -t $T -i <jobId> -j '{"status":"succeeded"}'
192
+ social-hub jobs agent-status -t $T -i <jobId> -j '{"status":"failed","lastError":"timeout"}'
193
+ social-hub jobs retry -t $T -i <jobId>
194
+ social-hub jobs cancel -t $T -i <jobId>
195
+ ```
196
+
197
+ ### 发布计划
198
+
199
+ ```bash
200
+ social-hub plans list -t $T
201
+ social-hub plans list -t $T --campaign <campaignId>
202
+ social-hub plans create -t $T -j '{"campaignId":"<uuid>","name":"Q3 Week1","entries":[{"socialAccountId":"<uuid>","subreddit":"LocalLLaMA","plannedAt":"2026-07-01T09:00:00Z"}]}'
203
+ social-hub plans cancel -t $T --plan <planId>
204
+ ```
205
+
206
+ ### 内容草稿
207
+
208
+ ```bash
209
+ social-hub drafts list -t $T -n 20
210
+ social-hub drafts create -t $T -j '{"campaignId":"<uuid>","title":"Test Post","body":"Content..."}'
211
+ social-hub drafts get -t $T --draft <uuid>
212
+ social-hub drafts update -t $T --draft <uuid> -j '{"status":"approved"}'
213
+ social-hub drafts delete -t $T --draft <uuid>
214
+ ```
215
+
216
+ ### 报告库
217
+
218
+ ```bash
219
+ social-hub reports list -t $T -n 20
220
+ social-hub reports create -t $T -j '{"reportType":"campaign-digest","title":"5月报告","source":"manual","contentMarkdown":"# 报告..."}'
221
+ social-hub reports ingest -t $T -j '{"reportType":"reddit-post-snapshot","source":"path/to/file.md"}'
222
+ ```
223
+
224
+ ### 账号管理
225
+
226
+ ```bash
227
+ social-hub accounts list -t $T
228
+ social-hub accounts list -t $T --status active
229
+ social-hub accounts get -t $T --account <uuid>
230
+ social-hub accounts create -t $T -j '{"platform":"reddit","handle":"u_example","externalId":"..."}'
231
+ social-hub compliance risk-get -t $T -a <accountId>
232
+ social-hub compliance risk-put -t $T -a <accountId> -j '{"riskLevel":"medium","notes":"..."}'
233
+ ```
234
+
235
+ ### 品牌与 Campaign
236
+
237
+ ```bash
238
+ social-hub brands list -t $T
239
+ social-hub brands create -t $T -j '{"name":"My Brand","slug":"my-brand"}'
240
+ social-hub brands update -t $T --brand <brandId> -j '{"name":"New Name"}'
241
+ social-hub campaigns list -t $T --brand <brandId>
242
+ social-hub campaigns get -t $T --campaign <uuid>
243
+ social-hub campaigns create -t $T -j '{"brandId":"<uuid>","name":"2026 Q2"}'
244
+ social-hub campaigns update -t $T --campaign <uuid> -j '{"name":"2026 Q3"}'
245
+ ```
246
+
247
+ ### 板块情报
248
+
249
+ ```bash
250
+ social-hub intelligence hot-posts -t $T --subreddit LocalLLaMA
251
+ social-hub intelligence hot-posts -t $T --sort score -n 50
252
+ social-hub intelligence dispatch -t $T -j '{"hotPostId":"<uuid>","socialAccountId":"<uuid>","action":"engage"}'
253
+ social-hub intelligence kol-intents -t $T -n 20
254
+ social-hub intelligence watchlists-list -t $T
255
+ ```
256
+
257
+ ### 团队与用户管理
258
+
259
+ ```bash
260
+ social-hub agent-teams list
261
+ social-hub agent-teams create --slug moss --name "Moss Agent Team" # admin only
262
+ social-hub agent-teams add-member -t $T --user <userId> --role manager # admin only
263
+ social-hub users list -t $T
264
+ social-hub users create -t $T -j '{"email":"agent@example.com","password":"xxx","role":"manager"}'
265
+ ```
266
+
267
+ ### 通知渠道
268
+
269
+ ```bash
270
+ social-hub notification-channels list -t $T
271
+ social-hub notification-channels create -t $T -j '{"provider":"feishu","externalId":"https://open.feishu.cn/open-apis/bot/v2/hook/..."}'
272
+ social-hub notification-channels test -t $T --channel <uuid>
273
+ social-hub notification-channels delete -t $T --channel <uuid>
274
+ ```
275
+
276
+ ### API Key 管理
277
+
278
+ ```bash
279
+ social-hub api-keys list -t $T
280
+ social-hub api-keys create -t $T -j '{"name":"agent-key","role":"manager"}'
281
+ social-hub api-keys rotate -t $T --key <uuid>
282
+ social-hub api-keys delete -t $T --key <uuid>
283
+ ```
284
+
285
+ ---
286
+
287
+ ## 典型工作流
288
+
289
+ ### 工作流 1:Agent 执行完成后回填 Hub
290
+
291
+ ```bash
292
+ T=$SOCIAL_HUB_TEAM_ID
293
+ ENTRY_ID="<calendarEntryId>"
294
+ PERMALINK="https://www.reddit.com/r/LocalLLaMA/comments/xxx/yyy/"
295
+
296
+ # 1. 更新日历条目状态为 succeeded
297
+ social-hub calendar patch -t $T -e $ENTRY_ID \
298
+ --body "{\"status\":\"succeeded\",\"permalink\":\"$PERMALINK\"}"
299
+
300
+ # 2. 写入互动事件
301
+ social-hub events append -t $T \
302
+ --type "post.published" \
303
+ --payload "{\"permalink\":\"$PERMALINK\",\"calendarEntryId\":\"$ENTRY_ID\"}"
304
+
305
+ # 3. 查看该账号近期事件(验证写入)
306
+ social-hub events list-full -t $T --account $ACCOUNT_ID -n 10
307
+ ```
308
+
309
+ ### 工作流 2:查看账号运营数据
310
+
311
+ ```bash
312
+ T=$SOCIAL_HUB_TEAM_ID
313
+ ACCOUNT_ID="<socialAccountId>"
314
+
315
+ # 账号详情
316
+ social-hub accounts get -t $T --account $ACCOUNT_ID
317
+
318
+ # 近期事件
319
+ social-hub events list-full -t $T --account $ACCOUNT_ID -n 20
320
+
321
+ # 近期调度任务
322
+ social-hub jobs list-full -t $T --account $ACCOUNT_ID --status scheduled
323
+
324
+ # 关联发布日历
325
+ social-hub calendar list-full -t $T --account $ACCOUNT_ID --status scheduled
326
+
327
+ # 风险档案
328
+ social-hub compliance risk-get -t $T -a $ACCOUNT_ID
329
+ ```
330
+
331
+ ### 工作流 3:情报热帖派发任务
332
+
333
+ ```bash
334
+ T=$SOCIAL_HUB_TEAM_ID
335
+
336
+ # 1. 查看热帖
337
+ social-hub intelligence hot-posts -t $T --sort score -n 10
338
+
339
+ # 2. 查看可用账号
340
+ social-hub accounts list -t $T --status active
341
+
342
+ # 3. 派发互动任务
343
+ social-hub intelligence dispatch -t $T -j '{
344
+ "hotPostId": "<hotPostId>",
345
+ "socialAccountId": "<accountId>",
346
+ "action": "engage",
347
+ "runAt": "2026-05-07T09:00:00Z"
348
+ }'
349
+
350
+ # 4. 确认任务已创建
351
+ social-hub jobs list -t $T --status scheduled -n 5
352
+ ```
353
+
354
+ ---
355
+
356
+ ## 注意事项
357
+
358
+ - 所有命令输出均为 **JSON**,可管道传给 `jq` 处理:`social-hub accounts list -t $T | jq '.items[].handle'`
359
+ - `DELETE` 端点(drafts delete、plans cancel、notification-channels delete)返回空响应(204),成功时打印 `OK`
360
+ - `events export-csv` 和 `intelligence hot-posts-export` 输出 CSV 到 stdout,可直接重定向:`> output.csv`
361
+ - 团队管理操作(`agent-teams create/update/add-member`)需要 **admin** 角色的 API Key
362
+ - Session(Cookie)认证不在 CLI 支持范围内,始终使用 API Key
363
+
@@ -0,0 +1,23 @@
1
+ {
2
+ "skill_name": "social-hub-cli",
3
+ "evals": [
4
+ {
5
+ "id": 0,
6
+ "prompt": "我刚在本地部署好了 Social Ops Hub,openclaw-template 也初始化完了。我需要在 Hub 里注册一个新团队叫 javis,slug 也是 javis,然后给这个团队添加一个管理员用户,email 是 ops@javis.local,密码是 Javis2026!。完成后确认一下团队列表里有了这个团队。",
7
+ "expected_output": "使用 social-hub-cli skill,依次执行:social-hub agent-teams create、social-hub users create -t <newTeamId>、social-hub agent-teams list,输出各步骤的命令和 JSON 结果",
8
+ "assertions": []
9
+ },
10
+ {
11
+ "id": 1,
12
+ "prompt": "我的 Reddit 账号 u/example_user(id 是 abc123-...-uuid)刚刚在 r/LocalLLaMA 发了一个帖子,permalink 是 https://www.reddit.com/r/LocalLLaMA/comments/abc123/test_post/。对应的发布日历条目 id 是 def456-...-uuid。帮我把这个结果写进 Social Ops Hub:把日历条目标记为 succeeded,写入 permalink,同时记录一条 post.published 事件。最后查一下这个账号最近的互动事件确认写入成功。",
13
+ "expected_output": "执行 calendar patch(succeeded + permalink)、events append(post.published)、events list-full --account,输出每步的命令和结果",
14
+ "assertions": []
15
+ },
16
+ {
17
+ "id": 2,
18
+ "prompt": "帮我查一下 Social Ops Hub 里板块情报里 r/Entrepreneur 最近按分数排名的前 5 条热帖,然后选第一条,派发一个 engage 互动任务给账号 ghi789-...-uuid,运行时间设为明天上午 9 点(2026-05-07T01:00:00Z UTC)。任务派发完后确认一下调度任务列表里有这条新任务。",
19
+ "expected_output": "执行 intelligence hot-posts --subreddit Entrepreneur --sort score -n 5、intelligence dispatch(带 hotPostId/socialAccountId/action/runAt)、jobs list 确认,输出各步命令和结果",
20
+ "assertions": []
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: social-hub-intelligence
3
+ description: >-
4
+ 板块情报:watchlists、hot posts、KOL intents、industry-pools、dispatch 等 social-hub intelligence 子命令。
5
+ 用户要盯 subreddit、拉热帖、行业池、情报派发时用本 skill。
6
+ metadata:
7
+ cliVersion: ">=0.0.1"
8
+ ---
9
+
10
+ # social-hub-intelligence
11
+
12
+ ```bash
13
+ social-hub intelligence industry-pools-list -t "$T"
14
+ social-hub intelligence watchlists-list -t "$T"
15
+ social-hub intelligence hot-posts -t "$T" --subreddit technology
16
+ social-hub intelligence dispatch -t "$T" -j '{ ... }' # 写操作注意 --apply
17
+ ```
18
+
19
+ 账号可发帖板块优先用:
20
+
21
+ ```bash
22
+ social-hub query account-pools -t "$T" --account <ref>
23
+ ```
24
+
25
+ WebSocket `runs/ws` 为 watch 能力,不适合普通 CLI 批处理。
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: social-hub-migration
3
+ description: >-
4
+ Hub 数据批量:export events-jsonl、export agent-context、runbook replay、openclaw-ingest。
5
+ 用户要导出 JSONL、回放事件、迁移/对账时用本 skill;不包含工作区 shared 目录批量 sync(需人工决策)。
6
+ metadata:
7
+ cliVersion: ">=0.0.1"
8
+ ---
9
+
10
+ # social-hub-migration
11
+
12
+ ## 导出
13
+
14
+ ```bash
15
+ social-hub export events-jsonl -t "$T" -o events.jsonl -n 500
16
+ social-hub export agent-context -t "$T" --account "<uuid>" -o ctx.json
17
+ ```
18
+
19
+ ## Runbook 回放
20
+
21
+ ```bash
22
+ social-hub runbook replay -t "$T" -f events.jsonl --dry-run
23
+ social-hub runbook replay -t "$T" -f events.jsonl # 实际 append events
24
+ ```
25
+
26
+ JSONL 每行:`{"type":"comment","payload":{...}}`
27
+
28
+ ## openclaw-ingest
29
+
30
+ API 支持将工作区文档写入 `team_workspace_documents`;**不要**在本 skill 内自动化批量 sync 整个 `Javis-workspace/shared` 或 `Moss-workspace/shared`,除非用户明确要求并指定范围。
31
+
32
+ 运行时查询请用 `social-hub-openclaw-context`,不是解析 Markdown。
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: social-hub-openclaw-context
3
+ description: >-
4
+ OpenClaw Agent 执行前上下文:social-hub context account/job、query account-pools、subreddit-candidates、
5
+ export agent-context。用户问账号能发哪些版、任务上下文、板块池、guardrails、数据是否过期时,
6
+ 必须用 Hub DB 聚合接口,不要解析 Javis/Moss/Panda 工作区里的 shared/*.md。
7
+ metadata:
8
+ cliVersion: ">=0.0.1"
9
+ ---
10
+
11
+ # social-hub-openclaw-context
12
+
13
+ ## 账号上下文
14
+
15
+ ```bash
16
+ social-hub context account -t "$T" --account A1 \
17
+ --expand pools,jobs,persona,risk,env,guardrails
18
+ ```
19
+
20
+ `--account` 可为 UUID 或 handle(如 `A1`)。
21
+
22
+ ## 任务上下文
23
+
24
+ ```bash
25
+ social-hub context job -t "$T" --job "<scheduledJobId>"
26
+ ```
27
+
28
+ ## 板块与候选
29
+
30
+ ```bash
31
+ social-hub query account-pools -t "$T" --account A1 --limit 50
32
+ social-hub query subreddit-candidates -t "$T" --account A1 --action publish_post
33
+ ```
34
+
35
+ ## 导出(给人看或离线审计)
36
+
37
+ ```bash
38
+ social-hub export agent-context -t "$T" --account "<uuid>" -o /tmp/ctx.json
39
+ ```
40
+
41
+ ## freshness
42
+
43
+ 响应中的 `freshness.needsRefresh === true` 时,应先刷新账号指标或情报,再执行发帖/评论。
44
+
45
+ 执行任务前配合 `social-hub-ops-runtime`;执行后 `ops complete` 回填 permalink。
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: social-hub-ops-runtime
3
+ description: >-
4
+ OpenClaw / Agent 任务运行时:social-hub ops claim-next、claim、heartbeat、complete、fail、skip。
5
+ 用户要领任务、续租、心跳、回填 permalink、任务失败/跳过、避免改本地 Markdown 状态时必须用本 skill。
6
+ metadata:
7
+ cliVersion: ">=0.0.1"
8
+ ---
9
+
10
+ # social-hub-ops-runtime
11
+
12
+ Hub DB 是执行状态的真源;不要用 `shared/reddit-account-status.md` 等文件记录任务结果。
13
+
14
+ ## 推荐流程
15
+
16
+ ```bash
17
+ export T="$SOCIAL_HUB_TEAM_ID"
18
+ export AGENT="javis" # 或 moss / 你的 agentId
19
+
20
+ social-hub ops claim-next -t "$T" --agent "$AGENT"
21
+ social-hub context job -t "$T" --job "<jobId>"
22
+ social-hub ops heartbeat -t "$T" --job "<jobId>" --agent "$AGENT"
23
+ # 执行 Reddit / 浏览器操作,并写 interaction events(见 social-hub-cli events)
24
+ social-hub ops complete -t "$T" --job "<jobId>" --agent "$AGENT" --permalink "https://reddit.com/..."
25
+ ```
26
+
27
+ 失败或跳过:
28
+
29
+ ```bash
30
+ social-hub ops fail -t "$T" --job "<jobId>" --agent "$AGENT" --reason rule_blocked --message "..."
31
+ social-hub ops skip -t "$T" --job "<jobId>" --agent "$AGENT" --reason manual_intervention_required
32
+ ```
33
+
34
+ ## `--reason` 枚举(仅允许下列值)
35
+
36
+ `ip_drift`, `env_start_timeout`, `login_expired`, `wrong_account_logged_in`, `reddit_connection_failed`, `rte_failed`, `subreddit_banned`, `bot_bouncer_blocked`, `rule_blocked`, `manual_intervention_required`, `unknown`
37
+
38
+ ## 并发
39
+
40
+ 同一账号同时只能有一个有效 lease;重复 claim 会被拒绝。`complete` 会原子更新 job 与关联 calendar(若 payload 含 calendarEntryId)。
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: social-hub-posts
3
+ description: >-
4
+ Reddit 帖快照与数据:social-hub reddit list/stats/refresh/refresh-all/import-feishu 等。
5
+ 用户要查帖表现、刷新 score、导入飞书表、permalink 对应快照时用本 skill(命令组名为 reddit)。
6
+ metadata:
7
+ cliVersion: ">=0.0.1"
8
+ ---
9
+
10
+ # social-hub-posts
11
+
12
+ ```bash
13
+ social-hub reddit list -t "$T" -n 20
14
+ social-hub reddit stats -t "$T" --campaign "<uuid>"
15
+ social-hub reddit refresh-status -t "$T" --id "<snapshotId>"
16
+ social-hub reddit refresh-all -t "$T"
17
+ social-hub reddit import-feishu -t "$T" -j '{ ... }'
18
+ ```
19
+
20
+ 发帖成功后应通过 `social-hub ops complete --permalink ...` 写回任务链路(见 `social-hub-publishing`)。
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: social-hub-publishing
3
+ description: >-
4
+ 内容发布闭环:campaign → plan → draft → calendar → scheduled_job → events → reddit snapshot → report。
5
+ 用户要从草稿到排期、执行任务、permalink 回填、避免 job 成功但 calendar 未更新时用本 skill。
6
+ metadata:
7
+ cliVersion: ">=0.0.1"
8
+ ---
9
+
10
+ # social-hub-publishing
11
+
12
+ ## 事实源
13
+
14
+ - **计划**:`calendar_entries`
15
+ - **执行**:`scheduled_jobs`
16
+ - 本地 Markdown 日历仅作导入/导出视图,不是运行时真源
17
+
18
+ ## 链路
19
+
20
+ ```
21
+ campaign → publishing_plan → content_draft → calendar_entry → scheduled_job
22
+ → interaction_events → reddit_post_snapshot → op_report
23
+ ```
24
+
25
+ ## Agent 推荐
26
+
27
+ 1. 创建/查询 draft、plan、calendar、job(见 `social-hub-cli` 对应命令)
28
+ 2. `social-hub ops claim-next` → 执行 → `social-hub ops complete --permalink <url>`
29
+ 3. `complete` 原子更新 job + calendar(+ 可选 snapshot id)
30
+
31
+ 失败时 `ops fail` / `ops skip`,并写标准 `reason` 枚举。
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: social-hub-shared
3
+ description: >-
4
+ social-hub 基础能力:config init/show、auth login、doctor、version、permissions、context list/use/current。
5
+ 在跑任何 Hub 写操作前应先 doctor 或 auth;配置报错、连不上 API、team 不对、权限不足时优先用本 skill。
6
+ metadata:
7
+ cliVersion: ">=0.0.1"
8
+ ---
9
+
10
+ # social-hub-shared
11
+
12
+ ## 环境变量
13
+
14
+ ```bash
15
+ export SOCIAL_HUB_API_URL="http://localhost:3000"
16
+ export SOCIAL_HUB_API_KEY="soh_..."
17
+ export SOCIAL_HUB_TEAM_ID="<team-uuid>" # 或用 context use 持久化
18
+ ```
19
+
20
+ ## 常用命令
21
+
22
+ ```bash
23
+ social-hub config init --api-url http://localhost:3000 --team $T
24
+ social-hub auth login --api-key "$SOCIAL_HUB_API_KEY"
25
+ social-hub auth whoami
26
+ social-hub doctor
27
+ social-hub version --json
28
+ social-hub context use "$T"
29
+ social-hub context current
30
+ social-hub permissions matrix
31
+ social-hub auth explain
32
+ ```
33
+
34
+ ## 排障顺序
35
+
36
+ 1. `social-hub health`(无需 Key)
37
+ 2. `social-hub doctor`(含 `/health/live` 与 auth context)
38
+ 3. 确认 `SOCIAL_HUB_TEAM_ID` 与 API Key 绑定 team 一致
39
+ 4. `social-hub auth explain` 查看当前角色允许的命令
40
+
41
+ 更完整命令表见同包的 `social-hub-cli` skill。