Skip to content

Add reproducible OCI skill packager#21

Closed
JAORMX wants to merge 1 commit intomainfrom
oci-skills-packager
Closed

Add reproducible OCI skill packager#21
JAORMX wants to merge 1 commit intomainfrom
oci-skills-packager

Conversation

@JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Feb 6, 2026

Summary

  • Implement the SkillPackager interface with deterministic OCI artifact creation from skill directories
  • Add tar.go for reproducible tar archives (sorted entries, normalized headers, PAX format, UID/GID=0)
  • Add gzip.go for reproducible gzip compression (OS=255, no name/comment, BestCompression)
  • Add packager.go with full packaging pipeline: directory reading, SKILL.md YAML frontmatter parsing, content layer creation, per-platform OCI configs with metadata labels, manifests with annotations, and multi-platform image indexes
  • Promote gopkg.in/yaml.v3 from indirect to direct dependency for frontmatter parsing

Security hardening:

  • Rejects symlinks (both files and directories), hardlinks, and device entries
  • Path traversal protection in both filesystem reads and tar extraction
  • Size limits on decompression (100MB) and per-file tar extraction (100MB)
  • Frontmatter size cap (64KB) to mitigate YAML parsing attacks
  • Tar headers strip UID/GID/username/groupname to prevent info leakage

82.6% test coverage with table-driven, parallel tests using testify.

Resolves #16

Test plan

  • task passes (lint + test)
  • task license-check passes
  • Reproducibility verified: same input produces identical digests across separate stores
  • Multi-platform index verified: per-platform configs match index descriptor os/arch
  • Security tests: symlink files, symlink directories, hardlinks, device entries, path traversal all rejected
  • Expert reviews: OCI spec compliance, Go best practices, security audit — no blocking findings

🤖 Generated with Claude Code

@JAORMX JAORMX force-pushed the oci-skills-packager branch from 41bfb71 to 3cbcedd Compare February 6, 2026 19:11
Implement the SkillPackager interface with deterministic OCI artifact
creation from skill directories. Uses ocispec types from
github.com/opencontainers/image-spec for OCI 1.1 compliance.

Parses SKILL.md YAML frontmatter for metadata, creates reproducible
tar.gz content layers, per-platform OCI configs (ocispec.Image) with
skill metadata in labels, manifests (ocispec.Manifest) with annotations,
and multi-platform image indexes (ocispec.Index).

Key components:
- tar.go: Deterministic tar (sorted entries, normalized headers, PAX format)
- gzip.go: Deterministic gzip (OS=255, no name/comment, BestCompression)
- packager.go: Full packaging pipeline using ocispec types with
  digest.FromBytes for diff IDs and specs.Versioned for schema version

Security: rejects symlinks (files and directories), hardlinks, device
entries, path traversal in both filesystem reads and tar extraction.
Size limits on decompression and per-file extraction.

Resolves: #16

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX force-pushed the oci-skills-packager branch from 3cbcedd to aa1ebf4 Compare February 6, 2026 19:14
@JAORMX JAORMX closed this Feb 6, 2026
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.

OCI Skills Library: Reproducible packager

1 participant