forked from wshobson/agents
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
270 lines (224 loc) · 8.74 KB
/
install.ps1
File metadata and controls
270 lines (224 loc) · 8.74 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
# Claude Code Agents Installation Script for Windows
# This script automatically installs and configures agents for Claude Code
$ErrorActionPreference = "Stop"
# Configuration
$ClaudeDir = "$env:USERPROFILE\.claude"
$AgentsDir = "$ClaudeDir\agents"
$ConfigFile = "$ClaudeDir\claude_code_config.json"
$BackupSuffix = ".backup.$(Get-Date -Format 'yyyyMMdd_HHmmss')"
$RepoUrl = "https://github.com/OrrisTech/agents.git"
# Colors for output
function Write-ColorOutput {
param([string]$Text, [string]$Color = "White")
Write-Host $Text -ForegroundColor $Color
}
# Print header
function Write-Header {
param([string]$Text)
Write-Host ""
Write-ColorOutput ("=" * 50) "Blue"
Write-ColorOutput $Text "Blue"
Write-ColorOutput ("=" * 50) "Blue"
Write-Host ""
}
# Check if command exists
function Test-Command {
param([string]$Command)
$null = Get-Command $Command -ErrorAction SilentlyContinue
return $?
}
# Create backup
function New-Backup {
param([string]$FilePath)
if (Test-Path $FilePath) {
$BackupPath = "$FilePath$BackupSuffix"
Copy-Item $FilePath $BackupPath
Write-ColorOutput "✓ Backed up: $FilePath" "Green"
}
}
# Welcome message
Write-Header "Claude Code Agents Installer"
Write-ColorOutput "This script will install Claude Code agents to enhance your development experience." "Yellow"
Write-Host ""
# Check prerequisites
Write-ColorOutput "Checking prerequisites..." "Yellow"
if (-not (Test-Command "git")) {
Write-ColorOutput "✗ Git is not installed. Please install git first." "Red"
Write-ColorOutput " Download from: https://git-scm.com/download/windows" "Yellow"
exit 1
}
# Check if Claude Code directory exists
if (-not (Test-Path $ClaudeDir)) {
Write-ColorOutput "Creating Claude Code directory at $ClaudeDir..." "Yellow"
New-Item -ItemType Directory -Path $ClaudeDir -Force | Out-Null
}
# Clone or update agents repository
Write-Header "Setting up Agents"
if (Test-Path $AgentsDir) {
Write-ColorOutput "Agents directory already exists. Updating..." "Yellow"
Push-Location $AgentsDir
# Check if it's a git repository
if (Test-Path ".git") {
# Stash any local changes
git stash push -m "Auto-stash before update $(Get-Date -Format 'yyyyMMdd_HHmmss')" 2>$null | Out-Null
# Pull latest changes
try {
git pull origin main 2>$null
if ($LASTEXITCODE -ne 0) {
git pull origin master 2>$null
}
Write-ColorOutput "✓ Agents updated successfully" "Green"
}
catch {
Write-ColorOutput "⚠ Could not update repository. Using existing version." "Yellow"
}
}
else {
Write-ColorOutput "⚠ Existing directory is not a git repository. Skipping update." "Yellow"
}
Pop-Location
}
else {
Write-ColorOutput "Cloning agents repository..." "Yellow"
try {
git clone $RepoUrl $AgentsDir
Write-ColorOutput "✓ Agents cloned successfully" "Green"
}
catch {
Write-ColorOutput "✗ Failed to clone repository. Please check your internet connection." "Red"
exit 1
}
}
# Generate agents configuration
Write-Header "Generating Configuration"
Push-Location $AgentsDir
Write-ColorOutput "Scanning for agent files..." "Yellow"
$agents = @()
$agentFiles = Get-ChildItem -Path . -Filter "*.md" | Where-Object { $_.Name -notmatch "^(README|LICENSE)" }
foreach ($file in $agentFiles) {
$agentId = $file.BaseName
$agentName = (Get-Culture).TextInfo.ToTitleCase($agentId.Replace("-", " "))
# Extract description from file
$content = Get-Content $file.FullName -First 10 -ErrorAction SilentlyContinue
$description = ($content | Where-Object { $_ -match "^[A-Z]" } | Select-Object -First 1) -replace '"', '\"'
if (-not $description) {
$description = "Specialized agent for $agentName"
}
if ($description.Length -gt 100) {
$description = $description.Substring(0, 100)
}
$agents += @{
id = $agentId
name = $agentName
description = $description
file = $file.Name
}
}
# Create agents.json
$agentsConfig = @{
agents = $agents
}
$agentsConfig | ConvertTo-Json -Depth 3 | Set-Content "$AgentsDir\agents.json"
$agentCount = $agents.Count
Write-ColorOutput "✓ Found and configured $agentCount agents" "Green"
Pop-Location
# Update Claude Code configuration
Write-Header "Updating Claude Code Configuration"
if (Test-Path $ConfigFile) {
New-Backup $ConfigFile
# Read existing configuration
$config = Get-Content $ConfigFile -Raw | ConvertFrom-Json
# Check if agents configuration already exists
if ($config.PSObject.Properties.Name -contains "agents") {
Write-ColorOutput "⚠ Agents configuration already exists in claude_code_config.json" "Yellow"
$response = Read-Host "Would you like to update it? (y/n)"
if ($response -eq 'y') {
$config.agents = @{
directory = "./agents"
config = "./agents/agents.json"
}
$config | ConvertTo-Json -Depth 3 | Set-Content $ConfigFile
Write-ColorOutput "✓ Updated agents configuration" "Green"
}
else {
Write-ColorOutput "Skipping configuration update." "Yellow"
}
}
else {
# Add agents configuration
$config | Add-Member -NotePropertyName "agents" -NotePropertyValue @{
directory = "./agents"
config = "./agents/agents.json"
}
$config | ConvertTo-Json -Depth 3 | Set-Content $ConfigFile
Write-ColorOutput "✓ Added agents configuration" "Green"
}
}
else {
# Create new configuration file
$newConfig = @{
name = "Claude Code Configuration"
agents = @{
directory = "./agents"
config = "./agents/agents.json"
}
}
$newConfig | ConvertTo-Json -Depth 3 | Set-Content $ConfigFile
Write-ColorOutput "✓ Created new claude_code_config.json with agents configuration" "Green"
}
# Create quick reference
Write-Header "Creating Quick Reference"
@'
# Claude Code Agents Quick Reference
## Available Agents
To use an agent, simply describe your task and Claude Code will automatically select the appropriate agent, or you can explicitly request a specific agent.
### Development & Architecture
- **backend-architect** - API design, microservices, databases
- **frontend-developer** - React, responsive layouts, state management
- **mobile-developer** - React Native, Flutter, native integrations
- **ui-ux-designer** - Interface design, wireframes, design systems
### Programming Languages
- **python-pro** - Advanced Python features and optimizations
- **typescript-pro** - TypeScript with strict type safety
- **golang-pro** - Go with goroutines and channels
- **rust-pro** - Rust ownership and lifetimes
- **java-pro** - Modern Java with streams and concurrency
### Infrastructure & DevOps
- **devops-troubleshooter** - Debug production issues
- **cloud-architect** - AWS/Azure/GCP infrastructure
- **kubernetes-architect** - K8s and cloud-native design
- **deployment-engineer** - CI/CD pipelines, Docker
### Quality & Security
- **code-reviewer** - Code quality and security review
- **security-auditor** - Vulnerability assessment, OWASP
- **test-automator** - Unit, integration, e2e tests
- **debugger** - Error diagnosis and fixes
### Data & AI
- **data-scientist** - SQL, BigQuery, data analysis
- **ai-engineer** - LLM applications, RAG systems
- **ml-engineer** - ML pipelines, model serving
## Usage Examples
1. "Review my code for security issues" → Activates security-auditor
2. "Help me optimize this Python function" → Activates python-pro
3. "Design a REST API for user management" → Activates backend-architect
4. "Debug this production error" → Activates devops-troubleshooter
## Commands
- List agents: `/agents`
- Get help: `/help`
'@ | Set-Content "$AgentsDir\QUICK_REFERENCE.md"
Write-ColorOutput "✓ Created quick reference at $AgentsDir\QUICK_REFERENCE.md" "Green"
# Final summary
Write-Header "Installation Complete!"
Write-ColorOutput "✅ Successfully installed $agentCount Claude Code agents" "Green"
Write-Host ""
Write-ColorOutput "📁 Agents location: $AgentsDir" "Cyan"
Write-ColorOutput "📋 Configuration: $ConfigFile" "Cyan"
Write-ColorOutput "📖 Quick reference: $AgentsDir\QUICK_REFERENCE.md" "Cyan"
Write-Host ""
Write-ColorOutput "🚀 Your Claude Code agents are now ready to use!" "Green"
Write-ColorOutput " Restart Claude Code to load the new configuration." "Yellow"
Write-Host ""
Write-ColorOutput "💡 Tip: View the quick reference to see all available agents and usage examples" "Yellow"
Write-Host ""
Write-Host "Press any key to exit..."
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")