fix(cli): harden config prime-agent skills sync + install /mcpctl switcher extension
#94
Reference in New Issue
Block a user
Delete Branch "feat/config-prime-agent"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #93 (merged). Hardens the
config prime-agent/skills sync against the silent-data-loss paths found in review, and adds the in-app/mcpctlproject switcher.Safety/correctness fixes
The shared, hand-editable
~/.prime/agenttree must never suffer silent data loss:loadPrimeAgentSettingsnow fails loudly and refuses to overwrite a corrupt file (previously it swallowed the parse error and rewrote the whole file, destroying every non-mcpServerssetting).mcpServersentry is merged, preserving user-added fields, rather than replaced wholesale.rm -rf— under the prime-agent target the sync preserves untracked, pre-existing skill dirs (e.g. hand-authoredsre) instead of clobbering them because the state file is fresh.config prime-agentnow provisionsmcp:<project>inauth.json(via--token, an existing entry, or auto-mint through POST/api/v1/mcptokens) instead of only documenting it..mcpctl-projectmarker is written only when none exists up-tree, and never from$HOME(running it from home used to scope every later sync).--agentvalidation — an unknown value errors instead of silently running the Claude sync.DRY
The near-verbatim 180-line
runPrimeAgentSkillsSynccopy is gone —runSkillsSyncnow acceptstarget: 'claude' | 'prime-agent'and the prime-agent module is a thin wrapper.New feature:
/mcpctlswitcher extensionconfig prime-agentinstalls a/mcpctlproject-switcher extension into~/.prime/agent/extensions/(skip with--skip-extension). It lists projects viamcpctl get projects -o json, lets you pick one from the prime-agent TUI (ctx.ui.select), applies the switch through the CLI, and callsctx.reload()so MCP servers, credentials and skills take effect without an app restart.Validation
tsc --buildclean; full CLI suite 538 tests green (new coverage: settings corruption, entry merge, auth provisioning, extension install/skip, marker$HOMEhandling, untracked/cross-project skill preservation,--agentvalidation).sreskill.config prime-agentsync + install /mcpctl switcher extensionPull request closed