Repository navigation
feat: OCI-based skill distribution - #21
Conversation
Design spec for packaging skills as OCI artifacts with sigstore signature verification. Covers SkillCard schema, OCI artifact layout, CLI commands (pack/push/pull/verify/inspect), and init container deployment model. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Analyze the Agent Skills OCI Artifacts Specification by Thomas Vitale and align our design where possible. Key changes: - Add prior art section with community spec comparison - Align media types to use agentskills namespace for interoperability - Add standard OCI and io.agentskills annotations - Prefer Referrers API over cosign tag convention - Add deployment audit trail (K8s-adapted lock file) - Add references section with community links Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add missing field mappings from the Agent Skills Specification: - metadata.metadata for arbitrary key-value pass-through - spec.allowedTools mirroring SKILL.md allowed-tools field - spec.compatibility.environment mirroring SKILL.md compatibility - Add compatibility mapping table showing every SKILL.md field - Document name validation rules matching upstream constraints Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add section showing DocsClaw with OCI skills deployed as a Kubernetes SIG Agent Sandbox, including a concrete YAML manifest with init container for skill pulling and signature verification. Note future opportunity to use SandboxTemplate/SandboxClaim for skill assignment instead of a custom operator. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Based on feedback from Andrew Block (ORAS maintainer): - Add image volumes (K8s 1.33+, OpenShift 4.20+) as the preferred deployment model — skill OCI artifacts mounted directly as pod volumes, no init container needed - Demote init container to fallback for older clusters; switch from emptyDir to PVC per Andrew's advice to avoid filling node storage - Update Agent Sandbox example to use image volumes - Signature verification shifts to platform level (OpenShift containers-policy.json) for image volumes - Add Zot registry and Image Volumes KEP to references - Update demo scenario to include image volume mounting step Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Cover authentication for private registries across both models: - Image volumes: imagePullSecrets, service account pull secrets, OpenShift global pull secret, cloud provider IAM integration - Init container: DOCKER_CONFIG env var with mounted secret - Include YAML examples for both approaches Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add three example skills derived from HR user stories to demonstrate OCI skill packaging: - resume-screener: grades resumes against a job description - policy-comparator: side-by-side policy document comparison - checklist-auditor: audits checklists against a corporate standard Each skill has both SKILL.md (Agent Skills spec) and skill.yaml (SkillCard with resource hints and tool dependencies). Also clarify in the design doc that oras-go is used for both image and artifact modes (--as-image flag), add demo deployment manifest, and update the demo scenario. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Ten-task plan covering: dependencies, SkillCard types and validation, OCI media constants, Pack/Push/Pull/Inspect operations, signature verification with policy modes, five CLI commands, backward compatibility in skill loader, and end-to-end testing with example HR skills. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add oras.land/oras-go/v2 for OCI artifact push/pull and github.com/sigstore/sigstore-go for signature verification. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add OCI artifact media type constants for skill distribution: - ArtifactType for skill artifacts - ConfigMediaType and ImageConfigMediaType for config blobs - CardMediaType for skill.yaml layer - ContentMediaType for tar+gzip skill content layer Add OCI annotation constants following opencontainers.image spec and custom io.agentskills and io.docsclaw namespaces for skill metadata (name, version, resources, required tools). Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add Pack function to create OCI artifacts from skill directories: - Parses and validates skill.yaml using SkillCard - Creates config blob with skill metadata (name, version, tools) - Builds two layers: skill.yaml as CardMediaType, tar+gzip of entire directory as ContentMediaType - Supports --as-image mode (ImageConfigMediaType) for OCI image compatibility alongside pure artifact mode - Uses deterministic tar creation (fixed mtime, sorted entries) for reproducible digests - Pushes all blobs and manifest to ORAS content.Storage Add comprehensive unit tests with memory.New() storage: - TestPack: verify artifact mode produces valid manifest - TestPackAsImage: verify image mode compatibility - TestPackMissingSkillYaml: verify error handling Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Push packs and copies a skill artifact to an OCI registry. Pull fetches and extracts the content layer. Inspect fetches only the SkillCard layer for metadata-only queries. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Implements enforce/warn/skip verification modes. Sigstore-go integration is stubbed for the initial PoC. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add skill subcommand group with pack, push, pull, verify, and inspect commands. Commands are thin wrappers over internal/oci and internal/verify packages. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
When a skill directory contains both SKILL.md and skill.yaml, the SkillCard description takes precedence. Skills without skill.yaml continue to work unchanged. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
- Check w.Write return value in signedcard.go - Suppress unused BindPFlag returns in serve.go and config.go - Mark unused llmProvider parameter in startAgent - Add oci-layout to .gitignore Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add docs/oci-skills-guide.md with the full CLI workflow: pack, push, pull, inspect, verify. Includes deployment manifests for both image volumes (OpenShift 4.20+) and init containers (older clusters), local testing with Zot, and links to the design spec and community standards. Add OCI skills section to README with a reference to the guide. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
- pack: error when output already exists; --force/-f to overwrite - list: show locally cached skills with name, version, description - delete: remove a skill from the local cache with path traversal protection Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Add --tls-verify flag (default true) to push, pull, and inspect commands. Set --tls-verify=false for local registries like Zot running without TLS. Matches podman/docker convention. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Wire up oras-go credential store to read authentication from ~/.docker/config.json or Podman's auth.json. This enables pushing and pulling to/from authenticated registries like quay.io after 'podman login' or 'docker login'. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Registries like quay.io use OAuth2 bearer token auth via challenge-response. The auth.Client needs a Cache to handle the token exchange correctly, otherwise every request fails with 401 Unauthorized. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Align example skill refs and guide to match the actual quay.io organization where skills are published: quay.io/docsclaw/skill-* (without the /official/ namespace path). Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
The tarDirectory function now skips the oci-layout/ subdirectory that may be left over from a previous 'docsclaw skill pack'. This prevents generated artifacts from being included in the OCI content layer. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
…s-image Registries like quay.io validate the config blob structure when the config media type is application/vnd.oci.image.config.v1+json. Use a minimal valid OCI image config (scratch image) and standard OCI layer media types so the artifact is recognized as a real image by both registries and the kubelet for image volume mounting. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
In image mode, produce a single tar+gzip layer containing the entire skill directory (including skill.yaml). The separate SkillCard layer is an artifact-mode concept; registries like quay.io expect image layers to be valid tarballs. Artifact mode is unchanged: two layers (SkillCard YAML + content tarball) with custom media types. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
Quay.io validates the OCI image config structure and requires rootfs.type and rootfs.diff_ids fields. Build the config with the proper ocispec.Image type including Platform and RootFS with the uncompressed layer digest. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
The OCI spec requires diff_ids to contain the digest of the uncompressed tar layer, not the gzipped version. Refactor tarDirectory to return both the gzipped data and the uncompressed digest separately. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
In --as-image mode, the mount path already provides scoping (e.g., /skills/resume-screener), so the tar entries should not include a skill-name prefix. This prevents the double directory nesting (/skills/resume-screener/resume-screener/). Artifact mode is unchanged: entries are rooted at <skill-name>/ since multiple skills may be extracted to the same directory. Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
|
@coderabbitai check |
|
✅ Actions performedReview triggered.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 17 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR introduces OCI-based skill distribution, adding new packages for SkillCard schema definitions and parsing ( Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 12
🧹 Nitpick comments (14)
docs/dev/2026-04-12-oci-skill-distribution-design.md (2)
683-695: Remove duplicated “Future opportunity” block.The
SandboxTemplate/SandboxClaimfuture-opportunity paragraph is repeated, which adds noise and can confuse future edits.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/dev/2026-04-12-oci-skill-distribution-design.md` around lines 683 - 695, Remove the duplicated "Future opportunity" paragraph: keep a single paragraph describing how the SandboxTemplate + SandboxClaim pattern could be used for skill assignment at scale and delete the repeated block so only one mention of SandboxTemplate and SandboxClaim remains; ensure the kept paragraph still mentions the base agent image, default skill set, and that SandboxClaim handles per-user provisioning.
316-322: CLI command list is missing implemented commands.This section should include
docsclaw skill listanddocsclaw skill deleteso the design doc matches the CLI surface described in the PR objectives.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/dev/2026-04-12-oci-skill-distribution-design.md` around lines 316 - 322, The CLI command list omitted two implemented commands; update the command block to include "docsclaw skill list <ref|--all>" and "docsclaw skill delete <ref>" (or whatever exact signatures the implementation uses) so the design doc matches the CLI surface; locate the command list in the document and add lines for the Skill list and delete commands, ensuring the usage syntax matches the implemented functions/handlers (e.g., the skill list and skill delete subcommands) and adjust any short descriptions to mirror the actual behavior.examples/skills/checklist-auditor/skill.yaml (1)
6-6: Alignmetadata.refwith namespace-based naming convention.
metadata.namespaceisofficial, but the ref omits that namespace path. Usingquay.io/docsclaw/official/skill-checklist-auditorwould keep examples consistent with the design doc and avoid user confusion.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/skills/checklist-auditor/skill.yaml` at line 6, The metadata.ref value does not include the namespace and should match metadata.namespace; update the ref in skill.yaml to include the namespace path (change the existing ref "quay.io/docsclaw/skill-checklist-auditor" to "quay.io/docsclaw/official/skill-checklist-auditor") so metadata.namespace ("official") and metadata.ref are consistent.internal/cmd/serve.go (1)
132-139: Same flag-binding reliability issue in command wiring.
BindPFlagerrors are discarded here as well. Recommend using explicit error handling to avoid silent misconfiguration when flags are renamed or keys drift.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cmd/serve.go` around lines 132 - 139, The BindPFlag return values are ignored causing silent failures if flags or keys drift; update the flag wiring in serveCmd by checking errors from v.BindPFlag (calls for "config_dir", "document_service_url", "llm.provider", "llm.api_key", "llm.base_url", "llm.model", "llm.max_tokens", "llm.timeout_seconds") and handle them explicitly (e.g., wrap in a helper that returns/records the error or log.Fatalf/return the error) rather than discarding with `_ =`, so any binding failure via v.BindPFlag / serveCmd.Flags().Lookup(...) is surfaced during startup.examples/skills/resume-screener/skill.yaml (1)
6-6: Use a namespace-qualified OCI ref for consistency.Given
metadata.namespace: official, considerquay.io/docsclaw/official/skill-resume-screenerto match the naming model documented elsewhere in this PR.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/skills/resume-screener/skill.yaml` at line 6, The OCI image ref in the skill manifest (the `ref` value) is not namespace-qualified while `metadata.namespace` is set to `official`; update the `ref` from `quay.io/docsclaw/skill-resume-screener` to a namespace-qualified form `quay.io/docsclaw/official/skill-resume-screener` so it follows the documented naming model and remains consistent with `metadata.namespace`.internal/config/config.go (1)
174-178: HandleBindPFlagerrors instead of discarding them.Silent bind failures can leave config keys unbound and are hard to debug later. Consider fail-fast behavior (return error from
BindFlagsor panic during startup wiring) so key/flag mismatches surface immediately.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
Also applies to: 182-185
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/config/config.go` around lines 174 - 178, The calls to v.BindPFlag are currently ignoring errors, so fix BindFlags to handle and propagate binding failures: change the BindFlags function to return an error (or explicitly panic during startup wiring), check the error returned from each v.BindPFlag call (for all occurrences of v.BindPFlag referencing cmd.PersistentFlags().Lookup like "service.port", "service.host", "service.mock_spiffe", "service.listen_plain_http", "service.log_level"), and either aggregate/return the first error to the caller or panic with a clear message so key/flag mismatches surface immediately instead of being silently discarded.pkg/skills/loader_test.go (1)
123-125: Tighten precedence assertion to exact value.
strings.Contains(...)can pass even if precedence regresses partially. Use exact equality for a stronger contract check.Suggested change
- if !strings.Contains(skills[0].Description, "From SkillCard") { - t.Errorf("Description = %q, want SkillCard description", skills[0].Description) - } + if got, want := skills[0].Description, "From SkillCard with more detail."; got != want { + t.Errorf("Description = %q, want %q", got, want) + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/skills/loader_test.go` around lines 123 - 125, The test currently checks precedence using strings.Contains on skills[0].Description which can mask partial regressions; change the assertion to require exact equality against the expected description string (replace the strings.Contains(...) check with a direct equality check on skills[0].Description) and update the t.Errorf message to reflect the expected exact value so the test fails loudly when the description deviates.internal/oci/pack_test.go (1)
153-157: Negative-path assertion is too permissive.
For this case, assert the error referencesskill.yaml(or parse failure) so the test protects the intended failure mode, not just “any error”.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/oci/pack_test.go` around lines 153 - 157, The current negative-path assertion only checks that err.Error() is non-empty (using errStr) which is too broad; update the test (in internal/oci/pack_test.go) to assert the error message specifically references "skill.yaml" or a parse failure for that file. Replace the loose check on errStr with a targeted assertion using strings.Contains(errStr, "skill.yaml") (or also checking for "parse" / "parse failure") and fail the test with a clear message if the substring is not present, ensuring the test protects the intended failure mode tied to skill.yaml rather than any error.pkg/skills/loader.go (1)
46-50: Don’t silently ignore invalidskill.yaml.
Ifskill.yamlexists but is malformed, discovery currently falls back quietly toSKILL.md, which makes bad metadata hard to detect.Suggested change
// If skill.yaml exists, prefer its description. cardPath := filepath.Join(skillsDir, entry.Name(), "skill.yaml") - if sc, err := card.Parse(cardPath); err == nil { - meta.Description = sc.Metadata.Description - } + if _, err := os.Stat(cardPath); err == nil { + sc, err := card.Parse(cardPath) + if err != nil { + return nil, fmt.Errorf("invalid skill card %q: %w", cardPath, err) + } + meta.Description = sc.Metadata.Description + } else if !os.IsNotExist(err) { + return nil, fmt.Errorf("failed to stat skill card %q: %w", cardPath, err) + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/skills/loader.go` around lines 46 - 50, The code currently ignores parse errors from card.Parse and falls back to SKILL.md; change the logic to first check whether cardPath (filepath.Join(skillsDir, entry.Name(), "skill.yaml")) actually exists (os.Stat) and if it does but card.Parse(cardPath) returns an error, propagate or return that error (wrap with context) instead of silently ignoring it; only if the file does not exist should you continue with the SKILL.md fallback—ensure you update the loader function in loader.go so that card.Parse errors for existing skill.yaml are surfaced rather than ignored while still setting meta.Description = sc.Metadata.Description on successful parse.internal/oci/push_pull_test.go (1)
24-27: Add coverage for the image-mode path too.Both tests lock
AsImagetofalse, so the image-specific manifest/config branch introduced by this PR still has no regression coverage. A small table-driven variant withAsImage: truewould protect the other core packaging mode.Also applies to: 68-71
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/oci/push_pull_test.go` around lines 24 - 27, The tests in push_pull_test.go only exercise PushOptions{AsImage:false} so add a table-driven variant that also runs the same push/pull assertions with PushOptions{AsImage:true} to cover the image-specific manifest/config branch; update the test that constructs PushOptions (and the similar block at lines 68-71) to iterate over cases (e.g., name + AsImage bool) and run the existing assertions for each case so both AsImage true and false paths of the PushOptions handling are executed.internal/cmd/skill_inspect.go (1)
37-38: Tools output format inconsistent with other CLI commands.Using
%vfor the slice produces Go-style output like[read_file write_file]. The plan document (line 1747) showsskill_inspect.gousingstrings.Join(sc.Spec.Tools.Required, ", ")for a cleaner comma-separated format.Suggested fix
+ "strings" "github.com/spf13/cobra"if len(sc.Spec.Tools.Required) > 0 { - fmt.Printf("Tools: %v\n", sc.Spec.Tools.Required) + fmt.Printf("Tools: %s\n", strings.Join(sc.Spec.Tools.Required, ", ")) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cmd/skill_inspect.go` around lines 37 - 38, The Tools output currently uses fmt.Printf with "%v" which renders a Go-style slice; update the print for sc.Spec.Tools.Required to use strings.Join(sc.Spec.Tools.Required, ", ") so it prints a clean comma-separated list (e.g., "read_file, write_file"); ensure the strings package is imported and replace the fmt.Printf("Tools: %v\n", sc.Spec.Tools.Required) call with a formatted print that uses the joined string.internal/cmd/skill_list.go (1)
48-51: Long descriptions may break table alignment.Descriptions can be up to 1024 characters (per
card.Validate). Printing them untruncated will break the column layout for terminal display.Suggested fix
if sc, err := card.Parse(cardPath); err == nil { - fmt.Printf("%-25s %-10s %s\n", sc.Metadata.Name, sc.Metadata.Version, sc.Metadata.Description) + desc := sc.Metadata.Description + if len(desc) > 50 { + desc = desc[:47] + "..." + } + fmt.Printf("%-25s %-10s %s\n", sc.Metadata.Name, sc.Metadata.Version, desc) found++ continue }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cmd/skill_list.go` around lines 48 - 51, The table printing in skill_list.go currently prints sc.Metadata.Description verbatim (in the block using card.Parse), which can be up to 1024 chars and will break alignment; update the printing logic to truncate the description to a reasonable width (e.g., 50-80 chars or calculated terminal width minus name/version columns) and append "…" when truncated, then use that truncated string in the fmt.Printf call that formats "%-25s %-10s %s"; ensure the truncation helper is applied to sc.Metadata.Description before incrementing found/continuing.internal/cmd/skill_pull.go (1)
31-45:--verifywithout--keyprovides no actual verification.When
--verifyis passed without--key, the code setsModeWarnwhich (perinternal/verify/verify.go) logs a warning and returnsnil— the pull proceeds without any verification. Users might expect--verifyalone to fail or at least indicate that verification was skipped.Consider either:
- Requiring
--keywhen--verifyis set- Providing clearer feedback that verification was skipped
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/cmd/skill_pull.go` around lines 31 - 45, The current logic in the pull command uses pullVerify and pullKey to set verify.Policy.Mode to verify.ModeWarn when no key is provided, which effectively skips verification; change this to require a key when verification is requested: when pullVerify is true and pullKey is empty, return a user-facing error instructing to pass --key (or make the CLI flag validation enforce that) instead of silently using verify.ModeWarn; update the block that builds verify.Policy and the call to verify.Verify (symbols: pullVerify, pullKey, verify.Policy, verify.ModeWarn, verify.ModeEnforce, verify.Verify) so the command fails early with a clear message if --verify is used without --key.docs/dev/plans/2026-04-13-oci-skill-distribution-plan.md (1)
65-68: Hardcoded absolute path in example command.The path
/Users/panni/work/docsclawis developer-specific. Consider using a relative path or placeholder.Suggested fix
-cd /Users/panni/work/docsclaw -go get oras.land/oras-go/v2@latest +# From the repository root: +go get oras.land/oras-go/v2@latest🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/dev/plans/2026-04-13-oci-skill-distribution-plan.md` around lines 65 - 68, The example uses a developer-specific absolute path in the `cd /Users/panni/work/docsclaw` command; change it to a relative or placeholder path (e.g., `cd ./docsclaw` or `cd <project-root>`), leaving the `go get oras.land/oras-go/v2@latest` line unchanged, so the example works for other users and avoids leaking personal paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/skills/resume-screener/SKILL.md`:
- Around line 18-29: Remove the subjective "cultural fit" dimension: delete the
"Cultural fit indicators" bullet and remove the "Fit" scoring lines; keep using
read_file to read resumes and score only "Qualification alignment" and
"Experience match", then compute a weighted overall score by normalizing the
original weights (Qualification alignment = 40/75 ≈ 53.33%, Experience match =
35/75 ≈ 46.67%) so the two weights sum to 100%; update the steps that mention
scoring and the "weighted overall score" calculation accordingly.
In `@internal/cmd/skill_delete.go`:
- Around line 33-40: The deletion currently calls os.RemoveAll on skillPath
without verifying it's actually a skill cache entry; before calling os.RemoveAll
in the function that builds skillPath, check that skillPath contains a skill
marker (e.g., ensure at least one of filepath.Join(skillPath, "skill.yaml") or
filepath.Join(skillPath, "SKILL.md") exists via os.Stat) and return a clear
error if neither file is present; only proceed to call os.RemoveAll(skillPath)
after this validation to avoid wiping non-skill directories.
In `@internal/cmd/skill_pack.go`:
- Around line 35-40: The current logic unconditionally removes the existing
output directory when packForce is true; change it to refuse deleting arbitrary
directories by only allowing RemoveAll when the existing path already appears to
be an OCI layout (e.g., contains the "oci-layout" file or expected files like
"index.json" in the root) or is an empty directory; update the branch around
os.Stat(output) and packForce to check for these markers (use os.ReadDir or
os.Stat to detect "oci-layout" / "index.json") and return an error asking the
user to manually remove non-OCI or non-empty destinations instead of calling
os.RemoveAll(output).
In `@internal/cmd/skill_pull.go`:
- Around line 57-62: The pull call may fail because the output directory
(variable output) might not exist; before calling ociops.Pull(ctx, ref, output,
opts) create the directory with os.MkdirAll(output, 0o755) and handle its error
(returning a wrapped fmt.Errorf on failure) so tlsVerify, opts and the
subsequent ociops.Pull call operate against a guaranteed existing directory.
In `@internal/oci/pack.go`:
- Around line 295-302: The AnnotationCreated entry in buildAnnotations uses
time.Now(), which makes manifests non-deterministic; change buildAnnotations to
stop injecting a runtime timestamp: remove the time.Now().UTC().Format(...)
usage for AnnotationCreated and instead populate that key from a stable source
on the SkillCard (e.g., sc.Metadata.Created / sc.Metadata.PublishedAt) or omit
the AnnotationCreated key entirely if no stable timestamp exists, or
alternatively add a deterministic creationTime argument to the pack path and use
that value; update the code around buildAnnotations, AnnotationCreated, and any
callers that expect the timestamp so manifests remain reproducible.
- Around line 190-203: The walk callback in the filepath.Walk inside pack.go
wrongly only skips entries when info.IsDir() is true, so the OCI layout file
("oci-layout") and other artifact files like "index.json" are still included;
update the callback (the anonymous func used in filepath.Walk that references
skipDirs, dir and paths) to check info.Name() regardless of IsDir() and skip
both the "oci-layout" file and OCI artifact entries (e.g., "index.json" and the
"blobs" directory) appropriately—return nil to ignore matching files and return
filepath.SkipDir to skip the "blobs" directory—so existing OCI layouts are not
repackaged.
In `@internal/oci/pull.go`:
- Around line 137-159: The current check using strings.HasPrefix on targetPath
(in internal/oci/pull.go around the tar extraction where targetPath is computed)
can be bypassed by pre-existing symlinks under destDir; replace this by
resolving and validating the real path (or walking ancestor components) before
creating or writing: call filepath.EvalSymlinks or iterate parents with os.Lstat
starting from destDir to ensure none are symlinks and that the resolved
targetPath is inside the resolved destDir, and perform this validation prior to
any os.MkdirAll or os.OpenFile operations (i.e., before the tar.TypeDir and
tar.TypeReg handling) to reject entries that would escape via symlinks.
- Around line 60-71: The loop in Pull (manifest.Layers scan) only looks for
ContentMediaType and thus fails for image-mode archives produced by
internal/oci/pack.go which use ocispec.MediaTypeImageLayerGzip when AsImage is
true; update the search in the Pull function (manifest.Layers loop / contentDesc
logic) to accept either ContentMediaType OR ocispec.MediaTypeImageLayerGzip (or
otherwise detect AsImage-produced layers) and select that descriptor, or add a
clear early rejection when AsImage is unsupported; reference manifest.Layers,
ContentMediaType, ocispec.MediaTypeImageLayerGzip and AsImage to locate and fix
the check.
In `@internal/oci/push.go`:
- Around line 81-92: The code incorrectly maps tlsVerify=false to
repo.PlainHTTP=true (changing HTTPS to plaintext); instead, remove or stop
setting repo.PlainHTTP when TLSVerify is false and configure the transport to
skip TLS verification or avoid credential loading for plain HTTP. Concretely: in
the block checking tlsVerify, do not set repo.PlainHTTP when !*tlsVerify; if the
oras/registry client supports it, set a custom HTTP transport/TLS config with
InsecureSkipVerify=true on the client used by repo (or propagate an option that
ors-go uses to skip cert checks). Also, when repo.PlainHTTP is true ensure you
do not call credentials.NewStoreFromDocker / set auth.Client with
credentials.Credential to prevent sending credentials over plain HTTP.
In `@internal/verify/verify.go`:
- Around line 43-46: The verifySignature function currently always returns an
error, which breaks enforce-mode callers like the CLI command invoked by
"docsclaw skill verify --key ..."; either implement real sigstore verification
in verifySignature using sigstore-go APIs (perform signature retrieval, public
key load, and signature verification and return nil on success) or gate this
behavior behind an explicit experimental/unsupported flag: detect a new
boolean/config (e.g., enableSigstoreVerification or experimentalVerify) before
running verifySignature and if not enabled return a clear
unsupported/experimental error instead of always failing; update callers to
check and surface that flag so enforce-mode only runs when real verification is
available.
In `@pkg/skills/card/parse_test.go`:
- Around line 101-107: The test dereferences err without guaranteeing it's
non-nil; update the assertion around Validate(sc) so the test fails fast instead
of panicking—replace the non-fatal t.Error("expected error...") with a fatal
failure (e.g., t.Fatalf or t.Fatal) or return immediately after the check so
that subsequent code (the strings.Contains(err.Error()) call) only runs when err
is non-nil; target the Validate call and the surrounding assertions in the Test
(where sc is used) to make this change.
In `@pkg/skills/card/parse.go`:
- Around line 39-45: The validator currently only checks that sc.APIVersion is
non-empty; change it to explicitly accept only the supported version(s) (e.g.,
"v1" or the exact string your schema uses) by comparing sc.APIVersion against
the allowed set and returning an error for any other value; update the same
validation block that checks sc.Kind (the sc.APIVersion check in parse.go) so it
returns a clear error like "unsupported apiVersion %q" when sc.APIVersion is not
one of the allowed values.
---
Nitpick comments:
In `@docs/dev/2026-04-12-oci-skill-distribution-design.md`:
- Around line 683-695: Remove the duplicated "Future opportunity" paragraph:
keep a single paragraph describing how the SandboxTemplate + SandboxClaim
pattern could be used for skill assignment at scale and delete the repeated
block so only one mention of SandboxTemplate and SandboxClaim remains; ensure
the kept paragraph still mentions the base agent image, default skill set, and
that SandboxClaim handles per-user provisioning.
- Around line 316-322: The CLI command list omitted two implemented commands;
update the command block to include "docsclaw skill list <ref|--all>" and
"docsclaw skill delete <ref>" (or whatever exact signatures the implementation
uses) so the design doc matches the CLI surface; locate the command list in the
document and add lines for the Skill list and delete commands, ensuring the
usage syntax matches the implemented functions/handlers (e.g., the skill list
and skill delete subcommands) and adjust any short descriptions to mirror the
actual behavior.
In `@docs/dev/plans/2026-04-13-oci-skill-distribution-plan.md`:
- Around line 65-68: The example uses a developer-specific absolute path in the
`cd /Users/panni/work/docsclaw` command; change it to a relative or placeholder
path (e.g., `cd ./docsclaw` or `cd <project-root>`), leaving the `go get
oras.land/oras-go/v2@latest` line unchanged, so the example works for other
users and avoids leaking personal paths.
In `@examples/skills/checklist-auditor/skill.yaml`:
- Line 6: The metadata.ref value does not include the namespace and should match
metadata.namespace; update the ref in skill.yaml to include the namespace path
(change the existing ref "quay.io/docsclaw/skill-checklist-auditor" to
"quay.io/docsclaw/official/skill-checklist-auditor") so metadata.namespace
("official") and metadata.ref are consistent.
In `@examples/skills/resume-screener/skill.yaml`:
- Line 6: The OCI image ref in the skill manifest (the `ref` value) is not
namespace-qualified while `metadata.namespace` is set to `official`; update the
`ref` from `quay.io/docsclaw/skill-resume-screener` to a namespace-qualified
form `quay.io/docsclaw/official/skill-resume-screener` so it follows the
documented naming model and remains consistent with `metadata.namespace`.
In `@internal/cmd/serve.go`:
- Around line 132-139: The BindPFlag return values are ignored causing silent
failures if flags or keys drift; update the flag wiring in serveCmd by checking
errors from v.BindPFlag (calls for "config_dir", "document_service_url",
"llm.provider", "llm.api_key", "llm.base_url", "llm.model", "llm.max_tokens",
"llm.timeout_seconds") and handle them explicitly (e.g., wrap in a helper that
returns/records the error or log.Fatalf/return the error) rather than discarding
with `_ =`, so any binding failure via v.BindPFlag /
serveCmd.Flags().Lookup(...) is surfaced during startup.
In `@internal/cmd/skill_inspect.go`:
- Around line 37-38: The Tools output currently uses fmt.Printf with "%v" which
renders a Go-style slice; update the print for sc.Spec.Tools.Required to use
strings.Join(sc.Spec.Tools.Required, ", ") so it prints a clean comma-separated
list (e.g., "read_file, write_file"); ensure the strings package is imported and
replace the fmt.Printf("Tools: %v\n", sc.Spec.Tools.Required) call with a
formatted print that uses the joined string.
In `@internal/cmd/skill_list.go`:
- Around line 48-51: The table printing in skill_list.go currently prints
sc.Metadata.Description verbatim (in the block using card.Parse), which can be
up to 1024 chars and will break alignment; update the printing logic to truncate
the description to a reasonable width (e.g., 50-80 chars or calculated terminal
width minus name/version columns) and append "…" when truncated, then use that
truncated string in the fmt.Printf call that formats "%-25s %-10s %s"; ensure
the truncation helper is applied to sc.Metadata.Description before incrementing
found/continuing.
In `@internal/cmd/skill_pull.go`:
- Around line 31-45: The current logic in the pull command uses pullVerify and
pullKey to set verify.Policy.Mode to verify.ModeWarn when no key is provided,
which effectively skips verification; change this to require a key when
verification is requested: when pullVerify is true and pullKey is empty, return
a user-facing error instructing to pass --key (or make the CLI flag validation
enforce that) instead of silently using verify.ModeWarn; update the block that
builds verify.Policy and the call to verify.Verify (symbols: pullVerify,
pullKey, verify.Policy, verify.ModeWarn, verify.ModeEnforce, verify.Verify) so
the command fails early with a clear message if --verify is used without --key.
In `@internal/config/config.go`:
- Around line 174-178: The calls to v.BindPFlag are currently ignoring errors,
so fix BindFlags to handle and propagate binding failures: change the BindFlags
function to return an error (or explicitly panic during startup wiring), check
the error returned from each v.BindPFlag call (for all occurrences of
v.BindPFlag referencing cmd.PersistentFlags().Lookup like "service.port",
"service.host", "service.mock_spiffe", "service.listen_plain_http",
"service.log_level"), and either aggregate/return the first error to the caller
or panic with a clear message so key/flag mismatches surface immediately instead
of being silently discarded.
In `@internal/oci/pack_test.go`:
- Around line 153-157: The current negative-path assertion only checks that
err.Error() is non-empty (using errStr) which is too broad; update the test (in
internal/oci/pack_test.go) to assert the error message specifically references
"skill.yaml" or a parse failure for that file. Replace the loose check on errStr
with a targeted assertion using strings.Contains(errStr, "skill.yaml") (or also
checking for "parse" / "parse failure") and fail the test with a clear message
if the substring is not present, ensuring the test protects the intended failure
mode tied to skill.yaml rather than any error.
In `@internal/oci/push_pull_test.go`:
- Around line 24-27: The tests in push_pull_test.go only exercise
PushOptions{AsImage:false} so add a table-driven variant that also runs the same
push/pull assertions with PushOptions{AsImage:true} to cover the image-specific
manifest/config branch; update the test that constructs PushOptions (and the
similar block at lines 68-71) to iterate over cases (e.g., name + AsImage bool)
and run the existing assertions for each case so both AsImage true and false
paths of the PushOptions handling are executed.
In `@pkg/skills/loader_test.go`:
- Around line 123-125: The test currently checks precedence using
strings.Contains on skills[0].Description which can mask partial regressions;
change the assertion to require exact equality against the expected description
string (replace the strings.Contains(...) check with a direct equality check on
skills[0].Description) and update the t.Errorf message to reflect the expected
exact value so the test fails loudly when the description deviates.
In `@pkg/skills/loader.go`:
- Around line 46-50: The code currently ignores parse errors from card.Parse and
falls back to SKILL.md; change the logic to first check whether cardPath
(filepath.Join(skillsDir, entry.Name(), "skill.yaml")) actually exists (os.Stat)
and if it does but card.Parse(cardPath) returns an error, propagate or return
that error (wrap with context) instead of silently ignoring it; only if the file
does not exist should you continue with the SKILL.md fallback—ensure you update
the loader function in loader.go so that card.Parse errors for existing
skill.yaml are surfaced rather than ignored while still setting meta.Description
= sc.Metadata.Description on successful parse.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2f231ad4-7343-4ea5-a37d-09f6043bfbb2
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (38)
.gitignoreREADME.mddocs/dev/2026-04-12-oci-skill-distribution-design.mddocs/dev/plans/2026-04-13-oci-skill-distribution-plan.mddocs/oci-skills-guide.mdexamples/skills/checklist-auditor/SKILL.mdexamples/skills/checklist-auditor/skill.yamlexamples/skills/policy-comparator/SKILL.mdexamples/skills/policy-comparator/skill.yamlexamples/skills/resume-screener/SKILL.mdexamples/skills/resume-screener/skill.yamlgo.modinternal/bridge/signedcard.gointernal/cmd/serve.gointernal/cmd/skill.gointernal/cmd/skill_delete.gointernal/cmd/skill_inspect.gointernal/cmd/skill_list.gointernal/cmd/skill_pack.gointernal/cmd/skill_pull.gointernal/cmd/skill_push.gointernal/cmd/skill_verify.gointernal/config/config.gointernal/oci/inspect.gointernal/oci/media.gointernal/oci/pack.gointernal/oci/pack_test.gointernal/oci/pull.gointernal/oci/push.gointernal/oci/push_pull_test.gointernal/verify/policy.gointernal/verify/verify.gointernal/verify/verify_test.gopkg/skills/card/parse.gopkg/skills/card/parse_test.gopkg/skills/card/types.gopkg/skills/loader.gopkg/skills/loader_test.go
| 2. Extract the key requirements: | ||
| - **Required qualifications** (must-have skills, certifications) | ||
| - **Preferred experience** (years, domains, technologies) | ||
| - **Cultural fit indicators** (leadership style, collaboration) | ||
| 3. For each resume: | ||
| - Use `read_file` to read the resume | ||
| - Score on a 1-10 scale for each category: | ||
| - **Qualification alignment**: how well required skills match | ||
| - **Experience match**: relevance and depth of experience | ||
| - **Fit**: alignment with role expectations and culture | ||
| - Compute a weighted overall score (qualifications 40%, | ||
| experience 35%, fit 25%) |
There was a problem hiding this comment.
Remove “cultural fit” from the scored dimensions.
Making “fit” 25% of the ranking introduces a subjective HR criterion into the final ordering. That undercuts the fairness guardrails below and is hard to defend or audit as job-related evaluation; use concrete role behaviors instead, or drop it from the weighted score.
As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/skills/resume-screener/SKILL.md` around lines 18 - 29, Remove the
subjective "cultural fit" dimension: delete the "Cultural fit indicators" bullet
and remove the "Fit" scoring lines; keep using read_file to read resumes and
score only "Qualification alignment" and "Experience match", then compute a
weighted overall score by normalizing the original weights (Qualification
alignment = 40/75 ≈ 53.33%, Experience match = 35/75 ≈ 46.67%) so the two
weights sum to 100%; update the steps that mention scoring and the "weighted
overall score" calculation accordingly.
| if tlsVerify != nil && !*tlsVerify { | ||
| repo.PlainHTTP = true | ||
| } | ||
|
|
||
| // Set up credential resolution from Docker/Podman config. | ||
| credStore, err := credentials.NewStoreFromDocker(credentials.StoreOptions{}) | ||
| if err == nil { | ||
| repo.Client = &auth.Client{ | ||
| Credential: credentials.Credential(credStore), | ||
| Cache: auth.NewCache(), | ||
| } | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
In oras-go v2.6.0, what exactly does remote.Repository.PlainHTTP change, and is there any supported way to skip TLS certificate verification while still using HTTPS?
💡 Result:
In oras-go v2.6.0, remote.Repository.PlainHTTP is a field that controls whether to use plain HTTP instead of HTTPS when constructing registry URLs. When set to true, functions like buildRegistryBaseURL and buildRegistryCatalogURL use "http://" instead of "https://" for the registry endpoint (e.g., for Ping and Repositories listing). This change has been present since at least v2 (not new in v2.6.0, as v2.6.0 changelog does not mention modifications to it). There is no built-in supported way in the library to skip TLS certificate verification while keeping HTTPS. To achieve this, users must provide a custom *http.Client to repo.Client (or reg.Client for Registry) with a *http.Transport configured with tls.Config{InsecureSkipVerify: true}. Example: go import ( "crypto/tls" "net/http" "oras.land/oras-go/v2/registry/remote" ) repo, err := remote.NewRepository("example.com/repo") if err != nil { // handle error } transport := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } repo.Client = &remote.auth.Client{Client: &transport.Transport} // Note: auth.Client wraps http.Client // Use repo... This is standard Go HTTP client configuration and works because Repository uses the provided Client for all requests. No official example in docs, but code structure supports it. PlainHTTP=true forces HTTP (no TLS), distinct from skipping verification over HTTPS.
Citations:
- 1: https://github.com/oras-project/oras-go/blob/main/registry/remote/registry.go
- 2: https://github.com/oras-project/oras-go/blob/v2.6.0/docs/tutorial/quickstart.md
- 3: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote
- 4: https://github.com/oras-project/oras-go/releases/tag/v2.6.0
- 5: https://github.com/oras-project/oras-go/blob/main/registry/remote/auth/client.go
- 6: https://stackoverflow.com/questions/12122159/how-to-do-a-https-request-with-bad-certificate
Don't map TLSVerify=false to repo.PlainHTTP=true—this downgrades HTTPS to plain HTTP.
The current code treats disabling certificate verification as enabling plain HTTP, which silently changes the protocol entirely. A user expecting "HTTPS without certificate verification" will unknowingly send credentials over plaintext HTTP.
Instead, when TLSVerify=false, configure the HTTP client with InsecureSkipVerify: true in the TLS config (supported by oras-go) to skip verification while maintaining HTTPS. Alternatively, explicitly disable automatic credential loading when using plain HTTP.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/oci/push.go` around lines 81 - 92, The code incorrectly maps
tlsVerify=false to repo.PlainHTTP=true (changing HTTPS to plaintext); instead,
remove or stop setting repo.PlainHTTP when TLSVerify is false and configure the
transport to skip TLS verification or avoid credential loading for plain HTTP.
Concretely: in the block checking tlsVerify, do not set repo.PlainHTTP when
!*tlsVerify; if the oras/registry client supports it, set a custom HTTP
transport/TLS config with InsecureSkipVerify=true on the client used by repo (or
propagate an option that ors-go uses to skip cert checks). Also, when
repo.PlainHTTP is true ensure you do not call credentials.NewStoreFromDocker /
set auth.Client with credentials.Credential to prevent sending credentials over
plain HTTP.
| // verifySignature is a stub that checks the cosign signature of an OCI artifact. | ||
| // TODO(#4): Replace with real sigstore-go verification. | ||
| func verifySignature(_ context.Context, ref, publicKeyPath string) error { | ||
| return fmt.Errorf("sigstore verification not yet implemented (ref=%s, key=%s)", ref, publicKeyPath) |
There was a problem hiding this comment.
Enforce-mode verification cannot succeed in this implementation.
Lines 45-46 always return an error, so docsclaw skill verify --key ... never has a success path and any other enforce-mode caller will fail too. Either implement the real verifier before exposing these paths, or gate them behind an explicit experimental/unsupported flow.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/verify/verify.go` around lines 43 - 46, The verifySignature function
currently always returns an error, which breaks enforce-mode callers like the
CLI command invoked by "docsclaw skill verify --key ..."; either implement real
sigstore verification in verifySignature using sigstore-go APIs (perform
signature retrieval, public key load, and signature verification and return nil
on success) or gate this behavior behind an explicit experimental/unsupported
flag: detect a new boolean/config (e.g., enableSigstoreVerification or
experimentalVerify) before running verifySignature and if not enabled return a
clear unsupported/experimental error instead of always failing; update callers
to check and surface that flag so enforce-mode only runs when real verification
is available.
Code reviewFound 1 issue:
Lines 111 to 115 in 416f70e 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Safety improvements: - skill delete: verify target has SKILL.md or skill.yaml before removing - skill pack --force: verify target is an OCI layout before removing - pull: resolve symlinks in extraction to prevent path traversal - pull: use bytes.NewReader instead of strings.NewReader (avoids copy) - pull: accept both artifact and image-mode layer media types Validation improvements: - parse: reject unsupported apiVersion (pin to docsclaw.io/v1alpha1) - parse_test: use t.Fatal to prevent nil dereference on err - pack: skip all OCI layout artifacts (blobs/, ingest/, index.json) Usability: - skill pull: create output directory if it doesn't exist Relates to #4 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Pavel Anni <[email protected]>
|
@coderabbitai check |
|
Also, noting the excellent catch from your earlier comment — the unnecessary memory copy in strings.NewReader(string(data))with: bytes.NewReader(data)avoids an extra full-copy of potentially large OCI layer data and is a straightforward fix. Would you like me to plan that code change? ✅ Actions performedReview triggered.
|
Summary
Implement OCI-based skill packaging, signing, and distribution for DocsClaw. Skills can now be packaged as OCI artifacts, pushed to registries, verified, and pulled by agents.
pkg/skills/card/) — machine-readable metadata for skills with resource hints, tool dependencies, and Agent Skills spec compatibilityinternal/oci/) — pack, push, pull, inspect via oras-go v2 with community-aligned media types and annotationsinternal/verify/) — enforce/warn/skip modes with sigstore-go (key-based verification stubbed for PoC)docsclaw skill pack|push|pull|inspect|verify|list|deletewith--tls-verify,--as-image,--forceflagsskill.yamlwhen present, preferring SkillCard descriptionpodman login/docker loginResolves #4
Verified workflow
Test plan
make test— 18 tests across 4 packages, all passingmake lint— zero errors--tls-verify=false), inspect, pull, list/skills/--as-image) — skills at/skills/resume-screener/SKILL.md@coderabbitai ignore
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
skillCLI command group with pack, push, pull, verify, inspect, list, and delete subcommandsDocumentation