Skip to content

refactor: use skillimage packages for skill.yaml parsing and discovery #40

Open

Description

@pavelanni

Summary

Replace docsclaw's local skill-related packages with imports from
skillimage to avoid
duplication and keep the two projects aligned.

What to replace

docsclaw package skillimage replacement Notes
pkg/skills/card/ skillimage/pkg/skillcard SkillCard parsing, validation, serialization
pkg/skills.ParseSkillYAML() skillimage/pkg/skillcard.Parse() Loose skill.yaml parse in a2a.go
pkg/skills.SkillYAML struct skillimage/pkg/skillcard.SkillCard Metadata struct

What to keep in docsclaw

  • pkg/skills/loader.go — Discover(), LoadContent(),
    BuildSummary() (runtime skill loading, agent-specific)
  • pkg/skills/a2a.go — ToAgentSkills(), MergeSkills()
    (AgentCard population, A2A-specific)

These functions would call into skillimage types instead of local
ones.

Skillimage packages available

Package Purpose
pkg/skillcard Parse, validate, serialize skill.yaml (any apiVersion)
pkg/source Discover skills from directories or git repos
pkg/installed Scan agent directories for installed skills
pkg/collection Parse SkillCollection YAML, generate K8s manifests
pkg/lifecycle Skill status transitions (draft → testing → published)

Steps

  1. Add github.com/redhat-et/skillimage as a dependency
  2. Replace pkg/skills/card/ types with skillcard.SkillCard
  3. Replace ParseSkillYAML() with skillcard.Parse()
  4. Update ToAgentSkills() to map skillcard.SkillCard → a2a.AgentSkill
  5. Remove pkg/skills/card/ package
  6. Verify skill list and Discover() still work

Context

Both projects are maintained by the same team. The skillimage
project owns the skill.yaml schema (currently
skillimage.io/v1alpha1) and should be the single source of truth
for parsing and validation. Docsclaw currently has its own
docsclaw.io/v1alpha1 schema in pkg/skills/card/ plus a loose
SkillYAML struct — both should be replaced by the skillimage
types.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions