param(
    [string]$CodexHome = "$env:USERPROFILE\.codex",
    [string]$ClaudeHome = "$env:USERPROFILE\.claude"
)

$ErrorActionPreference = "Stop"

$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..")

$CodexSkillSource = Join-Path $RepoRoot ".codex\skills\google-ads-client-report"
$ClaudeSkillSource = Join-Path $RepoRoot ".claude\skills\google-ads-client-report"
$ClaudeCommandSource = Join-Path $RepoRoot ".claude\commands\raport-klienta.md"

$CodexSkillTarget = Join-Path $CodexHome "skills\google-ads-client-report"
$ClaudeSkillTarget = Join-Path $ClaudeHome "skills\google-ads-client-report"
$ClaudeCommandTarget = Join-Path $ClaudeHome "commands\raport-klienta.md"

New-Item -ItemType Directory -Force $CodexSkillTarget | Out-Null
New-Item -ItemType Directory -Force $ClaudeSkillTarget | Out-Null
New-Item -ItemType Directory -Force (Split-Path $ClaudeCommandTarget) | Out-Null

Copy-Item -Recurse -Force (Join-Path $CodexSkillSource "*") $CodexSkillTarget
Copy-Item -Recurse -Force (Join-Path $ClaudeSkillSource "*") $ClaudeSkillTarget
Copy-Item -Force $ClaudeCommandSource $ClaudeCommandTarget

Write-Host "Installed Codex skill: $CodexSkillTarget"
Write-Host "Installed Claude skill: $ClaudeSkillTarget"
Write-Host "Installed Claude command: $ClaudeCommandTarget"
