feat(workspace): publish a project skill to the workspace over `serve` HTTP

Merged
SA
2mo ago
+780-31

Issue for this PR

No public issue. The consumer is the IDE extension's /workspace publish chat command.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

skill publish works from the CLI and TUI, but the IDE extension runs serve headless. serve is also the only process holding the extension's workspace pin, so publishing there targets the workspace selected in the panel.

  • Routes. GET /altimate/skill/publishable lists the project skills that can be published. POST /altimate/skill/publish { name } runs publishSkill, so the pin, ledger and wording match the CLI.
    • The pilot and origin gate is the one /altimate/workspace/* uses, and now also refuses a browser's cross-site Sec-Fetch-Site.
    • Refusals return 422; 409 stays the pilot gate.
    • An unknown name returns 404 with a case hint.
  • Reload. The registry is reloaded in-context (Config.Service.invalidate() + Skill.Service.refresh()), so a skill written after start is found, even in a new directory.
  • Workspace-owned skills. isManagedSkill also recognises skills the extension delivered (.altimate-managed.json) and a snapshot above the project directory.
  • Discovery. Skills are added concurrently, so a synced copy could replace the user's own same-name skill. The user's skill then vanished from the list and couldn't be updated. Now a snapshot copy yields to a skill inside the project; built-in, personal and configured-path skills are overridden as before.
  • Test hardening. create-then-rebind ignores read-only binding lookups. A background lookup from another file (it fails the same way on main) landed in its request log.

How did you verify your code works?

  • Tests:
    • route tests: gating, validation, status mapping, and a real-registry skill added after start;
    • eligibility and the precedence predicate as pure-function tests;
    • delivered-skill refusal in skill-publish.test.ts.
    • test/skill, test/altimate/workspace and test/server: 2037 pass; the 3 failures also time out on main.
  • Live workspace:
    • the list shows only the user's skill; a delivered skill is refused (422);
    • "Published…", then "Updated…" after an edit, and again after a refresh.

Screenshots / recordings

publishable list

publish flow

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a way to view and publish eligible project skills. Personal, built-in, managed, IDE-delivered, and out-of-project skills cannot be published.
    • The publishable-skills list refreshes the skill registry, so newly added skills can appear without restarting.
  • Bug Fixes
    • Project skills now take precedence over workspace-snapshot copies with the same name.
    • Workspace skill routes refuse requests from disallowed browser contexts.
  • Documentation
    • Clarified that managed IDE-delivered skills cannot be published, including copies in extension skill directories.