Open-source skills for designing and reviewing software with AI agents
Python agent-skillsai-agentsantigravityclaude-codeclaude-code-pluginclaude-skillscodexcodex-plugincoding-agentscontext-engineeringdeveloper-toolsgeminillmmulti-agentprompt-engineeringspec-driven-development
fix(packaging): check codex manifest icons in the openai zip (#286)
Rup Sarmah464db031e7dd
diff --git a/scripts/pack_plugin.py b/scripts/pack_plugin.pyindex bc40d2f..74c6eb2 100644--- a/scripts/pack_plugin.py+++ b/scripts/pack_plugin.py@@ -89,13 +89,16 @@ def build(root: Path, target: str, output: Path) -> tuple[Path, Path]:if not isinstance(agents, (str, list)):raise ValueError(f"Invalid manifest agents: {agents!r}")references = [agents] if isinstance(agents, str) else list(agents)- interface = openai.get("interface", {})if target == "openai":- interface = interface or manifest.get("interface", {})- for key in ("composerIcon", "logo"):- if not interface.get(key):- raise ValueError(f"Missing OpenAI interface reference: {key}")- references.append(interface[key])+ # Codex reads the host manifest, so check it as well as the portable copy.+ interfaces = [manifest.get("interface", {})]+ if "interface" in openai:+ interfaces.append(openai["interface"])+ for interface in interfaces:+ for key in ("composerIcon", "logo"):+ if not interface.get(key):+ raise ValueError(f"Missing OpenAI interface reference: {key}")+ references.append(interface[key])else:references.append(manifest.get("icon", "./.claude-plugin/icon.png"))for reference in references:diff --git a/tests/unit/test_packaging.py b/tests/unit/test_packaging.pyindex 12b721f..b2fdcdf 100644--- a/tests/unit/test_packaging.py+++ b/tests/unit/test_packaging.py@@ -247,6 +247,18 @@ def test_rejects_missing_openai_interface_icons(build(source, "openai", tmp_path / "output")[email protected]("key", ["composerIcon", "logo"])+def test_rejects_unbundled_codex_manifest_icons(+ source: Path, tmp_path: Path, key: str,+) -> None:+ path = source / ".codex-plugin/plugin.json"+ manifest = json.loads(path.read_text())+ manifest["interface"][key] = "./assets/missing.svg"+ path.write_text(json.dumps(manifest))+ with pytest.raises(ValueError, match="Unbundled manifest reference"):+ build(source, "openai", tmp_path / "output")++def test_refuses_hooks_and_overwrites(source: Path, tmp_path: Path) -> None:output = tmp_path / "output"build(source, "claude", output)