Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

feat(harness): check the plugin components each harness delivers (#543)

Christopher Kevin468db731a214
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 843c71cb..16efd1c0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,9 @@ All notable changes to SkillEvaluator are documented in this file.
comment helpers, and needs no Pages configuration or history branch. Future
generated bundles include the template; archived bundles and the released
onboarding CLI retain their existing hosted publisher setup.
+- Plugin component rules: skill namespacing, Codex's plugin-skill cap and Agent
+ Plugins hooks, Copilot CLI MCP server names, disabled plugins, and components a
+ harness does not deliver.
- `harness-check` on a plugin folder shows which plugin formats each harness
accepts (`.claude-plugin`, `.codex-plugin`, Copilot, Agent Plugins v1, Hermes
`plugin.yaml`) and flags an empty plugin.
diff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdx
index d6d414a4..dbcc2591 100644
--- a/docs/tier1-validation.mdx
+++ b/docs/tier1-validation.mdx
@@ -296,6 +296,8 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice
Gate rules: Hermes `platforms` and OpenClaw `metadata.openclaw.requires` hide the skill on hosts that don't match.
`harness-check` on a plugin folder also shows a plugin panel: which plugin formats each harness accepts (`.claude-plugin`, `.codex-plugin`, Copilot, Agent Plugins v1, Hermes `plugin.yaml`), and an empty plugin.
+
+ Plugin component rules cover skill namespacing, Codex's plugin-skill cap and Agent Plugins hooks, Copilot CLI MCP server names, disabled plugins, and components a harness registers but doesn't deliver.
</Accordion>
<Accordion title="security — vulnerability scanning">
diff --git a/src/skillevaluator/harness/plugin.py b/src/skillevaluator/harness/plugin.py
index bd719393..3399b0c5 100644
--- a/src/skillevaluator/harness/plugin.py
+++ b/src/skillevaluator/harness/plugin.py
@@ -3,13 +3,15 @@
"""Static plugin facts and per-harness plugin rules.
A profile's ``plugin`` section has ``rules`` (format acceptance, same expression
-language as skill rules). Like the skill overlay, this is advisory and never
-changes Tier 1 results.
+language as skill rules) and ``components`` (what the pinned harness version did
+with each component kind in canary probes). Like the skill overlay, this is
+advisory and never changes Tier 1 results.
"""
from __future__ import annotations
import json
+import stat
from pathlib import Path
from typing import Any
@@ -25,8 +27,63 @@ MANIFESTS = {
"hermes_native": "plugin.yaml",
}
AGENT_PLUGINS_SCHEMA = "https://agent-plugins.org/schemas/"
+COMPONENTS = {
+ "skills": lambda r: len(_skill_sizes(r)),
+ "commands": lambda r: len(list((r / "commands").rglob("*.md"))) if (r / "commands").is_dir() else 0,
+ "agents": lambda r: len(list((r / "agents").rglob("*.md"))) if (r / "agents").is_dir() else 0,
+ "hooks": lambda r: _json_keys(r / "hooks" / "hooks.json", "hooks") or _json_keys(r / "hooks.json", "hooks"),
+ "mcp": lambda r: _json_keys(r / ".mcp.json", "mcpServers") or _json_keys(r / "mcp.json", "mcpServers"),
+ "lsp": lambda r: _json_keys(r / ".lsp.json"),
+}
# Folders a harness can pick up without any manifest (Claude Code inline plugins).
DEFAULT_DIRS = ("skills", "commands", "agents", "hooks")
+DECLARED_COMPONENT_KEYS = ("skills", "commands", "agents", "hooks", "mcpServers", "lspServers")
+# What a component outcome means for the plugin's status. Outcomes come from canary probes.
+OUTCOME_EFFECT = {
+ "delivered": None,
+ "listed": None,
+ "runs": None,
+ "deferred": "advisory",
+ "trust_gated": "advisory",
+ "registered": "degraded",
+ "not_observed": "degraded",
+}
+OUTCOME_TEXT = {
+ "trust_gated": "{n} {kind}: run only after the user trusts the plugin's current content (or with a per-run trust bypass).",
+ "deferred": "{n} {kind}: registered; tool schemas reach the model only when it searches for or asks to use them.",
+ "registered": "{n} {kind}: started or registered, but nothing reached the model in canary runs.",
+ "not_observed": "{n} {kind}: not registered or delivered in canary runs.",
+}
+
+
+def _skill_sizes(root: Path) -> dict[Path, int]:
+ """Size of each SKILL.md under skills/ that is a readable regular file.
+
+ Pipes, sockets, devices, dangling or looping links and unreadable files are skipped. Only a
+ regular file is ever opened: opening a named pipe with no writer would block forever.
+ """
+ sizes: dict[Path, int] = {}
+ for path in (root / "skills").rglob("SKILL.md") if (root / "skills").is_dir() else []:
+ try:
+ info = path.stat()
+ if not stat.S_ISREG(info.st_mode):
+ continue
+ with path.open("rb"):
+ sizes[path] = info.st_size
+ except OSError:
+ continue
+ return sizes
+
+
+def _json_keys(path: Path, key: str | None = None) -> int:
+ if not path.is_file():
+ return 0
+ try:
+ data = json.loads(path.read_text(encoding="utf-8"))
+ except (OSError, ValueError, UnicodeDecodeError):
+ return 1
+ section = data.get(key, {}) if key and isinstance(data, dict) else data
+ return len(section) if isinstance(section, (dict, list)) else 1
def is_plugin_root(path: Path) -> bool:
@@ -34,8 +91,8 @@ def is_plugin_root(path: Path) -> bool:
def plugin_facts(root: Path) -> dict[str, Any]:
- """Facts about a plugin folder: manifest formats, manifest validity and name."""
- facts: dict[str, Any] = {"plugin_name": root.name, "manifest_invalid": False}
+ """Facts about a plugin folder: manifest formats, manifest validity, name and component counts."""
+ facts: dict[str, Any] = {"plugin_name": root.name, "manifest_invalid": False, "declares_components": False}
for fmt, rel in MANIFESTS.items():
path = root / rel
facts[f"fmt_{fmt}"] = path.is_file()
@@ -49,6 +106,8 @@ def plugin_facts(root: Path) -> dict[str, Any]:
continue
if isinstance(data, dict) and isinstance(data.get("name"), str) and data["name"]:
facts["plugin_name"] = data["name"]
+ if isinstance(data, dict) and any(data.get(key) for key in DECLARED_COMPONENT_KEYS):
+ facts["declares_components"] = True
if fmt == "root_json":
facts["fmt_agent_v1"] = isinstance(data, dict) and str(data.get("$schema", "")).startswith(
AGENT_PLUGINS_SCHEMA
@@ -57,11 +116,13 @@ def plugin_facts(root: Path) -> dict[str, Any]:
facts.setdefault("fmt_agent_v1", False)
facts["any_manifest"] = any(v for k, v in facts.items() if k.startswith("fmt_"))
facts["default_dirs"] = any((root / d).is_dir() for d in DEFAULT_DIRS)
+ facts["components"] = {kind: count(root) for kind, count in COMPONENTS.items()}
+ facts["max_skill_bytes"] = max(_skill_sizes(root).values(), default=0)
return facts
def evaluate_plugin(profile: dict[str, Any], facts: dict[str, Any]) -> HarnessResult:
- """Apply a profile's plugin rules."""
+ """Apply a profile's plugin rules; components the harness does not deliver become findings."""
section = profile.get("plugin") or {}
findings: list[dict[str, str]] = []
worst = -1
@@ -74,6 +135,34 @@ def evaluate_plugin(profile: dict[str, Any], facts: dict[str, Any]) -> HarnessRe
finding[key] = _fill(rule[key], facts)
findings.append(finding)
worst = max(worst, _EFFECT_RANK[rule["effect"]])
+ if worst < 2:
+ for kind, outcome in (section.get("components") or {}).items():
+ n = facts["components"].get(kind, 0)
+ effect = OUTCOME_EFFECT[outcome]
+ if not n or effect is None or any(f["id"].endswith(f"-{kind.upper()}") for f in findings):
+ continue
+ prefix = str(profile["rules"][0]["id"]).split("-")[0]
+ findings.append(
+ {
+ "id": f"{prefix}-PLUGIN-{kind.upper()}",
+ "effect": effect,
+ "outcome": outcome.replace("_", " "),
+ "message": OUTCOME_TEXT[outcome].format(n=n, kind=kind),
+ }
+ )
+ worst = max(worst, _EFFECT_RANK[effect])
+ if facts.get("any_manifest") and not facts["declares_components"] and not any(facts["components"].values()):
+ prefix = str(profile["rules"][0]["id"]).split("-")[0]
+ findings.append(
+ {
+ "id": f"{prefix}-PLUGIN-NO-COMPONENTS",
+ "effect": "advisory",
+ "message": "No skills, commands, agents, hooks, MCP or LSP servers in the default places, "
+ "so the plugin installs but adds nothing.",
+ "fix": "Add components in the default folders, or check that the manifest points to them.",
+ }
+ )
+ worst = max(worst, _EFFECT_RANK["advisory"])
verified = profile.get("verified", {})
return HarnessResult(
harness=profile["harness"],
diff --git a/src/skillevaluator/harness/profiles/claude-code.yaml b/src/skillevaluator/harness/profiles/claude-code.yaml
index 4eda8da4..f060bb62 100644
--- a/src/skillevaluator/harness/profiles/claude-code.yaml
+++ b/src/skillevaluator/harness/profiles/claude-code.yaml
@@ -27,3 +27,4 @@ notes:
plugin:
rules:
- {id: CC-PLUGIN-EMPTY, when: "not fmt_claude and not default_dirs", effect: not_loaded, outcome: not found, message: "No .claude-plugin/plugin.json and no skills/, commands/, agents/ or hooks/ folder: Claude Code finds nothing to load.", fix: "Add .claude-plugin/plugin.json or put components in the default folders."}
+ components: {skills: delivered, commands: delivered, agents: delivered, hooks: runs, mcp: deferred, lsp: runs}
diff --git a/src/skillevaluator/harness/profiles/codex.yaml b/src/skillevaluator/harness/profiles/codex.yaml
index e77dd92b..af92dd33 100644
--- a/src/skillevaluator/harness/profiles/codex.yaml
+++ b/src/skillevaluator/harness/profiles/codex.yaml
@@ -31,3 +31,7 @@ notes:
plugin:
rules:
- {id: CX-PLUGIN-FORMAT, when: "not (fmt_codex or fmt_claude or fmt_cursor or fmt_agent_v1)", effect: not_loaded, outcome: rejected, message: "Codex installs .codex-plugin, .claude-plugin, .cursor-plugin and Agent Plugins v1 bundles; this one has none of them.", fix: "Add .codex-plugin/plugin.json."}
+ - {id: CX-PLUGIN-NAMESPACE, when: "components.skills > 0", effect: advisory, message: "Plugin skills are named {plugin_name}:<skill>; a bare skill name does not invoke them.", fix: "Refer to plugin skills by their full {plugin_name}:<skill> name."}
+ - {id: CX-PLUGIN-SKILL-CAP, when: "fmt_agent_v1 and not (fmt_codex or fmt_claude or fmt_cursor) and max_skill_bytes > 8000", effect: degraded, outcome: cut, message: "Agent Plugins-format bundle with a {max_skill_bytes}-byte SKILL.md: Codex cuts plugin-skill bodies to 8,000 bytes and warns that the skill was truncated.", fix: "Keep each SKILL.md under 8,000 bytes; move detail into referenced files."}
+ - {id: CX-PLUGIN-AGENT-HOOKS, when: "fmt_agent_v1 and not (fmt_codex or fmt_claude or fmt_cursor) and components.hooks > 0", effect: degraded, outcome: not run, message: "Codex does not load hooks from Agent Plugins-format bundles, even with hook trust bypassed.", fix: "Add .codex-plugin/plugin.json if the hooks must run in Codex."}
+ components: {skills: listed, commands: not_observed, agents: not_observed, hooks: trust_gated, mcp: delivered, lsp: not_observed}
diff --git a/src/skillevaluator/harness/profiles/copilot-cli.yaml b/src/skillevaluator/harness/profiles/copilot-cli.yaml
index 8e140758..ef11a508 100644
--- a/src/skillevaluator/harness/profiles/copilot-cli.yaml
+++ b/src/skillevaluator/harness/profiles/copilot-cli.yaml
@@ -31,3 +31,6 @@ notes:
plugin:
rules:
- {id: CP-PLUGIN-FORMAT, when: "not (fmt_claude or fmt_agent_v1 or fmt_copilot or fmt_root_json)", effect: not_loaded, outcome: rejected, message: "Copilot CLI installs .claude-plugin, .github/plugin, .plugin and plugin.json bundles; Codex- and Cursor-only bundles are refused.", fix: "Add .claude-plugin/plugin.json (Copilot reads it)."}
+ - {id: CP-PLUGIN-AGENTV1, when: "fmt_agent_v1 and not fmt_claude and (components.commands > 0 or components.agents > 0 or components.hooks > 0)", effect: degraded, outcome: partly delivered, message: "From an Agent Plugins v1 bundle Copilot delivers skills and MCP tools only; commands, agents and hooks did not reach the model or run.", fix: "Also ship .claude-plugin/plugin.json."}
+ - {id: CP-PLUGIN-MCP-NAMES, when: "components.mcp > 0", effect: advisory, message: "MCP tool names are shown as <server>-<tool> and cut to 64 characters.", fix: "Keep server plus tool names under 64 characters."}
+ components: {skills: delivered, commands: listed, agents: delivered, hooks: runs, mcp: delivered, lsp: not_observed}
diff --git a/src/skillevaluator/harness/profiles/hermes.yaml b/src/skillevaluator/harness/profiles/hermes.yaml
index 48a4d7aa..6f7e9822 100644
--- a/src/skillevaluator/harness/profiles/hermes.yaml
+++ b/src/skillevaluator/harness/profiles/hermes.yaml
@@ -35,3 +35,5 @@ notes:
plugin:
rules:
- {id: HM-PLUGIN-FORMAT, when: "not (fmt_agent_v1 or fmt_hermes_native)", effect: not_loaded, outcome: rejected, message: "Hermes installs Agent Plugins v1 (plugin.json with the agent-plugins.org $schema) or native plugin.yaml plugins only.", fix: "Add an Agent Plugins v1 plugin.json."}
+ - {id: HM-PLUGIN-DISABLED, when: "fmt_agent_v1", effect: advisory, message: "Portable packages install disabled; nothing loads until `hermes plugins enable {plugin_name}`."}
+ components: {skills: listed, commands: not_observed, agents: not_observed, hooks: not_observed, mcp: not_observed, lsp: not_observed}
diff --git a/src/skillevaluator/harness/profiles/openclaw.yaml b/src/skillevaluator/harness/profiles/openclaw.yaml
index 04878b83..dd857127 100644
--- a/src/skillevaluator/harness/profiles/openclaw.yaml
+++ b/src/skillevaluator/harness/profiles/openclaw.yaml
@@ -36,3 +36,5 @@ notes:
plugin:
rules:
- {id: OW-PLUGIN-FORMAT, when: "not (fmt_claude or fmt_codex or fmt_cursor or fmt_agent_v1 or fmt_root_json)", effect: not_loaded, outcome: rejected, message: "OpenClaw installs bundles with a JSON plugin manifest (.claude-plugin, .codex-plugin, .cursor-plugin or plugin.json); Hermes plugin.yaml plugins are not found.", fix: "Add .claude-plugin/plugin.json."}
+ - {id: OW-PLUGIN-CODEX-MCP, when: "fmt_codex and not (fmt_claude or fmt_agent_v1) and components.mcp > 0", effect: degraded, outcome: registered, message: "MCP servers of Codex-format bundles start, but their tools never reached the model.", fix: "Also ship .claude-plugin/plugin.json."}
+ components: {skills: listed, commands: not_observed, agents: not_observed, hooks: not_observed, mcp: deferred, lsp: runs}
diff --git a/src/skillevaluator/harness/profiles/opencode.yaml b/src/skillevaluator/harness/profiles/opencode.yaml
index 6c78da30..133a3cad 100644
--- a/src/skillevaluator/harness/profiles/opencode.yaml
+++ b/src/skillevaluator/harness/profiles/opencode.yaml
@@ -33,3 +33,4 @@ notes:
plugin:
rules:
- {id: OC-PLUGIN-FORMAT, when: "always", effect: not_loaded, outcome: not found, message: "OpenCode does not load manifest plugin bundles; its plugins are JS/TS modules in .opencode/plugin/ or npm packages in opencode.json.", fix: "Install the skills under .opencode/skills, or port the plugin to an OpenCode JS plugin."}
+ components: {}
diff --git a/tests/harness/test_plugin_compat.py b/tests/harness/test_plugin_compat.py
index de635dff..37eb7718 100644
--- a/tests/harness/test_plugin_compat.py
+++ b/tests/harness/test_plugin_compat.py
@@ -3,8 +3,11 @@
"""Tests for plugin facts and per-harness plugin rules."""
import json
+import os
+import threading
from pathlib import Path
+import pytest
from click.testing import CliRunner
from skillevaluator.cli import cli
@@ -42,7 +45,7 @@ def _status(root: Path) -> dict[str, tuple[str, list[str]]]:
def test_every_profile_has_plugin_section():
for profile in load_profiles():
- assert "rules" in profile["plugin"]
+ assert "rules" in profile["plugin"] and "components" in profile["plugin"]
def test_facts_detect_formats_name_and_components(tmp_path: Path):
@@ -50,6 +53,7 @@ def test_facts_detect_formats_name_and_components(tmp_path: Path):
facts = plugin_facts(root)
assert is_plugin_root(root) and facts["fmt_claude"] and not facts["fmt_codex"]
assert facts["plugin_name"] == "demo"
+ assert facts["components"] == {"skills": 1, "commands": 1, "agents": 0, "hooks": 0, "mcp": 2, "lsp": 0}
def test_claude_format_acceptance_matrix(tmp_path: Path):
@@ -62,6 +66,7 @@ def test_claude_format_acceptance_matrix(tmp_path: Path):
"openclaw": "loads",
"opencode": "not_loaded",
}
+ assert "CX-PLUGIN-NAMESPACE" in s["codex"][1]
def test_codex_only_bundle_is_refused_by_copilot(tmp_path: Path):
@@ -72,10 +77,17 @@ def test_codex_only_bundle_is_refused_by_copilot(tmp_path: Path):
def test_agent_v1_needs_schema_for_hermes(tmp_path: Path):
good = _status(_plugin(tmp_path / "a", "plugin.json", {"$schema": AGENT_V1, "name": "demo", "version": "1"}))
plain = _status(_plugin(tmp_path / "b", "plugin.json", {"name": "demo"}))
- assert good["hermes"][0] == "loads"
+ assert good["hermes"][0] == "loads" and "HM-PLUGIN-DISABLED" in good["hermes"][1]
assert plain["hermes"][0] == "not_loaded"
+def test_undelivered_components_degrade(tmp_path: Path):
+ s = _status(_plugin(tmp_path / "p", ".claude-plugin/plugin.json", components=("skills", "commands", "mcp")))
+ assert s["codex"][0] == "degraded" and "CX-PLUGIN-COMMANDS" in s["codex"][1]
+ assert s["openclaw"][0] == "degraded" and "OW-PLUGIN-MCP" in s["openclaw"][1]
+ assert s["claude-code"][0] == "loads" and "CC-PLUGIN-MCP" in s["claude-code"][1]
+
+
def test_claude_inline_plugin_needs_default_folders(tmp_path: Path):
inline = tmp_path / "inline"
_plugin(inline, None)
@@ -102,6 +114,22 @@ def test_harness_check_prints_plugin_panel(tmp_path: Path):
assert "Plugin compatibility" in result.output and "opencode" in result.output
+def test_codex_agent_plugins_cap_and_hooks(tmp_path: Path):
+ def bundle(name: str, manifest: str, data: dict) -> Path:
+ root = _plugin(tmp_path / name, manifest, data)
+ (root / "skills/demo/SKILL.md").write_text(
+ "---\nname: demo\ndescription: Use when testing.\n---\n" + "x" * 8200
+ )
+ (root / "hooks").mkdir()
+ (root / "hooks/hooks.json").write_text(json.dumps({"hooks": {"Stop": []}}))
+ return root
+
+ agent = _status(bundle("a", "plugin.json", {"$schema": AGENT_V1, "name": "demo", "version": "1"}))["codex"]
+ codex = _status(bundle("c", ".codex-plugin/plugin.json", {"name": "demo", "version": "1"}))["codex"]
+ assert agent[0] == "degraded" and {"CX-PLUGIN-SKILL-CAP", "CX-PLUGIN-AGENT-HOOKS"} <= set(agent[1])
+ assert codex[0] == "loads" and "CX-PLUGIN-HOOKS" in codex[1] and "CX-PLUGIN-SKILL-CAP" not in codex[1]
+
+
def test_unreadable_or_malformed_manifest_is_not_an_accepted_format(tmp_path: Path):
from skillevaluator.harness.plugin import plugin_facts
@@ -109,3 +137,77 @@ def test_unreadable_or_malformed_manifest_is_not_an_accepted_format(tmp_path: Pa
(tmp_path / ".claude-plugin" / "plugin.json").write_text("{not json", encoding="utf-8")
facts = plugin_facts(tmp_path)
assert facts["manifest_invalid"] and not facts["fmt_claude"] and not facts["any_manifest"]
+
+
+def test_manifest_only_plugin_is_flagged_as_adding_nothing(tmp_path: Path):
+ (tmp_path / ".claude-plugin").mkdir()
+ (tmp_path / ".claude-plugin" / "plugin.json").write_text('{"name": "empty"}', encoding="utf-8")
+ facts = plugin_facts(tmp_path)
+ claude = next(p for p in load_profiles() if p["harness"] == "claude-code")
+ result = evaluate_plugin(claude, facts)
+ assert result.status == "loads"
+ assert [f["id"] for f in result.findings] == ["CC-PLUGIN-NO-COMPONENTS"]
+
+
+def test_dangling_skill_link_does_not_abort_plugin_facts(tmp_path: Path):
+ (tmp_path / ".claude-plugin").mkdir()
+ (tmp_path / ".claude-plugin" / "plugin.json").write_text('{"name": "p"}', encoding="utf-8")
+ (tmp_path / "skills" / "gone").mkdir(parents=True)
+ (tmp_path / "skills" / "gone" / "SKILL.md").symlink_to(tmp_path / "missing.md")
+ assert plugin_facts(tmp_path)["max_skill_bytes"] == 0
+
+
+def test_unreadable_skill_is_not_counted_as_delivered(tmp_path: Path):
+ (tmp_path / ".claude-plugin").mkdir()
+ (tmp_path / ".claude-plugin" / "plugin.json").write_text('{"name": "p"}', encoding="utf-8")
+ (tmp_path / "skills" / "gone").mkdir(parents=True)
+ (tmp_path / "skills" / "gone" / "SKILL.md").symlink_to(tmp_path / "missing.md")
+ (tmp_path / "skills" / "loop").mkdir()
+ (tmp_path / "skills" / "loop" / "SKILL.md").symlink_to(tmp_path / "skills" / "loop" / "SKILL.md")
+ facts = plugin_facts(tmp_path)
+ assert facts["components"]["skills"] == 0
+ assert facts["max_skill_bytes"] == 0
+ claude = next(p for p in load_profiles() if p["harness"] == "claude-code")
+ assert [f["id"] for f in evaluate_plugin(claude, facts).findings] == ["CC-PLUGIN-NO-COMPONENTS"]
+ (tmp_path / "skills" / "real").mkdir()
+ (tmp_path / "skills" / "real" / "SKILL.md").write_text("---\nname: real\n---\n", encoding="utf-8")
+ facts = plugin_facts(tmp_path)
+ assert facts["components"]["skills"] == 1
+ assert facts["max_skill_bytes"] > 0
+
+
[email protected](not hasattr(os, "mkfifo"), reason="needs named pipes")
+def test_named_pipe_skill_is_skipped_without_blocking(tmp_path: Path):
+ (tmp_path / ".claude-plugin").mkdir()
+ (tmp_path / ".claude-plugin" / "plugin.json").write_text('{"name": "p"}', encoding="utf-8")
+ (tmp_path / "skills" / "pipe").mkdir(parents=True)
+ fifo = tmp_path / "skills" / "pipe" / "SKILL.md"
+ os.mkfifo(fifo)
+ out: dict = {}
+ worker = threading.Thread(target=lambda: out.update(plugin_facts(tmp_path)), daemon=True)
+ worker.start()
+ worker.join(5)
+ if worker.is_alive(): # still blocked in open(); unblock it so the thread can end
+ os.close(os.open(fifo, os.O_WRONLY | os.O_NONBLOCK))
+ worker.join(5)
+ pytest.fail("plugin_facts blocked on a named-pipe SKILL.md")
+ assert out["components"]["skills"] == 0
+ assert out["max_skill_bytes"] == 0
+
+
+def test_components_declared_in_the_manifest_are_not_reported_missing(tmp_path: Path):
+ (tmp_path / ".claude-plugin").mkdir()
+ manifest = {"name": "p", "commands": "./custom/commands"}
+ (tmp_path / ".claude-plugin" / "plugin.json").write_text(json.dumps(manifest), encoding="utf-8")
+ claude = next(p for p in load_profiles() if p["harness"] == "claude-code")
+ assert not evaluate_plugin(claude, plugin_facts(tmp_path)).findings
+
+
+def test_component_rule_replaces_the_generic_delivery_finding(tmp_path: Path):
+ manifest = {"$schema": "https://agent-plugins.org/schemas/v1/plugin.json", "name": "p"}
+ (tmp_path / "plugin.json").write_text(json.dumps(manifest), encoding="utf-8")
+ (tmp_path / "hooks").mkdir()
+ (tmp_path / "hooks" / "hooks.json").write_text('{"hooks": {"PreToolUse": []}}', encoding="utf-8")
+ codex = next(p for p in load_profiles() if p["harness"] == "codex")
+ ids = [f["id"] for f in evaluate_plugin(codex, plugin_facts(tmp_path)).findings]
+ assert "CX-PLUGIN-AGENT-HOOKS" in ids and "CX-PLUGIN-HOOKS" not in ids