siluzan-tso-cli 1.1.21 → 1.1.22-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.
- package/README.md +3 -2
- package/dist/index.js +140 -58
- package/dist/skill/AGENTS.md +45 -0
- package/dist/skill/SKILL.md +60 -346
- package/dist/skill/_meta.json +2 -2
- package/dist/skill/assets/campaign-create-template.md +4 -4
- package/dist/skill/assets/pmax-create-template.md +4 -3
- package/dist/skill/docs/skill-guide.md +44 -0
- package/dist/skill/references/README.md +73 -0
- package/dist/skill/references/{accounts.md → accounts/accounts.md} +7 -7
- package/dist/skill/references/{currency.md → accounts/currency.md} +7 -7
- package/dist/skill/references/{finance.md → accounts/finance.md} +5 -5
- package/dist/skill/references/accounts/open-account-by-media.md +151 -0
- package/dist/skill/references/{open-account-google-ui.md → accounts/open-account-google-ui.md} +2 -2
- package/dist/skill/references/{account-analytics.md → analytics/account-analytics.md} +2 -2
- package/dist/skill/references/{google-analysis-batch.md → analytics/google-analysis-batch.md} +2 -2
- package/dist/skill/references/{keyword-planner-workflows.md → analytics/keyword-planner-workflows.md} +9 -9
- package/dist/skill/references/{rag.md → analytics/rag.md} +6 -6
- package/dist/skill/references/{reporting.md → analytics/reporting.md} +6 -6
- package/dist/skill/references/core/agent-conventions.md +180 -0
- package/dist/skill/references/core/playbooks.md +141 -0
- package/dist/skill/references/{setup.md → core/setup.md} +5 -5
- package/dist/skill/references/core/skill-authoring.md +192 -0
- package/dist/skill/references/{tips.md → core/tips.md} +5 -5
- package/dist/skill/references/{workflows.md → core/workflows.md} +23 -25
- package/dist/skill/references/{google-ads-campaign-plan.md → google-ads/google-ads-campaign-plan.md} +22 -22
- package/dist/skill/references/{google-ads.md → google-ads/google-ads.md} +11 -15
- package/dist/skill/references/{pmax-api.md → google-ads/pmax-api.md} +0 -2
- package/dist/skill/references/google-ads/rules/README.md +21 -0
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-keyword-taxonomy.md +2 -2
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-launch-plan-template.md +8 -8
- package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-pmax-guide.md +1 -1
- package/dist/skill/references/{tso-home.md → misc/tso-home.md} +5 -5
- package/dist/skill/references/{hosted-automation-monitoring-json.md → operations/hosted-automation-monitoring-json.md} +8 -8
- package/dist/skill/references/{hosted-automation-optimize-ab-winner.md → operations/hosted-automation-optimize-ab-winner.md} +2 -2
- package/dist/skill/references/{hosted-automation-optimize-index.md → operations/hosted-automation-optimize-index.md} +6 -6
- package/dist/skill/references/{hosted-automation-optimize-scale.md → operations/hosted-automation-optimize-scale.md} +2 -2
- package/dist/skill/references/{hosted-automation-optimize-weak-downbid.md → operations/hosted-automation-optimize-weak-downbid.md} +5 -5
- package/dist/skill/references/operations/hosted-automation-scenarios.md +23 -0
- package/dist/skill/references/{hosted-automation-self-control.md → operations/hosted-automation-self-control.md} +14 -14
- package/{assets/siluzan-ads/references → dist/skill/references/operations}/hosted-automation-user-catalog.md +12 -12
- package/dist/skill/report-templates/README.md +2 -1
- package/dist/skill/report-templates/REPORT-WORKFLOW.md +2 -2
- package/dist/skill/report-templates/google-ads-diagnosis.md +1 -1
- package/dist/skill/report-templates/google-inquiry-analysis.md +6 -6
- package/dist/skill/report-templates/google-period-report.md +1 -1
- package/dist/skill/report-templates/okki-weekly-google-client.md +4 -4
- package/dist/skill/scripts/install.ps1 +3 -3
- package/dist/skill/scripts/install.sh +3 -3
- package/eval/cases/accounts-entityid-vs-mediaccustomerid.scenario.json +2 -2
- package/eval/cases/accounts-mcc-bind-inquiry.scenario.json +3 -3
- package/eval/cases/accounts-single-balance-not-bulk.scenario.json +2 -2
- package/eval/cases/clue-meta-leads-json.scenario.json +2 -2
- package/eval/cases/clue-tiktok-leads-json.scenario.json +2 -2
- package/eval/cases/destructive-account-delink-needs-confirm.scenario.json +1 -1
- package/eval/cases/destructive-forewarning-delete-needs-confirm.scenario.json +1 -1
- package/eval/cases/destructive-invoice-apply-needs-confirm.scenario.json +1 -1
- package/eval/cases/finance-invoice-info-list.scenario.json +2 -2
- package/eval/cases/forewarning-list-google.scenario.json +2 -2
- package/eval/cases/google-ads-no-structural-without-confirm.scenario.json +3 -3
- package/eval/cases/google-analysis-keywords-route.scenario.json +2 -2
- package/eval/cases/hosted-sop-cpa-spike-downbid.scenario.json +5 -5
- package/eval/cases/hosted-sop-daily-budget-circuit-breaker.scenario.json +3 -3
- package/eval/cases/hosted-sop-empty-spend-pause-p1.scenario.json +5 -5
- package/eval/cases/meta-single-balance-not-bulk.scenario.json +2 -2
- package/eval/cases/open-account-bing-noninteractive.scenario.json +3 -3
- package/eval/cases/open-account-google-noninteractive.scenario.json +2 -2
- package/eval/cases/open-account-tiktok-license-file.scenario.json +2 -2
- package/eval/cases/optimize-list-by-account.scenario.json +2 -2
- package/eval/cases/rag-before-keyword-expand.scenario.json +3 -3
- package/eval/cases/rag-list-then-query.scenario.json +2 -2
- package/eval/cases/report-list-google.scenario.json +2 -2
- package/eval/cases/report-push-list-google.scenario.json +3 -3
- package/eval/cases/reporting-vs-account-analytics-routing.scenario.json +4 -4
- package/eval/cases/setup-login-or-env.scenario.json +2 -2
- package/eval/cases/setup-siluzan-data-permission-env.scenario.json +2 -2
- package/eval/cases/skill-optimize-vs-google-ads-distinction.scenario.json +4 -4
- package/eval/cases/tiktok-bc-bind-inquiry.scenario.json +2 -2
- package/eval/cases/tips-json-filtering.scenario.json +4 -4
- package/eval/cases/tips-large-json-pagination.scenario.json +3 -3
- package/eval/cases/uj-ad-bluetooth-keywords-exclude-cheap-free.scenario.json +1 -1
- package/eval/cases/uj-ad-campaign-validate-before-create-stub.scenario.json +2 -2
- package/eval/cases/uj-ad-keywords-camping-tent-outdoor-plan.scenario.json +1 -1
- package/eval/cases/uj-ad-outdoor-campgear-search-plan.scenario.json +3 -3
- package/eval/cases/uj-analytics-30d-pdf-campaign-device-geo.scenario.json +2 -2
- package/eval/cases/uj-analytics-compare-google-tiktok-last-month-roi.scenario.json +1 -1
- package/eval/cases/uj-analytics-google-weekly-trends-campaigns-keywords.scenario.json +2 -2
- package/eval/cases/uj-analytics-report-push-weekly-email.scenario.json +3 -3
- package/eval/cases/uj-finance-invoice-records-this-month.scenario.json +2 -2
- package/eval/cases/uj-life-newbie-siluzan-google-end-to-end.scenario.json +2 -2
- package/eval/cases/uj-ops-google-accounts-list-normal.scenario.json +2 -2
- package/eval/cases/uj-ops-google-yesterday-spend-conversions.scenario.json +2 -2
- package/eval/cases/uj-ops-open-google-b2c-usd-shenzhen.scenario.json +3 -3
- package/eval/cases/uj-ops-pause-worst-adgroup-confirm.scenario.json +2 -2
- package/eval/cases/uj-ops-tiktok-leads-last-week.scenario.json +2 -2
- package/eval/cases/uj-patrol-cpc-spike-adgroups-over-15.scenario.json +3 -3
- package/eval/cases/uj-patrol-forewarning-create-daily-cap-3000.scenario.json +3 -3
- package/eval/cases/uj-patrol-forewarning-trigger-records.scenario.json +2 -2
- package/eval/cases/uj-patrol-google-balances-low.scenario.json +2 -2
- package/eval/cases/uj-roi-full-google-account-diagnosis.scenario.json +1 -1
- package/eval/cases/uj-roi-keywords-high-cpa-low-cvr-triage.scenario.json +1 -1
- package/eval/cases/uj-roi-optimize-records-then-execute-cautiously.scenario.json +2 -2
- package/eval/cases/uj-roi-search-terms-add-negative-keywords.scenario.json +2 -2
- package/package.json +2 -2
- package/dist/skill/references/hosted-automation-scenarios.md +0 -23
- package/dist/skill/references/hosted-automation-user-catalog.md +0 -38
- /package/dist/skill/references/{write-audit-restore.md → accounts/write-audit-restore.md} +0 -0
- /package/dist/skill/references/{geo-continents.json → analytics/geo-continents.json} +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-account-audit.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-audience-strategy.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-campaign-optimization.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-compliance.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-conversion-architecture.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-creative-optimization.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-keyword-optimization.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-keyword-strategy.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/google-ads-landing-page-discovery-via-webfetch.md +0 -0
- /package/dist/skill/references/{google-ads-rules → google-ads/rules}/sensitive-industries.md +0 -0
- /package/dist/skill/references/{clue.md → operations/clue.md} +0 -0
- /package/dist/skill/references/{forewarning.md → operations/forewarning.md} +0 -0
- /package/dist/skill/references/{optimize.md → operations/optimize.md} +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Agent 执行规范
|
|
2
|
+
|
|
3
|
+
> 本文件定义 siluzan-tso Skill 下 **AI 助手必须遵守** 的加载纪律、执行流程与硬规范。
|
|
4
|
+
> CLI 参数细节见各功能 reference;标准任务步骤见 `references/core/playbooks.md`。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 文档加载纪律
|
|
9
|
+
|
|
10
|
+
本 Skill 采用 **SKILL 路由 + references 按需加载**;**「按需」= 每个用户任务都要按需,不是整段对话只读一次**。
|
|
11
|
+
|
|
12
|
+
### 何时必须 Read references
|
|
13
|
+
|
|
14
|
+
| 触发 | 动作 |
|
|
15
|
+
| ---- | ---- |
|
|
16
|
+
| **新的用户任务**(新需求、新账户、新媒体、新报告类型) | 用 `SKILL.md`「任务 → 文档」表确定路径,**Read 全部必读项**后再计划/执行 CLI |
|
|
17
|
+
| **同一对话内换话题**(例:刚查余额 → 改问建系列 / 预警 / 发票) | **重新 Read** 新话题对应 references,**禁止**沿用上一任务的参数记忆 |
|
|
18
|
+
| **Playbook 编号不同**(P1→P3、P4→P5) | 即使刚做过 P1,执行 P3 仍须 Read `accounts/accounts.md`(`accounts-digest`)等 P3 专属节 |
|
|
19
|
+
| **专用 report-templates**(OKKI / 询盘分析) | Read 对应 `report-templates/*.md` **全文**,勿只凭 SKILL 摘要 |
|
|
20
|
+
| **上下文被压缩 / 记不清字段或命令** | 重读 `SKILL.md` 路由表 + 当次任务 references |
|
|
21
|
+
| **CLI 返回 400 / 字段对不上** | 回到对应 reference 核对参数名与口径,勿猜 |
|
|
22
|
+
|
|
23
|
+
### 禁止
|
|
24
|
+
|
|
25
|
+
- **禁止**「上次已经读过 `accounts/accounts.md` / `google-ads/google-ads.md`,本任务直接 `siluzan-tso …`」
|
|
26
|
+
- **禁止**用对话记忆中的示例 ID、金额、命令 flags 代替当次 Read 文档
|
|
27
|
+
- **禁止**跳过 `references/core/tips.md` 里的 outline→JSON 顺序
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 执行流程
|
|
32
|
+
|
|
33
|
+
**计划 → 确认 → 执行 → 验证 → 推测下一步**:
|
|
34
|
+
|
|
35
|
+
1. **按加载纪律 Read 当次任务 references** → 用 `-h` 确认命令 → 向用户输出操作计划
|
|
36
|
+
2. 涉及写入/修改/删除的操作必须与用户确认
|
|
37
|
+
3. 按计划执行,说明每步意图
|
|
38
|
+
4. 用成对的读命令复核写入结果;异步任务每 5s 轮询直到完成
|
|
39
|
+
5. 全部完成后预测用户下一步操作
|
|
40
|
+
|
|
41
|
+
### 执行模式速查
|
|
42
|
+
|
|
43
|
+
| 模式 | 说明 |
|
|
44
|
+
| ---- | ---- |
|
|
45
|
+
| **数据交付类** | `google-analysis` / `stats` / `ad campaigns` 等带 `--json-out`:必须脚本读盘转换,见下文「数据转换硬规范」 |
|
|
46
|
+
| **客户/产品背景** | 拓词、方案、报告背景段:先 `rag list` + `rag query`,再衔接 `keyword` / `ad` / `google-analysis` |
|
|
47
|
+
| **仅调接口** | 优化记录、线索表单、预警、财务命令:无需输出转换 |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 硬规范
|
|
52
|
+
|
|
53
|
+
- **账户状态 ≠ 系列状态**:`stats` / `balance` / `list-accounts` 的 `status` 只表示账户是否可用;系列状态必须来自 `ad campaigns`。
|
|
54
|
+
- **数据时效性**:涉及「今天/当天/今日消耗」「实时消耗排行」前,必读 `references/analytics/account-analytics.md` 顶部「数据时效性」表。TikTok / Yandex / BingV2 / Kwai 仍是 `accountsoverview` 同步昨天数据,**不能查今天**。
|
|
55
|
+
- **先查账户再操作**:`list-accounts -m [mediaType] -k [mediaCustomerId]`;涉及金额前必读 `references/accounts/currency.md`,从 `ma.currencyCode` 确定 CNY/USD,**禁止**默认 Google=美金。
|
|
56
|
+
- **不猜测账户 ID**:`entityId` ≠ `mediaCustomerId`,两者均来自 `list-accounts`。
|
|
57
|
+
- **媒体类型区分大小写**:`Google`、`TikTok`、`MetaAd`、`BingV2`、`Kwai`。
|
|
58
|
+
- **CLI 输出忠实**:数值与 ID 须与本次落盘 JSON / stdout 一致,不编造示例 ID;`data` 为空时只说「当前返回无记录」并附 JSON 路径。
|
|
59
|
+
- **破坏性操作必须确认 + `--commit`**:账户解绑/关闭/取消分享、BC/MCC 解绑、删除预警/报告/广告/关键词、发票申请、广告发布等。
|
|
60
|
+
- **不确定时读文档**:先读对应 references 或用 `-h`,不要猜参数。
|
|
61
|
+
- **Google 新建搜索系列**:流程仅在 `references/google-ads/google-ads-campaign-plan.md` 维护。
|
|
62
|
+
- **Google 开户**:`open-account google-wizard` 仅限真实 TTY;Agent/自动化用非交互 `open-account google ...`,审核进度用 `account-history`。
|
|
63
|
+
- **主动更新**:详见 `references/core/setup.md`。
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 数据转换硬规范
|
|
68
|
+
|
|
69
|
+
本 Skill 下**所有**业务数据均以 CLI `--json-out`(或用户提供的同构 JSON)落盘为唯一真相源。Agent **不得**在对话或脚本里「代替」磁盘数据。
|
|
70
|
+
|
|
71
|
+
| 必须 | 禁止 |
|
|
72
|
+
| ---- | ---- |
|
|
73
|
+
| 编写并**执行** Node/Python 脚本:`readFile` / `require` 读落盘 JSON → 计算 → 写出 | 用 `Read` 读大 JSON 后在回复里手填、改数、心算汇总 |
|
|
74
|
+
| **先 outline 后 JSON**:`outlineFile`(`.outline.txt`)→ `writtenFiles[0]` | 跳过 outline 猜字段名;把 outline 当数据贴给用户 |
|
|
75
|
+
| 字段路径以 `outlineFile` + 当次 `writtenFiles` / manifest 为准 | 把国家名、ID、金额、词表等**业务值**写成源码字面量 |
|
|
76
|
+
| 映射表 / 模板契约在运行时加载(`analytics/geo-continents.json`、`campaign-create-template.json`) | 复制配置条目进源码常量 |
|
|
77
|
+
| 脚本输出与落盘 JSON 可复核 | 用「上次对话记住的数」「占位数」写入交付物 |
|
|
78
|
+
|
|
79
|
+
**允许的字面量**:输出目录、Sheet/列标题、技术格式、`focusCountries` 等**用户当轮明确给出**的配置(建议落盘为 `config.json` 再读)。
|
|
80
|
+
|
|
81
|
+
完整协议见 `references/core/tips.md` § 处理顺序、§ 已有 JSON 时。
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 时间范围
|
|
86
|
+
|
|
87
|
+
涉及「投放数据 / 消耗 / 报告 / 周报 / 月报 / 优化建议」且用户未给明确起止日期时**必须反问**(示例:A) 最近完整自然周 B) 本月 1 号到昨天 C) 自定义 YYYY-MM-DD)。给出范围后,报告首行标注 `统计区间:YYYY-MM-DD ~ YYYY-MM-DD(货币:XXX)`。
|
|
88
|
+
|
|
89
|
+
**例外**(不反问):
|
|
90
|
+
|
|
91
|
+
- `list-accounts` 全量:用 `--json-out`,注意翻页
|
|
92
|
+
- 「昨天」单日 stats:默认 `Asia/Shanghai` 日历日;先 `list-accounts` 再 `stats`
|
|
93
|
+
- 仅持有 `entityId`:先 `list-accounts` 解出 `mediaCustomerId`,**禁止**把 `entityId` 传给 `stats -a` / `balance -a`
|
|
94
|
+
- `forewarning records`、`invoice list`「本月」、TikTok `clue`「最近一周」:见对应 references
|
|
95
|
+
|
|
96
|
+
**默认值白名单**(仅用户明确授权「你决定」时使用):
|
|
97
|
+
|
|
98
|
+
| 场景 | 默认窗口 |
|
|
99
|
+
| ---- | -------- |
|
|
100
|
+
| 日常巡检 / 余额扫描 | `now - 7d` ~ `now - 1d` |
|
|
101
|
+
| 周报 | 上一个完整自然周(周一 ~ 周日) |
|
|
102
|
+
| 月报 | 上一个完整自然月 |
|
|
103
|
+
| Google 关键词/系列分析 | `now - 30d` ~ `now - 1d` |
|
|
104
|
+
| MetaAd 账户分析 | 不得默认,必须问 |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 币种与金额(速查)
|
|
109
|
+
|
|
110
|
+
完整字段表见 `references/accounts/currency.md`。
|
|
111
|
+
|
|
112
|
+
- **币种只认接口字段**:`list-accounts` → `items[].ma.currencyCode`;同媒体可同时有 CNY 与 USD,不得凭媒体猜币种。
|
|
113
|
+
- **符号**:`CNY` → **¥**;`USD` → **$**。多账户按 `currencyCode` 分表,**禁止**跨币种求和。
|
|
114
|
+
- **金额单位统一为「元」**:报告保留 2 位小数。
|
|
115
|
+
- **品牌名优先级**:(1) 用户明确提供 → (2) `list-accounts.mag.advertiserName` → (3) 网址域名占位 `[待确认品牌名]`。**严禁**把英文域名翻译为虚构中文品牌。
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 批量任务硬约束
|
|
120
|
+
|
|
121
|
+
| 任务 | 推荐命令 | 禁止 |
|
|
122
|
+
| ---- | -------- | ---- |
|
|
123
|
+
| 多账户余额 / 预算不足预警 | `balance-scan -m <媒体> --threshold-days 7` | 逐账户 `balance --accounts ...` |
|
|
124
|
+
| 多账户投放画像 | `accounts-digest -m <媒体> [-a ...] --start --end --json-out` | 逐账户 `stats` |
|
|
125
|
+
| 多账户 × 多维度 Google 数据 | 全量:`google-analysis-batch run`(省略 `-a`);2~10:`google-analysis -a id1,id2,...` | 外层 for-loop;先 list 再拼 `-a` |
|
|
126
|
+
| 多系列诊断 | `ad campaigns --json-out` + node 读文件过滤 | 逐系列 `ad campaign-get` |
|
|
127
|
+
|
|
128
|
+
**`google-analysis-batch` 纪律**(详见 `references/analytics/google-analysis-batch.md`):
|
|
129
|
+
|
|
130
|
+
1. 拉全量时**省略** `-a`;中断后**必须** `resume --run-id <id>`,**禁止**重新 `run`。
|
|
131
|
+
2. stdout 始终是单行 JSON(`kind=siluzan-tso-batch-summary`)。
|
|
132
|
+
3. 退出码:`0` 全成功 / `2` 部分成功 / `3` 全失败或 Token 失效 / `4` 用法错误。
|
|
133
|
+
4. 401 → 整批终止;按 `references/core/setup.md` 重登录后 `resume`。
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 运行时长与进度
|
|
138
|
+
|
|
139
|
+
预估超 2 分钟的任务先告知预计耗时;超 5 分钟未完成时主动检查并告知用户。长任务中断后用对应 `resume` 入口续跑,**禁止**直接重跑 `run`。
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 账户 ID 示例
|
|
144
|
+
|
|
145
|
+
先用位数判断类型,不确定再 `list-accounts -m [mediaType] -k [id]`:
|
|
146
|
+
|
|
147
|
+
- Google: `454xxx5137` 或 `270-xxx-0720`(去掉 `-`)
|
|
148
|
+
- TikTok: `70083497xxx59820033`
|
|
149
|
+
- Meta(Facebook): `1716030xxx734076`
|
|
150
|
+
- Bing: `138xxx763`
|
|
151
|
+
- Yandex: `porg-uthxxxrk`
|
|
152
|
+
- Kwai: `act_1716030xxx734076`
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 常见 HTTP 状态码
|
|
157
|
+
|
|
158
|
+
- **400**:参数错误,查看对应 reference 或 `-h`
|
|
159
|
+
- **401**:平台方返回则需用户重新授权;**我方凭据失效**则优先 `send-login-code` + `login --phone --code`,见 `references/core/setup.md`
|
|
160
|
+
- **500**:服务可能正在部署/升级,建议反馈 Siluzan 相关人员
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 风险预警与自动化(主动介绍)
|
|
165
|
+
|
|
166
|
+
加载本 skill 时须向用户介绍 `references/operations/hosted-automation-user-catalog.md` 中的能力:
|
|
167
|
+
|
|
168
|
+
- **预算 & ROI 控制**:单日预算熔断、CPA 飙升自动降价、连续空耗自动暂停
|
|
169
|
+
- **异常监控与报警**:账户封禁检测、落地页死链强停、素材拒审提醒、花费异动、余额枯竭预警
|
|
170
|
+
- **自动优化**:差广告降价/关停、高转化提价扩量、A/B 测试自动决出胜者
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 消息平台语法
|
|
175
|
+
|
|
176
|
+
需 webhook 发送消息时,先阅读对应平台文档:
|
|
177
|
+
|
|
178
|
+
- 企业微信:https://developer.work.weixin.qq.com/document/path/99110
|
|
179
|
+
- 飞书:https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot
|
|
180
|
+
- 其他平台默认 markdown 输出
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# 高频任务 Playbook(P1–P7)
|
|
2
|
+
|
|
3
|
+
> **开始前**:按 `references/core/agent-conventions.md` § 文档加载纪律,Read 各 Playbook 列出的 references(**不因同对话内刚做过其他 Playbook 而跳过**)。
|
|
4
|
+
|
|
5
|
+
| 编号 | 场景 | 必读 references |
|
|
6
|
+
| ---- | ---- | --------------- |
|
|
7
|
+
| P1 | 单账户投放画像 | `analytics/account-analytics.md`、`accounts/currency.md`、`core/tips.md` |
|
|
8
|
+
| P2 | 多账户余额扫描 | `accounts/accounts.md`(`balance-scan`)、`accounts/currency.md` |
|
|
9
|
+
| P3 | 多账户投放画像汇总 | `accounts/accounts.md` § accounts-digest、`accounts/currency.md`、`core/tips.md` |
|
|
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` |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## P1 · 单账户投放画像
|
|
18
|
+
|
|
19
|
+
1. 反问时间范围(已授权默认时按 `core/agent-conventions.md` 白名单并写明区间)。
|
|
20
|
+
2. `list-accounts -m Google -k <mediaCustomerId> --json-out ./snap-p1`
|
|
21
|
+
3. `stats -m Google -a <mediaCustomerId> --start <S> --end <D> --json-out ./snap-p1`
|
|
22
|
+
4. `ad campaigns -a <mediaCustomerId> --start <S> --end <D> --json-out ./snap-p1`
|
|
23
|
+
5. 用 `report-templates/google-account-diagnosis-report.md` 模板输出,首行标注统计区间和货币。
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## P2 · 多账户余额扫描
|
|
28
|
+
|
|
29
|
+
**全量巡检**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
siluzan-tso balance-scan -m BingV2 --threshold-days 7 --json-out ./snap-p2
|
|
33
|
+
# 可选:--min-balance 100 / --target-days 60
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
按 `remainingDays` 升序输出;消耗过低的僵尸账户不纳入预警。
|
|
37
|
+
|
|
38
|
+
**已知 ID 子集**:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
siluzan-tso balance-scan -m Google -a id1,id2,id3 --json-out ./snap-p2-subset
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
跳过翻页全部展示;`hitReason="none"` 表示未触阈值。
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## P3 · 多账户投放画像汇总
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
siluzan-tso accounts-digest -m Google -a id1,id2,... --start <S> --end <D> --json-out ./snap-p3
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
1. 反问时间范围后执行。
|
|
55
|
+
2. 基于落盘 `data.items` 与 `meta.totals` 生成报告,**不要**再逐账户 `stats`。
|
|
56
|
+
3. 表格覆盖用户请求的**每一个** ID;某 ID 未返回时仍占一行标注「未返回」。
|
|
57
|
+
4. 跨币种账户按 `currencyCode` 分表或分币种小计。
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## P4 · Google 账户周期报告
|
|
62
|
+
|
|
63
|
+
1. 确认时间范围;区间 > 3 个月时分段(季度/月)。
|
|
64
|
+
2. 按 P1 步骤拿数据,用 `report-templates/google-period-report.md` 模板输出,首行标注统计区间和货币。
|
|
65
|
+
3. 报告须含:账户概览、投放趋势、Top 关键词/系列/地区分布、优化建议。
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## P5 · 多账户多维度报告
|
|
70
|
+
|
|
71
|
+
> 适用:账户数 ≥ 2 且需拉取 ≥ 2 个 google-analysis 维度。**禁止**外层 for-loop。
|
|
72
|
+
|
|
73
|
+
**入口选择**:全量 → 省略 `-a`;2~10 子集 → `google-analysis -a id1,id2,...`;≥10 子集或需 resume → `google-analysis-batch run -a id1,id2,...`
|
|
74
|
+
|
|
75
|
+
1. 反问时间范围 + 维度(默认 `campaigns,geographic,keywords`)。
|
|
76
|
+
2. **执行**:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# 全量账号(推荐):省略 -a
|
|
80
|
+
siluzan-tso google-analysis-batch run \
|
|
81
|
+
--start <S> --end <D> \
|
|
82
|
+
--sections campaigns,geographic,keywords \
|
|
83
|
+
--account-concurrency 4 --section-concurrency 6 \
|
|
84
|
+
--min-spend 1 --keyword-limit 1000 \
|
|
85
|
+
--json-out ./snap-p5
|
|
86
|
+
|
|
87
|
+
# 仅当用户明确给出 ID 子集时才传 -a
|
|
88
|
+
siluzan-tso google-analysis-batch run \
|
|
89
|
+
-a id1,id2,id3,id4 \
|
|
90
|
+
--start <S> --end <D> \
|
|
91
|
+
--sections campaigns,geographic,keywords \
|
|
92
|
+
--json-out ./snap-p5
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
3. **中断后只能 resume**:`siluzan-tso google-analysis-batch resume --json-out ./snap-p5 --run-id <runId>`
|
|
96
|
+
4. **只读进度**:`siluzan-tso google-analysis-batch status --json-out ./snap-p5 --run-id <runId>`
|
|
97
|
+
5. **产物消费**:先 outline 后 JSON 再脚本,详见 `references/core/tips.md` § 处理顺序。
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## P6 · OKKI 周报
|
|
102
|
+
|
|
103
|
+
> **触发**:用户话术含 `使用okki周报模板` / `OKKI 周报` / `okki 周报` 等,且指向 Google 账户 + 日期区间。
|
|
104
|
+
|
|
105
|
+
1. **不要**按 `google-period-report.md` 展开默认 8 维;改读 `report-templates/okki-weekly-google-client.md` 全文。
|
|
106
|
+
2. 确认 `mediaCustomerId` 与 `--start` / `--end`(未给齐按 `core/agent-conventions.md` 时间范围规则反问)。
|
|
107
|
+
3. 同一 `--json-out` 目录执行模板中的命令组合:`list-accounts`(可选)、`stats`、`balance`、`google-analysis --sections overview,campaigns,keywords,search-terms,campaign-device,campaign-geo`。
|
|
108
|
+
4. **先 outline 后脚本** → 交付话术 + 多 Sheet `.xlsx`(无 CLI 写表命令)。
|
|
109
|
+
5. 遵守硬规范:金额读 `*Yuan`、禁止手填业务数、禁止编造 ID。
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## P7 · Google 账户询盘分析
|
|
114
|
+
|
|
115
|
+
> **触发**:用户话术含 `Goog账户询盘分析` / `Google 账户询盘分析` / `分析XXX Google账号的询盘效果`,或同时包含「询盘 + 账户 + Google」三要素。
|
|
116
|
+
> **不要**按 `google-period-report.md` 默认 8 维流程。
|
|
117
|
+
|
|
118
|
+
1. **时间窗口强约束**:**严格 3 个月** = 分析月份 + 向前 2 个完整自然月。**禁止**扩展到 7 个月。
|
|
119
|
+
2. **询盘资料入场**:
|
|
120
|
+
- **流程 A**(用户已附文件):解析 → 落盘 `./snap-inquiry/inquiries.json`(字段见模板「询盘字段清单」)。
|
|
121
|
+
- **流程 B**(仅给账户 ID):反问账户 + 分析月份,贴字段清单 + 示例。**禁止**自行编造询盘数据。
|
|
122
|
+
3. **CLI 拉数**(同一 `--json-out` 目录):
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
siluzan-tso list-accounts -m Google -k <mediaCustomerId> --json-out ./snap-inquiry
|
|
126
|
+
siluzan-tso google-analysis -a <mediaCustomerId> \
|
|
127
|
+
--start <S> --end <D> \
|
|
128
|
+
--sections campaigns,keywords,search-terms,campaign-geo \
|
|
129
|
+
--json-out ./snap-inquiry
|
|
130
|
+
# Sheet 4/6:每月 campaigns+geographic(禁止用 daily-metrics 填 Sheet 4 上区)
|
|
131
|
+
siluzan-tso google-analysis -a <mediaCustomerId> --start <M1S> --end <M1E> \
|
|
132
|
+
--sections campaigns,geographic --json-out ./snap-inquiry/m1
|
|
133
|
+
siluzan-tso google-analysis -a <mediaCustomerId> --start <M2S> --end <M2E> \
|
|
134
|
+
--sections campaigns,geographic --json-out ./snap-inquiry/m2
|
|
135
|
+
siluzan-tso google-analysis -a <mediaCustomerId> --start <M3S> --end <M3E> \
|
|
136
|
+
--sections campaigns,geographic --json-out ./snap-inquiry/m3
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
4. **先 outline 后脚本** → 聚合脚本读 JSON → 计算 8 Sheet 数据。
|
|
140
|
+
5. **国家 → 大洲映射**:脚本读 `references/analytics/geo-continents.json`;Sheet 4 重点国按 `focusCountries`(详见模板「重点国家配置」节),**禁止**硬编码国家名。
|
|
141
|
+
6. **必产 8 Sheet xlsx**:版式以 `report-templates/google-inquiry-analysis.md` 为准;**只能**由 Agent 执行脚本生成,**禁止**假设 `siluzan-tso … excel` 子命令存在。
|
|
@@ -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
|
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Agent SKILL 最佳实践(siluzan-tso 维护指南)
|
|
2
|
+
|
|
3
|
+
本文档基于 [Agent Skills 开放规范](https://agentskills.io/specification) 与 [Cursor Skills 文档](https://cursor.com/docs/skills),结合 siluzan-skill monorepo 的 TSO 实践,供维护 `tso-cli/assets/siluzan-ads/` 时对照。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 协议要点(agentskills.io)
|
|
8
|
+
|
|
9
|
+
### 1.1 目录结构
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
siluzan-tso/ # 安装后目录名
|
|
13
|
+
├── AGENTS.md # Agent 域目录(gstack 风格)
|
|
14
|
+
├── SKILL.md.tmpl → SKILL.md # 构建生成
|
|
15
|
+
├── snippets/ # 共享注入块
|
|
16
|
+
├── docs/skill-guide.md # 人类导读
|
|
17
|
+
├── references/
|
|
18
|
+
│ ├── core/ # 纪律、安装、playbooks
|
|
19
|
+
│ ├── accounts/ # 账户、开户、财务
|
|
20
|
+
│ ├── google-ads/ # CLI + rules/
|
|
21
|
+
│ ├── analytics/ # 拉数、批处理、拓词
|
|
22
|
+
│ └── operations/ # 预警、线索、自动化
|
|
23
|
+
├── assets/
|
|
24
|
+
└── report-templates/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
源码位于 `tso-cli/assets/siluzan-ads/`,构建时 `copy-skill-assets.mjs` 替换占位符后写入 `dist/skill/`。
|
|
28
|
+
|
|
29
|
+
### 1.2 SKILL.md frontmatter
|
|
30
|
+
|
|
31
|
+
| 字段 | 要求 | siluzan-tso 用法 |
|
|
32
|
+
| ---- | ---- | ---------------- |
|
|
33
|
+
| `name` | 小写+连字符,≤64 字,**须与安装目录名一致** | `siluzan-tso`(非 `siluzan-ads`) |
|
|
34
|
+
| `description` | ≤1024 字,**第三人称**,含 WHAT + WHEN + 触发词 | 列出媒体、开户、Google Ads、报告、预警等 |
|
|
35
|
+
| `license` | 可选 | `MIT` |
|
|
36
|
+
| `compatibility` | 可选,≤500 字,环境依赖 | Node 18+、`siluzan-tso-cli`、鉴权 |
|
|
37
|
+
| `metadata` | 可选键值 | `requires: nodejs,siluzan-tso-cli` |
|
|
38
|
+
| `allowed-tools` | 可选(实验性) | `Bash(siluzan-tso:*) Read Write` |
|
|
39
|
+
| `disable-model-invocation` | Cursor 扩展 | TSO 需自动激活,**不设** true |
|
|
40
|
+
|
|
41
|
+
### 1.3 渐进式披露(三层加载)
|
|
42
|
+
|
|
43
|
+
| 层级 | 内容 | Token 预算建议 |
|
|
44
|
+
| ---- | ---- | -------------- |
|
|
45
|
+
| L1 元数据 | `name` + `description` | ~100 tokens,启动时索引 |
|
|
46
|
+
| L2 指令 | `SKILL.md` 正文 | <500 行,<5000 tokens,激活时加载 |
|
|
47
|
+
| L3 资源 | `references/`、`assets/`、`report-templates/` | 任务相关时才 Read |
|
|
48
|
+
|
|
49
|
+
**原则**:SKILL.md 只做路由与不可妥协的纪律;参数表、Playbook 步骤、优化 SOP 放 references。
|
|
50
|
+
|
|
51
|
+
### 1.4 文件引用规则
|
|
52
|
+
|
|
53
|
+
- 从 SKILL.md **只链接一层**(`references/foo.md`),避免 A→B→C 链式引用。
|
|
54
|
+
- 路径用正斜杠,不用 Windows 反斜杠。
|
|
55
|
+
- 占位符 `https://www-ci.siluzan.com`、`https://tso-api-ci.siluzan.com`、`npm install -g siluzan-tso-cli@beta` 由构建脚本替换,文档中禁止硬编码环境 URL。
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 2. 内容编写原则
|
|
60
|
+
|
|
61
|
+
### 2.1 简洁(Concise is Key)
|
|
62
|
+
|
|
63
|
+
Agent 已具备通用能力。文档只写 **CLI 特有** 内容:字段口径、批量命令、门禁流程、与前端不一致处。
|
|
64
|
+
|
|
65
|
+
❌ 解释「什么是 Google Ads」
|
|
66
|
+
✅ `budgetAmountYuan` 已是元,禁止再 ÷100
|
|
67
|
+
|
|
68
|
+
### 2.2 单一术语
|
|
69
|
+
|
|
70
|
+
全库统一:
|
|
71
|
+
|
|
72
|
+
| 概念 | 统一用词 | 禁止混用 |
|
|
73
|
+
| ---- | -------- | -------- |
|
|
74
|
+
| 广告账户 ID | `mediaCustomerId` | customer id、账户号(无上下文时) |
|
|
75
|
+
| 实体 ID | `entityId` | 内部 id |
|
|
76
|
+
| 落盘 | `--json-out` | --json(Agent 编排禁止) |
|
|
77
|
+
| 媒体 | `Google`、`TikTok`、`MetaAd`… | google、meta |
|
|
78
|
+
|
|
79
|
+
### 2.3 默认 + 逃生口
|
|
80
|
+
|
|
81
|
+
每个决策点给一个默认路径,例外单独一行:
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
全量 Google 批处理:省略 `-a`(CLI 内部拉清单)。
|
|
85
|
+
仅当用户明确给出 ID 子集时才传 `-a id1,id2,...`。
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2.4 反馈环(Feedback Loop)
|
|
89
|
+
|
|
90
|
+
写操作文档须含:**写命令 → 读命令复核 → 失败时查 reference**。
|
|
91
|
+
|
|
92
|
+
破坏性操作统一:**用户确认 → `--commit` → 读命令验证**。
|
|
93
|
+
|
|
94
|
+
### 2.5 禁止时间敏感表述
|
|
95
|
+
|
|
96
|
+
不写「2025 年 8 月前用旧 API」。废弃内容放 `## 已废弃` 折叠或删除。
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 3. siluzan-tso 文档分层
|
|
101
|
+
|
|
102
|
+
| 文件 | 职责 |
|
|
103
|
+
| ---- | ---- |
|
|
104
|
+
| `SKILL.md` | 安装、能力边界、文档路由表、任务→文档速查、Playbook 索引 |
|
|
105
|
+
| `references/core/agent-conventions.md` | Agent 纪律:加载时机、硬规范、数据转换、时间/币种/批量 |
|
|
106
|
+
| `references/core/playbooks.md` | P1–P7 标准动作(可复制命令块) |
|
|
107
|
+
| `references/core/tips.md` | `--json-out` 协议、outline 处理顺序 |
|
|
108
|
+
| `references/*.md` | 单功能域:命令、参数、输出示例 |
|
|
109
|
+
| `references/google-ads/rules/` | Google 优化/合规 SOP(非 CLI 参数) |
|
|
110
|
+
| `assets/*.json` / `*.md` | 创建类 JSON 契约 |
|
|
111
|
+
| `report-templates/*.md` | 报告内容纲要(优先于 HTML) |
|
|
112
|
+
| `report-templates/*.html` | 视觉样式,**不含业务数据** |
|
|
113
|
+
| `README.md` | 给「通过 URL 安装」的大模型说明(不进 dist 路由) |
|
|
114
|
+
|
|
115
|
+
### 3.1 与 CLI 代码同步
|
|
116
|
+
|
|
117
|
+
**代码变更 → 必须同步 Skill**(tutorial-10 #2)。新命令注册在 `_register.ts` / `index.ts` 后:
|
|
118
|
+
|
|
119
|
+
1. 更新对应 `references/*.md`
|
|
120
|
+
2. 更新 `SKILL.md` 路由表(若新功能域)
|
|
121
|
+
3. 评估场景:`tso-cli/eval/scenarios/` + `pnpm --filter siluzan-tso-cli run eval:export-cases`
|
|
122
|
+
|
|
123
|
+
### 3.2 灰度开关(tutorial-10 #11)
|
|
124
|
+
|
|
125
|
+
| 状态 | CLI 注册 | SKILL 文档 | AI 可见 |
|
|
126
|
+
| ---- | -------- | ---------- | ------- |
|
|
127
|
+
| 内测 | 是 | 否 | 否 |
|
|
128
|
+
| 公开 | 是 | 是 | 是 |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 4. description 写法模板
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
description: >-
|
|
136
|
+
Operates Siluzan TSO ad accounts via siluzan-tso-cli: Google/Bing/Yandex/TikTok/Kwai/Meta
|
|
137
|
+
account management, Google Ads CRUD, analytics, optimization reports, forewarning, leads,
|
|
138
|
+
invoicing, and RAG knowledge lookup. Use when the user mentions ad accounts, balance, spend,
|
|
139
|
+
campaigns, keywords, PMax, open account, MCC/BC binding, or TSO reporting.
|
|
140
|
+
Each new task requires re-reading routed references per SKILL.md.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
中文项目可保留中文 description,但仍须:**第三人称 + 能力列表 + 触发场景 + 重读纪律一句**。
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 5. 体积与质量检查清单
|
|
148
|
+
|
|
149
|
+
发布前逐项确认:
|
|
150
|
+
|
|
151
|
+
### Frontmatter
|
|
152
|
+
- [ ] `name` === 安装目录名 `siluzan-tso`
|
|
153
|
+
- [ ] `description` 含 WHAT、WHEN、关键词
|
|
154
|
+
- [ ] `compatibility` 列出 Node + CLI + 鉴权
|
|
155
|
+
|
|
156
|
+
### SKILL.md
|
|
157
|
+
- [ ] 正文 < 500 行
|
|
158
|
+
- [ ] 无重复 parameters 表(细节在 references)
|
|
159
|
+
- [ ] 路由表覆盖所有 `references/*.md` 入口
|
|
160
|
+
- [ ] Playbook 仅索引,步骤在 `core/playbooks.md`
|
|
161
|
+
|
|
162
|
+
### References
|
|
163
|
+
- [ ] 每个 CLI 命令族有且仅有一个主 reference
|
|
164
|
+
- [ ] 含 `--json-out` 示例(查询类)
|
|
165
|
+
- [ ] 写命令含 `--commit` 与复核命令
|
|
166
|
+
- [ ] 无断链(如 `accounts/open-account-by-media.md` 必须存在)
|
|
167
|
+
|
|
168
|
+
### 构建
|
|
169
|
+
- [ ] `pnpm run build:tso:test` 后 `dist/skill/SKILL.md` 占位符已替换
|
|
170
|
+
- [ ] `_meta.json` 版本与 package.json 一致
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 6. 反模式(Avoid)
|
|
175
|
+
|
|
176
|
+
| 反模式 | 正确做法 |
|
|
177
|
+
| ------ | -------- |
|
|
178
|
+
| SKILL.md 内嵌 200 行 Playbook | 移至 `references/core/playbooks.md` |
|
|
179
|
+
| Agent 用 `--json` 落大 JSON 到对话 | 一律 `--json-out` + 脚本读盘 |
|
|
180
|
+
| 路由表缺文件 | 补文件或删链接 |
|
|
181
|
+
| google-ads-rules 深链三层 | SKILL → `google-ads/rules/README.md` → 具体规则 |
|
|
182
|
+
| HTML 模板假数据当示例 | 纲要 `.md` 定义维度,数据来自 CLI |
|
|
183
|
+
| 凭记忆跨任务复用参数 | 每任务重读 `core/agent-conventions.md` § 加载纪律 |
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 7. 相关仓库文档
|
|
188
|
+
|
|
189
|
+
- `.cursor/rules/tutorial-05-core/skill-authoring.mdc` — 项目内 Skill 结构速查
|
|
190
|
+
- `.cursor/rules/tutorial-10-best-practices.mdc` — CLI + Skill 同步等 12 条
|
|
191
|
+
- `cso-cli/assets/siluzan-cso/SKILL.md` — 姊妹包参考(命令索引表风格)
|
|
192
|
+
- https://agentskills.io/specification — 开放规范原文
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CLI 使用技巧:`--json-out` 落盘 + Node.js 精准查询
|
|
2
2
|
|
|
3
|
-
> **文档重读(与落盘无关,但同样硬)**:**每个新的用户任务**或**同对话内换话题**时,须按 `
|
|
3
|
+
> **文档重读(与落盘无关,但同样硬)**:**每个新的用户任务**或**同对话内换话题**时,须按 `references/core/agent-conventions.md` § 文档加载纪律 **重新 Read** 当次任务对应的 `references/*.md` / `report-templates/*.md`,再执行 CLI。
|
|
4
4
|
|
|
5
5
|
> **AI 助手(本 Skill)**:凡需结构化数据,一律使用 **`--json-out <路径>`**(**目录** 或 **`*.json` 具体文件**)将 JSON 写入磁盘(并更新 **`cli-manifest[-<查询id>].json`**,与 `google-analysis` 的 **`manifest-<accountId>.json`**、`report …` 的 **`report-manifest[-<accountId>].json`** 并存于各自目录),再用 **脚本读文件**(`fs.readFileSync` / `require`)做筛选与聚合;**不要**依赖对话里粘贴的 stdout 整包 JSON。命令成功时 **stdout 仅一行摘要 JSON**(体积小),其中 **`outlineFile`** 指向与当次 `*.json` **同 stem** 的 **`*.outline.txt`**(纯文本单行,接近 **TypeScript 类型字面量**:`{ a: number; b: string }`、`(T | U)[]` 等;数组由**前 8 项**去重推断并集;环 / 同对象再出现为 `any`)。完整数据仍以落盘 `*.json` 为准,类型扫一眼读 outline 文件即可。
|
|
6
6
|
>
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
>
|
|
13
13
|
> 人类/一次性调试仍可在终端使用 **`--json`**(与 **`--json-out` 互斥**);Skill 正文与 Agent 编排**只写 `--json-out`**。
|
|
14
14
|
|
|
15
|
-
**Google `google-analysis` 与 Meta/TikTok/Bing `report …` 账户分析拉数(本 Skill 推荐口径)**:统一 **`--json-out <目录>`** 落盘(分析子命令以目录为主;通用业务命令另支持 **`--json-out ./foo.json` 单文件**);**用脚本读目录内 JSON + 数据处理库算指标,再由代码写出交付文件**(HTML / Excel / PDF / PPT / Markdown 等任选),勿用 `Read` 代替程序读数、勿在聊天里直接贴完整交付稿;脚本里勿写业务数据常量。详见 `references/account-analytics.md`「Google 分析快照工作流」及清单文件说明。
|
|
15
|
+
**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 分析快照工作流」及清单文件说明。
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
## 币种(**Agent 必读**)
|
|
20
20
|
|
|
21
|
-
涉及余额、消耗、预算、报告、Excel 前:**先 Read `references/currency.md`**,从 `list-accounts` / `balance` / `stats` / `google-analysis` 的 **`currencyCode`** 确定 CNY 或 USD,再选 **¥** 或 **$**。**禁止**默认 Google=美金、禁止跨币种求和。
|
|
21
|
+
涉及余额、消耗、预算、报告、Excel 前:**先 Read `references/accounts/currency.md`**,从 `list-accounts` / `balance` / `stats` / `google-analysis` 的 **`currencyCode`** 确定 CNY 或 USD,再选 **¥** 或 **$**。**禁止**默认 Google=美金、禁止跨币种求和。
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
- 网关原始字段 `budgetAmount`(分)、`*Micros`(微元)**已不再落盘**,无需做任何单位换算。
|
|
50
50
|
- **`campaigns-*.outline.txt`** 在标准 3 行头注释之后会多 **2 行** 中文 `//` 提示;提取类型行请用 **`outlineRaw.trimEnd().split('\n').filter(l => !l.startsWith('//')).pop()`**(与上文步骤 2 一致),勿把提示行当 TS 类型。
|
|
51
51
|
|
|
52
|
-
详见 `references/account-analytics.md`「金额单位」「CampaignSectionData」。
|
|
52
|
+
详见 `references/analytics/account-analytics.md`「金额单位」「CampaignSectionData」。
|
|
53
53
|
|
|
54
54
|
---
|
|
55
55
|
|
|
@@ -143,7 +143,7 @@ list
|
|
|
143
143
|
|
|
144
144
|
### 3b. 多账户投放画像(`accounts-digest`)
|
|
145
145
|
|
|
146
|
-
多账户汇总消耗/点击/转化时**优先** `accounts-digest`,不要对每个账户循环 `stats`(见 `SKILL.md` Playbook P3、`references/accounts.md` § accounts-digest)。
|
|
146
|
+
多账户汇总消耗/点击/转化时**优先** `accounts-digest`,不要对每个账户循环 `stats`(见 `SKILL.md` Playbook P3、`references/accounts/accounts.md` § accounts-digest)。
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
149
|
siluzan-tso accounts-digest -m Google -a id1,id2,id3 \
|