Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ 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.
- `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.
- `harness` rules for harness gates: Hermes `platforms` and OpenClaw
`metadata.openclaw.requires`.
- `harness` rules for invocation fields: `disable-model-invocation`, Codex's
`agents/openai.yaml` policy, `allowed-tools`, Claude Code-only fields and Hermes
project trust. Tier 1 `schema` now reports fields outside the agentskills.io
Expand Down
4 changes: 4 additions & 0 deletions docs/tier1-validation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice
Placeholder rules: `$ARGUMENTS` and `${CLAUDE_SKILL_DIR}` are substituted only by Claude Code, and price-like `$N` text is replaced with arguments by Claude Code and OpenCode.

Invocation rules: `disable-model-invocation` (ignored by Codex, Hermes and OpenCode), Codex's `agents/openai.yaml` implicit-invocation policy (Codex only), `allowed-tools`, Claude Code-only fields, and Hermes project trust.

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.
</Accordion>

<Accordion title="security — vulnerability scanning">
Expand Down
4 changes: 4 additions & 0 deletions src/skillevaluator/harness/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@
model_config,
skill_facts,
)
from skillevaluator.harness.plugin import evaluate_plugin, is_plugin_root, plugin_facts

__all__ = [
"HARNESS_STATUSES",
"Catalog",
"HarnessResult",
"evaluate_harnesses",
"evaluate_plugin",
"evaluate_profile",
"facts_for",
"is_plugin_root",
"listed_description",
"load_profiles",
"model_config",
"plugin_facts",
"skill_facts",
]
32 changes: 32 additions & 0 deletions src/skillevaluator/harness/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,34 @@ def _codex_implicit_disabled(skill_path: Path) -> bool:
return isinstance(policy, dict) and policy.get("allow_implicit_invocation") is False


_HERMES_OS = {"linux": "linux", "macos": "darwin", "windows": "win32"}


def _excluded_os(platforms: Any) -> str:
"""Operating systems Hermes hides the skill on (it maps names, then prefix-matches sys.platform)."""
if not platforms:
return ""
wanted = [str(p).lower().strip() for p in (platforms if isinstance(platforms, list) else [platforms])]
mapped = [_HERMES_OS.get(p, p) for p in wanted]
return ", ".join(os for os, sys_name in _HERMES_OS.items() if not any(sys_name.startswith(m) for m in mapped))


def _openclaw_gates(data: dict[str, Any]) -> str:
metadata = data.get("metadata")
claw = metadata.get("openclaw") if isinstance(metadata, dict) else None
if not isinstance(claw, dict):
return ""
requires = claw.get("requires") if isinstance(claw.get("requires"), dict) else {}
gates = [
f"{key} {', '.join(map(str, value)) if isinstance(value, list) else value}"
for key in ("bins", "anyBins", "env", "config")
if (value := requires.get(key))
]
if claw.get("os"):
gates.append(f"os {', '.join(map(str, claw['os'])) if isinstance(claw['os'], list) else claw['os']}")
return "; ".join(gates)


def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, Any]:
"""Compute the facts profile rules refer to (see profiles README).

Expand All @@ -380,6 +408,7 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, A
match = FRONTMATTER_PATTERN.match(text)
body = match.group(2) if match else text
custom = {k: v for k, v in data.items() if str(k) not in _KNOWN_FIELDS}
platforms = data.get("platforms")
name = _skill_name(skill_path, data)
duplicates = catalog.duplicates(skill_path, name) if catalog else []
return {
Expand Down Expand Up @@ -418,6 +447,9 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, A
"claude_only_fields": ", ".join(f for f in _CLAUDE_ONLY_FIELDS if f in data),
"custom_fields": ", ".join(map(str, custom)),
"custom_field_chars": sum(len(v) if isinstance(v, str) else len(yaml.safe_dump(v)) for v in custom.values()),
"platforms": ", ".join(map(str, platforms)) if isinstance(platforms, list) else str(platforms or ""),
"platforms_excluded": _excluded_os(platforms),
"openclaw_gates": _openclaw_gates(data),
"skill_md_chars": len(text),
"skill_md_tokens": len(raw) // 4,
"description_over": max(0, (len(description) if isinstance(description, str) else 0) - 1024),
Expand Down
85 changes: 85 additions & 0 deletions src/skillevaluator/harness/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""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.
"""

from __future__ import annotations

import json
from pathlib import Path
from typing import Any

from skillevaluator.harness.overlay import _EFFECT_RANK, HarnessResult, _fill, _Rule

MANIFESTS = {
"claude": ".claude-plugin/plugin.json",
"codex": ".codex-plugin/plugin.json",
"cursor": ".cursor-plugin/plugin.json",
"copilot": ".github/plugin/plugin.json",
"copilot_alt": ".plugin/plugin.json",
"root_json": "plugin.json",
"hermes_native": "plugin.yaml",
}
AGENT_PLUGINS_SCHEMA = "https://agent-plugins.org/schemas/"
# Folders a harness can pick up without any manifest (Claude Code inline plugins).
DEFAULT_DIRS = ("skills", "commands", "agents", "hooks")


def is_plugin_root(path: Path) -> bool:
return any((path / rel).is_file() for rel in MANIFESTS.values())
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved


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}
for fmt, rel in MANIFESTS.items():
path = root / rel
facts[f"fmt_{fmt}"] = path.is_file()
if not path.is_file() or path.suffix != ".json":
continue
try:
data = json.loads(path.read_text(encoding="utf-8"))
except (OSError, ValueError, UnicodeDecodeError):
facts["manifest_invalid"] = True
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
facts[f"fmt_{fmt}"] = False
continue
if isinstance(data, dict) and isinstance(data.get("name"), str) and data["name"]:
facts["plugin_name"] = data["name"]
if fmt == "root_json":
facts["fmt_agent_v1"] = isinstance(data, dict) and str(data.get("$schema", "")).startswith(
AGENT_PLUGINS_SCHEMA
)
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
facts["fmt_copilot"] = facts["fmt_copilot"] or facts.pop("fmt_copilot_alt")
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)
return facts


def evaluate_plugin(profile: dict[str, Any], facts: dict[str, Any]) -> HarnessResult:
"""Apply a profile's plugin rules."""
section = profile.get("plugin") or {}
findings: list[dict[str, str]] = []
worst = -1
for rule in section.get("rules", []):
if not _Rule.evaluate(str(rule["when"]), {**facts, "always": True}):
continue
finding = {"id": rule["id"], "effect": rule["effect"], "message": _fill(rule["message"], facts)}
for key in ("fix", "outcome"):
if rule.get(key):
finding[key] = _fill(rule[key], facts)
findings.append(finding)
worst = max(worst, _EFFECT_RANK[rule["effect"]])
verified = profile.get("verified", {})
return HarnessResult(
harness=profile["harness"],
display_name=profile.get("display_name", profile["harness"]),
status="not_loaded" if worst == 2 else "degraded" if worst == 1 else "loads",
version=str(verified.get("version", "")),
verified_date=str(verified.get("date", "")),
findings=findings,
)
3 changes: 3 additions & 0 deletions src/skillevaluator/harness/profiles/claude-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ notes:
- "Follows symlinked skill folders and symlinked SKILL.md files, inside or outside the root."
- "Nested SKILL.md, CRLF, BOM, tabs, uppercase names: no effect observed."
- "New skills and edited bodies are picked up mid-session without restart."
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."}
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
3 changes: 3 additions & 0 deletions src/skillevaluator/harness/profiles/codex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ notes:
- "Explicit $skill injects the whole SKILL.md (145 KB tested)."
- "Follows symlinked skill folders (inside or outside the root)."
- "New skills are listed next turn; files are re-read from disk."
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."}
3 changes: 3 additions & 0 deletions src/skillevaluator/harness/profiles/copilot-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ notes:
- "Docs say skills only in immediate subfolders; runtime finds them 3 grouping levels deep."
- "Follows symlinks inside and outside the checkout (SDK docs say inside only)."
- "Project copy wins on duplicate names (3/3); missing name falls back to the folder name."
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)."}
4 changes: 4 additions & 0 deletions src/skillevaluator/harness/profiles/hermes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rules:
- {id: HM-ALLOWED-TOOLS, when: "allowed_tools_shape != 'none'", effect: advisory, message: "allowed-tools is ignored by Hermes.", fix: "Don't rely on allowed-tools to restrict tools; use the harness's permission settings."}
- {id: HM-CASING, when: "not manifest_name_exact", effect: not_loaded, message: "Non-canonical name (skill.md/Skill.md): never loaded, on Linux or macOS (3/3 each).", fix: "Rename the file to SKILL.md (exact casing)."}
- {id: HM-DUP-NAME, when: "duplicate_name", effect: advisory, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); Hermes uses one: project, then ~/.hermes/skills.", fix: "Give each skill a unique name."}
- {id: HM-PLATFORMS, when: "platforms_excluded != ''", effect: advisory, message: "Hidden from the skill list on {platforms_excluded} (platforms: {platforms}).", fix: "Add those systems to platforms, or remove platforms if the skill works everywhere."}
- {id: HM-RESOURCE-SYMLINK, when: "resource_symlinks > 0", effect: degraded, message: "Symlinked files ({resource_symlink_paths}) are left out of the skill's file list.", fix: "Copy those files into the skill instead of symlinking them."}
- {id: HM-LINKED-LAYOUT, when: "hermes_unlisted_files > 0", effect: advisory, message: "{hermes_unlisted_files} files outside references/, templates/, assets/ and scripts/ ({hermes_unlisted_dirs}) are left out of the skill's file list; the model finds them only if SKILL.md names their paths.", fix: "Move supporting files under references/, templates/, assets/ or scripts/."}
- {id: HM-VIEW-BUDGET, when: "hermes_view_chars > 100000", effect: degraded, outcome: instructions not delivered, message: "When the model loads the skill, skill_view returns ~{hermes_view_chars} chars, over the 100,000-char tool-result budget (lower on models under ~167K context): the model gets a 1,500-char preview, not the instructions.", fix: "Keep SKILL.md under ~95,000 characters; move detail into references/ files."}
Expand All @@ -31,3 +32,6 @@ notes:
- "Precedence: project > ~/.hermes/skills > skills.create_dir > external_dirs (project wins, 3/3)."
- "Large bodies are spilled and paged through in small reads."
- "Pin the commit: the displayed version string did not match the installed code."
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."}
4 changes: 4 additions & 0 deletions src/skillevaluator/harness/profiles/openclaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rules:
- {id: OW-CASING, when: "not manifest_name_exact", effect: degraded, message: "Non-canonical name (skill.md/Skill.md): loaded on case-insensitive filesystems (macOS default APFS, 3/3), ignored on case-sensitive Linux (3/3). Works or breaks depending on the OS.", fix: "Rename the file to SKILL.md (exact casing)."}
- {id: OW-PROMPT-CAP, when: "catalog_size > 150 or catalog_desc_chars > 18000", effect: advisory, outcome: listing shortened, message: "{catalog_size} skills / {catalog_desc_chars} description chars here: past 150 skills or 18,000 chars OpenClaw also leaves skills out of the list (121 of 225 listed in our test).", fix: "Shorten descriptions (trigger first) or install fewer skills in one folder."}
- {id: OW-DUP-NAME, when: "duplicate_name", effect: advisory, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); OpenClaw uses one: workspace skills/, then .agents/skills, then user folders.", fix: "Give each skill a unique name."}
- {id: OW-REQUIRES, when: "openclaw_gates != ''", effect: advisory, message: "Left out of the skill list unless the host has: {openclaw_gates}.", fix: "Make sure target hosts provide these, or drop requirements the skill doesn't need."}
- {id: OW-REF-BUDGET, when: "files_over_64000 > 0", effect: advisory, outcome: needs paging, message: "{files_over_64000} files over 64,000 bytes ({files_over_64000_paths}): OpenClaw's read cap is 16,000-64,000 UTF-8 bytes by model context, so each takes several reads.", fix: "Split large reference files into pieces under 16,000 UTF-8 bytes."}
- {id: OW-CODEX-POLICY, when: "codex_implicit_disabled and not disable_model_invocation", effect: degraded, message: "agents/openai.yaml implicit-invocation policy is Codex-only: here the model can still use this skill on its own.", fix: "Also set disable-model-invocation: true (Claude Code, Copilot and OpenClaw honour it)."}
- {id: OW-ARGUMENTS, when: "uses_arguments_placeholder", effect: degraded, message: "$ARGUMENTS is not substituted: the model sees the literal text.", fix: "Describe the expected input in words instead of $ARGUMENTS."}
Expand All @@ -32,3 +33,6 @@ notes:
- "Precedence: workspace skills/ > .agents/skills > ~/.agents/skills > managed > bundled > extra dirs (project wins, 3/3)."
- "Description given as a YAML list is stringified and listed. BOM, CRLF, bare colons tolerated."
- "New skills listed next turn in `openclaw chat`; files re-read from disk."
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."}
3 changes: 3 additions & 0 deletions src/skillevaluator/harness/profiles/opencode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ rules:
notes:
- "Docs (V1) say one level deep and a 1-1024 description; runtime matches the V2 docs: recursive, no length cap."
- "Tolerant of tabs, bare colons and BOM. Follows all symlinks tested."
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."}
14 changes: 14 additions & 0 deletions src/skillevaluator/harness/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from rich.text import Text

from skillevaluator.harness.overlay import evaluate_profile, facts_for, load_profiles
from skillevaluator.harness.plugin import evaluate_plugin, is_plugin_root, plugin_facts
from skillevaluator.reporting.console_ui import AMBER, BRIGHT, FAINT, GREEN, MUTED, RED, SPIN, TEXT, WIDTH
from skillevaluator.validators.harness import HARNESS_METADATA_KEY, HarnessValidator

Expand Down Expand Up @@ -250,6 +251,19 @@ def run_harness_check(
skills = [target] if finder._is_skill_directory(target) else finder._find_all_skills(target)
width = max(60, min(WIDTH, console.width))
block: Block = {}
if is_plugin_root(target):
facts = plugin_facts(target)
rows = [evaluate_plugin(profile, facts).to_dict() for profile in profiles]
console.print(
harness_panel(
{str(target): rows},
title=f"Plugin compatibility · {facts['plugin_name']}",
verbose=verbose,
width=width,
)
)
console.print()
block[f"{target} (plugin)"] = rows
all_facts = facts_for(skills)
for skill in skills:
rows: list[dict[str, Any]] = [{"harness": p["harness"], "status": "pending"} for p in profiles]
Expand Down
14 changes: 14 additions & 0 deletions tests/harness/test_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,10 @@ def test_gating_and_claude_only_fields(tmp_path: Path):
)
rows = _rows(skill)

assert "HM-PLATFORMS" in _ids(rows, "hermes")
assert "Left out of the skill list unless the host has: bins pdftotext." in {
f["message"] for f in rows["openclaw"]["findings"]
}
assert "OC-CLAUDE-ONLY" in _ids(rows, "opencode")
assert not any(f["id"].endswith("CLAUDE-ONLY") for f in rows["claude-code"]["findings"])

Expand Down Expand Up @@ -564,6 +568,16 @@ def test_fix_reaches_findings_and_panels(tmp_path: Path):
assert "Description in the model's skill list" in out


def test_hermes_platforms_listing_every_os_is_not_flagged(tmp_path: Path):
everywhere = _rows(_skill(tmp_path / "a", extra="platforms: [linux, macos, windows]\n"))
mac_only = _rows(_skill(tmp_path / "b", extra="platforms: macos\n"))

assert "HM-PLATFORMS" not in _ids(everywhere, "hermes")
assert "Hidden from the skill list on linux, windows (platforms: macos)." in {
f["message"] for f in mac_only["hermes"]["findings"]
}


def _sized(root: Path, fact: str, target: int) -> Path:
"""A skill whose ``fact`` (a body-length measure) is exactly ``target``."""
probe = _skill(root / "probe", body="a")
Expand Down
Loading
Loading