-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
341 lines (311 loc) · 17.6 KB
/
install.ps1
File metadata and controls
341 lines (311 loc) · 17.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# Claude GitHub - Installation Script (Windows PowerShell)
# Installs the GitHub optimization skill suite for Claude Code
$ErrorActionPreference = "Stop"
Clear-Host
Write-Host ""
Write-Host @"
██████╗██╗ █████╗ ██╗ ██╗██████╗ ███████╗
██╔════╝██║ ██╔══██╗██║ ██║██╔══██╗██╔════╝
██║ ██║ ███████║██║ ██║██║ ██║█████╗
██║ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝
╚██████╗███████╗██║ ██║╚██████╔╝██████╔╝███████╗
╚═════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
██████╗ ██╗████████╗██╗ ██╗██╗ ██╗██████╗
██╔════╝ ██║╚══██╔══╝██║ ██║██║ ██║██╔══██╗
██║ ███╗██║ ██║ ███████║██║ ██║██████╔╝
██║ ██║██║ ██║ ██╔══██║██║ ██║██╔══██╗
╚██████╔╝██║ ██║ ██║ ██║╚██████╔╝██████╔╝
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝
"@ -ForegroundColor Cyan
Write-Host " " -NoNewline
Write-Host "░▒▓" -NoNewline -ForegroundColor Magenta
Write-Host " v1.2 " -NoNewline -ForegroundColor Green
Write-Host "▓▒░" -NoNewline -ForegroundColor Magenta
Write-Host " Repository Optimization Skills for Claude Code" -ForegroundColor DarkGray
Write-Host ""
# Check prerequisites
if (-not (Get-Command gh -ErrorAction SilentlyContinue)) {
Write-Host " [!] GitHub CLI (gh) not detected" -ForegroundColor Yellow
Write-Host " Required for repo operations. Install: winget install GitHub.cli" -ForegroundColor DarkGray
Write-Host ""
}
# Determine Claude skills directory
$ClaudeDir = Join-Path $env:USERPROFILE ".claude"
$SkillsDir = Join-Path $ClaudeDir "skills"
$AgentsDir = Join-Path $ClaudeDir "agents"
# Create directories
$dirs = @(
(Join-Path $SkillsDir "github\references"),
(Join-Path $SkillsDir "github-audit"),
(Join-Path $SkillsDir "github-readme"),
(Join-Path $SkillsDir "github-legal"),
(Join-Path $SkillsDir "github-meta"),
(Join-Path $SkillsDir "github-seo"),
(Join-Path $SkillsDir "github-community"),
(Join-Path $SkillsDir "github-release"),
(Join-Path $SkillsDir "github-empire"),
$AgentsDir
)
foreach ($dir in $dirs) {
if (-not (Test-Path $dir)) {
New-Item -ItemType Directory -Path $dir -Force | Out-Null
}
}
# Get script directory
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
Write-Host " " -NoNewline
Write-Host "Installing skills..." -ForegroundColor Cyan
Write-Host ""
Copy-Item (Join-Path $ScriptDir "github\SKILL.md") (Join-Path $SkillsDir "github\SKILL.md") -Force
Write-Host " " -NoNewline
Write-Host "[+]" -NoNewline -ForegroundColor Green
Write-Host " Orchestrator " -NoNewline
Write-Host "routes commands to 8 sub-skills" -ForegroundColor DarkGray
Copy-Item (Join-Path $ScriptDir "github\references\*.md") (Join-Path $SkillsDir "github\references\") -Force
Write-Host " " -NoNewline
Write-Host "[+]" -NoNewline -ForegroundColor Green
Write-Host " 9 Reference Files " -NoNewline
Write-Host "SEO, legal, readme, community guides" -ForegroundColor DarkGray
$skills = @("github-audit", "github-legal", "github-community", "github-release", "github-seo", "github-meta", "github-readme", "github-empire")
foreach ($skill in $skills) {
Copy-Item (Join-Path $ScriptDir "skills\$skill\SKILL.md") (Join-Path $SkillsDir "$skill\SKILL.md") -Force
}
Write-Host " " -NoNewline
Write-Host "[+]" -NoNewline -ForegroundColor Green
Write-Host " 8 Sub-Skills " -NoNewline
Write-Host "audit, legal, community, release, seo, meta, readme, empire" -ForegroundColor DarkGray
$agents = @("github-legal", "github-community", "github-release", "github-seo", "github-meta", "github-readme")
foreach ($agent in $agents) {
Copy-Item (Join-Path $ScriptDir "agents\$agent.md") (Join-Path $AgentsDir "$agent.md") -Force
}
Write-Host " " -NoNewline
Write-Host "[+]" -NoNewline -ForegroundColor Green
Write-Host " 6 Scoring Agents " -NoNewline
Write-Host "parallel audit across 6 categories" -ForegroundColor DarkGray
Write-Host ""
Write-Host " Skills installed." -ForegroundColor Green
# ─────────────────────────────────────────────────
# GUIDED SETUP: DataForSEO
# ─────────────────────────────────────────────────
Write-Host ""
Write-Host " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Magenta
Write-Host " SERVICE SETUP" -ForegroundColor Yellow
Write-Host " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Magenta
Write-Host ""
Write-Host " Two services are " -NoNewline
Write-Host "strongly recommended" -NoNewline -ForegroundColor White
Write-Host " to unlock the full suite."
Write-Host " Setting them up takes about 5 minutes and is well worth it."
Write-Host ""
Write-Host " " -NoNewline
Write-Host "--- 1/2 ---" -NoNewline -ForegroundColor Magenta
Write-Host " " -NoNewline
Write-Host "DataForSEO" -NoNewline -ForegroundColor White
Write-Host " (live keyword data, SERP rankings, AI visibility)" -ForegroundColor DarkGray
Write-Host ""
Write-Host " This powers real keyword research with actual search volume and"
Write-Host " difficulty data. Without it, SEO recommendations are best-guess only."
Write-Host ""
$DataForSeoDone = $false
$setupDfs = Read-Host " Set up DataForSEO now? (y/n)"
Write-Host ""
if ($setupDfs -match "^[Yy]") {
$nodeCmd = Get-Command node -ErrorAction SilentlyContinue
if (-not $nodeCmd) {
Write-Host " [!] Node.js is required for the DataForSEO MCP server." -ForegroundColor Yellow
Write-Host " Install it from https://nodejs.org/ and re-run this installer." -ForegroundColor DarkGray
Write-Host " Skipping DataForSEO for now." -ForegroundColor DarkGray
} else {
$nodeVer = [int](node -v).TrimStart('v').Split('.')[0]
if ($nodeVer -lt 20) {
Write-Host " [!] Node.js 20+ required. You have $(node -v)." -ForegroundColor Yellow
Write-Host " Update Node.js and re-run this installer." -ForegroundColor DarkGray
} else {
Write-Host " If you don't have an account yet:" -ForegroundColor DarkGray
Write-Host " 1. Sign up free at " -NoNewline -ForegroundColor DarkGray
Write-Host "https://dataforseo.com" -ForegroundColor Cyan
Write-Host " 2. Find your login + password at " -NoNewline -ForegroundColor DarkGray
Write-Host "https://app.dataforseo.com/api-access" -ForegroundColor Cyan
Write-Host ""
$DfLogin = Read-Host " DataForSEO Login (email)"
$DfPassword = Read-Host " DataForSEO Password" -AsSecureString
$DfPasswordPlain = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($DfPassword))
Write-Host ""
if ($DfLogin -and $DfPasswordPlain) {
# Install DataForSEO skill and agent
$dfSkillDir = Join-Path $SkillsDir "github-dataforseo"
if (-not (Test-Path $dfSkillDir)) { New-Item -ItemType Directory -Path $dfSkillDir -Force | Out-Null }
Copy-Item (Join-Path $ScriptDir "extensions\dataforseo\skills\github-dataforseo\SKILL.md") (Join-Path $dfSkillDir "SKILL.md") -Force
Copy-Item (Join-Path $ScriptDir "extensions\dataforseo\agents\github-dataforseo.md") (Join-Path $AgentsDir "github-dataforseo.md") -Force
# Pre-download MCP server
Write-Host " Downloading DataForSEO MCP server..." -ForegroundColor DarkGray
npx -y @anthropic/data-for-seo-mcp --version 2>$null | Out-Null
# Configure MCP server
$SettingsFile = Join-Path $ClaudeDir "settings.json"
try {
if (Test-Path $SettingsFile) {
$settings = Get-Content $SettingsFile -Raw | ConvertFrom-Json -AsHashtable
} else {
$settings = @{}
}
if (-not $settings.ContainsKey('mcpServers')) { $settings['mcpServers'] = @{} }
$settings['mcpServers']['dataforseo'] = @{
command = 'npx'
args = @('-y', '@anthropic/data-for-seo-mcp')
env = @{
DATAFORSEO_LOGIN = $DfLogin
DATAFORSEO_PASSWORD = $DfPasswordPlain
}
}
$settings | ConvertTo-Json -Depth 10 | Set-Content $SettingsFile -Encoding UTF8
Write-Host " " -NoNewline
Write-Host "[+]" -NoNewline -ForegroundColor Green
Write-Host " DataForSEO " -NoNewline
Write-Host "MCP server configured" -ForegroundColor DarkGray
$DataForSeoDone = $true
} catch {
Write-Host " [!] Could not auto-configure. You can set it up manually later:" -ForegroundColor Yellow
Write-Host " claude mcp add dataforseo-mcp-server" -ForegroundColor DarkGray
}
} else {
Write-Host " No credentials entered. Skipping DataForSEO." -ForegroundColor DarkGray
}
}
}
} else {
Write-Host " Skipped. You can set it up later:" -ForegroundColor DarkGray
Write-Host " powershell -File extensions\dataforseo\install.ps1" -ForegroundColor DarkGray
}
# ─────────────────────────────────────────────────
# GUIDED SETUP: KIE.ai
# ─────────────────────────────────────────────────
Write-Host ""
Write-Host " " -NoNewline
Write-Host "--- 2/2 ---" -NoNewline -ForegroundColor Magenta
Write-Host " " -NoNewline
Write-Host "KIE.ai" -NoNewline -ForegroundColor White
Write-Host " (AI-generated banners and profile avatars)" -ForegroundColor DarkGray
Write-Host ""
Write-Host " This generates professional banner images for READMEs and"
Write-Host " AI profile avatars for your GitHub account. About 4 cents per image."
Write-Host " Without it, image generation is skipped entirely."
Write-Host ""
$EnvFile = Join-Path $SkillsDir "github\.env"
$KieDone = $false
$setupKie = Read-Host " Set up KIE.ai now? (y/n)"
Write-Host ""
if ($setupKie -match "^[Yy]") {
Write-Host " If you don't have an account yet:" -ForegroundColor DarkGray
Write-Host " 1. Go to " -NoNewline -ForegroundColor DarkGray
Write-Host "https://kie.ai/api-key" -ForegroundColor Cyan
Write-Host " 2. Create an account and copy your API key" -ForegroundColor DarkGray
Write-Host ""
$KieKey = Read-Host " KIE.ai API Key"
Write-Host ""
if ($KieKey) {
# Write or update .env
if ((Test-Path $EnvFile) -and (Select-String -Path $EnvFile -Pattern "^KIE_API_KEY=" -Quiet)) {
(Get-Content $EnvFile) -replace "^KIE_API_KEY=.*", "KIE_API_KEY=$KieKey" | Set-Content $EnvFile -Encoding UTF8
} else {
"KIE_API_KEY=$KieKey" | Add-Content $EnvFile -Encoding UTF8
}
Write-Host " " -NoNewline
Write-Host "[+]" -NoNewline -ForegroundColor Green
Write-Host " KIE.ai " -NoNewline
Write-Host "API key saved to .env" -ForegroundColor DarkGray
$KieDone = $true
} else {
Write-Host " No key entered. Skipping KIE.ai." -ForegroundColor DarkGray
}
} else {
Write-Host " Skipped. You can add your key later to:" -ForegroundColor DarkGray
Write-Host " ~\.claude\skills\github\.env" -ForegroundColor DarkGray
}
# Create .env template if it doesn't exist yet (user skipped both)
if (-not (Test-Path $EnvFile)) {
@"
# Claude GitHub - API Credentials
#
# KIE.ai -- AI-generated banner images for READMEs
# Get your API key: https://kie.ai/api-key
KIE_API_KEY=
#
# DataForSEO credentials are NOT stored here.
# They are configured via the MCP server installer:
# powershell -File extensions\dataforseo\install.ps1
# See: https://dataforseo.com (free tier available)
"@ | Out-File -FilePath $EnvFile -Encoding UTF8
}
# ─────────────────────────────────────────────────
# SUMMARY
# ─────────────────────────────────────────────────
Write-Host ""
Write-Host " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Magenta
Write-Host " SETUP COMPLETE" -ForegroundColor Green
Write-Host " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -ForegroundColor Magenta
Write-Host ""
$dfsStatus = if ($DataForSeoDone) { "active" } else { "not configured" }
$dfsColor = if ($DataForSeoDone) { "Green" } else { "Yellow" }
$kieStatus = if ($KieDone) { "active" } else { "not configured" }
$kieColor = if ($KieDone) { "Green" } else { "Yellow" }
Write-Host " DataForSEO [" -NoNewline
Write-Host $dfsStatus -NoNewline -ForegroundColor $dfsColor
Write-Host "] | KIE.ai [" -NoNewline
Write-Host $kieStatus -NoNewline -ForegroundColor $kieColor
Write-Host "]"
Write-Host ""
Write-Host " " -NoNewline
Write-Host "Next step: restart Claude Code so the new skills load." -ForegroundColor White
Write-Host ""
Write-Host " How to restart:" -ForegroundColor Magenta
Write-Host " 1. " -NoNewline -ForegroundColor Cyan
Write-Host "Type " -NoNewline
Write-Host "/exit" -NoNewline -ForegroundColor White
Write-Host " to quit Claude Code"
Write-Host " 2. " -NoNewline -ForegroundColor Cyan
Write-Host "Run " -NoNewline
Write-Host "claude" -NoNewline -ForegroundColor White
Write-Host " again from your project folder"
Write-Host " 3. " -NoNewline -ForegroundColor Cyan
Write-Host "(optional) " -NoNewline -ForegroundColor DarkGray
Write-Host "Type " -NoNewline
Write-Host "/resume" -NoNewline -ForegroundColor White
Write-Host " to pick up where you left off"
Write-Host ""
Write-Host " Important:" -NoNewline -ForegroundColor Magenta
Write-Host " Run skills from inside the project you want to optimize."
Write-Host " The skills read your source code, configs, and git remote to make" -ForegroundColor DarkGray
Write-Host " informed recommendations. Running from an empty folder won't work well." -ForegroundColor DarkGray
Write-Host ""
Write-Host " Standard Operating Procedure (run in this order):" -ForegroundColor Magenta
Write-Host ""
Write-Host " Step 0 " -NoNewline -ForegroundColor White
Write-Host "/github audit " -NoNewline -ForegroundColor Cyan
Write-Host "Diagnose: score 0-100, generates your SOP" -ForegroundColor DarkGray
Write-Host " Step 1 " -NoNewline -ForegroundColor White
Write-Host "/github legal " -NoNewline -ForegroundColor Cyan
Write-Host "Foundation: license, SECURITY.md, CITATION.cff" -ForegroundColor DarkGray
Write-Host " Step 2 " -NoNewline -ForegroundColor White
Write-Host "/github community " -NoNewline -ForegroundColor Cyan
Write-Host "Infrastructure: templates, CoC, devcontainer" -ForegroundColor DarkGray
Write-Host " Step 3 " -NoNewline -ForegroundColor White
Write-Host "/github release " -NoNewline -ForegroundColor Cyan
Write-Host "Versioning: CHANGELOG, badges, releases" -ForegroundColor DarkGray
Write-Host " Step 4 " -NoNewline -ForegroundColor White
Write-Host "/github seo " -NoNewline -ForegroundColor Cyan
Write-Host "Research: keyword data for description + README" -ForegroundColor DarkGray
Write-Host " Step 5 " -NoNewline -ForegroundColor White
Write-Host "/github meta " -NoNewline -ForegroundColor Cyan
Write-Host "Settings: description, topics, features" -ForegroundColor DarkGray
Write-Host " Step 6 " -NoNewline -ForegroundColor White
Write-Host "/github readme " -NoNewline -ForegroundColor Cyan
Write-Host "Capstone: README optimization with SEO keywords" -ForegroundColor DarkGray
Write-Host " Step 7 " -NoNewline -ForegroundColor White
Write-Host "/github audit " -NoNewline -ForegroundColor Cyan
Write-Host "Measure: re-audit to verify improvement" -ForegroundColor DarkGray
Write-Host ""
Write-Host " After all repos are optimized:" -ForegroundColor DarkGray
Write-Host " " -NoNewline
Write-Host "/github empire " -NoNewline -ForegroundColor Cyan
Write-Host "Portfolio strategy, profile README, avatar" -ForegroundColor DarkGray
Write-Host ""