The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(website): tolerate optional catalog artwork manifest
Brooklyn Nicholsonbd361db20071
diff --git a/tests/website/test_extract_skills.py b/tests/website/test_extract_skills.pyindex 0b946fc1ddf..c702c9a36ba 100644--- a/tests/website/test_extract_skills.py+++ b/tests/website/test_extract_skills.py@@ -48,6 +48,26 @@ def test_local_skills_publish_exact_install_target(mod, tmp_path, monkeypatch, dexpected = f"{prefix}/creative/nested/example"assert entry["installIdentifier"] == expectedassert entry["installCmd"] == f"hermes skills install {expected}"+ assert "image" not in entry++[email protected]("directory", ["skills", "optional-skills"])+def test_local_skills_publish_mapped_artwork_only(mod, tmp_path, monkeypatch, directory):+ for name in ("illustrated", "plain"):+ skill = tmp_path / directory / "creative" / name+ skill.mkdir(parents=True)+ (skill / "SKILL.md").write_text(f"---\nname: {name}\n---\nExample.")+ manifest = tmp_path / "apps/shared/src/catalog-artwork.json"+ manifest.parent.mkdir(parents=True)+ manifest.write_text(json.dumps({"skills": {"creative/illustrated": "art.jpg"}}))+ monkeypatch.setattr(mod, "REPO_ROOT", str(tmp_path))++ entries = {entry["name"]: entry for entry in mod.extract_local_skills()}++ assert entries["illustrated"]["image"] == (+ "https://raw.githubusercontent.com/NousResearch/hermes-agent/main/website/static/img/catalog/art.jpg"+ )+ assert "image" not in entries["plain"]def test_unified_skills_keep_source_identifiers_and_match_cli_install_targets(mod, tmp_path, monkeypatch):diff --git a/website/scripts/extract-skills.py b/website/scripts/extract-skills.pyindex c7162a237a5..7d2bc8f1741 100644--- a/website/scripts/extract-skills.py+++ b/website/scripts/extract-skills.py@@ -252,8 +252,12 @@ def _source_url(source: str, identifier: str, extra: dict) -> str:def extract_local_skills():skills = []- with open(os.path.join(REPO_ROOT, "apps/shared/src/catalog-artwork.json"), encoding="utf-8") as artwork_file:- artwork = json.load(artwork_file)["skills"]+ try:+ with open(os.path.join(REPO_ROOT, "apps/shared/src/catalog-artwork.json"), encoding="utf-8") as artwork_file:+ artwork = json.load(artwork_file)["skills"]+ except FileNotFoundError:+ # Artwork is optional; a skills-only checkout still produces a catalog.+ artwork = {}for base_dir, source_label in LOCAL_SKILL_DIRS:base_path = os.path.join(REPO_ROOT, base_dir)