param( [switch]$SkipVerify ) $ErrorActionPreference = "Stop" $Root = Resolve-Path (Join-Path $PSScriptRoot "..\..\..") $LocalEnvPath = Join-Path $PSScriptRoot ".env.local" if (Test-Path $LocalEnvPath) { Get-Content $LocalEnvPath | ForEach-Object { $line = $_.Trim() if (-not $line -or $line.StartsWith("#") -or -not $line.Contains("=")) { return } $parts = $line.Split("=", 2) $name = $parts[0].Trim() $value = $parts[1].Trim() if ($name -and -not [Environment]::GetEnvironmentVariable($name, "Process")) { [Environment]::SetEnvironmentVariable($name, $value, "Process") } } } Push-Location $Root try { if (-not $SkipVerify) { Write-Host "[verify] npm pack + install smoke + npx smoke" -ForegroundColor Cyan npm run claude-voc:npm-pack if ($LASTEXITCODE -ne 0) { throw "npm package verification failed." } } Write-Host "[auth] checking npm auth" -ForegroundColor Cyan cmd /c "npm whoami >nul 2>nul" if ($LASTEXITCODE -ne 0 -and -not $env:NPM_TOKEN -and -not $env:NODE_AUTH_TOKEN) { throw 'npm auth missing. Run npm login, or set NPM_TOKEN/NODE_AUTH_TOKEN and retry.' } Write-Host "[publish] npm publish" -ForegroundColor Cyan npm run claude-voc:npm-publish if ($LASTEXITCODE -ne 0) { throw "npm publish failed." } Write-Host "[done] published @vocmarket/voc-skill" -ForegroundColor Green } finally { Pop-Location }