Skip to content

Remove OCI skill code, populate AgentCard from discovered skills - #41

Merged
pavelanni merged 13 commits into
mainfrom
refactor/skill-cleanup-and-agentcard
May 3, 2026
Merged

pavelanni merged 13 commits into
mainfrom
refactor/skill-cleanup-and-agentcard

Conversation

@pavelanni

@pavelanni pavelanni commented May 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Remove OCI skill management code moved to the
    skillimage project
    (internal/oci/, internal/verify/, 5 CLI commands). Drops
    oras.land/oras-go/v2 dependency. Closes refactor: remove OCI skill management code (moved to skillimage) #38
  • Populate AgentCard skills from discovered skill files at
    runtime. The A2A endpoint at /.well-known/agent-card.json now
    reflects skills mounted as ConfigMaps or OCI image volumes.
    Closes Populate AgentCard skills from discovered skill files #39
  • Add --skills-dir flag to mount skills at a separate path
    from --config-dir, avoiding a Kubernetes limitation where
    image volumes nested under ConfigMap mounts appear empty
  • Accept any skill.yaml format — loose parse without
    apiVersion checks, supporting both skillimage.io and docsclaw.io
    schemas
  • Add Kagenti discovery labels to all demo deployment manifests
  • Update docs — CLI examples reference skillctl, document
    the K8s volume nesting gotcha

What changed

Area Change
internal/oci/ Deleted (7 files, ~1400 lines)
internal/verify/ Deleted (3 files)
internal/cmd/skill_*.go Removed pack, push, pull, inspect, verify
pkg/skills/a2a.go New: ToAgentSkills(), MergeSkills(), ParseSkillYAML()
pkg/skills/a2a_test.go 6 test cases (docsclaw format, skillimage format, fallback, empty, mixed, dedup)
internal/cmd/serve.go Wire skill discovery into AgentCard, add --skills-dir flag
docs/oci-skills-guide.md CLI → skillctl, volume nesting gotcha
docs/demo/skill-discovery-test.yaml New test manifest for OpenShift

Verified on

  • Local: testdata/standalone — 3 skills (1 static + 2 discovered)
  • OpenShift 4.20: ConfigMap skill + OCI image volume skill both
    appear in AgentCard with tags and examples

Test plan

  • make build passes
  • make test passes (all packages)
  • make lint clean (pre-existing errcheck issues only)
  • go mod tidy — oras/opencontainers deps removed
  • No references to deleted packages remain
  • Local test: skills appear in AgentCard
  • OpenShift test: both ConfigMap and image volume skills discovered
  • a2a discover shows skills on deployed agent

Summary by CodeRabbit

Release Notes

  • New Features

    • Skills are now automatically discovered at runtime and injected into the served agent card.
    • Added --skills-dir configuration option to specify where skills are discovered.
  • Bug Fixes

    • Removed OCI skill management CLI commands (pack, push, pull, inspect, verify)—use skillctl instead.
  • Documentation

    • Updated skill distribution guide and examples to use skillctl CLI.
    • Added skill discovery test example and volume nesting guidance.
  • Chores

    • Removed OCI and signature verification dependencies.
    • Updated demo manifests with agent protocol labeling.

pavelanni added 11 commits May 2, 2026 21:54
Covers issues #38 (remove OCI code moved to skillimage) and #39
(populate AgentCard skills from discovered skill files).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Six-task plan covering OCI code removal (#38) and AgentCard skill
population (#39).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Remove internal/oci/, internal/verify/, and CLI commands skill pack,
push, pull, inspect, verify. This code now lives in the skillimage
project and its skillctl CLI.

Keep local skill management (list, delete), runtime skill discovery
(pkg/skills/), and SkillCard parsing (pkg/skills/card/).

Closes #38

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Map discovered SkillMeta to a2a.AgentSkill with optional SkillCard
enrichment (tags from namespace, author, required tools). MergeSkills
handles deduplication with static entries winning on ID conflict.

Refs #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Move skill discovery before the toolRegistry block so discovered
skills are injected into the AgentCard in both phase 1 and phase 2
modes. The A2A endpoint now reflects runtime-available skills.

Static skills from agent-card.json are preserved; discovered skills
are merged with static entries winning on ID conflict.

Closes #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
- README: document automatic AgentCard skill injection, replace
  docsclaw skill commands with skillctl
- OCI skills guide: replace all docsclaw skill CLI examples with
  skillctl, update init container to use skillctl image
- examples/openshift/agent-pod-pull.yaml: use skillctl image

Refs #38, #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Initialize Tags to empty slice for skills without skill.yaml so
the AgentCard JSON serializes as "tags": [] instead of "tags": null.

Add docs/demo/skill-discovery-test.yaml that demonstrates pure
skill discovery — agent-card.json has empty skills array, skills
come from an OCI image volume and a ConfigMap.

Refs #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Add --skills-dir flag to docsclaw serve so skills can be mounted at
a separate path from --config-dir. This avoids a Kubernetes
limitation where image volumes mounted as subdirectories of a
ConfigMap volume appear empty.

Update skill-discovery-test.yaml to mount skills at /skills/ using
the new flag. Document the volume nesting gotcha in the OCI skills
guide with broken/working examples.

Refs #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Replace strict card.Parse() (requires docsclaw.io/v1alpha1) with a
loose YAML parse that extracts AgentSkill-relevant fields from any
skill.yaml regardless of apiVersion. This supports skillimage.io
format alongside the docsclaw format.

When explicit tags are present (skillimage format), use them
directly. Otherwise derive tags from namespace/author/tools
(docsclaw format). Also extract examples from spec.examples.

Refs #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Replace all card.Parse() callers (which required
docsclaw.io/v1alpha1) with the loose ParseSkillYAML that accepts
any apiVersion. This affects Discover() in loader.go and the
skill list command.

The card package with strict validation is retained but no longer
used outside its own tests.

Refs #39

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Add labels for Kagenti agent platform discovery:
- kagenti.io/type: agent
- protocol.kagenti.io/a2a: ""
- a2a-agent.demo/protocol: a2a
- a2a-agent.demo/type: agent

Applied to executive-assistant, hr-analyst, and
skill-discovery-test deployments.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented May 3, 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 15 minutes and 4 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ 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: Enterprise

Run ID: 85fecf49-a7a3-4f01-83cd-95b24381aff2

📥 Commits

Reviewing files that changed from the base of the PR and between 4eaf316 and bccd7b3.

📒 Files selected for processing (7)
  • docs/demo/executive-assistant.yaml
  • docs/demo/hr-analyst.yaml
  • docs/demo/skill-discovery-test.yaml
  • docs/oci-skills-guide.md
  • docs/superpowers/specs/2026-05-02-skill-cleanup-agentcard-design.md
  • internal/cmd/skill_list.go
  • pkg/skills/loader.go
📝 Walkthrough

Walkthrough

This PR removes OCI skill pack/push/pull/inspect functionality (delegated to the skillimage project's skillctl CLI) and injects runtime-discovered skills into the served AgentCard. Changes include deleting internal/oci/ and internal/verify/ packages, removing five CLI subcommands, adding pkg/skills/a2a.go for skill-to-AgentCard conversion, updating serve.go to merge discovered skills into the card, and updating documentation and examples.

Changes

OCI Skill Management Code Removal

Layer / File(s) Summary
Core Package Deletion
internal/oci/*, internal/verify/*
Remove Pack, Push, Pull, Inspect implementations; delete media-type/annotation constants; remove policy and verification logic with oras-go and OCI operations.
CLI Command Deletion
internal/cmd/skill_pack.go, skill_push.go, skill_pull.go, skill_inspect.go
Remove Cobra subcommands pack, push, pull, inspect with their flag definitions and RunE control flows.
Test Cleanup
internal/oci/extract_test.go, internal/oci/pack_test.go, internal/oci/push_pull_test.go, internal/verify/verify_test.go
Delete all test coverage for removed OCI operations and signature verification.
Dependency & Wiring Updates
go.mod, internal/cmd/skill.go
Remove direct dependencies oras.land/oras-go/v2 and github.com/opencontainers/image-spec; update skill command help text to reflect only local list/delete management.

AgentCard Skill Injection from Discovered Skills

Layer / File(s) Summary
Skill-to-AgentCard Conversion
pkg/skills/a2a.go
Add SkillYAML schema, ParseSkillYAML for reading metadata from disk, ToAgentSkills to map SkillMeta → a2a.AgentSkill with optional skill.yaml enrichment (tags, examples), MergeSkills for ID-based deduplication with static entries winning, and deriveTags/deriveExamples helpers.
Discovery Integration
internal/cmd/serve.go
Add --skills-dir flag (defaults to <config-dir>/skills), move skill discovery to both phases, convert discovered skills via ToAgentSkills, merge into agentCard.Skills, and register load_skill tool only when skills were discovered.
Skill Loader Update
pkg/skills/loader.go
Replace card.Parse with ParseSkillYAML for reading metadata; conditionally update description only when skill.yaml metadata is non-empty.
Tests
pkg/skills/a2a_test.go
Add comprehensive test suite covering skill.yaml with SkillCard metadata, fallback-only SKILL.md, empty input, mixed inputs, skillimage.io format, and MergeSkills deduplication.
Documentation & Examples
docs/oci-skills-guide.md, docs/demo/skill-discovery-test.yaml, examples/openshift/agent-pod-pull.yaml
Update OCI skills guide to use skillctl commands and document volume nesting constraints; add Kubernetes manifest demonstrating skill discovery into agent-card.json; update init container example to use skillctl image instead of docsclaw.

Documentation, Specifications & Examples

Layer / File(s) Summary
Guidance Updates
README.md
Add "Automatic AgentCard skill injection" section explaining runtime discovery and static-skill precedence; update "OCI skill distribution" to reference skillctl pack/push/inspect instead of docsclaw skill subcommands.
Design & Planning Documents
docs/superpowers/plans/2026-05-03-skill-cleanup-agentcard.md, docs/superpowers/specs/2026-05-02-skill-cleanup-agentcard-design.md
Document implementation tasks for OCI code removal and AgentCard skill injection with verification steps and expected test coverage.
OCI Registry Specification & Landscape
docs/superpowers/specs/2026-04-15-oci-skill-registry-design.md, docs/superpowers/specs/2026-04-15-oci-skill-registry-landscape.md
Establish architecture, schema, naming, lifecycle, REST API, and competitive positioning for the external skillimage OCI registry project.
Agent Demo Labeling
docs/demo/executive-assistant.yaml, docs/demo/hr-analyst.yaml
Add Kagenti type/protocol labels (kagenti.io/type, protocol.kagenti.io/a2a, a2a-agent.demo/*) to agent Deployments for A2A protocol identification.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The PR spans multiple independent layers (OCI removal, skill injection, documentation) with heterogeneous changes: deletion of deep OCI/verify implementations and extensive CLI command wiring, introduction of new conversion logic with multiple helper functions and fallback chains, and integration into the serve-time card-building flow. Review requires separate reasoning for package removals (ensuring no dangling imports), new conversion logic (validating YAML parsing and tag/example derivation), serve.go wiring (ensuring skills are discovered and merged at the correct phase), and verification that all removed references are cleaned up. The breadth of affected files (13 deletions, 10 additions spanning internal/cmd/, internal/oci/, internal/verify/, pkg/skills/, docs/, and manifests) and mixture of removal + addition patterns increase cognitive load despite individual changes being well-scoped.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.67% 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 accurately summarizes the two main changes: removing OCI skill code and populating AgentCard from discovered skills.
Linked Issues check ✅ Passed All objectives from linked issues #38 and #39 are comprehensively addressed: OCI code removed (#38), CLI commands deleted, oras dependency dropped, local discovery retained, docs updated; AgentCard now populated with discovered skills (#39) with proper merging logic.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the stated objectives. Documentation updates, demo manifest labels, and new pkg/skills/a2a.go implementation all support the core goals of removing OCI code and populating AgentCard.

✏️ 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 refactor/skill-cleanup-and-agentcard

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Review rate limit: 0/1 reviews remaining, refill in 15 minutes and 4 seconds.

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

Address review feedback: silent fallback to SKILL.md lost
observability for malformed skill.yaml files.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni
pavelanni marked this pull request as ready for review May 3, 2026 19:20

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/cmd/skill_list.go (1)

46-62: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Keep skill list informative when skill.yaml is missing or invalid.

This fallback currently prints the directory name plus "(no skill.yaml)", even though the SKILL.md frontmatter already has the skill name and description. That regresses the command for markdown-only skills and hides parse failures behind a generic placeholder.

🤖 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 46 - 62, When
skills.ParseSkillYAML(cardPath) fails, don’t immediately fall back to printing
entry.Name() with "(no skill.yaml)"; instead attempt to read and parse SKILL.md
frontmatter to extract name and description (use the repository's
frontmatter/markdown parser or add one) and print those values (name, version or
"-" if absent, description) using the same fmt.Printf formatting; if SKILL.md
parsing also fails, print the directory name but include the original
ParseSkillYAML error (and/or the SKILL.md parse error) in the output so parse
failures aren't hidden (referencing cardPath, mdPath, sy, and entry.Name()).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/demo/executive-assistant.yaml`:
- Around line 96-101: The Deployment's labels (app, kagenti.io/type,
protocol.kagenti.io/a2a, a2a-agent.demo/protocol, a2a-agent.demo/type) are only
on the Deployment metadata and must be copied into the Pod template so running
Pods expose the same labels; update the Deployment spec.template.metadata.labels
to include those same keys and values (mirror the labels block currently under
metadata.labels into spec.template.metadata.labels) so Kagenti/A2A discovery and
any label-based selection on Pod metadata will work.

In `@docs/demo/hr-analyst.yaml`:
- Around line 103-108: The Deployment's labels (app, kagenti.io/type,
protocol.kagenti.io/a2a, a2a-agent.demo/protocol, a2a-agent.demo/type) are only
on the Deployment metadata and need to be mirrored onto the Pod template so
running Pods inherit them; update the Deployment spec.template.metadata.labels
to include the same label keys and values (ensure spec.template.metadata.labels
matches metadata.labels) so Kagenti/A2A discovery and any pod-level label
selection will see these labels on pods.

In `@docs/oci-skills-guide.md`:
- Around line 163-168: The example mixes two CLI names; pick one and make both
lines consistent. Replace the mixed snippet so both commands use the same CLI
surface (e.g., change "docsclaw skill list" to "skillctl list" and "docsclaw
skill delete resume-screener --dir /tmp/skills" to "skillctl delete
resume-screener --dir /tmp/skills"), or alternatively switch both lines to the
"docsclaw skill ..." form if DocsClaw is still the canonical tool; ensure the
final block consistently uses either the skillctl or docsclaw command names
(referencing the "docsclaw skill list" / "docsclaw skill delete" and "skillctl
list" / "skillctl delete" symbols to locate and change the lines).

In `@docs/superpowers/specs/2026-05-02-skill-cleanup-agentcard-design.md`:
- Around line 10-13: Update the doc so it references the correct AgentCard
endpoint path by replacing any occurrences of "/.well-known/agent.json" with
"/.well-known/agent-card.json" and ensure mentions of the AgentCard endpoint
align with the server/demo manifest and pkg/skills/Discover() behavior; also
remove the noted dead code that references the old endpoint so the document no
longer points readers to a non-existent path and matches runtime discovery of
skills.

---

Outside diff comments:
In `@internal/cmd/skill_list.go`:
- Around line 46-62: When skills.ParseSkillYAML(cardPath) fails, don’t
immediately fall back to printing entry.Name() with "(no skill.yaml)"; instead
attempt to read and parse SKILL.md frontmatter to extract name and description
(use the repository's frontmatter/markdown parser or add one) and print those
values (name, version or "-" if absent, description) using the same fmt.Printf
formatting; if SKILL.md parsing also fails, print the directory name but include
the original ParseSkillYAML error (and/or the SKILL.md parse error) in the
output so parse failures aren't hidden (referencing cardPath, mdPath, sy, and
entry.Name()).
🪄 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: Enterprise

Run ID: b672d680-0452-4d97-9292-7722e79aa64d

📥 Commits

Reviewing files that changed from the base of the PR and between 58ee255 and 4eaf316.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (33)
  • README.md
  • docs/demo/executive-assistant.yaml
  • docs/demo/hr-analyst.yaml
  • docs/demo/skill-discovery-test.yaml
  • docs/oci-skills-guide.md
  • docs/superpowers/plans/2026-05-03-skill-cleanup-agentcard.md
  • docs/superpowers/specs/2026-04-15-oci-skill-registry-design.md
  • docs/superpowers/specs/2026-04-15-oci-skill-registry-landscape.md
  • docs/superpowers/specs/2026-05-02-skill-cleanup-agentcard-design.md
  • examples/openshift/agent-pod-pull.yaml
  • go.mod
  • internal/cmd/serve.go
  • internal/cmd/skill.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/oci/extract_test.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/a2a.go
  • pkg/skills/a2a_test.go
  • pkg/skills/loader.go
💤 Files with no reviewable changes (17)
  • internal/verify/policy.go
  • internal/verify/verify.go
  • internal/oci/media.go
  • internal/oci/push.go
  • internal/oci/pull.go
  • internal/cmd/skill_push.go
  • internal/verify/verify_test.go
  • internal/oci/extract_test.go
  • internal/oci/pack_test.go
  • go.mod
  • internal/cmd/skill_verify.go
  • internal/cmd/skill_pack.go
  • internal/oci/push_pull_test.go
  • internal/cmd/skill_inspect.go
  • internal/oci/inspect.go
  • internal/cmd/skill_pull.go
  • internal/oci/pack.go

Comment thread docs/demo/executive-assistant.yaml Resolved
Comment thread docs/demo/hr-analyst.yaml Resolved
Comment thread docs/oci-skills-guide.md Resolved
- Mirror Kagenti labels onto pod template labels so pods are
  discoverable (executive-assistant, hr-analyst, skill-discovery-test)
- Fix mixed CLI names in oci-skills-guide.md (list/delete stay in
  docsclaw)
- Fix endpoint typo in design spec (agent.json → agent-card.json)
- Show SKILL.md name/description in skill list fallback instead of
  "(no skill.yaml)"

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni
pavelanni merged commit 5f4c2da into main May 3, 2026
3 checks passed
@pavelanni
pavelanni deleted the refactor/skill-cleanup-and-agentcard branch May 3, 2026 20:06
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.

Populate AgentCard skills from discovered skill files refactor: remove OCI skill management code (moved to skillimage)

1 participant