-
Notifications
You must be signed in to change notification settings - Fork 176
Open
Labels
enhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go codeskillsSkills lifecycle managementSkills lifecycle managementtoolhive-platformToolHive Platform teamToolHive Platform team
Description
Description
Implement the skill installer that extracts OCI artifact layers to the appropriate client skill directory. Handles managed vs unmanaged detection, overwrite protection, and security validation (path traversal, symlinks).
Context
Part of the Skills Lifecycle Management epic. Uses the OCI store from toolhive-core (TASK-002), client paths from TASK-006, and state management from TASK-007.
Dependencies: stacklok/toolhive-core#14, #3647, #3648
Blocks: Skill service implementation
Acceptance Criteria
-
pkg/skills/installer.goextracts OCI layer tar.gz to client skill directory - Resolves target directory using client metadata skill paths (from TASK-006)
- Detects existing skills: managed (has
.thv-skill.json) vs unmanaged - Overwrite protection: refuses to overwrite unmanaged skills unless
--force - Upgrade detection: same digest = unchanged, different digest = upgraded
- Creates
.thv-skill.jsonmetadata file on install - Updates skill index on install/uninstall
- Clean removal: removes skill directory + metadata on uninstall
- Security: validates tar entries for path traversal (
../), symlinks, absolute paths, device entries - Size limits: max 100MB per file, 500MB total extraction
- All tests pass, SPDX headers present
Code Pointers
pkg/skills/types.go— domain types (from TASK-001)
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go codeskillsSkills lifecycle managementSkills lifecycle managementtoolhive-platformToolHive Platform teamToolHive Platform team