siluzan-tso-cli 1.1.29-beta.2 → 1.1.29-beta.21
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/README.md +1 -1
- package/dist/index.js +3174 -867
- package/dist/skill/AGENTS.md +30 -31
- package/dist/skill/SKILL.md +16 -33
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/assets/campaign-create-keyword-test.fixed.json +10 -33
- package/dist/skill/assets/campaign-create-template.json +2 -0
- package/dist/skill/assets/campaign-create-template.md +114 -99
- package/dist/skill/assets/market-analysis-rules.md +55 -55
- package/dist/skill/assets/meta-period-report-rules.md +61 -60
- package/dist/skill/assets/pmax-asset-group-template.json +12 -4
- package/dist/skill/assets/pmax-asset-group-template.md +25 -0
- package/dist/skill/assets/pmax-brand-assets-template.json +25 -0
- package/dist/skill/assets/pmax-brand-assets-template.md +22 -0
- package/dist/skill/assets/pmax-brand-guidelines-enable-template.json +24 -0
- package/dist/skill/assets/pmax-brand-guidelines-enable-template.md +22 -0
- package/dist/skill/assets/pmax-create-template.json +41 -2
- package/dist/skill/assets/pmax-create-template.md +84 -51
- package/dist/skill/assets/pmax-lead-form-template.json +36 -0
- package/dist/skill/assets/pmax-lead-form-template.md +70 -0
- package/dist/skill/assets/pmax-signals-template.json +2 -6
- package/dist/skill/assets/pmax-whatsapp-template.json +26 -0
- package/dist/skill/assets/pmax-whatsapp-template.md +45 -0
- package/dist/skill/assets/website-diagnosis-rules.md +67 -67
- package/dist/skill/references/README.md +78 -65
- package/dist/skill/references/accounts/accounts.md +99 -105
- package/dist/skill/references/accounts/finance.md +23 -79
- package/dist/skill/references/accounts/open-account-by-media.md +84 -81
- package/dist/skill/references/accounts/open-account-google-ui.md +24 -24
- package/dist/skill/references/analytics/account-analytics.md +94 -103
- package/dist/skill/references/analytics/facebook-analysis-guide.md +61 -61
- package/dist/skill/references/analytics/google-analysis-batch.md +2 -2
- package/dist/skill/references/analytics/keyword-planner-workflows.md +22 -23
- package/dist/skill/references/analytics/market-analysis-guide.md +31 -25
- package/dist/skill/references/analytics/rag.md +20 -20
- package/dist/skill/references/analytics/reporting.md +4 -4
- package/dist/skill/references/analytics/website-diagnosis-guide.md +24 -24
- package/dist/skill/references/core/agent-conventions.md +136 -106
- package/dist/skill/references/core/cli-enums.md +47 -53
- package/dist/skill/references/core/playbooks.md +42 -41
- package/dist/skill/references/core/subagent-orchestration.md +40 -40
- package/dist/skill/references/core/tips.md +18 -61
- package/dist/skill/references/core/workflows.md +36 -29
- package/dist/skill/references/google-ads/google-ads-campaign-plan.md +25 -24
- package/dist/skill/references/google-ads/google-ads.md +81 -57
- package/dist/skill/references/google-ads/pmax-api.md +138 -34
- package/dist/skill/references/google-ads/rules/README.md +15 -15
- package/dist/skill/references/google-ads/rules/google-ads-account-audit.md +22 -22
- package/dist/skill/references/google-ads/rules/google-ads-compliance.md +27 -27
- package/dist/skill/references/google-ads/rules/google-ads-keyword-strategy.md +15 -15
- package/dist/skill/references/google-ads/rules/google-ads-keyword-taxonomy.md +32 -22
- package/dist/skill/references/google-ads/rules/google-ads-launch-plan-template.md +32 -30
- package/dist/skill/references/google-ads/rules/google-ads-pmax-guide.md +3 -1
- package/dist/skill/references/misc/tso-home.md +8 -8
- package/dist/skill/references/operations/clue.md +1 -1
- package/dist/skill/references/operations/forewarning.md +1 -1
- package/dist/skill/references/operations/hosted-automation-optimize-index.md +2 -2
- package/dist/skill/references/operations/hosted-automation-scenarios.md +5 -5
- package/dist/skill/references/operations/hosted-automation-self-control.md +15 -15
- package/dist/skill/references/operations/hosted-automation-user-catalog.md +13 -13
- package/dist/skill/references/operations/optimize.md +8 -8
- package/dist/skill/references/report-templates/README.md +45 -0
- package/dist/skill/references/report-templates/REPORT-WORKFLOW.md +114 -0
- package/dist/skill/references/report-templates/bing-period-report.md +65 -0
- package/dist/skill/references/report-templates/google-account-diagnosis-report.md +83 -0
- package/dist/skill/references/report-templates/google-ads-diagnosis.md +378 -0
- package/dist/skill/references/report-templates/google-inquiry-analysis.md +543 -0
- package/dist/skill/references/report-templates/google-period-report-excel.md +126 -0
- package/dist/skill/references/report-templates/google-period-report.md +60 -0
- package/dist/skill/references/report-templates/market-analysis-report.md +40 -0
- package/dist/skill/references/report-templates/meta-account-diagnosis-report.md +74 -0
- package/dist/skill/references/report-templates/meta-period-report-excel.md +230 -0
- package/dist/skill/references/report-templates/meta-period-report.md +219 -0
- package/dist/skill/references/report-templates/okki-weekly-google-client.md +217 -0
- package/dist/skill/references/report-templates/tiktok-period-report.md +56 -0
- package/dist/skill/references/report-templates/website-diagnosis-report.md +79 -0
- package/dist/skill/report-templates/README.md +16 -14
- package/dist/skill/report-templates/REPORT-WORKFLOW.md +13 -13
- package/dist/skill/report-templates/google-account-diagnosis-report.md +1 -1
- package/dist/skill/report-templates/google-ads-diagnosis.md +21 -21
- package/dist/skill/report-templates/google-inquiry-analysis.md +44 -44
- package/dist/skill/report-templates/google-period-report-excel.md +24 -24
- package/dist/skill/report-templates/google-period-report.md +23 -23
- package/dist/skill/report-templates/market-analysis-report.md +1 -1
- package/dist/skill/report-templates/meta-period-report-excel.md +72 -64
- package/dist/skill/report-templates/meta-period-report.html +706 -428
- package/dist/skill/report-templates/meta-period-report.md +61 -60
- package/dist/skill/report-templates/okki-weekly-google-client.md +26 -26
- package/dist/skill/report-templates/report-template-academic.html +1 -1
- package/dist/skill/report-templates/report-template-dark.html +1 -1
- package/dist/skill/report-templates/report-template-formal.html +1 -1
- package/dist/skill/report-templates/report-template-mobile.html +1 -1
- package/dist/skill/report-templates/report-template-onepager.html +1 -1
- package/dist/skill/report-templates/report-template-print.html +1 -1
- package/dist/skill/report-templates/report-template.html +1 -1
- package/dist/skill/report-templates/website-diagnosis-report.html +1731 -1653
- package/dist/skill/report-templates/website-diagnosis-report.md +21 -23
- package/dist/skill/scripts/install.ps1 +1 -1
- package/dist/skill/scripts/install.sh +1 -1
- package/dist/skill/snippets/handoff-p7-inquiry.md +5 -5
- package/eval/cases/accounts-entityid-vs-mediaccustomerid.scenario.json +2 -14
- package/eval/cases/accounts-mcc-bind-inquiry.scenario.json +1 -3
- package/eval/cases/accounts-single-balance-not-bulk.scenario.json +3 -14
- package/eval/cases/budget-display-not-raw-micros.scenario.json +1 -8
- package/eval/cases/clue-meta-leads-json.scenario.json +2 -14
- package/eval/cases/clue-tiktok-leads-json.scenario.json +2 -11
- package/eval/cases/destructive-account-delink-needs-confirm.scenario.json +3 -9
- package/eval/cases/destructive-forewarning-delete-needs-confirm.scenario.json +3 -9
- package/eval/cases/destructive-invoice-apply-needs-confirm.scenario.json +3 -9
- package/eval/cases/facebook-analysis-google-section-aliases.scenario.json +2 -11
- package/eval/cases/facebook-analysis-not-google-keywords.scenario.json +3 -10
- package/eval/cases/facebook-analysis-period-default.scenario.json +2 -14
- package/eval/cases/finance-invoice-info-list.scenario.json +3 -11
- package/eval/cases/forewarning-list-google.scenario.json +3 -14
- package/eval/cases/google-ads-no-structural-without-confirm.scenario.json +2 -6
- package/eval/cases/google-analysis-keywords-route.scenario.json +2 -14
- package/eval/cases/human-p1-multiturn.scenario.json +1 -5
- package/eval/cases/meta-single-balance-not-bulk.scenario.json +3 -17
- package/eval/cases/no-legacy-json-flag.scenario.json +2 -6
- package/eval/cases/open-account-google-noninteractive.scenario.json +1 -3
- package/eval/cases/open-account-tiktok-license-file.scenario.json +1 -3
- package/eval/cases/optimize-list-by-account.scenario.json +3 -11
- package/eval/cases/p1-single-account-profile.scenario.json +1 -11
- package/eval/cases/p2-balance-scan-bulk.scenario.json +2 -9
- package/eval/cases/p3-accounts-digest.scenario.json +1 -5
- package/eval/cases/p4-fb-meta-period-report.scenario.json +2 -12
- package/eval/cases/p4-period-report-window.scenario.json +1 -8
- package/eval/cases/pmax-asset-group-create-with-bg.scenario.json +15 -0
- package/eval/cases/pmax-brand-edit-routing.scenario.json +12 -0
- package/eval/cases/pmax-edit-not-campaign-edit.scenario.json +15 -0
- package/eval/cases/pmax-enable-brand-guidelines.scenario.json +15 -0
- package/eval/cases/pmax-no-assets-update-brand-fields.scenario.json +12 -0
- package/eval/cases/rag-before-keyword-expand.scenario.json +1 -11
- package/eval/cases/rag-list-then-query.scenario.json +2 -14
- package/eval/cases/report-list-google.scenario.json +2 -11
- package/eval/cases/report-push-list-google.scenario.json +2 -11
- package/eval/cases/setup-login-or-env.scenario.json +1 -3
- package/eval/cases/setup-siluzan-data-permission-env.scenario.json +1 -3
- package/eval/cases/tiktok-bc-bind-inquiry.scenario.json +2 -6
- package/eval/cases/time-range-user-delegates-default.scenario.json +1 -8
- package/eval/cases/tips-json-out-filtering.scenario.json +1 -3
- package/eval/cases/tips-large-json-pagination.scenario.json +1 -3
- package/eval/cases/uj-ad-campaign-validate-before-create-stub.scenario.json +2 -11
- package/eval/cases/uj-ad-outdoor-campgear-search-plan.scenario.json +1 -3
- package/eval/cases/uj-analytics-30d-pdf-campaign-device-geo.scenario.json +6 -18
- package/eval/cases/uj-analytics-compare-google-tiktok-last-month-roi.scenario.json +1 -8
- package/eval/cases/uj-analytics-google-weekly-trends-campaigns-keywords.scenario.json +2 -11
- package/eval/cases/uj-analytics-report-push-weekly-email.scenario.json +1 -3
- package/eval/cases/uj-finance-invoice-records-this-month.scenario.json +2 -11
- package/eval/cases/uj-life-newbie-siluzan-google-end-to-end.scenario.json +1 -4
- package/eval/cases/uj-ops-google-accounts-list-normal.scenario.json +2 -17
- package/eval/cases/uj-ops-google-yesterday-spend-conversions.scenario.json +2 -14
- package/eval/cases/uj-ops-pause-worst-adgroup-confirm.scenario.json +2 -6
- package/eval/cases/uj-ops-tiktok-leads-last-week.scenario.json +3 -17
- package/eval/cases/uj-patrol-cpc-spike-adgroups-over-15.scenario.json +1 -5
- package/eval/cases/uj-patrol-forewarning-create-daily-cap-3000.scenario.json +1 -3
- package/eval/cases/uj-patrol-forewarning-trigger-records.scenario.json +3 -17
- package/eval/cases/uj-patrol-google-balances-low.scenario.json +2 -11
- package/eval/cases/uj-roi-optimize-records-then-execute-cautiously.scenario.json +3 -14
- package/eval/cases/uj-roi-search-terms-add-negative-keywords.scenario.json +2 -14
- package/eval/stub-fixtures/facebook-analysis.json +24 -4
- package/eval/stub-fixtures/meta-overview.json +4 -1
- package/eval/stub-fixtures/pmax-asset-group-create-ok.json +12 -0
- package/eval/stub-fixtures/pmax-brand-assets-edit-ok.json +11 -0
- package/eval/stub-fixtures/pmax-brand-guidelines-enable-ok.json +11 -0
- package/eval/stub-fixtures/pmax-edit-ok.json +11 -0
- package/eval/stub-fixtures/pmax-get-bg-on.json +20 -0
- package/package.json +1 -1
- package/dist/skill/references/core/deliverable-preflight.md +0 -109
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
# 工作流目录 · 分析 / 报告类(P1–P9)
|
|
2
2
|
|
|
3
|
-
> **范围**:CLI 拉数 → 脚本读盘 → Agent 撰稿 →
|
|
3
|
+
> **范围**:CLI 拉数 → 脚本读盘 → Agent 撰稿 → 交付的报告/分析任务。操作/管理类见 `references/core/workflows.md`(W1–W12)。
|
|
4
4
|
>
|
|
5
|
-
>
|
|
6
|
-
|
|
7
|
-
| 编号
|
|
8
|
-
|
|
|
9
|
-
| P1
|
|
10
|
-
| P2
|
|
11
|
-
| P3
|
|
12
|
-
| P4
|
|
13
|
-
| P4-FB | Meta/Facebook 周期报告 | facebook-analysis 5–7 维,默认 HTML
|
|
14
|
-
| P5
|
|
15
|
-
| P6
|
|
16
|
-
| P7
|
|
17
|
-
| P8
|
|
18
|
-
| P9
|
|
5
|
+
> **通用纪律统一见 `references/core/agent-conventions.md`**(加载纪律、数据处理协议「摘要 → outline → 脚本读 JSON」、时间范围反问、币种分表、交付前自检),各卡片**不再重复**,只写任务特有步骤。每张卡片结构统一:`触发 / 必读 / 步骤 / 交付与确认`。
|
|
6
|
+
|
|
7
|
+
| 编号 | 业务 | 一句话 |
|
|
8
|
+
| ----- | ---------------------- | -------------------------------------- |
|
|
9
|
+
| P1 | 单账户投放画像 | 单户拉数 + 诊断画像 |
|
|
10
|
+
| P2 | 多账户余额扫描 | 续航不足/充值预警巡检 |
|
|
11
|
+
| P3 | 多账户投放画像汇总 | accounts-digest 多户对比表 |
|
|
12
|
+
| P4 | Google 账户周期报告 | 默认 8 维周期汇总 |
|
|
13
|
+
| P4-FB | Meta/Facebook 周期报告 | facebook-analysis 5–7 维,默认 HTML |
|
|
14
|
+
| P5 | 多账户多维度批处理 | google-analysis-batch,禁外层 for-loop |
|
|
15
|
+
| P6 | OKKI 周报 | 固定模板多 Sheet xlsx |
|
|
16
|
+
| P7 | Google 询盘分析 | 严格 3 个月 8 Sheet xlsx |
|
|
17
|
+
| P8 | 网站诊断 | website-diagnosis,默认 HTML |
|
|
18
|
+
| P9 | 战略市场分析 | market-analysis,默认 HTML |
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
## P1 · 单账户投放画像
|
|
23
23
|
|
|
24
24
|
- **触发**:对单个 Google 账户做投放画像/诊断/健康检查。
|
|
25
|
-
- **必读**:`analytics/account-analytics.md
|
|
25
|
+
- **必读**:`analytics/account-analytics.md`;诊断报告加 `references/report-templates/google-ads-diagnosis.md` + `references/report-templates/google-account-diagnosis-report.md`。
|
|
26
26
|
- **步骤**:
|
|
27
|
-
1.
|
|
27
|
+
1. 确认统计区间(规则见 conventions §五)。
|
|
28
28
|
2. `list-accounts -m Google -k <mediaCustomerId> --json-out ./snap-p1`(取 `currencyCode`)。
|
|
29
29
|
3. `stats -m Google -a <mediaCustomerId> --start <S> --end <D> --json-out ./snap-p1`。
|
|
30
30
|
4. `google-analysis -a <mediaCustomerId> --start <S> --end <D> --sections overview,campaigns,devices,geographic,keywords,daily-metrics --json-out ./snap-p1`(诊断须含 `daily-metrics` 按日趋势)。
|
|
31
|
-
5.
|
|
32
|
-
|
|
31
|
+
5. **outline 门禁**:对**每个** section Read 其 `<section>-<accountId>_*.outline.txt`(一批并行读全)确认字段树后再写脚本——字段名以 outline 为准,**禁止**凭模板/通用命名直接写(详见 conventions §三 outline 门禁)。
|
|
32
|
+
6. 脚本读盘 → 撰写报告:每模块除表格外须有「分析 + 建议」;每日趋势金额/CPA 2 位小数。
|
|
33
|
+
- **交付/确认**:按 conventions §七 自检后交付。
|
|
33
34
|
|
|
34
35
|
---
|
|
35
36
|
|
|
36
37
|
## P2 · 多账户余额扫描
|
|
37
38
|
|
|
38
39
|
- **触发**:多账户余额续航不足、充值预警、僵尸账户巡检。
|
|
39
|
-
- **必读**:`accounts/accounts.md`(§ balance-scan
|
|
40
|
+
- **必读**:`accounts/accounts.md`(§ balance-scan)。
|
|
40
41
|
- **步骤**:
|
|
41
42
|
1. 全量巡检:`balance-scan -m <媒体> --threshold-days 7 --json-out ./snap-p2`(可选 `--min-balance 100` / `--target-days 60`)。
|
|
42
43
|
2. 已知子集:`balance-scan -m <媒体> -a id1,id2,id3 --json-out ./snap-p2-subset`(跳过翻页)。
|
|
@@ -47,26 +48,26 @@
|
|
|
47
48
|
## P3 · 多账户投放画像汇总
|
|
48
49
|
|
|
49
50
|
- **触发**:多账户消耗/点击/转化/CTR/CPC/CPA 汇总对比表、跨账户巡检。
|
|
50
|
-
- **必读**:`accounts/accounts.md`(§ accounts-digest
|
|
51
|
+
- **必读**:`accounts/accounts.md`(§ accounts-digest)。
|
|
51
52
|
- **步骤**:
|
|
52
|
-
1.
|
|
53
|
+
1. 确认时间范围后执行 `accounts-digest -m <媒体> -a id1,id2,... --start <S> --end <D> --json-out ./snap-p3`(全量则省略 `-a`)。
|
|
53
54
|
2. 基于落盘 `data.items` 与 `meta.totals` 生成报告,**不要**再逐账户 `stats`。
|
|
54
|
-
- **交付/确认**:表格覆盖用户请求的**每一个** ID
|
|
55
|
+
- **交付/确认**:表格覆盖用户请求的**每一个** ID(未返回的占一行标注「未返回」)。
|
|
55
56
|
|
|
56
57
|
---
|
|
57
58
|
|
|
58
59
|
## P4 · Google 账户周期报告
|
|
59
60
|
|
|
60
61
|
- **触发**:Google 账户某区间的周期/月度/季度汇总报告;或用户列出 Sheet/章节要 **Excel**(非 OKKI / 询盘)。
|
|
61
|
-
- **必读**:`report-templates/google-period-report.md
|
|
62
|
+
- **必读**:`references/report-templates/google-period-report.md` + `analytics/account-analytics.md`;**要 Excel** 加 `references/report-templates/google-period-report-excel.md`(全文)。
|
|
62
63
|
- **步骤**:
|
|
63
|
-
1. **账户核验**:`list-accounts -m Google -k <mediaCustomerId> --json-out <dir
|
|
64
|
+
1. **账户核验**:`list-accounts -m Google -k <mediaCustomerId> --json-out <dir>`;无记录则停止并告知用户。
|
|
64
65
|
2. 确认时间范围;区间 > 3 个月时分段(季度/月)。
|
|
65
66
|
3. **拉数**:用户已指定 Sheet/维度 → 只拉对应 `--sections`(见 `google-period-report-excel.md` 映射表);未指定 → 按 `google-period-report.md` 默认 8 维,并可并行追问可选追加。
|
|
66
|
-
4. **门禁**:对每个 section Read `<section>-<accountId>_*.outline.txt
|
|
67
|
+
4. **门禁**:对每个 section Read `<section>-<accountId>_*.outline.txt` 后再写脚本。
|
|
67
68
|
5. 脚本读盘写产物:默认 **HTML**(`report-template*.html` 版式参考);用户要 **Excel** → Agent 脚本写 xlsx(**禁止**宿主第三方 xlsx Skill;**无** CLI excel 子命令)。
|
|
68
69
|
6. 默认 HTML 报告须含:账户概览、投放趋势、Top 关键词/系列/地区分布、优化建议;用户定制 Excel 以用户 Sheet 清单为准。
|
|
69
|
-
-
|
|
70
|
+
- **交付/确认**:按 conventions §七 自检;`accountId` 须与用户给的 `mediaCustomerId` 一致。
|
|
70
71
|
|
|
71
72
|
> 用户用「OKKI 周报」固定话术 → 改走 **P6**,不按默认 8 维追问。
|
|
72
73
|
|
|
@@ -75,27 +76,27 @@
|
|
|
75
76
|
## P4-FB · Meta/Facebook 账户周期报告
|
|
76
77
|
|
|
77
78
|
- **触发**:Meta/Facebook 账户周期/月报/周报或诊断报告。
|
|
78
|
-
- **必读**:`report-templates/meta-period-report.md
|
|
79
|
+
- **必读**:`references/report-templates/meta-period-report.md` + `assets/meta-period-report-rules.md`(内容丰富度必读)+ `analytics/facebook-analysis-guide.md`;要 Excel 加 `references/report-templates/meta-period-report-excel.md`。
|
|
79
80
|
- **默认交付**:**HTML**(`facebook-analysis render`);用户明确要 Excel 时 Agent 脚本写 xlsx(步骤 1–3 不变,不调 `render`)。
|
|
80
81
|
- **步骤**:
|
|
81
82
|
1. `list-accounts -m MetaAd -k <mediaCustomerId> --json-out ./snap-fb` 确认账户与 `currencyCode`。
|
|
82
83
|
2. 确认 `--start` / `--end`(>3 个月可分段)。
|
|
83
84
|
3. **拉数**(默认 5 维,要创意加 `creative`):`facebook-analysis -a <id> --start <S> --end <D> --json-out ./snap-fb --sections overview,ad-sets,platform,country,audience`。
|
|
84
85
|
4. **分析**:脚本读落盘 JSON 聚合(见 `facebook-analysis-guide.md`)。
|
|
85
|
-
5. **写 JSON**:按 `meta-period-report-rules.md
|
|
86
|
+
5. **写 JSON**:按 `meta-period-report-rules.md` 落盘 `meta-period-report.json`(`narrative` 4 条建议各 ≥150 字 + `supplementaryRecommendations` 7 维 + HTML 必填扩展);无按日/关键词等写「接口未提供」,**禁止编造**。
|
|
86
87
|
6. **交付**:`facebook-analysis render --data ./meta-period-report.json --snapshot-dir ./snap-fb --out ./meta-period-report.html`。
|
|
87
|
-
-
|
|
88
|
+
- **交付/确认**:按 conventions §七 自检。诊断场景改用 `references/report-templates/meta-account-diagnosis-report.md`,拉数省略 `--sections` 拉全 7 维。
|
|
88
89
|
|
|
89
90
|
---
|
|
90
91
|
|
|
91
92
|
## P5 · 多账户多维度批处理
|
|
92
93
|
|
|
93
94
|
- **触发**:账户数 ≥ 2 且需拉取 ≥ 2 个 google-analysis 维度。**禁止**外层 for-loop。
|
|
94
|
-
- **必读**:`analytics/google-analysis-batch.md
|
|
95
|
+
- **必读**:`analytics/google-analysis-batch.md` + `analytics/account-analytics.md`;可选 `core/subagent-orchestration.md`。
|
|
95
96
|
- **入口选择**:全量 → 省略 `-a`;2~10 子集 → `google-analysis -a id1,id2,...`;≥10 子集或需 resume → `google-analysis-batch run -a id1,id2,...`。
|
|
96
97
|
- **步骤**:
|
|
97
98
|
1. (可选)Read `subagent-orchestration.md` § P5 决定执行模式。
|
|
98
|
-
2.
|
|
99
|
+
2. 确认时间范围 + 维度(默认 `campaigns,geographic,keywords`)。
|
|
99
100
|
3. 执行(推荐全量省略 `-a`):
|
|
100
101
|
```bash
|
|
101
102
|
siluzan-tso google-analysis-batch run --start <S> --end <D> \
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
--min-spend 1 --keyword-limit 1000 --json-out ./snap-p5
|
|
105
106
|
```
|
|
106
107
|
4. **中断只能 resume**:`google-analysis-batch resume --json-out ./snap-p5 --run-id <runId>`;只读进度用 `status`。
|
|
107
|
-
5.
|
|
108
|
+
5. **outline 门禁(消费产物前)**:每个维度 Read 其一份 `results/<accountId>/<section>-<accountId>.outline.txt`(同维度多账户同结构,读其一即可代表该维度;一批并行把所有维度 outline 读全)确认字段树后再写聚合脚本,**禁止**凭模板字段名直接写(详见 conventions §三 outline 门禁 + `analytics/google-analysis-batch.md` §产物消费)。
|
|
108
109
|
- **交付/确认**:**禁止**重新 `run` 续跑;401 → 整批终止,重登录后 `resume`。
|
|
109
110
|
|
|
110
111
|
---
|
|
@@ -112,26 +113,26 @@
|
|
|
112
113
|
## P6 · OKKI 周报
|
|
113
114
|
|
|
114
115
|
- **触发**:话术含 `使用 okki 周报模板` / `OKKI 周报` / `okki 周报`,且指向 Google 账户 + 日期区间。
|
|
115
|
-
- **必读**:`report-templates/okki-weekly-google-client.md
|
|
116
|
+
- **必读**:`references/report-templates/okki-weekly-google-client.md`(**全文**)+ `analytics/account-analytics.md`;可选 `core/subagent-orchestration.md`。
|
|
116
117
|
- **步骤**:
|
|
117
118
|
1. (可选)Read `subagent-orchestration.md` § P6 决定是否分阶段委派。
|
|
118
119
|
2. 确认 `mediaCustomerId` 与 `--start` / `--end`。
|
|
119
120
|
3. 同一 `--json-out` 目录执行模板命令组合:`stats`、`balance`、`google-analysis --sections overview,campaigns,keywords,search-terms,campaign-device,campaign-geo-matched`。
|
|
120
|
-
4.
|
|
121
|
-
- **交付/确认**:**不**按 P4 默认 8 维追加;金额读 `*Yuan
|
|
121
|
+
4. 脚本读盘 → 交付话术 + 多 Sheet `.xlsx`(无 CLI 写表命令)。
|
|
122
|
+
- **交付/确认**:**不**按 P4 默认 8 维追加;金额读 `*Yuan` 字段。
|
|
122
123
|
|
|
123
124
|
---
|
|
124
125
|
|
|
125
126
|
## P7 · Google 账户询盘分析
|
|
126
127
|
|
|
127
128
|
- **触发**:话术含 `Google 账户询盘分析` / `分析 XXX Google 账号的询盘效果`,或同时含「询盘 + 账户 + Google」。
|
|
128
|
-
- **必读**:`report-templates/google-inquiry-analysis.md
|
|
129
|
+
- **必读**:`references/report-templates/google-inquiry-analysis.md`(**全文**)+ `analytics/account-analytics.md` + `analytics/geo-continents.json`;可选 `core/subagent-orchestration.md`。
|
|
129
130
|
- **时间窗口强约束**:**严格 3 个月** = 分析月份 + 向前 2 个完整自然月,**禁止**扩展到 7 个月。
|
|
130
131
|
- **步骤**:
|
|
131
132
|
1. (可选)Read `subagent-orchestration.md` § P7。
|
|
132
133
|
2. 询盘资料入场:用户附文件 → 解析落盘 `./snap-inquiry/inquiries.json`;仅给账户 ID → 反问账户 + 分析月份并贴字段清单,**禁止编造询盘数据**。
|
|
133
134
|
3. CLI 拉数(同一目录):`list-accounts`、`google-analysis --sections campaigns,keywords,search-terms,campaign-geo`,并按月拉 `m1/m2/m3` 的 `campaigns,geographic`。
|
|
134
|
-
4.
|
|
135
|
+
4. 脚本聚合计算 8 Sheet 数据;国家→大洲映射读 `geo-continents.json`,**禁止**硬编码国家名。
|
|
135
136
|
- **交付/确认**:必产 8 Sheet xlsx(版式见模板),**只能**由 Agent 脚本生成,**禁止**假设 `… excel` 子命令存在。
|
|
136
137
|
|
|
137
138
|
---
|
|
@@ -139,12 +140,12 @@
|
|
|
139
140
|
## P8 · 网站诊断
|
|
140
141
|
|
|
141
142
|
- **触发**:对某 URL 做网站/落地页诊断、投放前网站评分,或话术含「网站诊断」「落地页质量」(**非** Google 账户 `AdvertisingDiagnosis`)。
|
|
142
|
-
- **必读**:`analytics/website-diagnosis-guide.md
|
|
143
|
+
- **必读**:`analytics/website-diagnosis-guide.md` + `assets/website-diagnosis-rules.md` + `references/report-templates/website-diagnosis-report.md`。
|
|
143
144
|
- **默认交付**:**HTML**(`website-diagnosis render`);**禁止**仅 Markdown 摘要或纯 JSON 充当终稿。
|
|
144
145
|
- **步骤**:
|
|
145
146
|
1. 确认完整 URL(`https://` 可省略,CLI 自动补全)。
|
|
146
147
|
2. 采集:`website-diagnosis collect --url <url> --json-out ./snap-web`。
|
|
147
|
-
3. 按 `website-diagnosis-rules.md
|
|
148
|
+
3. 按 `website-diagnosis-rules.md` 脚本落盘 `diagnosis.json`(与 tso_agent `getWebsiteDiagnosisData` 同结构:6 模块、29 子项、`ratingId`、`coreIssuesIds`)。
|
|
148
149
|
4. 出 HTML:`website-diagnosis render --data ./diagnosis.json --collect ./snap-web/<collect>.json --out ./snap-web/website-diagnosis-report.html`。
|
|
149
150
|
- **交付/确认**:交付 HTML 路径;Lighthouse 缺失时在 HTML 中说明;仅需历史 ARIT 分时用 `website-diagnosis search --ids <websiteDiagnoseId>`。
|
|
150
151
|
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
## P9 · 战略市场分析
|
|
154
155
|
|
|
155
156
|
- **触发**:话术含「市场分析」「行业分析」「战略市场报告」「KA 市场报告」,或对某客户/行业做竞品/GTM 战略分析(**非** `google-analysis`、**非** 网站诊断)。
|
|
156
|
-
- **必读**:`analytics/market-analysis-guide.md
|
|
157
|
+
- **必读**:`analytics/market-analysis-guide.md` + `assets/market-analysis-rules.md`(原始业务维度清单)+ `references/report-templates/market-analysis-report.md`。
|
|
157
158
|
- **默认交付**:**HTML**(`market-analysis render`)。
|
|
158
159
|
- **步骤**:
|
|
159
160
|
1. 确认客户信息(客户名称/网站/行业/核心产品至少一项);`targetMarket` 默认「全球」、`timeRange` 默认「近12个月」(未给须写明)。
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
## 主 Agent 与主会话的职责(不可下放)
|
|
11
11
|
|
|
12
|
-
| 保留在主 Agent
|
|
13
|
-
|
|
|
14
|
-
| 时间范围反问(见 `agent-conventions.md`) | 写入/修改/删除及 `--commit` 确认
|
|
15
|
-
| 向用户说明计划并获确认
|
|
16
|
-
| 合并子会话摘要并交付用户
|
|
17
|
-
| 选择 Playbook(P1–P7)与必读 references
|
|
12
|
+
| 保留在主 Agent | 禁止默认交给子会话 |
|
|
13
|
+
| ----------------------------------------- | ---------------------------------------- |
|
|
14
|
+
| 时间范围反问(见 `agent-conventions.md`) | 写入/修改/删除及 `--commit` 确认 |
|
|
15
|
+
| 向用户说明计划并获确认 | 401 后统一停批、引导 `login` 再 `resume` |
|
|
16
|
+
| 合并子会话摘要并交付用户 | 编造 `mediaCustomerId`、金额、业务数据 |
|
|
17
|
+
| 选择 Playbook(P1–P7)与必读 references | 用子会话替代「每任务 Read references」 |
|
|
18
18
|
|
|
19
19
|
子会话**不继承**父对话历史;handoff 必须**自包含**(见下文)。
|
|
20
20
|
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
|
|
34
34
|
## 决策矩阵
|
|
35
35
|
|
|
36
|
-
| 信号
|
|
37
|
-
|
|
|
38
|
-
| 单次 `list-accounts -k`、P1 三步拉数、`-h` 查参 | **主会话**
|
|
39
|
-
| `balance-scan` / `accounts-digest` 单命令
|
|
40
|
-
| 预计 CLI **>2 分钟** 或 stderr/stdout 很长
|
|
41
|
-
| **P6 OKKI**:拉数 → 写 xlsx(两阶段)
|
|
42
|
-
| **P7 询盘**:`m1`/`m2`/`m3` 三月拉数
|
|
43
|
-
| **P5** `google-analysis-batch run` 全量
|
|
44
|
-
| **P5** batch **完成后** 按账户聚合
|
|
45
|
-
| 读 `google-ads/rules/*` 全文做方案
|
|
46
|
-
| 用户仅闲聊 / 解释字段口径
|
|
36
|
+
| 信号 | 倾向 | 推荐子会话类型 | 勿委派 |
|
|
37
|
+
| ----------------------------------------------- | --------------------- | ------------------------------------------------------ | ------------------------ |
|
|
38
|
+
| 单次 `list-accounts -k`、P1 三步拉数、`-h` 查参 | **主会话** | — | 为查一个账户开子会话 |
|
|
39
|
+
| `balance-scan` / `accounts-digest` 单命令 | **主会话** | — | 外层 for-loop 逐账户 |
|
|
40
|
+
| 预计 CLI **>2 分钟** 或 stderr/stdout 很长 | **委派** | 内置 **Bash** 或 Task + `snippets/handoff-*.md` 拉数段 | 在主会话逐行读日志 |
|
|
41
|
+
| **P6 OKKI**:拉数 → 写 xlsx(两阶段) | **委派** | 阶段 1:Bash/Task 拉数;阶段 2:Task 只读 snap 写脚本 | 子会话做写操作确认 |
|
|
42
|
+
| **P7 询盘**:`m1`/`m2`/`m3` 三月拉数 | **并行委派** | 3× Task(`handoff-p7-inquiry.md` 子目录变体) | 3× 主会话顺序跑 |
|
|
43
|
+
| **P5** `google-analysis-batch run` 全量 | **主会话或单次 Bash** | **一次** batch;CLI 内置并发 | per-account 子会话调 API |
|
|
44
|
+
| **P5** batch **完成后** 按账户聚合 | **可选并行** | N× Task,只读 `results/<accountId>/` | 子会话 `run` 新 batch |
|
|
45
|
+
| 读 `google-ads/rules/*` 全文做方案 | **委派** | **Explore** + `readonly` | 主会话 Read 全文进上下文 |
|
|
46
|
+
| 用户仅闲聊 / 解释字段口径 | **主会话** | — | — |
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
|
|
52
52
|
### 必填字段(写入 Task prompt 或 Bash 说明)
|
|
53
53
|
|
|
54
|
-
| 字段
|
|
55
|
-
|
|
|
56
|
-
| `playbookId`
|
|
57
|
-
| `snapDir`
|
|
58
|
-
| `mediaCustomerId` | 来自当次 `list-accounts`,禁止猜
|
|
59
|
-
| `dateRange`
|
|
60
|
-
| `commands[]`
|
|
61
|
-
| `forbidden[]`
|
|
62
|
-
| `returnSchema`
|
|
54
|
+
| 字段 | 说明 |
|
|
55
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
56
|
+
| `playbookId` | `P5` / `P6` / `P7` 等 |
|
|
57
|
+
| `snapDir` | `--json-out` 根目录(绝对或相对 cwd) |
|
|
58
|
+
| `mediaCustomerId` | 来自当次 `list-accounts`,禁止猜 |
|
|
59
|
+
| `dateRange` | `start` / `end`(YYYY-MM-DD);P7 另附 `m1`/`m2`/`m3` |
|
|
60
|
+
| `commands[]` | 可复制 bash 块(来自 playbook 或 report-template) |
|
|
61
|
+
| `forbidden[]` | 至少包含:禁止 Read/cat 打开落盘业务 `*.json`(须 node/python 脚本读盘);禁止把 JSON 贴进回复;禁止编造 ID/金额;禁止 batch 重新 `run`(仅 `resume`) |
|
|
62
|
+
| `returnSchema` | 子会话**只**回传下列内容 |
|
|
63
63
|
|
|
64
64
|
### returnSchema(子会话结束时的回复格式)
|
|
65
65
|
|
|
@@ -76,11 +76,11 @@ summary: <1-3 句中文,无业务数字除非来自 manifest>
|
|
|
76
76
|
|
|
77
77
|
### Handoff 模板文件(复制进 Task prompt)
|
|
78
78
|
|
|
79
|
-
| Playbook
|
|
80
|
-
|
|
|
81
|
-
| P6 OKKI
|
|
82
|
-
| P5 batch 后 | `{skillRoot}/snippets/handoff-p5-batch.md`
|
|
83
|
-
| P7 询盘
|
|
79
|
+
| Playbook | 文件 |
|
|
80
|
+
| ----------- | -------------------------------------------- |
|
|
81
|
+
| P6 OKKI | `{skillRoot}/snippets/handoff-p6-okki.md` |
|
|
82
|
+
| P5 batch 后 | `{skillRoot}/snippets/handoff-p5-batch.md` |
|
|
83
|
+
| P7 询盘 | `{skillRoot}/snippets/handoff-p7-inquiry.md` |
|
|
84
84
|
|
|
85
85
|
> **路径说明**:`snippets/` 与 `SKILL.md`、`references/` 同级(skill 安装根目录)。主 Agent 派发 Task 前先 Read 对应 handoff 文件,替换占位符后写入子会话 prompt。
|
|
86
86
|
|
|
@@ -88,11 +88,11 @@ summary: <1-3 句中文,无业务数字除非来自 manifest>
|
|
|
88
88
|
|
|
89
89
|
## 内置 subagent vs 自定义 Task prompt
|
|
90
90
|
|
|
91
|
-
| 宿主能力
|
|
92
|
-
|
|
|
93
|
-
| **Bash**(Cursor 内置)
|
|
91
|
+
| 宿主能力 | 何时优先 |
|
|
92
|
+
| ------------------------ | -------------------------------------- |
|
|
93
|
+
| **Bash**(Cursor 内置) | 纯 `siluzan-tso` 命令序列、长输出隔离 |
|
|
94
94
|
| **Explore** + `readonly` | 只读搜 reference / `rules/`,不改 snap |
|
|
95
|
-
| **Task + 自写 prompt**
|
|
95
|
+
| **Task + 自写 prompt** | 需嵌入上表 `forbidden` 且 Bash 不够用 |
|
|
96
96
|
|
|
97
97
|
不要求固定子 Agent 名称;在 prompt 中写清角色即可(例:「TSO 拉数子任务,仅执行下列命令」)。
|
|
98
98
|
|
|
@@ -132,11 +132,11 @@ summary: <1-3 句中文,无业务数字除非来自 manifest>
|
|
|
132
132
|
|
|
133
133
|
## 客户端兼容说明
|
|
134
134
|
|
|
135
|
-
| 客户端
|
|
136
|
-
|
|
|
137
|
-
| **Cursor**
|
|
138
|
-
| **无 subagent**
|
|
139
|
-
| **Claude Code 等** | 若有子 Agent API,同样遵循 handoff + returnSchema
|
|
135
|
+
| 客户端 | 行为 |
|
|
136
|
+
| ------------------ | ------------------------------------------------------------------------ |
|
|
137
|
+
| **Cursor** | 主 Agent 通过 Task 或内置 Bash/Explore 委派;不依赖 skill 包内 `agents/` |
|
|
138
|
+
| **无 subagent** | 忽略本节,全部在主会话完成,仍遵守 `--json-out` 与 outline 纪律 |
|
|
139
|
+
| **Claude Code 等** | 若有子 Agent API,同样遵循 handoff + returnSchema |
|
|
140
140
|
|
|
141
141
|
---
|
|
142
142
|
|
|
@@ -1,76 +1,37 @@
|
|
|
1
|
-
# CLI
|
|
1
|
+
# CLI 脚本食谱:`--json-out` 落盘 + Node.js 精准查询
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
> **AI 助手(本 Skill)**:凡需结构化数据,一律 **`--json-out <路径>`** 落盘,再用 **Node/Python 脚本**(`require` / `readFileSync`)读 JSON 做筛选与聚合。**禁止**用宿主 **Read** 工具打开落盘业务 `*.json`(会占满上下文且易截断)。命令成功时 **stdout 仅一行摘要 JSON**(体积小);**`outlineFile`**(`*.outline.txt`,通常小于 2KB)是唯一允许用 Read 查看的「数据结构」文件——最后一行是 TS 类型字面量。业务数据**只**通过脚本访问,脚本 stdout 打印你需要的行/汇总即可。
|
|
6
|
-
>
|
|
7
|
-
> **文件命名规则(重要)**:当一条命令具备明确的"查询 id"(mediaCustomerId / entityId / ruleId / auditId 等)时,目录模式落盘的 `*.json`、`*.outline.txt` 与对应 manifest **都会带上 `-<查询id>` 后缀**:
|
|
8
|
-
>
|
|
9
|
-
> - 业务文件:`<section>-<查询id>.json`、`<section>-<查询id>.outline.txt`(如 `overview-9526903813.json`、`balance-Google.json`)
|
|
10
|
-
> - 清单文件:`manifest-<accountId>.json`(google-analysis)/ `report-manifest-<accountId>.json`(report 分析类)/ `cli-manifest-<查询id>.json`(通用业务命令)
|
|
11
|
-
> 当 section 已经以同一 slug 结尾(如 `list-accounts-google` + idSuffix `google`)时不会重复追加。**读文件请以 stdout 摘要里的 `writtenFiles[]` / `manifestFile` 为准**,不要把"`<section>.json`"当成不变的硬编码。
|
|
12
|
-
>
|
|
13
|
-
|
|
14
|
-
**Google `google-analysis` 与 Meta/TikTok/Bing `report …` 账户分析拉数(本 Skill 推荐口径)**:统一 **`--json-out <目录>`** 落盘(分析子命令以目录为主;通用业务命令另支持 **`--json-out ./foo.json` 单文件**);**用脚本读目录内 JSON + 数据处理库算指标,再由代码写出交付文件**(HTML / Excel / PDF / PPT / Markdown 等任选),勿用 `Read` 代替程序读数、勿在聊天里直接贴完整交付稿;脚本里勿写业务数据常量。详见 `references/analytics/account-analytics.md`「Google 分析快照工作流」及清单文件说明。
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 币种(**Agent 必读**)
|
|
19
|
-
|
|
20
|
-
涉及余额、消耗、预算、报告、Excel 前:**先 Read `references/accounts/currency.md`**,从 `list-accounts` / `balance` / `stats` / `google-analysis` 的 **`currencyCode`** 确定 CNY 或 USD,再选 **¥** 或 **$**。**禁止**默认 Google=美金、禁止跨币种求和。`list-accounts` **默认无 `--detail` 时 JSON 不含余额/消耗字段**,真实值须加 `--detail` 或另跑 `balance`/`stats`。
|
|
3
|
+
> 通用纪律(加载纪律、数据处理协议「摘要 → outline → 脚本读 JSON」、币种、交付自检)**只在** `references/core/agent-conventions.md` 维护,本文件是配套**脚本示例集**。
|
|
4
|
+
> 核心约定一句话:凡需结构化数据,一律 **`--json-out <路径>`** 落盘,**用 `node -e` / 脚本**读 JSON 筛选聚合;**禁止**用宿主 Read 工具打开落盘业务 `*.json`;唯一允许 Read 的数据结构文件是 `*.outline.txt`。
|
|
21
5
|
|
|
22
6
|
---
|
|
23
7
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
每条 `--json-out` 命令成功后,**必须**按以下顺序处理,不要跳步、不要把 outline 当数据:
|
|
27
|
-
|
|
28
|
-
1. **解析 stdout 一行摘要 JSON**(禁止 Read 打开 `writtenFiles[0]` 的 `.json`):拿到 `outlineFile`、`writtenFiles[0]`、`manifestFile`、`agentHint`。**不要硬编码 `<section>.json` 文件名**。
|
|
29
|
-
- **反例(常见踩坑)**:摘要里**没有** `total`、`items`、`page` 等业务字段;`JSON.parse(stdout)` 后取 `result.total` 会得到 `undefined`。**禁止**用 stdout 写翻页循环;`total` / `items` 只存在于 `writtenFiles[0]` 落盘文件(如 `list-accounts-google.json`)。
|
|
30
|
-
2. **了解字段结构**(二选一,推荐 A):
|
|
31
|
-
- **A**:宿主 **Read** 仅 `outlineFile`(`*.outline.txt`,体积小);或
|
|
32
|
-
- **B**:`node -e "const fs=require('fs'); const o=fs.readFileSync(process.argv[1],'utf8').trimEnd().split('\\n').filter(l=>!l.startsWith('//')); console.log(o.pop())" <outlineFile>`
|
|
33
|
-
- 第 1 行(注释):`// outline of \`<xxx>.json\` — schema-only, NOT the data.` —— **明确告诉你它是"数据结构描述文件"**,不要把它当业务数据使用。
|
|
34
|
-
- 第 2 行(注释):中文用法说明。
|
|
35
|
-
- 第 3 行(注释):类型推断口径(数组取前 8 项去重并集;环或重复对象记为 any)。
|
|
36
|
-
- 其后**可能**还有若干行 `//` 字段提示(例如 `google-analysis` 的 **`campaigns-*.outline.txt`** 会插入金额字段已统一为元的说明)。
|
|
37
|
-
- **类型字面量**:**最后一个不以 `//` 开头的行**(单行 TS,如 `{ a: number; items: { ... }[] }`)—— 写筛选/聚合脚本时取这一行即可。
|
|
38
|
-
- 提取写法:`outlineRaw.trimEnd().split('\n').filter(l => !l.startsWith('//')).pop()`(**不要**用 `lines[lines.length - 1]`:当最后一行是空行时会错)。
|
|
39
|
-
3. **必须用 Bash 执行脚本**读 `writtenFiles[0]`(及 manifest 中的路径)做筛选、聚合、计算——脚本内 `require` / `readFileSync`,**禁止**宿主 Read / cat / type 打开该 `.json`。**禁止**:
|
|
40
|
-
- 用 **Read** 读 `campaigns-*.json`、`list-accounts-*.json` 等落盘业务 JSON;
|
|
41
|
-
- 把 outline 当 JSON `require`(它是 `.txt`);
|
|
42
|
-
- 跳过 outline 猜字段名;
|
|
43
|
-
- 把 outline 或整段 JSON 贴进对话当结论。
|
|
44
|
-
4. **交付物**用代码写出(HTML / Excel / PDF / PPT / Markdown 等);向用户展示的数字须来自**脚本 stdout**,不要在对话里手填数。
|
|
8
|
+
## 文件命名规则
|
|
45
9
|
|
|
46
|
-
|
|
10
|
+
当一条命令具备明确的"查询 id"(mediaCustomerId / entityId / ruleId / auditId 等)时,目录模式落盘的 `*.json`、`*.outline.txt` 与对应 manifest **都会带上 `-<查询id>` 后缀**(全小写):
|
|
47
11
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
12
|
+
- 业务文件:`<section>-<查询id>.json`、`<section>-<查询id>.outline.txt`(如 `overview-9526903813.json`、`balance-google.json`)
|
|
13
|
+
- 清单文件:`manifest-<accountId>.json`(google-analysis)/ `report-manifest-<accountId>.json`(report 分析类)/ `cli-manifest-<查询id>.json`(通用业务命令)
|
|
14
|
+
- section 已以同一 slug 结尾时不重复追加(如 `list-accounts-google`)。**读文件以 stdout 摘要里的 `writtenFiles[]` / `manifestFile` 为准**,不要把 `<section>.json` 当成不变的硬编码。
|
|
51
15
|
|
|
52
|
-
|
|
16
|
+
此命名对三类快照统一生效:通用业务命令(`cli-manifest[-<id>].json`)、`google-analysis`(`manifest-<accountId>.json`)、`report …` 分析(`report-manifest[-<accountId>].json`);三种 stdout summary 都带 `outlineFile`、`agentHint` 字段。
|
|
53
17
|
|
|
54
|
-
###
|
|
18
|
+
### outline 文件格式
|
|
55
19
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
- **`campaigns-*.outline.txt`** 在标准 3 行头注释之后会多 **2 行** 中文 `//` 提示;提取类型行请用 **`outlineRaw.trimEnd().split('\n').filter(l => !l.startsWith('//')).pop()`**(与上文步骤 2 一致),勿把提示行当 TS 类型。
|
|
60
|
-
|
|
61
|
-
详见 `references/analytics/account-analytics.md`「金额单位」「CampaignSectionData」。
|
|
20
|
+
- 前 3 行为 `//` 注释(schema-only 声明、用法、类型推断口径),其后**可能**还有若干行 `//` 字段提示。
|
|
21
|
+
- **类型字面量**是最后一个不以 `//` 开头的行;提取写法:`outlineRaw.trimEnd().split('\n').filter(l => !l.startsWith('//')).pop()`。
|
|
22
|
+
- 例外提示:`google-analysis` 的 `campaigns-*.outline.txt` 在标准头注释后多 2 行中文 `//` 提示(金额字段已统一为元:`budgetAmountYuan`、`campaignTargetCpaYuan` 等,无需换算;详见 `references/analytics/account-analytics.md`「金额单位」)。
|
|
62
23
|
|
|
63
24
|
---
|
|
64
25
|
|
|
65
26
|
## 已有 JSON 时(不必先重跑 CLI)
|
|
66
27
|
|
|
67
|
-
用户已保存输出或只问「怎么从一大坨 JSON
|
|
28
|
+
用户已保存输出或只问「怎么从一大坨 JSON 里筛字段」时:直接用**本地文件**喂给 `node -e` 即可,不必为示例再执行 `list-accounts` 等业务命令(字段路径以实际响应为准;列表类命令多为 `items[]` 外层分页结构)。
|
|
68
29
|
|
|
69
30
|
---
|
|
70
31
|
|
|
71
32
|
## 基础模式:`--json-out` + 读文件 + `node -e`
|
|
72
33
|
|
|
73
|
-
约定示例目录 **`./snap-cli
|
|
34
|
+
约定示例目录 **`./snap-cli`**(可换任意空目录)。文件名以当次 `cli-manifest[-<查询id>].json` → `artifacts[].file` 为准。
|
|
74
35
|
|
|
75
36
|
### 过滤特定字段(Google 账户列表)
|
|
76
37
|
|
|
@@ -152,7 +113,7 @@ list
|
|
|
152
113
|
|
|
153
114
|
### 3b. 多账户投放画像(`accounts-digest`)
|
|
154
115
|
|
|
155
|
-
多账户汇总消耗/点击/转化时**优先** `accounts-digest
|
|
116
|
+
多账户汇总消耗/点击/转化时**优先** `accounts-digest`(见工作流 P3、`references/accounts/accounts.md` § accounts-digest),不要对每个账户循环 `stats`:
|
|
156
117
|
|
|
157
118
|
```bash
|
|
158
119
|
siluzan-tso accounts-digest -m Google -a id1,id2,id3 \
|
|
@@ -172,8 +133,6 @@ rows.slice(0, 10).forEach((r) =>
|
|
|
172
133
|
"
|
|
173
134
|
```
|
|
174
135
|
|
|
175
|
-
文件名以 stdout 摘要的 `writtenFiles[0]` / `manifestFile` 为准;读字段前先 `fs.readFileSync` 同 stem 的 `*.outline.txt`(见上文「处理顺序」)。
|
|
176
|
-
|
|
177
136
|
### 4. 从广告系列列表提取 ID
|
|
178
137
|
|
|
179
138
|
```bash
|
|
@@ -333,10 +292,8 @@ console.log('可用字段:', first && Object.keys(first));
|
|
|
333
292
|
|
|
334
293
|
---
|
|
335
294
|
|
|
336
|
-
##
|
|
295
|
+
## 脚本编写小贴士
|
|
337
296
|
|
|
338
|
-
- **优先用 `--json-out` 与清单文件**:同一运行目录、同一"查询 id"的多次拉数会合并到 `cli-manifest-<id>.json` 的 `artifacts[]`;不同账户/实体写入各自的 manifest,互不覆盖。读具体数据**只**在脚本里 `require(writtenFiles[0])`,**禁止 Read 工具**打开该 json。
|
|
339
|
-
- **中间结果一律落盘**:跨步骤数据不要靠对话记忆,写到工作目录并在后续 **`node`/`python` 脚本**中读盘。
|
|
340
|
-
- **Windows 上避免直接管道 JSON**:PowerShell 管道可能改变编码;优先 `--json-out` + `node -e` 读文件。
|
|
341
297
|
- **用 `process.stdout.write` 而不是 `console.log` 提取单个值**:前者不带换行符,方便直接赋给 shell 变量。
|
|
342
298
|
- **节点代码复杂时拆分写法**:不要写超过 10 行的 `node -e` 单行,改用 `node -e "$(cat <<'EOF'\n...\nEOF\n)"` 或多行 `.mjs` 脚本文件。
|
|
299
|
+
- 同一运行目录、同一"查询 id"的多次拉数会合并到 `cli-manifest-<id>.json` 的 `artifacts[]`;不同账户/实体写入各自的 manifest,互不覆盖。
|
|
@@ -2,43 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
> **范围**:调接口 / 写操作类业务(账户读取、开户、广告 CRUD、智投、拓词、优化、报告推送、财务、权限、预警、线索、巡检)。分析/报告类(拉数 → 撰稿 → 交付)见 `references/core/playbooks.md`(P1–P9)。
|
|
4
4
|
>
|
|
5
|
-
>
|
|
6
|
-
|
|
7
|
-
| 编号 | 业务
|
|
8
|
-
| ---- |
|
|
9
|
-
| W1
|
|
10
|
-
| W2
|
|
11
|
-
| W3
|
|
12
|
-
| W4
|
|
13
|
-
| W5
|
|
14
|
-
| W6
|
|
15
|
-
| W7
|
|
16
|
-
| W8
|
|
17
|
-
| W9
|
|
18
|
-
| W10
|
|
19
|
-
| W11
|
|
20
|
-
| W12
|
|
5
|
+
> **通用纪律统一见 `references/core/agent-conventions.md`**(写操作确认 + `--commit`、ID 口径、数据处理协议),各卡片不再重复。**命令参数、字段口径以「必读」指向的域 reference 为唯一真相源,本文件只给线性步骤,不重复参数表。** 每张卡片结构统一:`触发 / 必读 / 步骤 / 交付与确认`。
|
|
6
|
+
|
|
7
|
+
| 编号 | 业务 | 必读 |
|
|
8
|
+
| ---- | ------------------------------- | --------------------------------------------------------------------- |
|
|
9
|
+
| W1 | 账户查询(列表/余额/消耗/账单) | `accounts/accounts.md` |
|
|
10
|
+
| W2 | 开户申请(六大媒体) | `accounts/open-account-by-media.md` |
|
|
11
|
+
| W3 | Google 广告创建与精细管理 | `google-ads/google-ads-campaign-plan.md` + `google-ads/google-ads.md` |
|
|
12
|
+
| W4 | AI 智投草稿 → 发布 | `google-ads/google-ads.md`(ad batch) |
|
|
13
|
+
| W5 | 拓词 / RAG | `analytics/keyword-planner-workflows.md` + `analytics/rag.md` |
|
|
14
|
+
| W6 | AI 广告优化记录查看与执行 | `operations/optimize.md` |
|
|
15
|
+
| W7 | TSO 优化报告生成 → 推送 | `analytics/reporting.md` |
|
|
16
|
+
| W8 | 财务:充值 / 转账 / 开票 | `accounts/finance.md` |
|
|
17
|
+
| W9 | 账户权限管理 | `accounts/accounts.md`(account 子命令) |
|
|
18
|
+
| W10 | 智能预警规则管理 | `operations/forewarning.md` |
|
|
19
|
+
| W11 | 广告线索提取 | `operations/clue.md` |
|
|
20
|
+
| W12 | 日 / 周巡检 | `accounts/accounts.md` + 各域 |
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
24
|
## W1 · 账户查询(列表 / 余额 / 消耗 / 账单)
|
|
25
25
|
|
|
26
26
|
- **触发**:账户列表/有多少、单户余额、单户消耗、激活充值账单。
|
|
27
|
-
- **必读**:`accounts/accounts.md
|
|
27
|
+
- **必读**:`accounts/accounts.md`。
|
|
28
28
|
- **步骤**:
|
|
29
29
|
1. 列表/数量:`list-accounts -m <媒体> --page-size 999 --json-out ./snap`,脚本读 `list-accounts-*.json` 的 `total` / `items[]`(**禁止**默认 20 条再翻页)。
|
|
30
|
-
2. 单户余额:`balance -m <媒体> -a <mediaCustomerId
|
|
30
|
+
2. 单户余额:`balance -m <媒体> -a <mediaCustomerId>`。
|
|
31
31
|
3. 单户消耗:`stats -m <媒体> -a <mediaCustomerId> --start <S> --end <D>`(多账户对比走 **P3**)。
|
|
32
32
|
4. 激活账单:先取 `entityId` → `account-active-bills -m <媒体> --id <entityId> --json-out ./snap`。
|
|
33
|
-
-
|
|
33
|
+
- **交付/确认**:多账户余额预警走 **P2**、消耗汇总走 **P3**。
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
37
|
## W2 · 开户申请(Google / TikTok / Yandex / BingV2 / Kwai / MetaAd)
|
|
38
38
|
|
|
39
39
|
- **触发**:申请开户、新开广告账户、查开户进度。
|
|
40
|
-
- **必读**:`accounts/open-account-by-media.md
|
|
41
|
-
- **首次响应硬规范**:用户**第一次**进入开户话题时,**必须先**罗列目标媒体(未指明则六平台)**全部必填项**,再收集资料;**禁止**未列清单就执行 `open-account`。所有媒体均**无需**手动查 magKey,CLI 按公司名自动创建/关联广告主组。
|
|
40
|
+
- **必读**:`accounts/open-account-by-media.md`(各媒体必填项与参数,**含 §「首次响应硬规范」:首次进入开户话题必须先列全必填清单**);Google 字段加 `accounts/open-account-google-ui.md`。所有媒体均**无需**手动查 magKey,CLI 按公司名自动创建/关联广告主组。
|
|
42
41
|
- **步骤**:
|
|
43
42
|
1. 列出必填项 → 收集资料(TikTok/Bing/Kwai 需营业执照图片本地路径;CLI 无 OCR)。
|
|
44
43
|
2. 前置查询(按需):TikTok `open-account tiktok-areas/-industries/-timezones`;Bing `open-account bing-industries`;Google `open-account google-timezones`。
|
|
@@ -46,10 +45,10 @@
|
|
|
46
45
|
4. 轮询审核:`account-history -m <媒体>`。
|
|
47
46
|
- **交付/确认**:审核状态处理——
|
|
48
47
|
|
|
49
|
-
| 状态
|
|
50
|
-
|
|
|
51
|
-
| `Pending`
|
|
52
|
-
| `Approved` | `list-accounts` 确认账户出现 → 按 **W8** 引导充值激活
|
|
48
|
+
| 状态 | 下一步 |
|
|
49
|
+
| ---------- | ------------------------------------------------------ |
|
|
50
|
+
| `Pending` | 等待,可反复轮询 |
|
|
51
|
+
| `Approved` | `list-accounts` 确认账户出现 → 按 **W8** 引导充值激活 |
|
|
53
52
|
| `Rejected` | 看落盘 `reason` 字段,改资料重提;原因不明引导联系客服 |
|
|
54
53
|
|
|
55
54
|
---
|
|
@@ -57,12 +56,20 @@
|
|
|
57
56
|
## W3 · Google 广告创建与精细管理
|
|
58
57
|
|
|
59
58
|
- **触发**:新建搜索系列、出投放方案、系列/组/广告/关键词 CRUD、PMax、拒审处理、日常调价/启停。
|
|
60
|
-
- **必读**:方案与门禁 `google-ads/google-ads-campaign-plan.md` + `assets/campaign-create-template.md`;命令参数 `google-ads/google-ads.md`;PMax 加 `assets/pmax-create-template.md` + `google-ads/pmax-api.md`。
|
|
59
|
+
- **必读**:方案与门禁 `google-ads/google-ads-campaign-plan.md` + **`assets/campaign-create-template.json`**(先 Read)+ `assets/campaign-create-template.md`;命令参数 `google-ads/google-ads.md`;PMax 加 **`assets/pmax-create-template.json`** + `assets/pmax-create-template.md` + `google-ads/pmax-api.md`。
|
|
61
60
|
- **创建路径选择**:
|
|
62
61
|
- 已有 AI 智投草稿 → 走 **W4**。
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
62
|
+
- **PMax 出方案/创建** → **`assets/pmax-create-template.json`**(先 Read)+ `pmax-create-template.md` + `pmax-api.md`:`pmax-validate` → 用户确认 → `pmax-create`(**勿**用 Search `campaign-create`)。
|
|
63
|
+
- 搜索系列出方案 → `google-ads-campaign-plan.md`:JSON → `campaign-validate` → 用户确认 → `campaign-create`。
|
|
64
|
+
- 已有完整结构化 JSON → 对应 validate → create。
|
|
65
|
+
- **步骤(PMax 方案 → 创建)**:
|
|
66
|
+
1. 账户:`list-accounts -m Google -k <id>`;落地页与品牌从官网/RAG 归纳。
|
|
67
|
+
2. 地域/语言:`ad geo search` 取 location id;语言 id 写入 JSON。
|
|
68
|
+
3. 复制 `pmax-create-template.json` 填文案/预算/图片;**必须**含 `campaignExtensions`(至少 callouts + structuredSnippets);**Lead Gen/B2B 默认** `campaignExtensions.leadForm`(方案 Markdown 须单列表单节)。
|
|
69
|
+
4. 门禁:`ad pmax-validate --config-file ./pmax.json --json-out ./snap-pmax`。
|
|
70
|
+
5. 输出 JSON + Markdown 方案 → 用户确认 → `ad pmax-create --commit "…"`。
|
|
71
|
+
6. 复核:`ad campaigns` / `ad pmax-get`;缺表单时 `ad extension lead-form` 补挂。
|
|
72
|
+
- **步骤(Search 一体化创建)**:
|
|
66
73
|
1. 地域 ID:`ad geo search -a <id> -q "United States"` 写入 `campaign.targetedLocations[].id`。
|
|
67
74
|
2. 门禁:`ad campaign-validate --config-file ./campaign.json`(必跑)。
|
|
68
75
|
3. 用户确认后创建:`ad campaign-create --config-file ./campaign.json`,记录返回 taskId。
|