Skip to content

Populate AgentCard skills from discovered skill files #39

Closed

Description

@pavelanni

Summary

When DocsClaw is deployed in OpenShift/K8s, skills are mounted from OCI images or ConfigMaps into a predefined directory. The skill discovery mechanism (pkg/skills/Discover) already scans this directory and extracts metadata (name, description) from SKILL.md frontmatter and optional skill.yaml files. However, this discovered skill metadata is never injected into the AgentCard's skills array — the card is loaded from static agent-card.json and served as-is.

This means the A2A /.well-known/agent.json endpoint does not reflect the actual skills available to the agent at runtime, only what was hardcoded in the config.

Current behavior

  1. internal/cmd/serve.go loads agent-card.json → static skills array
  2. pkg/skills/Discover() scans the skills directory → []SkillMeta{Name, Description, Dir}
  3. Discovered skills are used to build a system prompt summary and register a load_skill tool
  4. No connection between steps 2-3 and the AgentCard served at the A2A endpoint

Expected behavior

After skill discovery, the AgentCard's skills field should be populated (or merged) with a2a.AgentSkill entries derived from the discovered skill metadata. The A2A endpoint should reflect the skills actually available at runtime.

Implementation notes

  • Map SkillMeta → a2a.AgentSkill (id, name, description; tags from skill.yaml if present)
  • Merge with any skills already defined in agent-card.json (static entries should not be overwritten)
  • The DynamicCardHandler already rewrites interface URLs per-request — skill injection can happen once at startup before the handler is created
  • skill.yaml may contain additional fields (tags, examples, inputModes) that map to AgentSkill fields — extract what's available
  • BuildAgentCard() in internal/bridge/agentcard.go already accepts a Skills param but is currently unused — consider whether to use it or inject directly

Key files

File Role
internal/cmd/serve.go Loads card + discovers skills (wiring goes here)
pkg/skills/loader.go Discover(), SkillMeta struct
internal/bridge/agentcard.go BuildAgentCard(), card construction
pkg/skills/card/ Optional skill.yaml parsing with richer metadata

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