-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
53 lines (45 loc) · 1.72 KB
/
Copy pathinstall.ps1
File metadata and controls
53 lines (45 loc) · 1.72 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
param(
[string]$TargetDir = ".opencode\skills",
[string]$RepoUrl = "https://github.com/schizo16/opencode-skillforge.git"
)
$ErrorActionPreference = "Stop"
$TempDir = Join-Path $env:TEMP "skillforge-install-$(Get-Random)"
$SkillPath = Join-Path $TargetDir "skillforge"
# Check git availability
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
Write-Error "git is required but not installed or not in PATH."
exit 1
}
try {
# Ensure target directory exists
New-Item -ItemType Directory -Path $TargetDir -Force | Out-Null
# Check for existing installation
if (Test-Path $SkillPath) {
Write-Error "$SkillPath already exists. Remove it first or install manually."
exit 1
}
# Clone to temp directory
Write-Host "Cloning SkillForge from $RepoUrl ..."
& git clone --depth 1 $RepoUrl $TempDir
if ($LASTEXITCODE -ne 0) {
throw "Failed to clone repository: $RepoUrl"
}
# Verify source path exists
$SourcePath = Join-Path $TempDir ".opencode\skills\skillforge"
if (-not (Test-Path $SourcePath)) {
Write-Error "SkillForge skill not found at .opencode/skills/skillforge in the cloned repository."
exit 1
}
# Copy only the skillforge skill
Copy-Item -Recurse -Path $SourcePath -Destination $SkillPath
Write-Host "Done. SkillForge installed to $SkillPath"
Write-Host ""
Write-Host "To verify, run in OpenCode:"
Write-Host " Use the SkillForge skill. Make a skill that reviews frontend code. Do not create files yet."
Write-Host "Expected output: Skill Intent Analysis, Existing Skill Check, Blocking/Configuration Questions"
} finally {
# Clean up temp directory on any exit
if (Test-Path $TempDir) {
Remove-Item -Recurse -Path $TempDir -Force -ErrorAction SilentlyContinue
}
}