siluzan-tso-cli 1.1.23 → 1.1.24-beta.3

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 (36) hide show
  1. package/README.md +2 -1
  2. package/dist/index.js +357 -45
  3. package/dist/skill/AGENTS.md +3 -1
  4. package/dist/skill/SKILL.md +21 -4
  5. package/dist/skill/_meta.json +2 -2
  6. package/dist/skill/references/README.md +12 -0
  7. package/dist/skill/references/accounts/finance.md +4 -4
  8. package/dist/skill/references/analytics/account-analytics.md +42 -6
  9. package/dist/skill/references/analytics/facebook-analysis-guide.md +111 -0
  10. package/dist/skill/references/analytics/google-analysis-batch.md +12 -0
  11. package/dist/skill/references/analytics/rag.md +1 -1
  12. package/dist/skill/references/analytics/reporting.md +3 -3
  13. package/dist/skill/references/core/agent-conventions.md +8 -0
  14. package/dist/skill/references/core/playbooks.md +30 -4
  15. package/dist/skill/references/core/setup.md +5 -5
  16. package/dist/skill/references/core/skill-authoring.md +6 -2
  17. package/dist/skill/references/core/subagent-orchestration.md +148 -0
  18. package/dist/skill/references/core/workflows.md +1 -1
  19. package/dist/skill/report-templates/README.md +2 -1
  20. package/dist/skill/report-templates/REPORT-WORKFLOW.md +2 -2
  21. package/dist/skill/report-templates/google-inquiry-analysis.md +10 -0
  22. package/dist/skill/report-templates/meta-account-diagnosis-report.md +73 -0
  23. package/dist/skill/report-templates/meta-period-report.md +98 -14
  24. package/dist/skill/report-templates/okki-weekly-google-client.md +13 -0
  25. package/dist/skill/scripts/install.ps1 +3 -3
  26. package/dist/skill/scripts/install.sh +3 -3
  27. package/dist/skill/snippets/handoff-p5-batch.md +45 -0
  28. package/dist/skill/snippets/handoff-p6-okki.md +51 -0
  29. package/dist/skill/snippets/handoff-p7-inquiry.md +43 -0
  30. package/eval/cases/facebook-analysis-google-section-aliases.scenario.json +20 -0
  31. package/eval/cases/facebook-analysis-not-google-keywords.scenario.json +20 -0
  32. package/eval/cases/facebook-analysis-period-default.scenario.json +30 -0
  33. package/eval/cases/p4-fb-meta-period-report.scenario.json +21 -0
  34. package/eval/stub-fixtures/facebook-analysis.json +19 -0
  35. package/eval/stub-fixtures/meta-overview.json +10 -0
  36. package/package.json +1 -1
@@ -7,12 +7,14 @@
7
7
  1. Read `SKILL.md`(路由 + 任务→文档表)
8
8
  2. **每个新任务** Read `references/core/agent-conventions.md`
9
9
  3. 按任务表 Read 对应域文档后再执行 `siluzan-tso …`
10
+ 4. **P5 / P6 / P7** 或长 CLI 输出:可选 Read `references/core/subagent-orchestration.md`(主 Agent 自行决定是否委派 subagent)
10
11
 
11
12
  ## 文档域(gstack-style domains)
12
13
 
13
14
  | 域 | 路径 | 何时 Read |
14
15
  | --- | --- | --- |
15
- | **Core** | `references/core/` | 纪律、安装、tips、playbooks、workflows |
16
+ | **Core** | `references/core/` | 纪律、安装、tips、playbooks、workflows、subagent-orchestration |
17
+ | **Handoff** | `snippets/` | P5/P6/P7 Task 派发模板(与 SKILL 同级) |
16
18
  | **Accounts** | `references/accounts/` | 列表、余额、开户、财务、审计 |
17
19
  | **Google Ads** | `references/google-ads/` | CRUD、PMax、搜索系列流水线;`rules/` 为优化 SOP |
18
20
  | **Analytics** | `references/analytics/` | 拉数、批处理、拓词、RAG、TSO 报告 |
@@ -16,6 +16,8 @@ allowed-tools: Bash(siluzan-tso:*) Read Write
16
16
  <!-- 注入到 SKILL.md.tmpl 的 {{AGENT_PREAMBLE}};构建时由 gen-skill-docs.mjs 合并 -->
17
17
 
18
18
  > **Agent 纪律(每个新任务必读)**:Read `references/core/agent-conventions.md`,再按 `SKILL.md` 任务表 Read 域文档。禁止跨话题复用参数记忆;数据类任务一律 `--json-out` + 脚本读盘(见 `references/core/tips.md`)。
19
+ >
20
+ > **Subagent(可选)**:若宿主支持 Task / 子会话,复杂报告(P5/P6/P7)或长 CLI 输出前 Read `references/core/subagent-orchestration.md`,**自行决定**是否委派;写操作确认与对用户的最终交付留在主 Agent。
19
21
 
20
22
  ---
21
23
 
@@ -53,13 +55,26 @@ Windows:部分 Agent 通过 PowerShell 代执行时可能失败,改在 [Git
53
55
  | `references/core/` | `agent-conventions.md` | 纪律、tips、playbooks、workflows |
54
56
  | `references/accounts/` | `accounts.md` | 列表、余额、MCC/BC、开户、发票 |
55
57
  | `references/google-ads/` | `google-ads.md` | CRUD、PMax、campaign-plan;`rules/` 优化 SOP |
56
- | `references/analytics/` | `account-analytics.md` | google-analysis、批处理、拓词、RAG |
58
+ | `references/analytics/` | `account-analytics.md` | google-analysis、facebook-analysis、批处理、拓词、RAG |
57
59
  | `references/operations/` | `forewarning.md` | 预警、线索、optimize、宿主编排 |
60
+ | `references/core/` | `subagent-orchestration.md` | **可选** subagent 自主委派(P5/P6/P7、长日志) |
58
61
 
59
62
  完整文件列表:`references/README.md` · Agent 目录:`AGENTS.md`
60
63
 
61
64
  ---
62
65
 
66
+ ## Subagent 自主委派(可选)
67
+
68
+ 宿主具备 **Task / subagent**(或内置 Bash/Explore)时:
69
+
70
+ 1. **复杂报告或批处理**(P5 / P6 OKKI / P7 询盘)、预计 CLI 输出很长 → 先 Read `references/core/subagent-orchestration.md`,按**决策矩阵**选择主会话或子会话。
71
+ 2. Handoff 模板在 skill 根目录 `snippets/handoff-p{5,6,7}-*.md`;子会话只回传 manifest/exitCode 摘要,**禁止**把 MB 级 JSON 贴回主对话。
72
+ 3. **无 subagent 能力** → 跳过本节,按 `core/playbooks.md` 在主会话执行。
73
+
74
+ 写操作、`--commit`、401/batch `resume` 策略由**主 Agent**负责,不默认下放子会话。
75
+
76
+ ---
77
+
63
78
  ## 任务 → 必读 references
64
79
 
65
80
  | 用户意图(关键词) | 必读(Read 后再 `-h` / 执行) |
@@ -67,6 +82,7 @@ Windows:部分 Agent 通过 PowerShell 代执行时可能失败,改在 [Git
67
82
  | 任意任务(首次) | `core/agent-conventions.md` |
68
83
  | 账户列表 / 余额 / 消耗 / 分享 / MCC / 多账户汇总 | `accounts/accounts.md`;金额加 `accounts/currency.md` |
69
84
  | 拉数 / 报告 / 周报 / `google-analysis` | `analytics/account-analytics.md` + `core/tips.md`;多账户加 `analytics/google-analysis-batch.md` |
85
+ | Meta/Facebook 周期或诊断报告 / `facebook-analysis` | `analytics/facebook-analysis-guide.md` + `report-templates/meta-period-report.md`(或 `meta-account-diagnosis-report.md`)+ `core/playbooks.md` P4-FB |
70
86
  | Google 新建搜索系列 | `google-ads/google-ads-campaign-plan.md` |
71
87
  | Google 广告 CRUD / 拒审 | `google-ads/google-ads.md` |
72
88
  | PMax | `assets/pmax-create-template.md` + `google-ads/pmax-api.md` |
@@ -75,9 +91,10 @@ Windows:部分 Agent 通过 PowerShell 代执行时可能失败,改在 [Git
75
91
  | 预警 | `operations/forewarning.md` |
76
92
  | 发票 / 转账 / 充值 | `accounts/finance.md` |
77
93
  | 开户 | `accounts/open-account-by-media.md`(Google 加 `accounts/open-account-google-ui.md`) |
78
- | OKKI 周报 | `report-templates/okki-weekly-google-client.md` + `core/playbooks.md` P6 |
79
- | Google 询盘分析 | `report-templates/google-inquiry-analysis.md` + `core/playbooks.md` P7 |
94
+ | OKKI 周报 | `report-templates/okki-weekly-google-client.md` + `core/playbooks.md` P6;可选 `core/subagent-orchestration.md` |
95
+ | Google 询盘分析 | `report-templates/google-inquiry-analysis.md` + `core/playbooks.md` P7;可选 `core/subagent-orchestration.md` |
80
96
  | 标准画像/扫描/周期报告 | `core/playbooks.md` 对应 P1–P5 |
97
+ | P5 多账户多维度 batch | `analytics/google-analysis-batch.md` + `core/playbooks.md` P5;可选 `core/subagent-orchestration.md` |
81
98
 
82
99
  > 表未覆盖时:查 `references/README.md` → Read 对应 reference → 再执行 CLI。
83
100
 
@@ -96,7 +113,7 @@ P1–P7 见 `references/core/playbooks.md`。
96
113
  | 结构化字段拉取(`--json-out`) | 何时触发检查(cron、对话) |
97
114
  | 写命令语义与读命令复核文档 | IF 条件计算与决策 |
98
115
  | 金额、ID、字段口径一致 | 触达(钉钉/飞书)与工单 |
99
- | references 与命令对齐 | 批处理循环、限速、重试 |
116
+ | references 与命令对齐 | 批处理循环、限速、重试;**可选** subagent 并行(见 `subagent-orchestration.md`) |
100
117
 
101
118
  详见 `operations/hosted-automation-self-control.md`、`operations/hosted-automation-monitoring-json.md`、`operations/hosted-automation-optimize-index.md`。
102
119
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "slug": "siluzan-tso",
3
- "version": "1.1.23",
4
- "publishedAt": 1780051263637
3
+ "version": "1.1.24-beta.3",
4
+ "publishedAt": 1780364315180
5
5
  }
@@ -12,6 +12,7 @@
12
12
  | `core/playbooks.md` | P1–P7 高频任务标准动作 |
13
13
  | `core/workflows.md` | 多命令串联业务流程 |
14
14
  | `core/skill-authoring.md` | Skill 文档维护最佳实践(维护者) |
15
+ | `core/subagent-orchestration.md` | **可选**:主 Agent 自主决定是否委派 subagent(P5/P6/P7) |
15
16
 
16
17
  ## 账户与财务
17
18
 
@@ -39,6 +40,7 @@
39
40
  | 文件 | 用途 |
40
41
  | ---- | ---- |
41
42
  | `analytics/account-analytics.md` | 拉数、数据时效性、诊断模板 |
43
+ | `analytics/facebook-analysis-guide.md` | Facebook 字段、与 Google 报告对照、撰写清单 |
42
44
  | `analytics/google-analysis-batch.md` | 多账户批处理 run/resume/status |
43
45
  | `analytics/reporting.md` | TSO 优化报告生成与推送 |
44
46
  | `analytics/rag.md` | 知识库 list/query |
@@ -71,3 +73,13 @@
71
73
  ## 报告模板(`../report-templates/`)
72
74
 
73
75
  见 `report-templates/README.md`。
76
+
77
+ ## Handoff 模板(`../snippets/`,随 skill 安装)
78
+
79
+ | 文件 | 用途 |
80
+ | ---- | ---- |
81
+ | `handoff-p5-batch.md` | P5 batch 与按账户聚合 Task prompt |
82
+ | `handoff-p6-okki.md` | P6 OKKI 拉数 / 写 xlsx |
83
+ | `handoff-p7-inquiry.md` | P7 询盘拉数与 xlsx |
84
+
85
+ `agent-preamble.md` 仅用于构建时注入 `SKILL.md`,不复制到 `dist/skill/snippets/`。
@@ -131,10 +131,10 @@ siluzan-tso config show
131
131
  **示例:**
132
132
 
133
133
  ```
134
- - 现金充值(单笔):https://www.siluzan.com/recharge/pay
135
- - 现金充值(批量):https://www.siluzan.com/recharge/pay_batch
136
- - 月结充值: https://www.siluzan.com/recharge/accountBillingQuota
137
- - 丝路赞钱包: https://www.siluzan.com/recharge/siluzanWallet
134
+ - 现金充值(单笔):https://www-ci.siluzan.com/recharge/pay
135
+ - 现金充值(批量):https://www-ci.siluzan.com/recharge/pay_batch
136
+ - 月结充值: https://www-ci.siluzan.com/recharge/accountBillingQuota
137
+ - 丝路赞钱包: https://www-ci.siluzan.com/recharge/siluzanWallet
138
138
  ```
139
139
 
140
140
  ---
@@ -235,11 +235,11 @@ CLI 在落盘前为以下维度自动补「中文译名字段」(**原英文
235
235
  | `searchClickShare` | 搜索点击份额 |
236
236
  | `relativeCtr` | 相对点击率 |
237
237
 
238
- 无竞争数据时 `competitiveMetrics` 为 `null`(或缺省)。写 Excel「x%」列:`(v * 100).toFixed(2) + '%'`。
238
+ 无竞争数据时 `competitiveMetrics` 为 `null`(或缺省)。`competitiveMetrics` 中均为 **0~1 小数**。写 Excel「x%」列:`(v * 100).toFixed(2) + '%'`。
239
239
 
240
- #### 行顶 legacy 份额(勿与 `competitiveMetrics` 混用)
240
+ #### 行顶 legacy 份额(与 `competitiveMetrics` 同名 3 项)
241
241
 
242
- 同一行仍保留 3 个行顶字段 `searchImpressionShare`、`searchBudgetLostImpressionShare`、`searchRankLostImpressionShare`,口径为 **0~100 百分数**(网关已 ×100)。分析 Top/AbsoluteTop/Content/ClickShare 等请用 `competitiveMetrics`;仅用行顶 3 项时按百分数理解,**禁止**与 `competitiveMetrics.*` 相加。
242
+ `campaigns[]` / `keywords[]` 行顶仍保留 `searchImpressionShare`、`searchBudgetLostImpressionShare`、`searchRankLostImpressionShare`。CLI 落盘前已统一为 **0~1 小数**(与 `competitiveMetrics` 同名项一致;有嵌套时以 `competitiveMetrics` 为准)。Top/AbsoluteTop/Content/ClickShare 等扩展项仅存在于 `competitiveMetrics`。展示为百分比:`(v * 100).toFixed(2) + '%'`。
243
243
 
244
244
  ### campaign-hour 字段
245
245
 
@@ -247,13 +247,49 @@ CLI 在落盘前为以下维度自动补「中文译名字段」(**原英文
247
247
 
248
248
  ---
249
249
 
250
- ## Meta 账户分析
250
+ ## Meta / Facebook Ads 账户分析
251
+
252
+ > 周期/诊断报告:**`facebook-analysis`**(`FacebookAds` 路径,7 Section,对齐 Google 周期报告能 cover 的部分)。
253
+ > 撰写与 Google 对照表:**`references/analytics/facebook-analysis-guide.md`**(必读)。
254
+ > `report meta-overview` 仅为遗留单维总览(`MetaAd` 路径)。
255
+
256
+ ### 周期报告(默认 6 维,等同 Google 周期报告主流程)
251
257
 
252
258
  ```bash
253
- siluzan-tso report meta-overview -a <mediaCustomerId> [--start YYYY-MM-DD --end YYYY-MM-DD] --json-out <dir>
259
+ mkdir -p ./snap-fb
260
+ siluzan-tso facebook-analysis -a <mediaCustomerId> --start YYYY-MM-DD --end YYYY-MM-DD --json-out ./snap-fb \
261
+ --sections overview,ad-sets,platform,country,audience,creative
254
262
  ```
255
263
 
256
- `--start`/`--end` 须同传或同省略;省略默认近 7 天(截至昨天)。报告模板:`report-templates/meta-period-report.md`。
264
+ | 选项 | 说明 |
265
+ | --- | --- |
266
+ | `-a, --account` | 数字 `mediaCustomerId` 或 `act_<数字>` |
267
+ | `--json-out` | 必填;`report-manifest-<id>.json` + `<section>-<id>.json` |
268
+ | `--sections` / `--exclude` | `overview` `ad-sets` `platform` `country` `audience` `creative` `material`;**别名**:`campaigns`→`ad-sets`,`geographic`→`country`,`devices`→`platform`,`ads`→`creative`,`materials`→`material` |
269
+ | `--limit` | 仅 `country`:按 spend 降序前 N 条 |
270
+ | `--start` / `--end` | 同传或同省略;省略=近 7 天截至昨天 |
271
+ | `--concurrency` | 默认 5,上限 16 |
272
+
273
+ ```bash
274
+ # 全 7 维(含 material)
275
+ siluzan-tso facebook-analysis -a <id> --json-out ./snap-fb
276
+
277
+ # 国家 Top 10
278
+ siluzan-tso facebook-analysis -a <id> --sections country --limit 10 --json-out ./snap-fb
279
+ ```
280
+
281
+ ### 报告模板
282
+
283
+ | 场景 | 模板 |
284
+ | --- | --- |
285
+ | 周期 / 月报 / 周报 | `report-templates/meta-period-report.md` |
286
+ | 深度诊断 | `report-templates/meta-account-diagnosis-report.md` |
287
+
288
+ 遗留总览:`siluzan-tso report meta-overview -a <id> [--start … --end …] --json-out <dir>`。
289
+
290
+ ### 相对 Google 无法拉取的维度
291
+
292
+ 无 `daily-metrics`、`keywords`、`search-terms`、`extensions`、`final-urls`、`gold-account`、`ads-index`、`conversion-actions`、`resource-counts`、`campaign-types`、`campaign-hour` — 报告中须标注「接口未提供」,禁止编造。
257
293
 
258
294
  ---
259
295
 
@@ -0,0 +1,111 @@
1
+ # Facebook Ads 账户分析 — 字段与撰写指南
2
+
3
+ > 拉数命令见 `account-analytics.md` § Meta / Facebook Ads。周期报告纲要见 `report-templates/meta-period-report.md`;诊断见 `report-templates/meta-account-diagnosis-report.md`。
4
+
5
+ ---
6
+
7
+ ## 与 Google 周期报告的能力对照
8
+
9
+ | Google 默认/常见维度 | Facebook 对应 | CLI | 说明 |
10
+ | -------------------- | ------------- | --- | ---- |
11
+ | 执行摘要 `overview` | ✅ 本期/上期环比 | `overview` | 上一周期由后端自动算,勿再拉第二次 |
12
+ | 每日趋势 `daily-metrics` | ❌ 无接口 | — | 报告中注明「Meta 报告无按日 Section」 |
13
+ | 月度汇总 `dimension-summary` | ⚠️ 用 `overview` 单周期汇总代替 | `overview` | 仅 currentPeriod 即全区间汇总 |
14
+ | 系列 `campaigns` | ⚠️ 广告组 + 行上 `campaignName` | `ad-sets` | 无独立 Campaign Section;可按 `campaignName` 聚合撰写 |
15
+ | 设备 `devices` | ⚠️ 投放平台 | `platform` | `facebook` / `instagram` / `audience_network` 等 |
16
+ | 地域 `geographic` | ✅ 国家 | `country` | 可选 `--limit N` |
17
+ | 关键词 `keywords` | ❌ 无 | — | 非搜索广告;章节写「不适用」 |
18
+ | 受众 `audience` | ⚠️ 年龄×性别 | `audience` | 无兴趣/自定义受众列表 |
19
+ | 广告创意 `ads` | ✅ 创意+文案+缩略图 | `creative` | 一行 = ad + creative |
20
+ | 图片/视频素材 `materials` | ⚠️ DC 素材 | `material` | 标准账户为空,用 `creative` |
21
+ | 搜索词 / 附加信息 / 落地页 / 黄金账户 / 质量分 / 转化动作列表 / 系列类型 / 按小时 | ❌ 无 | — | 诊断模板中标注「Facebook 无此数据」 |
22
+
23
+ **`--sections` 别名**(与 Google 习惯兼容):`campaigns`→`ad-sets`,`geographic`→`country`,`devices`→`platform`,`ads`→`creative`,`materials`→`material`。
24
+
25
+ ---
26
+
27
+ ## 公共指标(JSON camelCase)
28
+
29
+ ### 基础
30
+
31
+ | 字段 | 撰写展示 |
32
+ | ---- | -------- |
33
+ | `impressions` | 展示(整数) |
34
+ | `clicks` | 点击 |
35
+ | `spend` | 花费(账户币种,**非** micros) |
36
+ | `ctr` | 点击率:**小数**,展示时 ×100 加 `%`(0.05 → 5%) |
37
+ | `averageCpc` | 平均 CPC |
38
+ | `conversions` | 业务转化次数(lead/purchase/messaging 等汇总) |
39
+ | `costPerConversion` | CPA |
40
+ | `conversionRate` | CVR(小数,×100 为 %) |
41
+
42
+ ### Facebook 扩展
43
+
44
+ | 字段 | 撰写展示 |
45
+ | ---- | -------- |
46
+ | `reach` | 覆盖人数 |
47
+ | `frequency` | 频次;>3 可提示创意疲劳 |
48
+ | `resultType` | 结果类型(如 `lead`) |
49
+ | `attributionSetting` | 归因(如 `7d_click`) |
50
+ | `results` | 对齐 Meta「结果」列 |
51
+ | `costPerResult` | 单次成效费用 |
52
+
53
+ ### 口径(必读)
54
+
55
+ - **对客户/对齐后台**:优先 `results`、`costPerResult`。
56
+ - **对内诊断**:可同时列 `conversions`、`costPerConversion`。
57
+ - **禁止**:将 `creative` / `ad-sets` 各行 `results` 简单加总后与 `overview.currentPeriod.results` 对比(见 API 附录 B)。
58
+ - **`material` 行**:无 `results` / `costPerResult`,只看 spend、转化、CTR、reach。
59
+
60
+ ---
61
+
62
+ ## 各 Section 文件与章节要点
63
+
64
+ | section | 落盘文件 | 根字段 | 报告章节要点 |
65
+ | ------- | -------- | ------ | ------------ |
66
+ | `overview` | `overview-<id>.json` | `currentPeriod`, `previousPeriod` | 环比表:消耗、展示、点击、CTR、CPC、转化、CPA、结果、单次成效、reach、frequency;注明 `resultType` / `attributionSetting` |
67
+ | `ad-sets` | `ad-sets-<id>.json` | `adGroups[]` | Top 组 by spend;`spendPercentage`;按 `campaignName` 归并;高消耗低结果组 |
68
+ | `platform` | `platform-<id>.json` | `networks[]` | 各版位 spend 占比与 `costPerResult`;预算倾斜建议 |
69
+ | `country` | `country-<id>.json` | `countries[]` | Top 国家;`countryOrRegion` 为展示名 |
70
+ | `audience` | `audience-<id>.json` | `audiences[]` | 年龄×性别矩阵;高/低效人群段 |
71
+ | `creative` | `creative-<id>.json` | `creatives[]` | 按 `creativeType` 汇总;Top 创意表(adName、title、spend、results、costPerResult) |
72
+ | `material` | `material-<id>.json` | `materials[]`, `dataSource`, `message` | 仅 `dataSource===meta_asset_breakdown` 且有条目时写章节;否则一句说明 |
73
+
74
+ ---
75
+
76
+ ## 周期报告默认拉数
77
+
78
+ ```bash
79
+ mkdir -p ./snap-fb
80
+ siluzan-tso facebook-analysis -a <id> --start <s> --end <e> --json-out ./snap-fb
81
+ # 等价显式:
82
+ # --sections overview,ad-sets,platform,country,audience,creative
83
+ ```
84
+
85
+ 可选追加:`--sections material`(DC 账户)。
86
+
87
+ 国家 Top 10:整次命令加 `--limit 10`(仅 `country` 请求带 limit)。
88
+
89
+ ---
90
+
91
+ ## 优化建议撰写清单(不额外拉数)
92
+
93
+ 结合已拉维度,至少覆盖:
94
+
95
+ 1. **预算**:高 `spendPercentage` 但 `costPerResult` 差的 Ad Set → 降预算/暂停。
96
+ 2. **版位**:某 `network` CPA 明显差 → 减投或单独系列。
97
+ 3. **地域**:高消耗国家转化差 → 收窄/geo 排除。
98
+ 4. **受众**:低效 age×gender → 收窄定向。
99
+ 5. **创意**:关停高消耗低 `results` 的 ad;复制 winner 的 `creativeType`/文案结构。
100
+ 6. **频次**:`frequency` 过高 + 转化下滑 → 扩受众或换创意。
101
+ 7. **无法做的 Google 项**:按日趋势、关键词、质量分等 — 一句说明「接口未提供」,不编造。
102
+
103
+ ---
104
+
105
+ ## 辅助命令(非报告 Section)
106
+
107
+ | 意图 | CLI |
108
+ | ---- | --- |
109
+ | 账户列表 | `list-accounts -m MetaAd -k <id> --json-out <dir>` |
110
+ | 余额(若需) | `balance` / `stats`(口径与报告 spend 可能不同,须标注来源) |
111
+ | 遗留仅总览 | `report meta-overview`(`MetaAd` 路径,不推荐替代 `facebook-analysis`) |
@@ -200,6 +200,18 @@ const tsType = outline
200
200
 
201
201
  ---
202
202
 
203
+ ## 产物消费与 subagent(可选)
204
+
205
+ batch 完成后,主 Agent 按 `references/core/tips.md`:**先 outline 后 JSON**,脚本读盘聚合。
206
+
207
+ 若宿主支持 subagent(见 `references/core/subagent-orchestration.md` § P5):
208
+
209
+ - **batch `run` / `resume`**:主会话或**单次** Bash 执行,**禁止** per-account 子会话重复调 API。
210
+ - **按账户写报告片段**:可对每个 `results/<accountId>/` 并行 Task,handoff 见 `snippets/handoff-p5-batch.md` §阶段 B。
211
+ - 子会话**禁止**重新 `run` batch;401 由主 Agent 统一 `login` 后 `resume`。
212
+
213
+ ---
214
+
203
215
  ## 常见问题
204
216
 
205
217
  **Q:拉全量是不是先 `list-accounts` 再把 ID 拼进 `-a`?**
@@ -1,6 +1,6 @@
1
1
  # rag:知识库检索(TSO 广告投放辅助)
2
2
 
3
- 知识库管理页面在 https://www.siluzan.com/knowledge-base/
3
+ 知识库管理页面在 https://www-ci.siluzan.com/knowledge-base/
4
4
 
5
5
  为 **广告投放、账户分析、拓词、诊断报告** 等 TSO 业务提供**企业已入库**的产品、行业、客户背景事实依据。
6
6
 
@@ -3,7 +3,7 @@
3
3
  > 所属 skill:`siluzan-tso`。
4
4
  >
5
5
  > 本文档仅覆盖 **TSO steward 优化报告**:列表、生成、删除、邮件推送与查看链接。
6
- > **账户分析拉数**(`google-analysis`、`report tiktok-*`、`report bing-*`、`report meta-overview`)与**周期/诊断报告纲要**见 `references/analytics/account-analytics.md`。
6
+ > **账户分析拉数**(`google-analysis`、`facebook-analysis`、`report tiktok-*`、`report bing-*`、`report meta-overview`)与**周期/诊断报告纲要**见 `references/analytics/account-analytics.md`(Facebook 撰写见 `facebook-analysis-guide.md`)。
7
7
  > **异步批量创建记录**(`ad batch`)见 `references/google-ads/google-ads.md` § ad batch。
8
8
  > **AI 广告优化**(`optimize`)见 `references/operations/optimize.md`。
9
9
  > **广告线索**(`clue`)见 `references/operations/clue.md`。
@@ -207,8 +207,8 @@ siluzan-tso report list -m Google --json-out ./snap
207
207
 
208
208
  # 第二步:查看 webUrl
209
209
  siluzan-tso config show
210
- # webUrl: https://www.siluzan.com
210
+ # webUrl: https://www-ci.siluzan.com
211
211
 
212
212
  # 第三步:拼接链接(Google 日报)
213
- # https://www.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
213
+ # https://www-ci.siluzan.com/media-report/publish/rpt_abc123?culture=zh-CN
214
214
  ```
@@ -46,6 +46,14 @@
46
46
  | **客户/产品背景** | 拓词、方案、报告背景段:先 `rag list` + `rag query`,再衔接 `keyword` / `ad` / `google-analysis` |
47
47
  | **仅调接口** | 优化记录、线索表单、预警、财务命令:无需输出转换 |
48
48
 
49
+ ### Subagent(可选)
50
+
51
+ 宿主支持 Task / 子会话时:
52
+
53
+ 1. **P5 / P6 / P7** 或预计 CLI 日志很长 → Read `references/core/subagent-orchestration.md`,按决策矩阵选择主会话或委派。
54
+ 2. 子会话**不替代**本节「文档加载纪律」:主 Agent 仍须 Read 当次必读 references;handoff 只传路径与命令块,不传对话记忆。
55
+ 3. 写入/修改/删除、`--commit`、对用户确认与最终交付 → **主 Agent**。
56
+
49
57
  ---
50
58
 
51
59
  ## 硬规范
@@ -8,9 +8,10 @@
8
8
  | P2 | 多账户余额扫描 | `accounts/accounts.md`(`balance-scan`)、`accounts/currency.md` |
9
9
  | P3 | 多账户投放画像汇总 | `accounts/accounts.md` § accounts-digest、`accounts/currency.md`、`core/tips.md` |
10
10
  | P4 | Google 账户周期报告 | `report-templates/google-period-report.md`、`analytics/account-analytics.md`、`core/tips.md` |
11
- | P5 | 多账户多维度报告 | `analytics/google-analysis-batch.md`、`analytics/account-analytics.md`、`core/tips.md` |
12
- | P6 | OKKI 周报 | `report-templates/okki-weekly-google-client.md`(全文)、`analytics/account-analytics.md`、`core/tips.md` |
13
- | P7 | Google 询盘分析 | `report-templates/google-inquiry-analysis.md`(全文)、`analytics/account-analytics.md`、`core/tips.md`、`analytics/geo-continents.json` |
11
+ | P4-FB | Meta/Facebook 周期报告 | `report-templates/meta-period-report.md`、`analytics/facebook-analysis-guide.md`、`analytics/account-analytics.md`、`core/tips.md` |
12
+ | P5 | 多账户多维度报告 | `analytics/google-analysis-batch.md`、`analytics/account-analytics.md`、`core/tips.md`;可选 `core/subagent-orchestration.md` |
13
+ | P6 | OKKI 周报 | `report-templates/okki-weekly-google-client.md`(全文)、`analytics/account-analytics.md`、`core/tips.md`;可选 `core/subagent-orchestration.md` |
14
+ | P7 | Google 询盘分析 | `report-templates/google-inquiry-analysis.md`(全文)、`analytics/account-analytics.md`、`core/tips.md`、`analytics/geo-continents.json`;可选 `core/subagent-orchestration.md` |
14
15
 
15
16
  ---
16
17
 
@@ -61,17 +62,38 @@ siluzan-tso accounts-digest -m Google -a id1,id2,... --start <S> --end <D> --jso
61
62
  ## P4 · Google 账户周期报告
62
63
 
63
64
  1. 确认时间范围;区间 > 3 个月时分段(季度/月)。
64
- 2. 按 P1 步骤拿数据,用 `report-templates/google-period-report.md` 模板输出,首行标注统计区间和货币。
65
+ 2. 按 `google-period-report.md` 默认维度执行 `google-analysis --json-out <dir>`。
65
66
  3. 报告须含:账户概览、投放趋势、Top 关键词/系列/地区分布、优化建议。
66
67
 
67
68
  ---
68
69
 
70
+ ## P4-FB · Meta/Facebook 账户周期报告
71
+
72
+ 1. `list-accounts -m MetaAd -k <mediaCustomerId> --json-out ./snap-fb` 确认账户。
73
+ 2. 确认 `--start` / `--end`(>3 个月可分段,与 P4 相同)。
74
+ 3. **一次批拉**(默认 6 维,对齐 Google 周期主章节):
75
+
76
+ ```bash
77
+ siluzan-tso facebook-analysis -a <id> --start <S> --end <D> --json-out ./snap-fb \
78
+ --sections overview,ad-sets,platform,country,audience,creative
79
+ ```
80
+
81
+ 4. 按 `report-templates/meta-period-report.md` 撰写;字段与 Google 对照见 `analytics/facebook-analysis-guide.md`。
82
+ 5. 无按日趋势/关键词/质量分等:对应章节写「接口未提供」,**禁止编造**。
83
+ 6. 用户要素材 Tab 时追加 `--sections material`(或全量省略 `--sections`)。
84
+
85
+ 诊断场景改用 `report-templates/meta-account-diagnosis-report.md`,拉数可省略 `--sections` 拉全 7 维。
86
+
87
+ ---
88
+
69
89
  ## P5 · 多账户多维度报告
70
90
 
71
91
  > 适用:账户数 ≥ 2 且需拉取 ≥ 2 个 google-analysis 维度。**禁止**外层 for-loop。
72
92
 
73
93
  **入口选择**:全量 → 省略 `-a`;2~10 子集 → `google-analysis -a id1,id2,...`;≥10 子集或需 resume → `google-analysis-batch run -a id1,id2,...`
74
94
 
95
+ 0. **执行模式**(可选):Read `core/subagent-orchestration.md` § P5。batch 本身用主会话或**单次** Bash;**禁止** per-account 子会话调 API;batch 完成后可按账户并行 Task 聚合(`snippets/handoff-p5-batch.md`)。
96
+
75
97
  1. 反问时间范围 + 维度(默认 `campaigns,geographic,keywords`)。
76
98
  2. **执行**:
77
99
 
@@ -102,6 +124,8 @@ siluzan-tso accounts-digest -m Google -a id1,id2,... --start <S> --end <D> --jso
102
124
 
103
125
  > **触发**:用户话术含 `使用okki周报模板` / `OKKI 周报` / `okki 周报` 等,且指向 Google 账户 + 日期区间。
104
126
 
127
+ 0. **执行模式**(可选):Read `core/subagent-orchestration.md` § P6。拉数 / 写 xlsx 可分阶段委派(`snippets/handoff-p6-okki.md`);无 subagent 则主会话执行下列步骤。
128
+
105
129
  1. **不要**按 `google-period-report.md` 展开默认 8 维;改读 `report-templates/okki-weekly-google-client.md` 全文。
106
130
  2. 确认 `mediaCustomerId` 与 `--start` / `--end`(未给齐按 `core/agent-conventions.md` 时间范围规则反问)。
107
131
  3. 同一 `--json-out` 目录执行模板中的命令组合:`list-accounts`(可选)、`stats`、`balance`、`google-analysis --sections overview,campaigns,keywords,search-terms,campaign-device,campaign-geo-matched`。
@@ -115,6 +139,8 @@ siluzan-tso accounts-digest -m Google -a id1,id2,... --start <S> --end <D> --jso
115
139
  > **触发**:用户话术含 `Goog账户询盘分析` / `Google 账户询盘分析` / `分析XXX Google账号的询盘效果`,或同时包含「询盘 + 账户 + Google」三要素。
116
140
  > **不要**按 `google-period-report.md` 默认 8 维流程。
117
141
 
142
+ 0. **执行模式**(可选):Read `core/subagent-orchestration.md` § P7。`m1`/`m2`/`m3` 可并行 Task(`snippets/handoff-p7-inquiry.md`);写 8 Sheet xlsx 建议主 Agent 或单 Task 收尾。
143
+
118
144
  1. **时间窗口强约束**:**严格 3 个月** = 分析月份 + 向前 2 个完整自然月。**禁止**扩展到 7 个月。
119
145
  2. **询盘资料入场**:
120
146
  - **流程 A**(用户已附文件):解析 → 落盘 `./snap-inquiry/inquiries.json`(字段见模板「询盘字段清单」)。
@@ -10,7 +10,7 @@
10
10
  ## 安装 CLI
11
11
 
12
12
  ```bash
13
- npm install -g siluzan-tso-cli
13
+ npm install -g siluzan-tso-cli@beta
14
14
  ```
15
15
 
16
16
  ---
@@ -64,7 +64,7 @@ siluzan-tso config set --api-key <Key> # 或 config 直接写入
64
64
  siluzan-tso config set --token <Token> # 备用:设置 JWT Token
65
65
  ```
66
66
 
67
- API Key 获取入口:`https://www.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
67
+ API Key 获取入口:`https://www-ci.siluzan.com/v3/foreign_trade/settings/apiKeyManagement`
68
68
 
69
69
  ```bash
70
70
  # 第 1 步:让用户报出手机号后,立刻发码(命令立即返回,不会等待输入)
@@ -129,9 +129,9 @@ siluzan-tso config show
129
129
 
130
130
  ```
131
131
  构建环境 : production
132
- apiBaseUrl : https://tso-api.siluzan.com
133
- googleApiUrl : https://googleapi.mysiluzan.com
134
- webUrl : https://www.siluzan.com
132
+ apiBaseUrl : https://tso-api-ci.siluzan.com
133
+ googleApiUrl : https://googleapi-ci.mysiluzan.com
134
+ webUrl : https://www-ci.siluzan.com
135
135
  apiKey : abcd****1234
136
136
  ```
137
137
 
@@ -14,8 +14,9 @@ siluzan-tso/ # 安装后目录名
14
14
  ├── SKILL.md.tmpl → SKILL.md # 构建生成
15
15
  ├── snippets/ # 共享注入块
16
16
  ├── docs/skill-guide.md # 人类导读
17
+ ├── snippets/ # agent-preamble、handoff-p5/p6/p7(构建时注入 SKILL 或随包复制)
17
18
  ├── references/
18
- │ ├── core/ # 纪律、安装、playbooks
19
+ │ ├── core/ # 纪律、安装、playbooks、subagent-orchestration
19
20
  │ ├── accounts/ # 账户、开户、财务
20
21
  │ ├── google-ads/ # CLI + rules/
21
22
  │ ├── analytics/ # 拉数、批处理、拓词
@@ -52,7 +53,7 @@ siluzan-tso/ # 安装后目录名
52
53
 
53
54
  - 从 SKILL.md **只链接一层**(`references/foo.md`),避免 A→B→C 链式引用。
54
55
  - 路径用正斜杠,不用 Windows 反斜杠。
55
- - 占位符 `https://www.siluzan.com`、`https://tso-api.siluzan.com`、`npm install -g siluzan-tso-cli` 由构建脚本替换,文档中禁止硬编码环境 URL。
56
+ - 占位符 `https://www-ci.siluzan.com`、`https://tso-api-ci.siluzan.com`、`npm install -g siluzan-tso-cli@beta` 由构建脚本替换,文档中禁止硬编码环境 URL。
56
57
 
57
58
  ---
58
59
 
@@ -104,6 +105,8 @@ Agent 已具备通用能力。文档只写 **CLI 特有** 内容:字段口径
104
105
  | `SKILL.md` | 安装、能力边界、文档路由表、任务→文档速查、Playbook 索引 |
105
106
  | `references/core/agent-conventions.md` | Agent 纪律:加载时机、硬规范、数据转换、时间/币种/批量 |
106
107
  | `references/core/playbooks.md` | P1–P7 标准动作(可复制命令块) |
108
+ | `references/core/subagent-orchestration.md` | 主 Agent 自主委派决策矩阵(无 `agents/` 目录) |
109
+ | `snippets/handoff-p*.md` | Task handoff 模板(随 skill 安装根复制) |
107
110
  | `references/core/tips.md` | `--json-out` 协议、outline 处理顺序 |
108
111
  | `references/*.md` | 单功能域:命令、参数、输出示例 |
109
112
  | `references/google-ads/rules/` | Google 优化/合规 SOP(非 CLI 参数) |
@@ -181,6 +184,7 @@ description: >-
181
184
  | google-ads-rules 深链三层 | SKILL → `google-ads/rules/README.md` → 具体规则 |
182
185
  | HTML 模板假数据当示例 | 纲要 `.md` 定义维度,数据来自 CLI |
183
186
  | 凭记忆跨任务复用参数 | 每任务重读 `core/agent-conventions.md` § 加载纪律 |
187
+ | 固定 `agents/` 与 skill 双源维护 | 用 `subagent-orchestration.md` + handoff snippets,主 Agent 自主决策 |
184
188
 
185
189
  ---
186
190