param(
[string]$Target = (Join-Path $HOME ".workbuddy\skills")
)
$ErrorActionPreference = "Stop"
$Source = Split-Path -Parent $MyInvocation.MyCommand.Path
$Dest = Join-Path $Target "hardware-product-development"
New-Item -ItemType Directory -Force -Path $Dest | Out-Null
Copy-Item -Path (Join-Path $Source "SKILL.md") -Destination $Dest -Force
Copy-Item -Path (Join-Path $Source "references") -Destination $Dest -Recurse -Force
Copy-Item -Path (Join-Path $Source "scripts") -Destination $Dest -Recurse -Force
Copy-Item -Path (Join-Path $Source "assets") -Destination $Dest -Recurse -Force
Write-Host "Installed to $Dest"
$Companion = Join-Path $Source "hardware-copilot"
if (Test-Path $Companion) {
$Dest2 = Join-Path $Target "hardware-copilot"
New-Item -ItemType Directory -Force -Path $Dest2 | Out-Null
Copy-Item -Path (Join-Path $Companion "SKILL.md") -Destination $Dest2 -Force
foreach ($dir in @("references", "scripts", "templates")) {
$Path = Join-Path $Companion $dir
if (Test-Path $Path) { Copy-Item -Path $Path -Destination $Dest2 -Recurse -Force }
}
Write-Host "Installed to $Dest2"
}
Write-Host "Restart or reload your agent runtime to pick up the skill."