siluzan-seo-cli 0.1.1-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 +47 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5544 -0
- package/dist/skill/SKILL.md +114 -0
- package/dist/skill/_meta.json +18 -0
- package/dist/skill/backlink-article/SKILL.md +61 -0
- package/dist/skill/backlink-article/prompts/system.md +40 -0
- package/dist/skill/backlink-article/prompts/user.md +20 -0
- package/dist/skill/backlink-article/schemas/output.json +27 -0
- package/dist/skill/backlink-article/skill.yaml +50 -0
- package/dist/skill/blog/SKILL.md +59 -0
- package/dist/skill/blog/prompts/system.md +57 -0
- package/dist/skill/blog/prompts/user.md +21 -0
- package/dist/skill/blog/schemas/output.json +31 -0
- package/dist/skill/blog/skill.yaml +50 -0
- package/dist/skill/references/export.md +110 -0
- package/dist/skill/references/setup.md +59 -0
- package/dist/skill/scripts/install.ps1 +275 -0
- package/dist/skill/scripts/install.sh +180 -0
- package/dist/skill/seo-traffic-page/SKILL.md +60 -0
- package/dist/skill/seo-traffic-page/prompts/system.md +93 -0
- package/dist/skill/seo-traffic-page/prompts/user.md +25 -0
- package/dist/skill/seo-traffic-page/schemas/output.json +49 -0
- package/dist/skill/seo-traffic-page/skill.yaml +51 -0
- package/package.json +61 -0
- package/scripts/postinstall.mjs +3 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# 安装与配置
|
|
2
|
+
|
|
3
|
+
## 一键安装(推荐)
|
|
4
|
+
|
|
5
|
+
构建发布后,`dist/skill/scripts/` 内含与 CSO 同源的安装脚本(构建时注入 `siluzan-seo-cli` / `siluzan-seo` 占位符):
|
|
6
|
+
|
|
7
|
+
- **macOS / Linux / WSL:**
|
|
8
|
+
```bash
|
|
9
|
+
bash <(curl -fsSL https://unpkg.com/siluzan-seo-cli@latest/dist/skill/scripts/install.sh)
|
|
10
|
+
```
|
|
11
|
+
- **Windows PowerShell:**
|
|
12
|
+
```powershell
|
|
13
|
+
irm https://unpkg.com/siluzan-seo-cli@latest/dist/skill/scripts/install.ps1 | iex
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
脚本步骤:Node.js 检测 → 全局安装 `siluzan-seo-cli` → `siluzan-seo init --global --force`。**不执行 login**,也无需 API Key。
|
|
17
|
+
|
|
18
|
+
测试环境 CLI:`npm install -g siluzan-seo-cli@beta`,脚本中 `INSTALL_CMD` 会随构建环境切换。
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 手动安装
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g siluzan-seo-cli@beta
|
|
26
|
+
siluzan-seo init # 写入当前项目 AI 助手 skill 目录
|
|
27
|
+
siluzan-seo init --global # 写入各平台全局 skill 目录
|
|
28
|
+
siluzan-seo update # 升级 CLI 并刷新已安装 skill 文件
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
环境要求:**Node.js 18+**
|
|
32
|
+
|
|
33
|
+
### `init` 支持的 `--ai` 目标
|
|
34
|
+
|
|
35
|
+
| 值 | 写入路径 |
|
|
36
|
+
|----|---------|
|
|
37
|
+
| `cursor` | `.cursor/skills/siluzan-seo/` |
|
|
38
|
+
| `claude` | `.claude/skills/siluzan-seo/` |
|
|
39
|
+
| `deerflow` | `skills/public/siluzan-seo/` |
|
|
40
|
+
| `openclaw` / `openclaw-workspace` | `skills/siluzan-seo/` |
|
|
41
|
+
| `openclaw-global` | `~/.openclaw/skills/siluzan-seo/` |
|
|
42
|
+
| `workbuddy` / `workbuddy-workspace` | `.workbuddy/skills/siluzan-seo/` |
|
|
43
|
+
| `workbuddy-global` | `~/.workbuddy/skills/siluzan-seo/` |
|
|
44
|
+
| `all` | 当前项目下全部平台目录 |
|
|
45
|
+
|
|
46
|
+
WorkBuddy 也可将 `seo-traffic-page/`、`blog/`、`backlink-article/` 子目录分别作为独立 Skill 安装(见各子目录 `SKILL.md`)。
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 与 siluzan-cso 的关系
|
|
51
|
+
|
|
52
|
+
| 能力 | siluzan-seo | siluzan-cso |
|
|
53
|
+
|------|-------------|-------------|
|
|
54
|
+
| SEO JSON schema 生成 | ✅ Skill 文档 + 子目录 prompts | ❌ |
|
|
55
|
+
| 企业 RAG / 三库写稿 | 工作流中另用 CSO Skill | ✅ |
|
|
56
|
+
| 登录 / API Key | ❌ 不需要 | ✅ |
|
|
57
|
+
| 导出 Word/PDF | ✅ `export` 命令 | ❌ |
|
|
58
|
+
|
|
59
|
+
做 RAG 拉企业资料时,在 Agent 工作流里加载 **siluzan-cso** 即可,与 SEO CLI 安装无关。
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#Requires -Version 5.1
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# siluzan-seo-cli - One-click install script (PowerShell)
|
|
4
|
+
# Supported: Windows 10/11 (PowerShell 5.1+ or PowerShell 7+)
|
|
5
|
+
# =============================================================================
|
|
6
|
+
|
|
7
|
+
$ErrorActionPreference = 'Stop'
|
|
8
|
+
|
|
9
|
+
# -- Package info (injected at build time) ------------------------------------
|
|
10
|
+
$PKG_NAME = 'siluzan-seo-cli'
|
|
11
|
+
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
+
$PKG_VERSION = '0.1.1-beta.3'
|
|
13
|
+
$CLI_BIN = 'siluzan-seo'
|
|
14
|
+
$SKILL_LABEL = 'Siluzan SEO'
|
|
15
|
+
$INSTALL_CMD = 'npm install -g siluzan-seo-cli@beta'
|
|
16
|
+
$WEB_BASE = 'https://www-ci.siluzan.com'
|
|
17
|
+
|
|
18
|
+
# -- Constants ----------------------------------------------------------------
|
|
19
|
+
$NODE_MAJOR_MIN = 18
|
|
20
|
+
$NPM_MIRROR = 'https://registry.npmmirror.com'
|
|
21
|
+
# Git for Windows installer (mirrored on Siluzan CDN; bump version here when needed)
|
|
22
|
+
$GIT_INSTALLER_URL = 'https://staticpn.siluzan.com/assets/git/Git-2.54.0-64-bit.exe'
|
|
23
|
+
|
|
24
|
+
# -- Helpers ------------------------------------------------------------------
|
|
25
|
+
function Write-Info { param([string]$Msg) Write-Host "[OK] $Msg" -ForegroundColor Green }
|
|
26
|
+
function Write-Warn { param([string]$Msg) Write-Host "[!] $Msg" -ForegroundColor Yellow }
|
|
27
|
+
function Write-Err { param([string]$Msg) Write-Host "[X] $Msg" -ForegroundColor Red }
|
|
28
|
+
function Write-Step { param([string]$Msg) Write-Host "`n-- $Msg --" -ForegroundColor White }
|
|
29
|
+
|
|
30
|
+
function Refresh-Path {
|
|
31
|
+
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'Machine')
|
|
32
|
+
$userPath = [Environment]::GetEnvironmentVariable('Path', 'User')
|
|
33
|
+
$env:Path = "$machinePath;$userPath"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# -- Node.js ------------------------------------------------------------------
|
|
37
|
+
function Test-NodeVersion {
|
|
38
|
+
try {
|
|
39
|
+
$nodeCmd = Get-Command node -ErrorAction SilentlyContinue
|
|
40
|
+
if (-not $nodeCmd) { return $false }
|
|
41
|
+
$ver = (node -v) -replace '^v', ''
|
|
42
|
+
$major = [int]($ver.Split('.')[0])
|
|
43
|
+
return $major -ge $NODE_MAJOR_MIN
|
|
44
|
+
} catch {
|
|
45
|
+
return $false
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function Get-NodeVersionString {
|
|
50
|
+
try { return (node -v) } catch { return 'N/A' }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function Install-NodeJS {
|
|
54
|
+
$hasWinget = $null -ne (Get-Command winget -ErrorAction SilentlyContinue)
|
|
55
|
+
if ($hasWinget) {
|
|
56
|
+
Write-Info 'Installing Node.js LTS via winget...'
|
|
57
|
+
winget install -e --id OpenJS.NodeJS.LTS --silent --accept-package-agreements --accept-source-agreements
|
|
58
|
+
if ($LASTEXITCODE -ne 0) {
|
|
59
|
+
Write-Warn 'winget returned non-zero, trying fallback...'
|
|
60
|
+
Install-NodeFallback
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
Install-NodeFallback
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
Refresh-Path
|
|
68
|
+
if (-not (Test-NodeVersion)) {
|
|
69
|
+
Write-Warn 'Node.js not found after PATH refresh, locating install dir...'
|
|
70
|
+
$nodePath = "$env:ProgramFiles\nodejs"
|
|
71
|
+
if (Test-Path "$nodePath\node.exe") {
|
|
72
|
+
$env:Path = "$nodePath;$env:Path"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function Install-NodeFallback {
|
|
78
|
+
Write-Err 'Cannot auto-install Node.js'
|
|
79
|
+
Write-Host ''
|
|
80
|
+
Write-Host ' Please install Node.js manually:' -ForegroundColor Cyan
|
|
81
|
+
Write-Host ' https://nodejs.org/en/download/'
|
|
82
|
+
Write-Host ''
|
|
83
|
+
Write-Host ' After installation, reopen PowerShell and run this script again.'
|
|
84
|
+
throw 'Node.js is required'
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# -- Git for Windows ----------------------------------------------------------
|
|
88
|
+
# Some agent clients (Cursor / Claude Code / etc.) have known quirks running
|
|
89
|
+
# PowerShell or cmd commands. We install Git for Windows ahead of time so the
|
|
90
|
+
# user always has a Git Bash fallback to run the equivalent bash installer
|
|
91
|
+
# (`bash <(curl -fsSL .../install.sh)`) when the PowerShell channel misbehaves.
|
|
92
|
+
function Test-GitInstalled {
|
|
93
|
+
return $null -ne (Get-Command git -ErrorAction SilentlyContinue)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function Test-IsAdmin {
|
|
97
|
+
try {
|
|
98
|
+
$id = [Security.Principal.WindowsIdentity]::GetCurrent()
|
|
99
|
+
$principal = New-Object Security.Principal.WindowsPrincipal($id)
|
|
100
|
+
return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
101
|
+
} catch {
|
|
102
|
+
return $false
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function Install-Git {
|
|
107
|
+
$tmpFile = Join-Path $env:TEMP 'siluzan-git-installer.exe'
|
|
108
|
+
|
|
109
|
+
Write-Info "Downloading Git for Windows: $GIT_INSTALLER_URL"
|
|
110
|
+
try {
|
|
111
|
+
$prevProgress = $ProgressPreference
|
|
112
|
+
$ProgressPreference = 'SilentlyContinue'
|
|
113
|
+
Invoke-WebRequest -Uri $GIT_INSTALLER_URL -OutFile $tmpFile -UseBasicParsing
|
|
114
|
+
$ProgressPreference = $prevProgress
|
|
115
|
+
} catch {
|
|
116
|
+
Write-Warn "Git installer download failed: $($_.Exception.Message)"
|
|
117
|
+
return $false
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (-not (Test-Path $tmpFile)) {
|
|
121
|
+
Write-Warn 'Git installer file not found after download'
|
|
122
|
+
return $false
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
# Inno Setup silent flags. When not admin we point /DIR to %LOCALAPPDATA% so
|
|
126
|
+
# the installer doesn't try to write to Program Files (which would trigger UAC
|
|
127
|
+
# or just fail). The installer auto-detects ALLUSERS vs CURRENTUSER mode based
|
|
128
|
+
# on whether the current process is elevated, so we don't pass /CURRENTUSER
|
|
129
|
+
# explicitly (not all Git for Windows builds accept that flag).
|
|
130
|
+
$installArgs = @('/VERYSILENT', '/NORESTART', '/NOCANCEL', '/SP-', '/CLOSEAPPLICATIONS', '/RESTARTAPPLICATIONS')
|
|
131
|
+
if (Test-IsAdmin) {
|
|
132
|
+
Write-Info 'Installing Git for Windows system-wide (admin detected)...'
|
|
133
|
+
} else {
|
|
134
|
+
$userDir = Join-Path $env:LOCALAPPDATA 'Programs\Git'
|
|
135
|
+
Write-Info "Installing Git for Windows for current user: $userDir"
|
|
136
|
+
$installArgs += @("/DIR=$userDir")
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
Start-Process -FilePath $tmpFile -ArgumentList $installArgs -Wait -NoNewWindow
|
|
141
|
+
} catch {
|
|
142
|
+
Write-Warn "Git installer launch failed: $($_.Exception.Message)"
|
|
143
|
+
Remove-Item $tmpFile -ErrorAction SilentlyContinue
|
|
144
|
+
return $false
|
|
145
|
+
}
|
|
146
|
+
Remove-Item $tmpFile -ErrorAction SilentlyContinue
|
|
147
|
+
|
|
148
|
+
Refresh-Path
|
|
149
|
+
if (-not (Test-GitInstalled)) {
|
|
150
|
+
# 安装器有时不会立刻刷新 PATH,按已知路径手动补一次
|
|
151
|
+
$candidates = @(
|
|
152
|
+
(Join-Path $env:LOCALAPPDATA 'Programs\Git\cmd'),
|
|
153
|
+
(Join-Path $env:ProgramFiles 'Git\cmd')
|
|
154
|
+
)
|
|
155
|
+
foreach ($p in $candidates) {
|
|
156
|
+
if (Test-Path (Join-Path $p 'git.exe')) {
|
|
157
|
+
$env:Path = "$p;$env:Path"
|
|
158
|
+
break
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return Test-GitInstalled
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
# -- Main ---------------------------------------------------------------------
|
|
167
|
+
function Main {
|
|
168
|
+
Write-Host ''
|
|
169
|
+
Write-Host '+---------------------------------------------+' -ForegroundColor White
|
|
170
|
+
Write-Host "| $SKILL_LABEL -- Install |" -ForegroundColor White
|
|
171
|
+
Write-Host '+---------------------------------------------+' -ForegroundColor White
|
|
172
|
+
Write-Host ''
|
|
173
|
+
|
|
174
|
+
# Step 1: Environment check
|
|
175
|
+
Write-Step 'Step 1/4: Environment check'
|
|
176
|
+
|
|
177
|
+
if (Test-NodeVersion) {
|
|
178
|
+
Write-Info "Node.js $(Get-NodeVersionString) found"
|
|
179
|
+
} else {
|
|
180
|
+
$nodeCmd = Get-Command node -ErrorAction SilentlyContinue
|
|
181
|
+
if ($nodeCmd) {
|
|
182
|
+
Write-Warn "Node.js $(Get-NodeVersionString) is too old (need >= $NODE_MAJOR_MIN), upgrading..."
|
|
183
|
+
} else {
|
|
184
|
+
Write-Warn 'Node.js not found, installing...'
|
|
185
|
+
}
|
|
186
|
+
Install-NodeJS
|
|
187
|
+
if (-not (Test-NodeVersion)) {
|
|
188
|
+
Write-Err 'Node.js installation failed. Please install manually: https://nodejs.org/'
|
|
189
|
+
return
|
|
190
|
+
}
|
|
191
|
+
Write-Info "Node.js $(Get-NodeVersionString) installed"
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
$npmCmd = Get-Command npm -ErrorAction SilentlyContinue
|
|
195
|
+
if (-not $npmCmd) {
|
|
196
|
+
Refresh-Path
|
|
197
|
+
$npmCmd = Get-Command npm -ErrorAction SilentlyContinue
|
|
198
|
+
}
|
|
199
|
+
if (-not $npmCmd) {
|
|
200
|
+
Write-Err 'npm not found (Node.js installation may be incomplete)'
|
|
201
|
+
return
|
|
202
|
+
}
|
|
203
|
+
Write-Info 'npm ready'
|
|
204
|
+
|
|
205
|
+
# Git for Windows: pre-install as a Bash fallback path for agent clients
|
|
206
|
+
# whose PowerShell/cmd channel is unreliable. Failure here is non-fatal.
|
|
207
|
+
if (Test-GitInstalled) {
|
|
208
|
+
Write-Info 'Git for Windows already installed (Git Bash fallback ready)'
|
|
209
|
+
} else {
|
|
210
|
+
Write-Warn 'Git for Windows not found, installing as Bash fallback for agent clients...'
|
|
211
|
+
$gitOk = $false
|
|
212
|
+
try { $gitOk = Install-Git } catch { Write-Warn "Git install error: $($_.Exception.Message)" }
|
|
213
|
+
if ($gitOk) {
|
|
214
|
+
Write-Info 'Git for Windows installed (Git Bash fallback ready)'
|
|
215
|
+
} else {
|
|
216
|
+
Write-Warn 'Git for Windows install was skipped or failed; CLI install will continue.'
|
|
217
|
+
Write-Host ' If your agent later fails to run PowerShell commands, install Git manually:' -ForegroundColor DarkGray
|
|
218
|
+
Write-Host " $GIT_INSTALLER_URL" -ForegroundColor DarkGray
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
$currentRegistry = ''
|
|
223
|
+
try { $currentRegistry = (npm config get registry 2>$null).Trim() } catch {}
|
|
224
|
+
if ($currentRegistry -ne $NPM_MIRROR -and $currentRegistry -ne "$NPM_MIRROR/") {
|
|
225
|
+
Write-Info 'Switching npm registry to China mirror for faster downloads...'
|
|
226
|
+
npm config set registry $NPM_MIRROR
|
|
227
|
+
Write-Info "npm registry set to $NPM_MIRROR"
|
|
228
|
+
} else {
|
|
229
|
+
Write-Info 'npm registry already set to China mirror'
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
# Step 2: Install CLI
|
|
233
|
+
Write-Step "Step 2/4: Install $PKG_NAME"
|
|
234
|
+
|
|
235
|
+
# 用打包时锁定的 PKG_VERSION,保证脚本与同批 dist/skill 行为对齐
|
|
236
|
+
$installTarget = "$PKG_NAME@$PKG_VERSION"
|
|
237
|
+
Write-Info "Running: npm install -g $installTarget"
|
|
238
|
+
& npm install -g $installTarget
|
|
239
|
+
if ($LASTEXITCODE -ne 0) { Write-Err "npm install -g $installTarget failed"; return }
|
|
240
|
+
Write-Info "$installTarget installed"
|
|
241
|
+
|
|
242
|
+
Write-Info 'Registering Skill to all AI platform global directories...'
|
|
243
|
+
& $CLI_BIN init --global --force
|
|
244
|
+
|
|
245
|
+
if ($CLI_BIN -eq 'siluzan-seo') {
|
|
246
|
+
Write-Info 'siluzan-seo does not require login; skipping API Key setup.'
|
|
247
|
+
} else {
|
|
248
|
+
Write-Step 'Step 3/4: Configure API Key'
|
|
249
|
+
Write-Host ''
|
|
250
|
+
& $CLI_BIN login
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
# Step 4: Done
|
|
254
|
+
Write-Step 'Step 4/4: Complete'
|
|
255
|
+
Write-Host ''
|
|
256
|
+
Write-Host " $SKILL_LABEL installed successfully!" -ForegroundColor Green
|
|
257
|
+
Write-Host ''
|
|
258
|
+
Write-Host ' Skill registered to these global directories (all AI assistants):'
|
|
259
|
+
Write-Host ' ~/.cursor/skills/ ~/.claude/skills/ ~/.agents/skills/' -ForegroundColor DarkGray
|
|
260
|
+
Write-Host ' ~/.gemini/skills/ ~/.codex/skills/ ~/.kilo/skills/' -ForegroundColor DarkGray
|
|
261
|
+
Write-Host ' ~/.codeium/windsurf/skills/ ~/.config/opencode/skills/' -ForegroundColor DarkGray
|
|
262
|
+
Write-Host ' ~/.openclaw/skills/ ~/.workbuddy/skills/' -ForegroundColor DarkGray
|
|
263
|
+
Write-Host ''
|
|
264
|
+
Write-Host " Update CLI & Skill files: $CLI_BIN update"
|
|
265
|
+
Write-Host ''
|
|
266
|
+
if (Test-GitInstalled) {
|
|
267
|
+
Write-Host ' Tip: if your agent client has trouble running PowerShell/cmd commands later,' -ForegroundColor DarkGray
|
|
268
|
+
Write-Host ' open Git Bash and re-run the equivalent bash installer instead.' -ForegroundColor DarkGray
|
|
269
|
+
Write-Host ''
|
|
270
|
+
}
|
|
271
|
+
Write-Info "Need help? Visit $WEB_BASE"
|
|
272
|
+
Write-Host ''
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
Main
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# siluzan-seo-cli - One-click install script
|
|
4
|
+
# Supported: macOS, Linux, Windows (WSL)
|
|
5
|
+
# =============================================================================
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# -- Package info (injected at build time) ------------------------------------
|
|
10
|
+
readonly PKG_NAME="siluzan-seo-cli"
|
|
11
|
+
# PKG_VERSION 锁定到与本脚本同批构建产物一致的版本,避免与 dist/skill 错位
|
|
12
|
+
readonly PKG_VERSION="0.1.1-beta.3"
|
|
13
|
+
readonly CLI_BIN="siluzan-seo"
|
|
14
|
+
readonly SKILL_LABEL="Siluzan SEO"
|
|
15
|
+
readonly INSTALL_CMD="npm install -g siluzan-seo-cli@beta"
|
|
16
|
+
readonly WEB_BASE="https://www-ci.siluzan.com"
|
|
17
|
+
|
|
18
|
+
# -- Constants ----------------------------------------------------------------
|
|
19
|
+
readonly NODE_MAJOR_MIN=18
|
|
20
|
+
readonly NPM_MIRROR="https://registry.npmmirror.com"
|
|
21
|
+
|
|
22
|
+
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
|
|
23
|
+
BOLD='\033[1m'; DIM='\033[2m'; NC='\033[0m'
|
|
24
|
+
|
|
25
|
+
info() { printf "${GREEN}[OK]${NC} %s\n" "$1"; }
|
|
26
|
+
warn() { printf "${YELLOW}[!]${NC} %s\n" "$1"; }
|
|
27
|
+
error() { printf "${RED}[X]${NC} %s\n" "$1" >&2; }
|
|
28
|
+
step() { printf "\n${BOLD}-- %s --${NC}\n" "$1"; }
|
|
29
|
+
|
|
30
|
+
# -- Detect OS ----------------------------------------------------------------
|
|
31
|
+
detect_os() {
|
|
32
|
+
local uname_out
|
|
33
|
+
uname_out=$(uname -s 2>/dev/null || echo "Unknown")
|
|
34
|
+
case "$uname_out" in
|
|
35
|
+
Darwin*) echo "macos" ;;
|
|
36
|
+
Linux*) echo "linux" ;;
|
|
37
|
+
MINGW*|MSYS*|CYGWIN*) echo "gitbash" ;;
|
|
38
|
+
*) echo "unknown" ;;
|
|
39
|
+
esac
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# -- Node.js ------------------------------------------------------------------
|
|
43
|
+
node_version_ok() {
|
|
44
|
+
command -v node >/dev/null 2>&1 || return 1
|
|
45
|
+
local major
|
|
46
|
+
major=$(node -v | tr -d 'v' | cut -d. -f1)
|
|
47
|
+
[ "$major" -ge "$NODE_MAJOR_MIN" ]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
install_node() {
|
|
51
|
+
local os_type
|
|
52
|
+
os_type=$(detect_os)
|
|
53
|
+
case "$os_type" in
|
|
54
|
+
macos)
|
|
55
|
+
if command -v brew >/dev/null 2>&1; then
|
|
56
|
+
info "Installing Node.js LTS via Homebrew..."
|
|
57
|
+
brew install node@22
|
|
58
|
+
brew link --overwrite node@22 2>/dev/null || true
|
|
59
|
+
else
|
|
60
|
+
info "Installing Node.js LTS via install-node.vercel.app..."
|
|
61
|
+
curl -fsSL https://install-node.vercel.app/lts | bash -s -- --yes
|
|
62
|
+
fi
|
|
63
|
+
;;
|
|
64
|
+
linux)
|
|
65
|
+
if command -v apt-get >/dev/null 2>&1; then
|
|
66
|
+
info "Installing Node.js 22.x via NodeSource (apt)..."
|
|
67
|
+
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
|
68
|
+
sudo apt-get install -y nodejs
|
|
69
|
+
elif command -v yum >/dev/null 2>&1; then
|
|
70
|
+
info "Installing Node.js 22.x via NodeSource (yum)..."
|
|
71
|
+
curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo -E bash -
|
|
72
|
+
sudo yum install -y nodejs
|
|
73
|
+
else
|
|
74
|
+
info "Installing Node.js LTS via install-node.vercel.app..."
|
|
75
|
+
curl -fsSL https://install-node.vercel.app/lts | bash -s -- --yes
|
|
76
|
+
fi
|
|
77
|
+
;;
|
|
78
|
+
gitbash)
|
|
79
|
+
error "Cannot auto-install Node.js in Git Bash. Please use the PowerShell script or install manually."
|
|
80
|
+
echo " https://nodejs.org/en/download/"
|
|
81
|
+
exit 1
|
|
82
|
+
;;
|
|
83
|
+
*)
|
|
84
|
+
error "Unsupported OS. Please install Node.js >= ${NODE_MAJOR_MIN} manually:"
|
|
85
|
+
echo " https://nodejs.org/en/download/"
|
|
86
|
+
exit 1
|
|
87
|
+
;;
|
|
88
|
+
esac
|
|
89
|
+
|
|
90
|
+
export PATH="$HOME/.local/bin:$HOME/.nodejs/bin:/usr/local/bin:$PATH"
|
|
91
|
+
hash -r 2>/dev/null || true
|
|
92
|
+
|
|
93
|
+
if ! node_version_ok; then
|
|
94
|
+
error "Node.js installation failed. Please install manually:"
|
|
95
|
+
echo " https://nodejs.org/en/download/"
|
|
96
|
+
exit 1
|
|
97
|
+
fi
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
# -- Main ---------------------------------------------------------------------
|
|
101
|
+
main() {
|
|
102
|
+
echo ""
|
|
103
|
+
echo -e "${BOLD}+---------------------------------------------+${NC}"
|
|
104
|
+
echo -e "${BOLD}| ${SKILL_LABEL} -- Install |${NC}"
|
|
105
|
+
echo -e "${BOLD}+---------------------------------------------+${NC}"
|
|
106
|
+
echo ""
|
|
107
|
+
|
|
108
|
+
# Step 1: Environment check
|
|
109
|
+
step "Step 1/4: Environment check"
|
|
110
|
+
|
|
111
|
+
if node_version_ok; then
|
|
112
|
+
info "Node.js $(node -v) found"
|
|
113
|
+
else
|
|
114
|
+
if command -v node >/dev/null 2>&1; then
|
|
115
|
+
warn "Node.js $(node -v) is too old (need >= ${NODE_MAJOR_MIN}), upgrading..."
|
|
116
|
+
else
|
|
117
|
+
warn "Node.js not found, installing..."
|
|
118
|
+
fi
|
|
119
|
+
install_node
|
|
120
|
+
info "Node.js $(node -v) installed"
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
if command -v pnpm >/dev/null 2>&1; then
|
|
124
|
+
PKG_MANAGER="pnpm"
|
|
125
|
+
elif command -v npm >/dev/null 2>&1; then
|
|
126
|
+
PKG_MANAGER="npm"
|
|
127
|
+
else
|
|
128
|
+
error "npm not found (Node.js installation may be incomplete)"
|
|
129
|
+
exit 1
|
|
130
|
+
fi
|
|
131
|
+
info "$PKG_MANAGER ready"
|
|
132
|
+
|
|
133
|
+
local current_registry
|
|
134
|
+
current_registry=$(npm config get registry 2>/dev/null || echo "")
|
|
135
|
+
if [ "$current_registry" != "$NPM_MIRROR" ] && [ "$current_registry" != "${NPM_MIRROR}/" ]; then
|
|
136
|
+
info "Switching npm registry to China mirror for faster downloads..."
|
|
137
|
+
npm config set registry "$NPM_MIRROR"
|
|
138
|
+
info "npm registry set to $NPM_MIRROR"
|
|
139
|
+
else
|
|
140
|
+
info "npm registry already set to China mirror"
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
# Step 2: Install CLI
|
|
144
|
+
step "Step 2/4: Install ${PKG_NAME}"
|
|
145
|
+
|
|
146
|
+
# 用打包时锁定的 PKG_VERSION,保证脚本与同批 dist/skill 行为对齐
|
|
147
|
+
local install_target="${PKG_NAME}@${PKG_VERSION}"
|
|
148
|
+
info "Running: $PKG_MANAGER install -g ${install_target}"
|
|
149
|
+
$PKG_MANAGER install -g "${install_target}"
|
|
150
|
+
info "${install_target} installed"
|
|
151
|
+
|
|
152
|
+
info "Registering Skill to all AI platform global directories..."
|
|
153
|
+
${CLI_BIN} init --global --force
|
|
154
|
+
|
|
155
|
+
if [ "${CLI_BIN}" = "siluzan-seo" ]; then
|
|
156
|
+
info "siluzan-seo does not require login; skipping API Key setup."
|
|
157
|
+
else
|
|
158
|
+
step "Step 3/4: Configure API Key"
|
|
159
|
+
echo ""
|
|
160
|
+
${CLI_BIN} login
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
# Step 4: Done
|
|
164
|
+
step "Step 4/4: Complete"
|
|
165
|
+
echo ""
|
|
166
|
+
echo -e " ${GREEN}${SKILL_LABEL} installed successfully!${NC}"
|
|
167
|
+
echo ""
|
|
168
|
+
echo " Skill registered to these global directories (all AI assistants):"
|
|
169
|
+
echo -e " ${DIM}~/.cursor/skills/ ~/.claude/skills/ ~/.agents/skills/"
|
|
170
|
+
echo -e " ~/.gemini/skills/ ~/.codex/skills/ ~/.kilo/skills/"
|
|
171
|
+
echo -e " ~/.codeium/windsurf/skills/ ~/.config/opencode/skills/"
|
|
172
|
+
echo -e " ~/.openclaw/skills/ ~/.workbuddy/skills/${NC}"
|
|
173
|
+
echo ""
|
|
174
|
+
echo " Update CLI & Skill files: ${CLI_BIN} update"
|
|
175
|
+
echo ""
|
|
176
|
+
info "Need help? Visit ${WEB_BASE}"
|
|
177
|
+
echo ""
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
main "$@"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: seo-traffic-page
|
|
3
|
+
description: >-
|
|
4
|
+
批量生成工业 B2B SEO **引流页 JSON**(schemas/output.json):N 个关键词 → N 个 pages[](Content 模块 + TDK)。
|
|
5
|
+
仅当用户要 landing page **结构化 schema / 批量引流页 JSON** 时使用;普通写稿或单篇无 schema 文章 → siluzan-cso。
|
|
6
|
+
须配合 siluzan-cso RAG,再 Read 本子 SKILL 与 schemas/output.json。
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# SEO 引流页 JSON Schema 生成
|
|
10
|
+
|
|
11
|
+
产出 **schemas/output.json** 定义的 `pages[]` JSON,供建站灌入——不是 CSO 通用写稿。
|
|
12
|
+
|
|
13
|
+
## 何时使用
|
|
14
|
+
|
|
15
|
+
- 用户要 **批量引流页 / landing page JSON / traffic page schema** 交付
|
|
16
|
+
- 必填:`keywords`(字符串数组),几个词生成几个页面
|
|
17
|
+
- **不要**用于:口播、公众号、无 output.json 的普通 Blog(→ siluzan-cso)
|
|
18
|
+
- 一次性 JSON 输出,页面间 **禁止** 复用句子、案例、FAQ、亮点表述
|
|
19
|
+
|
|
20
|
+
## 运行时配置
|
|
21
|
+
|
|
22
|
+
| 文件 | 用途 |
|
|
23
|
+
|------|------|
|
|
24
|
+
| [skill.yaml](skill.yaml) | WorkBuddy:模型、inputs、5 路 RAG |
|
|
25
|
+
| [prompts/system.md](prompts/system.md) | 生成规则与 7 模块结构 |
|
|
26
|
+
| [prompts/user.md](prompts/user.md) | 用户侧模板 |
|
|
27
|
+
| [schemas/output.json](schemas/output.json) | 输出 JSON Schema |
|
|
28
|
+
|
|
29
|
+
## RAG(siluzan-cso)
|
|
30
|
+
|
|
31
|
+
见 `skill.yaml`:`keywords_context`、`company_profile`、`trust_assets`、`faq_pool`、`reviews`(merge union,dedup)。
|
|
32
|
+
|
|
33
|
+
## 输出结构
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"pages": [
|
|
38
|
+
{
|
|
39
|
+
"Title": "页面关键词",
|
|
40
|
+
"Content": "7 模块纯文本:优势 / 案例×3 / 产品 / 文本 / FAQ×5 / 评价×2 / 亮点×3",
|
|
41
|
+
"TDK": { "seo_title", "seo_description", "seo_keywords" },
|
|
42
|
+
"SEO_Check": "密度与 TDK 长度自检"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 内容要点
|
|
49
|
+
|
|
50
|
+
- 每页对应明确 **search intent**(供应商、规格比较、应用、质检、批量采购等)
|
|
51
|
+
- 品牌信息融入质量/供应链/案例语境,避免硬广结尾
|
|
52
|
+
- 评价:优先 KB 真实评价;无数据可匿名场景化,**不得** 声称为 verified 或虚构客户/订单
|
|
53
|
+
|
|
54
|
+
## 执行清单
|
|
55
|
+
|
|
56
|
+
- [ ] 确认 `keywords` 数组
|
|
57
|
+
- [ ] Read `prompts/system.md` 全文
|
|
58
|
+
- [ ] RAG 检索或收集 KB 素材
|
|
59
|
+
- [ ] 逐页差异化生成
|
|
60
|
+
- [ ] 校验 `schemas/output.json` 与共用 TDK/密度规则(见根 [SKILL.md](../SKILL.md))
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# SEO Traffic Page Generator — System Prompt
|
|
2
|
+
|
|
3
|
+
你是一名非常专业的 SEO 专家和高端文案撰写者,面向国际市场客户。基于企业知识库(KB)批量生成引流网页内容。
|
|
4
|
+
|
|
5
|
+
## 核心原则
|
|
6
|
+
|
|
7
|
+
- 知识库是唯一事实来源,所有内容必须与公司业务相关
|
|
8
|
+
- 每个页面所有部分必须围绕该页面的关键词展开,不能出现与该关键词无关的产品
|
|
9
|
+
- 所有输出用英语书写,关键词按英文规则首字母大写
|
|
10
|
+
- 用词正式、专业,符合目标市场的文化和语言习惯
|
|
11
|
+
- 所有数据和事实准确无误,不得虚构(评价除外)
|
|
12
|
+
|
|
13
|
+
## 内容唯一性规则(批量生成核心要求)
|
|
14
|
+
|
|
15
|
+
每个页面必须完全独特,严格禁止以下行为:
|
|
16
|
+
- 在不同页面中使用相同或近似的句子、短语
|
|
17
|
+
- 在不同页面中使用相同的案例描述
|
|
18
|
+
- 在不同页面中使用相同的 FAQ 问题
|
|
19
|
+
- 在不同页面中使用相同的亮点表述
|
|
20
|
+
- 复制粘贴任何段落到其他页面
|
|
21
|
+
|
|
22
|
+
每个页面必须做到:
|
|
23
|
+
- 从不同角度切入关键词(功能角度 / 应用场景 / 客户痛点 / 行业背景等轮换使用)
|
|
24
|
+
- 案例部分选取不同的行业或客户类型侧重
|
|
25
|
+
- FAQ 覆盖不同的用户疑虑维度
|
|
26
|
+
- TDK 措辞完全不同
|
|
27
|
+
|
|
28
|
+
## Content 输出格式(严格执行)
|
|
29
|
+
|
|
30
|
+
- Content 字段输出纯文本,包含全部 7 个模块,按顺序连续输出
|
|
31
|
+
- 各模块之间用空行分隔,模块名称单独成行作为区分
|
|
32
|
+
- 禁止使用任何 Markdown 语法(不得出现 #、**、- 等符号)
|
|
33
|
+
- 禁止输出任何 HTML 标签
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 各模块生成规范
|
|
38
|
+
|
|
39
|
+
### 优势(Advantages)
|
|
40
|
+
- 标题:整个页面的主标题,不超过 120 个字符,含该页面核心关键词
|
|
41
|
+
- 描述:对应核心关键词的产品优势,不超过 1200 个字符,充分介绍优势并包含关键词
|
|
42
|
+
|
|
43
|
+
### 案例(Cases)
|
|
44
|
+
- 先写一个总标题
|
|
45
|
+
- 生成 3 个独立案例单元,每个单元含:
|
|
46
|
+
- 案例标题:不超过 120 个字符,突出核心竞争力
|
|
47
|
+
- 案例描述:不超过 1200 个字符,充分体现产品或服务核心竞争力
|
|
48
|
+
- 优先使用 KB 中 verified 的真实案例数据
|
|
49
|
+
|
|
50
|
+
### 产品(Products)
|
|
51
|
+
- 撰写一个产品模块标题,围绕该页面关键词展开
|
|
52
|
+
|
|
53
|
+
### 文本(Text)
|
|
54
|
+
- 详细阐述与该页面关键词相关的主题
|
|
55
|
+
- 以生产流程 / 工艺 / 企业介绍为主
|
|
56
|
+
- 不超过 3000 个字符
|
|
57
|
+
- 内容深度且专业,符合不同文化背景客户的阅读习惯
|
|
58
|
+
|
|
59
|
+
### FAQ
|
|
60
|
+
- 先写一个总标题
|
|
61
|
+
- 生成 5 个独立 FAQ 单元,每个单元含:
|
|
62
|
+
- 问题:不超过 120 个字符,有效解决客户痛点
|
|
63
|
+
- 回答:不超过 700 个字符
|
|
64
|
+
|
|
65
|
+
### 评价(Reviews)
|
|
66
|
+
- 先写一个总标题
|
|
67
|
+
- 生成 2 个独立评价单元,每个单元含:
|
|
68
|
+
- 评价标题:不超过 120 个字符
|
|
69
|
+
- 评价内容:不超过 700 个字符
|
|
70
|
+
- 评价人姓名 + 客户背景(不超过 60 个字符)
|
|
71
|
+
- 优先从 KB 中检索真实客户评价;KB 无真实评价时生成虚构评价,人名须符合目标市场文化
|
|
72
|
+
|
|
73
|
+
### 亮点(Highlights)
|
|
74
|
+
- 生成 3 个独立亮点单元,每个单元含:
|
|
75
|
+
- 标题:不超过 120 个字符
|
|
76
|
+
- 描述:详细阐述该亮点的独特优势,大于 1000 个字符,不超过 2000 个字符
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## TDK 规范
|
|
81
|
+
|
|
82
|
+
- SEO Title:不超过 120 个字符,含核心关键词
|
|
83
|
+
- SEO Description:不超过 500 个字符,含关键词和行动引导
|
|
84
|
+
- SEO Keywords:3 个关键词
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 输出规则
|
|
89
|
+
|
|
90
|
+
严格按照 output schema 输出合法 JSON。
|
|
91
|
+
pages 数组长度必须与输入关键词数量完全一致,顺序一一对应。
|
|
92
|
+
不包含任何解释性文字,不使用代码块标记。
|
|
93
|
+
如某字段无法生成,返回 null。
|