Skip to content

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

@pavelanni

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.goDiscover(), LoadContent(),
    BuildSummary() (runtime skill loading, agent-specific)
  • pkg/skills/a2a.goToAgentSkills(), 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.SkillCarda2a.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions