You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define the foundational types, interfaces, and stub implementations for the skill lifecycle management feature in ToolHive. This task establishes the SkillService interface, domain types, CLI command stubs for thv skill {list,install,uninstall,info,validate,build,push}, REST API route stubs at /api/v1beta/skills/* returning 501 Not Implemented, and wires everything into the root command and ServerBuilder. This is the root task that unblocks all parallel work on subsequent skill lifecycle tasks.
Context
This is the first task in the Skills Lifecycle Management epic, which ports skill management from the standalone Skillet CLI into the ToolHive ecosystem. The stubs-first approach enables parallel development across Wave 2 tasks (parser/validator, client metadata, state management) and the toolhive-core OCI library.
A key architectural decision for skills is that CLI commands call the REST API via an HTTP client (unlike existing commands that call pkg/ directly). This requires the API server (thv serve) to be running. The stubs created in this task establish that pattern.
Description
Define the foundational types, interfaces, and stub implementations for the skill lifecycle management feature in ToolHive. This task establishes the
SkillServiceinterface, domain types, CLI command stubs forthv skill {list,install,uninstall,info,validate,build,push}, REST API route stubs at/api/v1beta/skills/*returning 501 Not Implemented, and wires everything into the root command andServerBuilder. This is the root task that unblocks all parallel work on subsequent skill lifecycle tasks.Context
This is the first task in the Skills Lifecycle Management epic, which ports skill management from the standalone Skillet CLI into the ToolHive ecosystem. The stubs-first approach enables parallel development across Wave 2 tasks (parser/validator, client metadata, state management) and the toolhive-core OCI library.
A key architectural decision for skills is that CLI commands call the REST API via an HTTP client (unlike existing commands that call
pkg/directly). This requires the API server (thv serve) to be running. The stubs created in this task establish that pattern.Dependencies: None (root task)
Blocks: TASK-005, TASK-006, TASK-007, TASK-010
Acceptance Criteria
pkg/skills/service.godefines theSkillServiceinterface with methods:List,Install,Uninstall,Info,Validate,Build,Pushpkg/skills/types.godefines domain types:InstalledSkill,SkillMetadata,SkillIndex,SkillIndexEntry, option/result structs, and enums (Scope,InstallStatus)pkg/skills/client/client.godefines the HTTP client struct withNewClient(baseURL string) *Clientconstructor (stub)pkg/api/v1/skills.godefinesSkillsRouterwith chi subrouter and route stubs for all 7 endpoints returning501 Not Implementedpkg/api/v1/skills_types.godefines request/response types for the skills REST APIcmd/thv/app/skill.godefinesskillCmdparent command and 7 subcommands as stubs printing "not yet implemented"skillCmdis registered inNewRootCmd()incmd/thv/app/commands.gopkg/api/server.goServerBuilderhas askillManagerfield andWithSkillManager()builder methodsetupDefaultRoutes()mounts skills router at/api/v1beta/skillsTechnical Approach
Split into 2-3 PRs (max 400 LOC each):
SkillServiceinterface + HTTP client stub (pkg/skills/)ServerBuilderwiring (pkg/api/)cmd/thv/app/)Patterns to Follow
GroupsRouterinpkg/api/v1/groups.go— chi subrouter withapierrors.ErrorHandlergroupCmdincmd/thv/app/group.go— parent + subcommandsWithGroupManager()inpkg/api/server.gopkg/api/v1/workload_types.gonaming conventionCode Pointers
pkg/api/v1/groups.go— SkillsRouter patternpkg/api/server.golines 54-66 — ServerBuilder struct, lines 136-140 — WithGroupManager pattern, lines 225-249 — setupDefaultRoutescmd/thv/app/group.go— parent command + subcommand patterncmd/thv/app/commands.go— NewRootCmd() registrationpkg/api/errors/handler.go— HandlerWithError typeinternal/application/skill/service.go— source for interface designKey Interfaces
References