Skip to content

feat: OCI-based skill distribution - #21

Merged
pavelanni merged 31 commits into
mainfrom
feature/oci-skill-distribution
Apr 14, 2026
Merged

pavelanni merged 31 commits into
mainfrom
feature/oci-skill-distribution

Conversation

@pavelanni

@pavelanni pavelanni commented Apr 14, 2026 •

Copy link
Copy Markdown
Collaborator

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.

  • SkillCard schema (pkg/skills/card/) — machine-readable metadata for skills with resource hints, tool dependencies, and Agent Skills spec compatibility
  • OCI operations (internal/oci/) — pack, push, pull, inspect via oras-go v2 with community-aligned media types and annotations
  • Signature verification (internal/verify/) — enforce/warn/skip modes with sigstore-go (key-based verification stubbed for PoC)
  • CLI commands — docsclaw skill pack|push|pull|inspect|verify|list|delete with --tls-verify, --as-image, --force flags
  • Backward compatibility — skill loader reads skill.yaml when present, preferring SkillCard description
  • Three example skills — resume-screener, policy-comparator, checklist-auditor (HR use cases)
  • Design spec with community alignment analysis (Vitale OCI spec, Agent Skills spec, Agent Sandbox compatibility)
  • OCI skills guide with deployment manifests for image volumes (OpenShift 4.20+) and init containers
  • Docker/Podman credential resolution — automatic auth from podman login / docker login
  • Two deployment models — image volumes (preferred, OpenShift 4.20+) and init container with PVC (fallback)

Resolves #4

Verified workflow

# Pack and push to quay.io
docsclaw skill pack examples/skills/resume-screener
docsclaw skill push examples/skills/resume-screener quay.io/docsclaw/skill-resume-screener:1.0.0
docsclaw skill inspect quay.io/docsclaw/skill-resume-screener:1.0.0

# Pull to local cache
docsclaw skill pull -o /tmp/skills quay.io/docsclaw/skill-resume-screener:1.0.0
docsclaw skill list /tmp/skills

# Push as mountable image and mount on OpenShift 4.20
docsclaw skill push --as-image examples/skills/resume-screener quay.io/docsclaw/skill-resume-screener:1.0.0-image
# Mount as image volume in pod spec → files at /skills/resume-screener/

Test plan

  • make test — 18 tests across 4 packages, all passing
  • make lint — zero errors
  • End-to-end: pack, push to local Zot (--tls-verify=false), inspect, pull, list
  • Push to quay.io with podman login credentials
  • Inspect from quay.io (public repo, anonymous access)
  • Init container pull from quay.io on OpenShift — skills at /skills/
  • Image volume mount on OpenShift 4.20 (--as-image) — skills at /skills/resume-screener/SKILL.md

@coderabbitai ignore

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • OCI-based skill distribution and packaging system with support for pack, push, pull, verify, and inspect operations with signature verification capabilities
    • New skill CLI command group with pack, push, pull, verify, inspect, list, and delete subcommands
    • Three new example skills: checklist-auditor, policy-comparator, and resume-screener with metadata
  • Documentation

    • Added comprehensive OCI skills guide covering skill packaging, signing, publishing, and deployment workflows
    • Added OCI skill distribution design specification and implementation plan

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]>
@pavelanni

Copy link
Copy Markdown
Collaborator Author

@coderabbitai check

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

@pavelanni Sure, I'll review the changes in this PR right away!

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Apr 14, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@pavelanni has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 17 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 36c4b3bd-4460-4db7-b54a-a02c133b46eb

📥 Commits

Reviewing files that changed from the base of the PR and between 416f70e and 2e6966f.

📒 Files selected for processing (8)
  • internal/cmd/skill_delete.go
  • internal/cmd/skill_pack.go
  • internal/cmd/skill_pull.go
  • internal/oci/pack.go
  • internal/oci/pack_test.go
  • internal/oci/pull.go
  • pkg/skills/card/parse.go
  • pkg/skills/card/parse_test.go
📝 Walkthrough

Walkthrough

This PR introduces OCI-based skill distribution, adding new packages for SkillCard schema definitions and parsing (pkg/skills/card), OCI artifact operations (internal/oci), and signature verification policy handling (internal/verify). It implements CLI subcommands (pack, push, pull, verify, inspect) for managing skills as OCI-distributed artifacts, includes three example skills with metadata, and provides comprehensive design and implementation documentation.

Changes

Cohort / File(s) Summary
Documentation & Configuration
.gitignore, README.md, go.mod, docs/dev/2026-04-12-oci-skill-distribution-design.md, docs/dev/plans/2026-04-13-oci-skill-distribution-plan.md, docs/oci-skills-guide.md
Added .gitignore entry for oci-layout/ directories, expanded README with OCI skill distribution section, added OCI-related dependencies (oras-go/v2, image-spec), and comprehensive design/planning/guide documentation for OCI skill distribution workflow.
SkillCard Package
pkg/skills/card/types.go, pkg/skills/card/parse.go, pkg/skills/card/parse_test.go
Introduced new card package defining SkillCard YAML schema types (SkillCard, SkillCardMeta, SkillCardSpec, ToolDeps, Dependencies, ResourceHints, Compatibility), plus Parse and Validate functions for reading and validating skill.yaml files with regex-based name validation and required-field checks.
OCI Operations Package
internal/oci/media.go, internal/oci/pack.go, internal/oci/pack_test.go, internal/oci/push.go, internal/oci/pull.go, internal/oci/inspect.go, internal/oci/push_pull_test.go
Implemented core OCI artifact handling: media.go defines artifact type and annotation constants; pack.go creates deterministic OCI artifacts from skill directories (two-layer artifacts or single-layer images); push.go and pull.go handle registry operations with optional TLS/credential support; inspect.go fetches and parses SkillCard metadata from remote artifacts without full download; tests validate pack/push/pull/inspect workflows using in-memory registries.
Signature Verification Package
internal/verify/policy.go, internal/verify/verify.go, internal/verify/verify_test.go
Added verify package defining Policy type with Mode constants (enforce/warn/skip) and configurable public key path; Verify function implements mode-based verification behavior (skip/warn/enforce) with stub cosign integration; tests cover skip mode and enforce-without-key error handling.
Skill CLI Subcommands
internal/cmd/skill.go, internal/cmd/skill_pack.go, internal/cmd/skill_push.go, internal/cmd/skill_pull.go, internal/cmd/skill_verify.go, internal/cmd/skill_inspect.go, internal/cmd/skill_delete.go, internal/cmd/skill_list.go
Added new skill command group with subcommands: pack (with --as-image, --output, --force flags), push (with --as-image, --tls-verify flags), pull (with --verify, --key, --output, --tls-verify flags), verify (with required --key flag), inspect (with --tls-verify flag), delete (with --dir flag), and list (optional skills-dir argument); each wraps underlying OCI/verify package operations.
Example Skills
examples/skills/checklist-auditor/SKILL.md, examples/skills/checklist-auditor/skill.yaml, examples/skills/policy-comparator/SKILL.md, examples/skills/policy-comparator/skill.yaml, examples/skills/resume-screener/SKILL.md, examples/skills/resume-screener/skill.yaml
Added three example skills (checklist-auditor, policy-comparator, resume-screener), each with SKILL.md workflow documentation and skill.yaml SkillCard manifests defining metadata, tool requirements, resource hints, and compatibility constraints.
Existing Code Cleanup
internal/cmd/serve.go, internal/config/config.go, internal/bridge/signedcard.go, pkg/skills/loader.go, pkg/skills/loader_test.go
Updated serve.go to suppress unused BindPFlag return values and mark unused llmProvider parameter; updated config.go and signedcard.go for linting (unused variable assignments); modified loader.go to prefer skill.yaml SkillCard metadata over SKILL.md frontmatter when both exist; added TestDiscoverWithSkillCard to validate precedence behavior.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.51% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: OCI-based skill distribution' clearly and concisely describes the primary feature added in this PR: OCI-based packaging and distribution of DocsClaw skills.
Linked Issues check ✅ Passed The PR fully implements all coding objectives from issue #4: OCI artifacts spec packaging via oras-go (Pack/Push/Pull/Inspect), SkillCard schema for metadata, signature verification support, CLI commands, backward-compatible loader integration, and deployment documentation.
Out of Scope Changes check ✅ Passed All code changes are in-scope: OCI operations, SkillCard schema, verification, CLI commands, and loader updates directly address issue #4. Minor linting fixes (unused return value assignments) and documentation are consistent with implementation scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/oci-skill-distribution

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/SandboxClaim future-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 list and docsclaw skill delete so 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: Align metadata.ref with namespace-based naming convention.

metadata.namespace is official, but the ref omits that namespace path. Using quay.io/docsclaw/official/skill-checklist-auditor would 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.

BindPFlag errors 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, consider quay.io/docsclaw/official/skill-resume-screener to 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: Handle BindPFlag errors 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 BindFlags or 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 references skill.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 invalid skill.yaml.
If skill.yaml exists but is malformed, discovery currently falls back quietly to SKILL.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 AsImage to false, so the image-specific manifest/config branch introduced by this PR still has no regression coverage. A small table-driven variant with AsImage: true would 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 %v for the slice produces Go-style output like [read_file write_file]. The plan document (line 1747) shows skill_inspect.go using strings.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: --verify without --key provides no actual verification.

When --verify is passed without --key, the code sets ModeWarn which (per internal/verify/verify.go) logs a warning and returns nil — the pull proceeds without any verification. Users might expect --verify alone to fail or at least indicate that verification was skipped.

Consider either:

  1. Requiring --key when --verify is set
  2. 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/docsclaw is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 25778f8 and 416f70e.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (38)
  • .gitignore
  • README.md
  • docs/dev/2026-04-12-oci-skill-distribution-design.md
  • docs/dev/plans/2026-04-13-oci-skill-distribution-plan.md
  • docs/oci-skills-guide.md
  • examples/skills/checklist-auditor/SKILL.md
  • examples/skills/checklist-auditor/skill.yaml
  • examples/skills/policy-comparator/SKILL.md
  • examples/skills/policy-comparator/skill.yaml
  • examples/skills/resume-screener/SKILL.md
  • examples/skills/resume-screener/skill.yaml
  • go.mod
  • internal/bridge/signedcard.go
  • internal/cmd/serve.go
  • internal/cmd/skill.go
  • internal/cmd/skill_delete.go
  • internal/cmd/skill_inspect.go
  • internal/cmd/skill_list.go
  • internal/cmd/skill_pack.go
  • internal/cmd/skill_pull.go
  • internal/cmd/skill_push.go
  • internal/cmd/skill_verify.go
  • internal/config/config.go
  • internal/oci/inspect.go
  • internal/oci/media.go
  • internal/oci/pack.go
  • internal/oci/pack_test.go
  • internal/oci/pull.go
  • internal/oci/push.go
  • internal/oci/push_pull_test.go
  • internal/verify/policy.go
  • internal/verify/verify.go
  • internal/verify/verify_test.go
  • pkg/skills/card/parse.go
  • pkg/skills/card/parse_test.go
  • pkg/skills/card/types.go
  • pkg/skills/loader.go
  • pkg/skills/loader_test.go

Comment on lines +18 to +29
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%)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Comment thread internal/cmd/skill_delete.go Resolved
Comment thread internal/cmd/skill_pack.go Resolved
Comment thread internal/cmd/skill_pull.go Resolved
Comment thread internal/oci/pack.go Resolved
Comment thread internal/oci/pull.go Resolved
Comment thread internal/oci/push.go
Comment on lines +81 to +92
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(),
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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:


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.

Comment thread internal/verify/verify.go
Comment on lines +43 to +46
// 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Comment thread pkg/skills/card/parse_test.go Resolved
Comment thread pkg/skills/card/parse.go Resolved
@pavelanni

Copy link
Copy Markdown
Collaborator Author

Code review

Found 1 issue:

  1. Unnecessary memory copy in extractTarGz: strings.NewReader(string(data)) converts the []byte layer data to a string (copying the entire slice), then wraps it in a strings.NewReader. Since data is already a []byte, use bytes.NewReader(data) directly to avoid doubling memory usage. OCI layers can be large, and this path runs on every skill pull.

// Create gzip reader
gr, err := gzip.NewReader(strings.NewReader(string(data)))
if err != nil {
return fmt.Errorf("failed to create gzip reader: %w", err)
}

🤖 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]>
@pavelanni

Copy link
Copy Markdown
Collaborator Author

@coderabbitai check

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

@pavelanni Sure! I'll trigger a review of the latest changes in this PR right away.

Also, noting the excellent catch from your earlier comment — the unnecessary memory copy in extractTarGz (Lines 111–115 of internal/oci/pull.go) is a real concern. Replacing:

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 performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@pavelanni
pavelanni merged commit ea1de23 into main Apr 14, 2026
2 checks passed
@pavelanni
pavelanni deleted the feature/oci-skill-distribution branch April 14, 2026 12:46
@pavelanni pavelanni mentioned this pull request Apr 14, 2026
2 tasks done
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-based skill distribution

1 participant