feat(core): agent skills package and skill:// resources - #190
feat(core): agent skills package and skill:// resources#190Kartikeya-trivedi wants to merge 1 commit into
Conversation
Publish Kubeflow training workflows as an Agent Skill and serve them via skill:// MCP resources (SEP-2640 proposal): - skills/kubeflow-training/SKILL.md: agentskills.io-compliant skill with YAML frontmatter and progressive disclosure, deferring detail to MCP resources served by this server - skills/kubeflow-training/mcp.json: wires the skill to kubeflow-mcp - CLIENT_SKILLS in trainer module: maps trainer://guides/* onto skill://kubeflow/* aliases (same cached content, no duplication) - skill://index.json resource: JSON index of all skills the server serves Fixes: kubeflow#184 Signed-off-by: Kartikeya Trivedi <kartikeyatrivedi4oct2004@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/ok-to-test |
| description = descriptions[source_uri] | ||
| mcp.resource(skill_uri)(_make_handler(cache, skill_uri, description)) | ||
| skill_resources.append({"uri": skill_uri, "description": description}) | ||
| logger.debug(f"Registered skill alias: {skill_uri} -> {source_uri}") |
There was a problem hiding this comment.
If every alias for a skill fails to resolve, here it still append an entry with "resources": []. Consider skipping the append when skill_resources is empty, so skill://index.json doesn't advertise broken skills.
| register_resources(mock_mcp, {"trainer": trainer_module}) | ||
| assert mock_mcp.resource.call_count == 3 | ||
| # 3 trainer://guides/* + 3 skill://kubeflow/* aliases + skill://index.json | ||
| assert mock_mcp.resource.call_count == 7 |
There was a problem hiding this comment.
it seems brittle magic number.. it will break when optimizer/hub clients add their own CLIENT_SKILLS. I would prefer counting CLIENT_RESOURCES + aliases + index dynamically. WDYT?
Description
Publishes Kubeflow training workflows as an Agent Skill (agentskills.io) and serves them via
skill://MCP resources, per the SEP-2640 skills-extension proposal.Approach: rather than duplicating guide content,
skill://kubeflow/*URIs are registered as aliases of the existingtrainer://guides/*resources — same startup cache, both URI schemes served, existing consumers untouched.skills/kubeflow-training/SKILL.md— spec-compliant (YAML frontmatter, progressive disclosure): a thin workflow body that defers detail to the MCP resources served by this server, which is exactly the SEP-2640 patternskills/kubeflow-training/mcp.json— wires the skill tokubeflow-mcp serveCLIENT_SKILLSdeclaration in the trainer module mapstrainer://guides/*→skill://kubeflow/*; the mechanism is generic, so future client modules (optimizer, hub) can declare their own skills with no core changesskill://index.jsonserved as an MCP resource (application/json), generated at startup:{version, skills: [{name, description, resources: [{uri, description}]}]}Note: the SEP-2640 link in the issue 404s — the SEP has not merged into the MCP spec repo, so it is cited here as a proposal and treated as directional.
Works in Claude Code and Cursor with no extra config (skills are read from
skills/; resources come from the connected server). Ready to publish to skills.sh.Related Issue
Fixes #184
Checklist
make test-python)make verify)git commit -s)Testing
New
TestAgentSkillssuite covers: alias URIs resolve to existing resources, aliased handlers serve byte-identical content,skill://index.jsonstructure, and skill package files exist with valid frontmatter. Full suite: 515 passed, ruff clean.Manual verification through an in-process FastMCP client — all 7 resources listed and alias content matches the source: