Files
AgentCompany/built-in skills/scripts/i18n/localize-agents-zh.ps1
T
ZacharyZhang-NY 86aa6fdb29 Ship skills built-in: bundle the catalogue, assign per hire, force humanizer
Skills no longer come from the user's ~/.agents library - most users have
none, and the CEO branch that compiled the entire catalogue into its
prompt overflowed the model context (1.1MB) and failed every CEO run.

- Bundle "built-in skills/" with the app (extraResources) and stage it
  at startup into <profile>/builtin-skills as one dir-per-skill copy -
  both bundle shapes (SKILL.md dirs and flat category .md files)
  normalize into the same importable layout
- Import the staged catalogue per org at startup and inside onboarding,
  so the CEO's first run already carries it
- Forced house style: resolveRuntimeSnapshot unions the humanizer skill
  into every agent's runtime (CEO included) as a resolution rule - no
  binding row to forget, delete, or bypass; revoke_skill refuses it
- CEO staffs hires with skills: hire_agent accepts a skills array,
  grant_skill/revoke_skill adjust later, list_skills now shows
  descriptions from skill frontmatter
- Kill the c_suite compile-all branch; everyone resolves bindings-only,
  capped at 200k chars with omissions named in the prompt
- Remove the Skills settings page and its import/sync/test IPC surface;
  drop ~/.agents discovery and the AGENTCOMPANY_NEW_SKILLS_ROOT seam in
  favor of AGENTCOMPANY_NEW_BUILTIN_SKILLS_DIR
- Tests: staging/import/forced-resolution/cap units, real-bundle CI
  check, e2e asserts the tab is gone and the catalogue self-imports
2026-07-08 21:18:50 -04:00

38 lines
1.6 KiB
PowerShell

param(
[string[]]$TargetDirs = @(
"$env:USERPROFILE\.github\agents",
"$env:USERPROFILE\.copilot\agents"
)
)
$mapFile = Join-Path $PSScriptRoot "agent-names-zh.json"
$map = Get-Content $mapFile -Raw -Encoding UTF8 | ConvertFrom-Json
$totalUpdated = 0
foreach ($dir in $TargetDirs) {
if (-not (Test-Path $dir)) { Write-Warning "Skip (not found): $dir"; continue }
$files = Get-ChildItem "$dir\*.md" -ErrorAction SilentlyContinue
$updated = 0
foreach ($f in $files) {
$raw = [System.IO.File]::ReadAllText($f.FullName, [System.Text.Encoding]::UTF8)
if (-not $raw.StartsWith("---")) { continue }
$endIdx = $raw.IndexOf("---", 3)
if ($endIdx -lt 0) { continue }
$yaml = $raw.Substring(3, $endIdx - 3)
if (-not ($yaml -match "(?m)^name:\s*(.+)$")) { continue }
$currentName = $Matches[1].Trim()
$entry = $map.$currentName
if (-not $entry) { continue }
$newYaml = $yaml -replace "(?m)^name:\s*.+$", "name: $($entry.name)"
if ($newYaml -match "(?m)^description:") {
$newYaml = $newYaml -replace "(?m)^description:\s*.+$", "description: $($entry.description)"
}
$newContent = "---" + $newYaml + "---" + $raw.Substring($endIdx + 3)
[System.IO.File]::WriteAllText($f.FullName, $newContent, [System.Text.Encoding]::UTF8)
$updated++
}
Write-Host "OK: $updated agents localized -> $dir"
$totalUpdated += $updated
}
Write-Host "Total: $totalUpdated agent files updated."
Write-Host "Reload VS Code window (Ctrl+Shift+P -> Reload Window) to apply."