Skip to content

feat(opencode): port codevhub skill commands as codev skill - #330

Merged
quickbeard merged 5 commits into
mainfrom
feat/skill-commands
Aug 26, 2026
Merged

quickbeard merged 5 commits into
mainfrom
feat/skill-commands

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Summary

Ports the codevhub skill command group into the standalone CLI as codev skill search | pull | push | office, so managing SkillHub skills no longer requires installing the hub CLI. Behavior mirrors the hub exactly — same flags, same error strings, same install layout — with the interactive flows rebuilt in @clack/prompts (the hub used Ink).

What's here

  • New tier-2 workspace package packages/codev-skillhub (@codev/skillhub, fork-only, plain async TS like @codev/upload):
    • skillhub.ts — registry client (search/detail/download/upload/metadata/submit/admin-review; cookie-or-Bearer auth, 401 → actionable auth error)
    • skill-dirs.ts / skill-install.ts — the hub's install policy verbatim: one real extraction in the directory covering the most selected agents (.claude/skills / .agents/skills, project or global), the other linked (relative symlink → Windows junction → copy, mechanism reported truthfully), Claude < 2.1.203 forced-copy probe, path-traversal/zip-slip defenses checked before any rm
    • skill-publish.ts — dir/zip → archive (secret/junk exclusion, 100 MB / 15 000-entry caps) → upload → metadata → submit → optional admin approve
    • office.ts + download.ts — resumable ETag/If-Range bundle downloader, Rosetta-aware arch detection, Windows elevated-PowerShell manual handoff, shared ~/.codev-hub/office staging
    • tls.ts / http.ts — corp-proxy fix: on a cert failure, merge the OS trust store once and retry
    • defaultAgents() re-derived from what's on the machine (PATH binary or config dir) instead of the hub's configure markers
  • SSO without a new port: sessions ride the same ~/.codev-hub/auth.json via @codev/gateway (a codevhub login signs this CLI in too). Gateway gains one export, loadSkillhubCookie(). The upload command's inline login prompt moved to a shared fork-only cli/cmd/sso-prompt.ts used by both codev upload and codev skill push.
  • CLI wiring (cli/cmd/skill.ts, fork-only, exported as SkillHubCommand — SkillCommand belongs to codev debug skill): yargs owns parsing; hub cross-flag messages preserved verbatim; deliberately no -f alias for --force; office maintenance flags stay hidden. Non-TTY without a location flag fails with the hub's "Not a terminal — pass --here, --global, or --dir" guidance. Push confirms (default No) before ever checking auth — cancelling never triggers a login.

Tests

  • 180 tests in packages/codev-skillhub — ported from the hub's vitest suites onto bun:test using injectable seams (httpApi/execApi/linkApi/detectApi/skillhubApi) instead of module mocks; auth tests use real auth.json fixtures under CODEV_TEST_HOME
  • 12 new subprocess tests in packages/opencode/test/cli/skill.test.ts (all offline: flag validation + TTY gating)
  • Help snapshots regenerated (additive: skill + 4 subcommands); gateway suite extended for loadSkillhubCookie
  • Verified live against the real hub: search --json (single clean JSON line), pull --here (store + relative symlink layout, force semantics), office --uninstall --download-only (ETag-tracked script download + manual-run handoff)

Bookkeeping

  • DIVERGENCES.md: updated the existing packages/opencode/src/index.ts + help-snapshot row (new files are untracked per policy)
  • CHANGELOG.md: "Skills" entry under Unreleased
  • Follow-up (separate repo): document codev skill in codev-landing-page/content/docs/code

🤖 Generated with Claude Code

quickbeard and others added 2 commits August 26, 2026 13:38
Adds a `codev skill` command group (search, pull, push, office) ported
from the hub CLI so a standalone codev install can manage SkillHub
skills without codevhub.

- New tier-2 workspace package `packages/codev-skillhub` with the
  registry client, install policy (.claude/skills + .agents/skills,
  one store + links, zip-slip and traversal defenses), publish
  pipeline, resumable office-bundle downloader, and corp-proxy TLS
  retry — hub argv parsing, Ink UIs, and NDJSON logging not ported.
- SSO reuses @codev/gateway (shared ~/.codev-hub/auth.json); gateway
  gains loadSkillhubCookie(); upload.ts's inline login prompt moved to
  the shared fork-only cli/cmd/sso-prompt.ts.
- Interactive flows rebuilt with @clack/prompts: pull prompts for
  scope + agents (CoDev Code always included); push previews the
  archive, confirms (default No), and signs in only after confirming.
- 180 package tests ported from the hub's vitest suite, 12 new CLI
  subprocess tests, help snapshots regenerated; DIVERGENCES.md row for
  index.ts updated and a CHANGELOG entry added.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard force-pushed the feat/skill-commands branch from faec241 to 5dadbb3 Compare August 26, 2026 06:38
quickbeard and others added 3 commits August 26, 2026 13:56
The agent checklist now shows CoDev Code as a real row that is always
selected and cannot be unchecked (matching the hub's locked picker row),
instead of omitting it with a note in the prompt message. Other agents
start unselected. Built on @clack/core's MultiSelectPrompt with clack's
default render plus a key subscriber that re-adds codev before each
frame, so the row can never be seen unchecked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 21bd294 into main Aug 26, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the feat/skill-commands branch August 26, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant