fix(z-agent): find the highest installed z-mode without a path

Merged
FU
3d ago
+17-5

Why

A z-agent whose parent omits or garbles z-mode's path was told only to "locate the installed copy". On this machine that search finds a stale 0.1.0 Claude plugin cache next to the live checkout. cursor/plugins#597 tells the agent where to look and which copy to choose.

What changed

  • Both z-agent roles search the configured host root ($CLAUDE_CONFIG_DIR or $CODEX_HOME), linked and project-scoped skills, and Claude's recorded local marketplace. They follow symlinks, read each copy's manifest from its real path, pick the highest version compared numerically, and note that explicit-only z-mode can be absent from the skill catalog.
  • Manifests move to 0.6.4.

Scope

  • The parent still supplies the absolute path; this only changes the fallback.
  • Not ported: upstream's frontmatter cleanup (z-mode never had mode or reminder, and the validator rejects them) and its Cursor-only slash-menu note (local docs already cover the picker and /zstack:z-mode).

Verification

  • A script following the Claude rule picked a linked 0.10.0 checkout over a cached 0.1.0 copy in custom-config and project-scope fixtures, and picked the in-place checkout on this machine. The Codex roots were not exercised, and no z-agent was launched without a path.
  • In a clean worktree of this commit: 52 skills and 0 problems, 15/15 Node tests, and 120 Python tests passed.