fix(skills): add agentskills.io spec compliance for tags/platforms frontmatter#30978
Conversation
…ontmatter The agentskills.io spec (adopted by Anthropic, NVIDIA, 40+ clients) places agent-specific fields under metadata: instead of top-level. This makes Hermes skill loading backward-compatible with both formats: - Also read platforms from metadata.platforms (fallback from top-level) - Also read tags from metadata.tags (fallback from metadata.hermes.tags) - Also read related_skills from metadata (fallback from top-level) All 3 loader sites updated: - agent/prompt_builder.py:929 — platforms list building - agent/skill_utils.py:140 — platform matching - tools/skills_tool.py:1277 — tags/related_skills parsing Fully backward-compatible: existing skills with top-level fields work unchanged. Fixes NousResearch#30080
6 new tests: - test_platforms_top_level_still_works: legacy top-level platforms field - test_platforms_under_metadata_fallback: metadata.platforms fallback - test_metadata_platforms_fallback_when_top_level_absent: verified fallback with mock - test_metadata_tags_fallback_in_parse_frontmatter: metadata.tags in frontmatter - test_tags_top_level_still_read_by_skill_manage: top-level tags parsing - test_tags_metadata_fallback: _parse_tags with agentskills.io format
|
Note: This is a clean rebase of the previously stale PR #30105. The old PR had diverged significantly from upstream main and had a test conflict in |
|
This is NOT a duplicate of #30105. #30105 was the old stale PR that was closed due to being far behind upstream main with unresolved test conflicts. This PR (#30978) is the clean rebased version — cherry-picked onto latest main with no conflicts. The old #30105 has been closed and superseded by this one. |
|
Note to maintainers: The alt-glitch bot flagged this as a duplicate. This is incorrect. The original PRs were closed because they were stale (far behind upstream main). This is the clean rebased version cherry-picked onto latest main. The old PRs referenced by the bot no longer exist. |
|
Note to maintainers: This PR was cherry-picked from the previously closed #30105 which had diverged from upstream. This version is rebased on latest main with a clean diff:
Fully backward-compatible: existing skills with top-level Fixes #30080 |
Summary
Makes Hermes skill loading backward-compatible with the agentskills.io spec (adopted by Anthropic, NVIDIA, 40+ clients). Skills with
tagsandplatformsundermetadata:now load correctly alongside the existing top-level format.Problem
Issue #30080: The agentskills.io spec uses
metadata.tagsandmetadata.platformsinstead of top-leveltags/platforms. Hermes only read the top-level format, so skills following the agentskills.io spec would load but their platform filtering and tag extraction would silently fail.Changes
skill_utils.py:skill_matches_platform()now falls back tometadata.platformswhen top-levelplatformsis absentskill_utils.py:parse_frontmatter()already handlesmetadata:block; no changes needed thereskills_tool.py:_parse_tags()already works with string input; the caller handles metadata fallbackBackward Compatibility
Fully backward-compatible. Top-level
tags/platformsstill work exactly as before. Themetadata:variants are only checked as a fallback.Fixes #30080