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.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
feat(harness): add the advisory Tier 1 harness compatibility check (#520)
Christopher Kevinca67b332b964
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1db540a0..695ff8ae 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,6 +6,14 @@ All notable changes to SkillEvaluator are documented in this file.### Added+- New advisory Tier 1 `harness` check: for each agent harness (`claude-code`,+ `codex`, `copilot-cli`, `hermes`, `openclaw`, `opencode`) it reports whether the+ skill `loads`, is `degraded` or is `not_loaded`, from versioned profiles shipped+ with the package. It runs by default, never fails the run, lists its findings in+ every report and adds a `harness_compatibility` block to JSON. `--harness+ codex,claude-code` narrows the harnesses and `--harness-profiles DIR` loads+ profiles from a directory. The first rules flag a skill installed outside the+ folders a harness scans.- A separate four-case synthetic grader pilot adds forbidden-startup-write androot-search challenges with quoted/read-only and scoped controls, an independentlabel worksheet, content/source manifest and explicit security/Efficiencydiff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdxindex 3543a9f0..7db9647c 100644--- a/docs/tier1-validation.mdx+++ b/docs/tier1-validation.mdx@@ -264,6 +264,14 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice**To fix common findings:** rename the directory to match `name`, remove forbidden fields, and move the skill under `skills/`.</Accordion>+ <Accordion title="harness — harness compatibility">+ The `harness` check reports, for each agent harness, whether the skill `loads`, is `degraded` (loads, but something is cut, hidden or ignored) or is `not_loaded`, with the rule IDs behind each verdict and the harness version and date the profile was verified against. Supported harnesses: `claude-code`, `codex`, `copilot-cli`, `hermes`, `openclaw`, `opencode`. All of this is static: no agent or model is run.++ `validate` runs it by default for all six and lists its findings in the HTML, JSON and SARIF reports; JSON reports also get a `harness_compatibility` block. Use `--checks harness` to run it alone and `--harness codex,claude-code` to narrow the harnesses.++ The profiles ship with the package and come from repeated runs of each harness in which the request sent to the model was captured. The check doesn't change pass/fail: its findings are MEDIUM (`not_loaded`), LOW (`degraded`) or INFO (`advisory`), so it never fails a run unless a policy raises those severities. Install-location rules apply only when the skill sits under a harness root such as `.claude/skills` or `.agents/skills`. Use `--harness-profiles DIR` to try newer profile YAMLs without a release.+ </Accordion>+<Accordion title="security — vulnerability scanning">`security-scan`, and the `security` check inside `validate`, run SkillSpector. Static scanning covers common skill attack patterns such as prompt injection and data exfiltration; each finding carries the matched pattern, severity, and location.diff --git a/pyproject.toml b/pyproject.tomlindex 4e1a28e8..b21fd55a 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -126,6 +126,7 @@ include = ["skillevaluator*"]"skillevaluator.tier3" = ["grader_reference/*.json", "grader_reference/trajectories/*.json"]"skillevaluator" = ["ci-release.json", "ci-release-all-tiers.json"]"skillevaluator.config" = ["*.yaml", "profiles/*.yaml"]+"skillevaluator.harness" = ["profiles/*.yaml"]"skillevaluator.reporting" = ["templates/*.j2", "assets/*.js", "assets/*.md"]"skillevaluator.tier3.harbor" = ["templates/*.py",diff --git a/src/skillevaluator/cli.py b/src/skillevaluator/cli.pyindex ff09064c..86c12885 100644--- a/src/skillevaluator/cli.py+++ b/src/skillevaluator/cli.py@@ -28,6 +28,7 @@ from skillevaluator.constants import (SIMILARITY_MAX_ENTRIES,)from skillevaluator.doctor import DEFAULT_PROBE_TIMEOUT_SEC, MAX_PROBE_TIMEOUT_SEC+from skillevaluator.harness.report import harness_block, write_json_blockfrom skillevaluator.logging_config import setup_loggingfrom skillevaluator.models.result import ValidationResultfrom skillevaluator.quality_config import QualityConfigError, load_quality_config@@ -1381,6 +1382,10 @@ def _catalog_child_argv_from_ctx(argv.extend(["--skip", str(params["skip"])])if params.get("previous_version"):argv.extend(["--previous-version", str(params["previous_version"])])+ if params.get("harness"):+ argv.extend(["--harness", str(params["harness"])])+ if params.get("harness_profiles"):+ argv.extend(["--harness-profiles", str(params["harness_profiles"])])if params.get("fail_fast"):argv.append("--fail-fast")if params.get("continue_on_failure"):@@ -2084,10 +2089,27 @@ def _print_run_banner(target_path: Path, content_type: str, profile: str | None)cls=GroupedOption,help_group=_TIER1_GROUP,help="Comma-separated subset of Tier 1 checks to run (default: all applicable). "- "Choices: schema, version, security, pii, license, code-integrity, unicode, quality, lint; "+ "Choices: schema, version, security, pii, license, code-integrity, unicode, quality, lint, harness; ""opt-in (not run by default): dependency. ""quality/lint/version are skill-only and skipped for rules/workflows.",)+ "--harness",+ "harness",+ default=None,+ cls=GroupedOption,+ help_group=_RUN_GROUP,+ help="Harnesses for the advisory harness check (default: all), e.g. --harness codex,claude-code.",+)+ "--harness-profiles",+ "harness_profiles",+ type=click.Path(path_type=Path, exists=True, file_okay=False),+ default=None,+ cls=GroupedOption,+ help_group=_RUN_GROUP,+ help="Directory of harness profile YAMLs to use instead of the packaged ones.",+)@click.option("--skip",default=None,@@ -2522,6 +2544,8 @@ def validate(evaluator_container_revision: str | None,report_formats: tuple[str, ...],output_dir: Path,+ harness: str | None = None,+ harness_profiles: Path | None = None,) -> None:"""Validate a skill through all three tiers, with automatic dataset preparation.@@ -2540,6 +2564,13 @@ def validate(skill-only and skipped for plugins."""_record_validate_json_report(None)+ if harness:+ from skillevaluator.harness import load_profiles++ try:+ load_profiles(harness, harness_profiles)+ except ValueError as exc:+ raise click.BadParameter(str(exc), param_hint="--harness") from excif dedup:_reject_linked_tier2_root(target_path)target_path = target_path.resolve()@@ -2732,6 +2763,8 @@ def validate(fail_fast=fail_fast,continue_on_failure=continue_on_failure,on_check=_on_check if quiet else None,+ harness=harness,+ harness_profiles=harness_profiles,skip=skip,)# The raw pass/fail signal drives --fail-fast identically in both modes;@@ -2742,6 +2775,7 @@ def validate(if quiet:apply_policy(results, policy)tier1_ok, tier1_rows = summarize_tier1(results, lineup=check_lineup)+ harness_rows = harness_block(results)view.tier_done(0, failed=not tier1_ok, rows=tier1_rows)tier1_gate_results = list(results)tier2_gate_results: list[ValidationResult] = []@@ -2983,6 +3017,8 @@ def validate(sarif_repository_root=sarif_repository_root,)_record_validate_json_report(f"{report_basename_value}.json" if "json" in effective_formats else None)+ if harness_rows and "json" in effective_formats:+ write_json_block(output_dir / f"{report_basename_value}.json", harness_rows)# BENCHMARK.md is generated compulsorily for skills (matches SkillEvaluator), even on# failure, so the publication card always reflects the latest evaluation --diff --git a/src/skillevaluator/harness/__init__.py b/src/skillevaluator/harness/__init__.pynew file mode 100644index 00000000..9d79ce1c--- /dev/null+++ b/src/skillevaluator/harness/__init__.py@@ -0,0 +1,31 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0+"""Static harness-compatibility overlay for Tier 1.++Each packaged profile describes how one agent harness discovers, parses and+shows skills, as verified against a pinned harness build. Rules map skill facts+to an effect (``not_loaded``, ``degraded`` or ``advisory``). The overlay is+advisory: it never changes Tier 1 findings or the exit code.+"""++from skillevaluator.harness.overlay import (+ HARNESS_STATUSES,+ HarnessResult,+ evaluate_harnesses,+ evaluate_profile,+ facts_for,+ load_profiles,+ model_config,+ skill_facts,+)++__all__ = [+ "HARNESS_STATUSES",+ "HarnessResult",+ "evaluate_harnesses",+ "evaluate_profile",+ "facts_for",+ "load_profiles",+ "model_config",+ "skill_facts",+]diff --git a/src/skillevaluator/harness/overlay.py b/src/skillevaluator/harness/overlay.pynew file mode 100644index 00000000..564301aa--- /dev/null+++ b/src/skillevaluator/harness/overlay.py@@ -0,0 +1,307 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0+"""Load harness profiles, compute skill facts and evaluate profile rules."""++from __future__ import annotations++import ast+import re+from dataclasses import dataclass, field+from pathlib import Path+from typing import Any++import yaml++from skillevaluator.constants import SKILL_MANIFEST_VARIANTS+from skillevaluator.validators.frontmatter_parser import FRONTMATTER_PATTERN++PROFILES_DIR = Path(__file__).parent / "profiles"+HARNESS_STATUSES = ("loads", "degraded", "not_loaded")+_EFFECT_RANK = {"advisory": 0, "degraded": 1, "not_loaded": 2}+_FACT_RE = re.compile(r"\{([a-z0-9_]+)\}")+_KNOWN_ROOTS = (+ ".agents/skills",+ ".claude/skills",+ ".codex/skills",+ ".github/skills",+ ".opencode/skills",+ ".opencode/skill",+ ".hermes/skills",+ ".copilot/skills",+ ".openclaw/skills",+ ".config/opencode/skills",+)+++@dataclass+class HarnessResult:+ harness: str+ display_name: str+ status: str+ version: str+ verified_date: str+ findings: list[dict[str, str]] = field(default_factory=list)++ def to_dict(self) -> dict[str, Any]:+ return {+ "harness": self.harness,+ "display_name": self.display_name,+ "status": self.status,+ "verified_version": self.version,+ "verified_date": self.verified_date,+ "findings": self.findings,+ }+++def load_profiles(names: str | list[str] = "all", profiles_dir: Path | None = None) -> list[dict[str, Any]]:+ """Load profiles by name (comma list or ``all``); unknown names raise ``ValueError``."""+ directory = profiles_dir or PROFILES_DIR+ available = {p.stem: p for p in sorted(directory.glob("*.yaml"))}+ requested = names.split(",") if isinstance(names, str) else list(names)+ requested = [n.strip() for n in requested if n.strip()]+ if not requested or requested == ["all"]:+ requested = list(available)+ unknown = [n for n in requested if n not in available]+ if unknown:+ raise ValueError(f"Unknown harness: {', '.join(unknown)}. Supported: {', '.join(available)}")+ return [yaml.safe_load(available[n].read_text(encoding="utf-8")) for n in requested]+++def _link_location_parts(path: Path) -> tuple[str, ...]:+ # Like os.path.normpath, but ".." after a symlink steps to the link target's parent, as the filesystem does.+ parts: list[str] = []+ for part in path.absolute().parts:+ if part != "..":+ parts.append(part)+ continue+ here = Path(*parts)+ if here.is_symlink():+ parts = list(here.resolve().parent.parts)+ elif len(parts) > 1:+ parts.pop()+ return tuple(parts)+++def _install_root(skill_path: Path) -> tuple[str | None, int]:+ # Harnesses scan the folder a skill is installed in, so a symlinked skill counts where the link is.+ parts = _link_location_parts(skill_path)+ try:+ home = Path.home()+ homes = {_link_location_parts(home), home.resolve().parts}+ except (KeyError, RuntimeError):+ homes = set()+ for root in sorted(_KNOWN_ROOTS, key=lambda r: -len(r.split("/"))):+ size = len(root.split("/"))+ for index in range(len(parts) - size - 1, -1, -1):+ if "/".join(parts[index : index + size]) == root:+ user = parts[:index] in homes+ return f"~/{root}" if user else root, len(parts) - (index + size) - 1+ return None, 0+++def _read_manifest(skill_path: Path) -> tuple[Path, bytes, str, str, dict[str, Any]]:+ manifest = next(+ (skill_path / n for n in SKILL_MANIFEST_VARIANTS if (skill_path / n).exists()), skill_path / "SKILL.md"+ )+ raw = manifest.read_bytes() if manifest.is_file() else b""+ text = raw.decode("utf-8-sig", errors="replace")+ match = FRONTMATTER_PATTERN.match(text)+ fm_yaml = match.group(1) if match else ""+ try:+ data = yaml.safe_load(fm_yaml) if match else None+ except yaml.YAMLError:+ data = None+ return manifest, raw, text, fm_yaml, data if isinstance(data, dict) else {}+++def _skill_name(skill_path: Path, data: dict[str, Any]) -> str:+ name = data.get("name")+ return name.strip() if isinstance(name, str) and name.strip() else skill_path.name+++def skill_facts(skill_path: Path) -> dict[str, Any]:+ """Compute the facts profile rules refer to."""+ *_, data = _read_manifest(skill_path)+ root, depth = _install_root(skill_path)+ name = _skill_name(skill_path, data)+ return {+ "skill_name": name,+ "install_root": root,+ "grouping_depth": depth,+ }+++def facts_for(skills: list[Path]) -> dict[Path, dict[str, Any]]:+ """Facts per skill."""+ return {skill: skill_facts(skill) for skill in skills}+++class _Rule:+ _ALLOWED = (+ ast.Expression,+ ast.BoolOp,+ ast.And,+ ast.Or,+ ast.UnaryOp,+ ast.Not,+ ast.Compare,+ ast.Name,+ ast.Load,+ ast.Constant,+ ast.Attribute,+ ast.List,+ ast.Tuple,+ ast.Eq,+ ast.NotEq,+ ast.Gt,+ ast.GtE,+ ast.Lt,+ ast.LtE,+ ast.In,+ ast.NotIn,+ ast.Is,+ ast.IsNot,+ )++ @classmethod+ def evaluate(cls, expression: str, names: dict[str, Any]) -> bool:+ tree = ast.parse(expression, mode="eval")+ for node in ast.walk(tree):+ if not isinstance(node, cls._ALLOWED):+ raise ValueError(f"Unsupported rule expression: {expression}")+ return bool(cls._eval(tree.body, names))++ @classmethod+ def _eval(cls, node: ast.AST, names: dict[str, Any]) -> Any:+ if isinstance(node, ast.Constant):+ return node.value+ if isinstance(node, ast.Name):+ return names[node.id]+ if isinstance(node, ast.Attribute):+ return (cls._eval(node.value, names) or {}).get(node.attr, [])+ if isinstance(node, (ast.List, ast.Tuple)):+ return [cls._eval(e, names) for e in node.elts]+ if isinstance(node, ast.UnaryOp):+ return not cls._eval(node.operand, names)+ if isinstance(node, ast.BoolOp):+ values = (cls._eval(v, names) for v in node.values)+ return all(values) if isinstance(node.op, ast.And) else any(values)+ if isinstance(node, ast.Compare):+ left = cls._eval(node.left, names)+ for op, comparator in zip(node.ops, node.comparators, strict=True):+ right = cls._eval(comparator, names)+ if left is None and not isinstance(op, (ast.Is, ast.IsNot, ast.Eq, ast.NotEq)):+ return False+ ok = {+ ast.Eq: lambda a, b: a == b,+ ast.NotEq: lambda a, b: a != b,+ ast.Gt: lambda a, b: a > b,+ ast.GtE: lambda a, b: a >= b,+ ast.Lt: lambda a, b: a < b,+ ast.LtE: lambda a, b: a <= b,+ ast.In: lambda a, b: a in b,+ ast.NotIn: lambda a, b: a not in b,+ ast.Is: lambda a, b: a is b,+ ast.IsNot: lambda a, b: a is not b,+ }[type(op)](left, right)+ if not ok:+ return False+ left = right+ return True+ raise ValueError("Unsupported rule expression")+++def model_config(profile: dict[str, Any], config: dict[str, Any] | None = None) -> dict[str, Any]:+ """Resolve the user's setup for one profile: ``context_tokens`` (0 = unknown), ``custom_provider`` and+ ``explicit_invocation`` (skills are activated by an explicit mention rather than opened by the model) and+ ``headless`` (a non-interactive run, e.g. ``claude -p``, with default permissions) and ``native_root``+ (evaluate as if installed in each harness's own skills root, so root rules are skipped).++ An unknown window falls back to the profile's ``config_defaults`` for a custom provider when one is set.+ """+ config = config or {}+ custom = bool(config.get("custom_provider", False))+ tokens = int(config.get("context_tokens") or 0)+ if not tokens and custom:+ tokens = int(profile.get("config_defaults", {}).get("custom_provider_context_tokens", 0))+ explicit = bool(config.get("explicit_invocation", False))+ headless = bool(config.get("headless", False))+ native_root = bool(config.get("native_root", False))+ return {+ "context_tokens": tokens,+ "custom_provider": custom,+ "explicit_invocation": explicit,+ "headless": headless,+ "native_root": native_root,+ }+++def evaluate_profile(+ profile: dict[str, Any], facts: dict[str, Any], config: dict[str, Any] | None = None+) -> HarnessResult:+ """Evaluate one profile's rules against precomputed skill facts (stricter effect wins).++ ``config`` describes the user's model setup (see :func:`model_config`); rules read it as+ ``context_tokens``, ``custom_provider``, ``explicit_invocation`` and ``headless``. Without it, rules assume an+ unknown context, a native provider, model-initiated activation and an interactive session.+ """+ roots = profile.get("roots", {})+ all_roots = [*roots.get("project", []), *roots.get("user", [])]+ setup = model_config(profile, config)+ names = {**facts, **setup, "always": True, "roots": _RootList(all_roots, roots)}+ findings: list[dict[str, str]] = []+ worst = -1+ for rule in profile.get("rules", []):+ expression = str(rule["when"])+ if "install_root" in expression and (facts["install_root"] is None or names["native_root"]):+ continue+ if expression != "always" and not _Rule.evaluate(expression, names):+ continue+ if expression == "always" and rule["effect"] == "advisory":+ 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"]])+ status = "not_loaded" if worst == 2 else "degraded" if worst == 1 else "loads"+ verified = profile.get("verified", {})+ return HarnessResult(+ harness=profile["harness"],+ display_name=profile.get("display_name", profile["harness"]),+ status=status,+ version=str(verified.get("version", "")),+ verified_date=str(verified.get("date", "")),+ findings=findings,+ )+++def _fill(text: str, facts: dict[str, Any]) -> str:+ """Substitute ``{fact}`` placeholders; numbers get thousands separators."""++ def value(match: re.Match[str]) -> str:+ fact = facts.get(match.group(1), match.group(0))+ return f"{fact:,}" if isinstance(fact, int) and not isinstance(fact, bool) else str(fact)++ return _FACT_RE.sub(value, str(text))+++class _RootList(list):+ def __init__(self, items: list[str], groups: dict[str, Any]) -> None:+ super().__init__(items)+ self._groups = groups++ def get(self, key: str, default: Any = None) -> Any:+ return self._groups.get(key, default)+++def evaluate_harnesses(+ skill_path: Path,+ harnesses: str | list[str] = "all",+ profiles_dir: Path | None = None,+ config: dict[str, Any] | None = None,+) -> list[HarnessResult]:+ """Evaluate one skill (and the catalog it is installed in) against the selected profiles."""+ facts = facts_for([skill_path])[skill_path]+ return [evaluate_profile(profile, facts, config) for profile in load_profiles(harnesses, profiles_dir)]diff --git a/src/skillevaluator/harness/profiles/claude-code.yaml b/src/skillevaluator/harness/profiles/claude-code.yamlnew file mode 100644index 00000000..784293d5--- /dev/null+++ b/src/skillevaluator/harness/profiles/claude-code.yaml@@ -0,0 +1,14 @@+harness: claude-code+display_name: Claude Code+verified: {version: 2.1.316, source: closed (bundled JS inspected), date: 2026-11-01, method: proxy-captured canary probes x3, os: linux}+roots:+ project: [.claude/skills]+ user: [~/.claude/skills]+ not_scanned: [.agents/skills, ~/.agents/skills]+listing: {cut: 1536}+rules:+ - {id: CC-ROOT, when: "install_root not in roots", effect: not_loaded, outcome: not found, message: "Claude Code reads only .claude/skills and ~/.claude/skills; .agents/skills is not scanned.", fix: "Install it under .claude/skills or ~/.claude/skills (a symlink from .agents/skills works)."}+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."diff --git a/src/skillevaluator/harness/profiles/codex.yaml b/src/skillevaluator/harness/profiles/codex.yamlnew file mode 100644index 00000000..478506b9--- /dev/null+++ b/src/skillevaluator/harness/profiles/codex.yaml@@ -0,0 +1,14 @@+harness: codex+display_name: OpenAI Codex CLI+verified: {version: 0.166.0, source: "rust-v0.166.0 @ 593389380740", date: 2026-11-01, method: proxy-captured canary probes x3 + source, os: linux}+roots:+ project: [.agents/skills, .codex/skills]+ user: [~/.agents/skills, ~/.codex/skills]+limits: {scan_depth: 6, skips_hidden_dirs: true, catalog_desc_codepoints: 1024, list_budget: "2% of context, 8,000 chars if unknown, max 10,000 tokens"}+listing: {cut: 1024}+rules:+ - {id: CX-ROOT, when: "install_root not in roots", effect: not_loaded, outcome: not found, message: "Codex reads .agents/skills and .codex/skills (project and user).", fix: "Install it under .agents/skills or .codex/skills."}+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."diff --git a/src/skillevaluator/harness/profiles/copilot-cli.yaml b/src/skillevaluator/harness/profiles/copilot-cli.yamlnew file mode 100644index 00000000..465b4d95--- /dev/null+++ b/src/skillevaluator/harness/profiles/copilot-cli.yaml@@ -0,0 +1,12 @@+harness: copilot-cli+display_name: GitHub Copilot CLI+verified: {version: 1.0.105, source: closed (cli-main.js inspected), date: 2026-11-01, method: proxy-captured canary probes x3 (BYOK), os: linux}+roots:+ project: [.github/skills, .agents/skills, .claude/skills]+ user: [~/.copilot/skills, ~/.agents/skills]+rules:+ - {id: CP-ROOT, when: "install_root not in roots", effect: not_loaded, outcome: not found, message: "Copilot reads .github/.agents/.claude skills (project) and ~/.copilot or ~/.agents skills (user).", fix: "Install it under .github/skills, .agents/skills or .claude/skills."}+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."diff --git a/src/skillevaluator/harness/profiles/hermes.yaml b/src/skillevaluator/harness/profiles/hermes.yamlnew file mode 100644index 00000000..91ea8711--- /dev/null+++ b/src/skillevaluator/harness/profiles/hermes.yaml@@ -0,0 +1,15 @@+harness: hermes+display_name: Hermes Agent+verified: {version: "main @ c419cf7c864a (binary reports 2026.9.24)", source: "NousResearch/hermes-agent c419cf7c864ac0ee511dbd9f7091a8bba0b567ee", date: 2026-11-01, method: proxy-captured canary probes x3 + source, os: linux}+roots:+ project: [.hermes/skills, .agents/skills]+ project_requires_trust: true+ user: [~/.hermes/skills]+ not_scanned: [~/.agents/skills]+limits: {listing_desc_chars: 60}+rules:+ - {id: HM-ROOT, when: "install_root not in roots", effect: not_loaded, outcome: not found, message: "Hermes reads ~/.hermes/skills, and project .hermes/skills or .agents/skills only when trusted.", fix: "Install it under ~/.hermes/skills, or .hermes/skills or .agents/skills in a trusted repo."}+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."diff --git a/src/skillevaluator/harness/profiles/openclaw.yaml b/src/skillevaluator/harness/profiles/openclaw.yamlnew file mode 100644index 00000000..5ed5987c--- /dev/null+++ b/src/skillevaluator/harness/profiles/openclaw.yaml@@ -0,0 +1,13 @@+harness: openclaw+display_name: OpenClaw+verified: {version: 2026.10.9, source: "v2026.10.9 @ 88a19e0d8677", date: 2026-11-01, method: proxy-captured canary probes x3 + source, os: linux}+roots:+ project: [skills, .agents/skills]+ user: [~/.agents/skills, ~/.openclaw/skills]+limits: {max_skills_in_prompt: 150, max_prompt_chars: 18000, compact_desc_chars: 220, max_skill_file_bytes: 256000, read_budget: "16,000-64,000 weighted chars of the skills_read result by model context"}+rules:+ - {id: OW-ROOT, when: "install_root not in roots", effect: not_loaded, outcome: not found, message: "OpenClaw reads skills/, .agents/skills, ~/.agents/skills and ~/.openclaw/skills.", fix: "Install it under skills/ or .agents/skills in the workspace, or ~/.openclaw/skills."}+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."diff --git a/src/skillevaluator/harness/profiles/opencode.yaml b/src/skillevaluator/harness/profiles/opencode.yamlnew file mode 100644index 00000000..b4025e04--- /dev/null+++ b/src/skillevaluator/harness/profiles/opencode.yaml@@ -0,0 +1,13 @@+harness: opencode+display_name: OpenCode+verified: {version: 1.19.5, source: "v1.19.5 @ 810c0eba1a73", date: 2026-11-01, method: proxy-captured canary probes x3 + source, os: linux}+roots:+ project: [.opencode/skills, .opencode/skill, .claude/skills, .agents/skills]+ user: [~/.config/opencode/skills, ~/.claude/skills, ~/.agents/skills]+limits: {scan_depth: unlimited, desc_cap: none, list_cap: none, tool_output: "2,000 lines / 50 KB, rest spilled to a file"}+listing: {}+rules:+ - {id: OC-ROOT, when: "install_root not in roots", effect: not_loaded, outcome: not found, message: "OpenCode reads .opencode, .claude and .agents skill folders.", fix: "Install it under .opencode/skills, .claude/skills or .agents/skills."}+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."diff --git a/src/skillevaluator/harness/report.py b/src/skillevaluator/harness/report.pynew file mode 100644index 00000000..df67d1e9--- /dev/null+++ b/src/skillevaluator/harness/report.py@@ -0,0 +1,33 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0+"""Collect the advisory harness-compatibility rows and write them to the JSON report."""++from __future__ import annotations++import json+from collections.abc import Iterable+from pathlib import Path+from typing import TYPE_CHECKING, Any++from skillevaluator.validators.harness import HARNESS_METADATA_KEY++if TYPE_CHECKING:+ from skillevaluator.models.result import ValidationResult++Block = dict[str, list[dict[str, Any]]]+++def harness_block(results: Iterable[ValidationResult]) -> Block:+ """Collect the per-skill harness rows recorded by the ``harness`` check."""+ block: Block = {}+ for result in results:+ block.update((result.metadata or {}).get(HARNESS_METADATA_KEY) or {})+ return block+++def write_json_block(json_report: Path, block: Block) -> None:+ """Add the ``harness_compatibility`` block to an existing JSON report."""+ if json_report.exists():+ data = json.loads(json_report.read_text(encoding="utf-8"))+ data[HARNESS_METADATA_KEY] = block+ json_report.write_text(json.dumps(data, indent=2), encoding="utf-8")diff --git a/src/skillevaluator/publication_evidence.py b/src/skillevaluator/publication_evidence.pyindex 8c3f6e99..7c21ae97 100644--- a/src/skillevaluator/publication_evidence.py+++ b/src/skillevaluator/publication_evidence.py@@ -30,6 +30,7 @@ _RECOGNIZED_CHECKS_BY_TIER = {"license","code-integrity","dependency",+ "harness","unicode","quality","lint",diff --git a/src/skillevaluator/reporting/console_ui.py b/src/skillevaluator/reporting/console_ui.pyindex 4f022aa0..ef6541b0 100644--- a/src/skillevaluator/reporting/console_ui.py+++ b/src/skillevaluator/reporting/console_ui.py@@ -1054,6 +1054,7 @@ _VALIDATOR_CHECK_KEYS = (("lint", "lint"),("dependency", "dependency"),("version", "version"),+ ("harness", "harness"),)@@ -1108,6 +1109,7 @@ def _short_name(validator_name: str) -> str:"Unicode Smuggling Detection": "unicode","QUALITY": "quality","SCRIPT_LINT": "lint",+ "Harness Compatibility": "harness","Context Deduplication": "context","Inter-Skill Deduplication": "catalog",}@@ -1151,7 +1153,7 @@ def summarize_tier1(results: list[ValidationResult], lineup: list[str] | None =warnings = sum(len(r.warnings) for r in failed)advisory: dict[str, int] = {}for r in results:- if r.passed and not _is_skipped(r) and r.findings:+ if r.passed and not _is_skipped(r) and r.findings and _short_name(r.validator_name) != "harness":advisory[_short_name(r.validator_name)] = advisory.get(_short_name(r.validator_name), 0) + len(r.findings)rows: list[TierRow] = []diff --git a/src/skillevaluator/tier1/commands.py b/src/skillevaluator/tier1/commands.pyindex 3eb7658e..374843fc 100644--- a/src/skillevaluator/tier1/commands.py+++ b/src/skillevaluator/tier1/commands.py@@ -47,6 +47,7 @@ from skillevaluator.utils.rich_markup import escape_markupfrom skillevaluator.validators.base import continue_on_failure_scopefrom skillevaluator.validators.code_risk import CodeRiskValidatorfrom skillevaluator.validators.dependencies import DependencySecurityValidator+from skillevaluator.validators.harness import HarnessValidatorfrom skillevaluator.validators.hygiene import HygieneValidatorfrom skillevaluator.validators.license import LicenseValidatorfrom skillevaluator.validators.plugin_schema import PluginSchemaValidator@@ -85,7 +86,10 @@ DEFAULT_CHECKS = ("unicode","quality","lint",+ "harness",)+# Advisory checks never gate and are not part of the publication lineup.+ADVISORY_CHECKS = ("harness",)# Opt-in checks: recognized by ``--checks`` but excluded from the default run.# The dependency CVE audit is also available through the standalone# ``dependency-audit`` command; the version check above runs by default.@@ -119,6 +123,7 @@ _SKIPPED_VALIDATORS = {"unicode": ("Unicode Smuggling Detection",),"quality": ("Quality Score (4-Dimension Analysis)",),"lint": ("Script Lint (Advisory)",),+ "harness": ("Harness Compatibility",),}# Checks that read a skill manifest (SKILL.md frontmatter, its version, its# quality). A target that ``--type auto`` detects as ``unknown`` and that holds@@ -308,6 +313,8 @@ def run_validation(fail_fast: bool = False,continue_on_failure: bool = False,on_check: Callable[[str], None] | None = None,+ harness: str | None = None,+ harness_profiles: Path | None = None,skillspector_baseline: Path | None = None,skip: str | None = None,) -> list[ValidationResult]:@@ -444,6 +451,10 @@ def run_validation(v = LicenseValidator()return [_run_result("license", v.name, v.description, v.validate)]+ def _harness_results() -> list[ValidationResult]:+ v = HarnessValidator(harness, harness_profiles)+ return [_run_result("harness", v.name, v.description, v.validate)]+def _dependency_results() -> list[ValidationResult]:v = DependencySecurityValidator()return [_run_result("dependency", v.name, v.description, v.validate)]@@ -464,6 +475,7 @@ def run_validation(("unicode", _unicode_results, True),("quality", _quality_results, skill_like),("lint", _lint_results, skill_like),+ ("harness", _harness_results, skill_like),)active = [(check_name, builder) for check_name, builder, applicable in steps if check_name in enabled and applicablediff --git a/src/skillevaluator/validators/harness.py b/src/skillevaluator/validators/harness.pynew file mode 100644index 00000000..2c433ae2--- /dev/null+++ b/src/skillevaluator/validators/harness.py@@ -0,0 +1,64 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0+"""Advisory Tier 1 check: how each agent harness loads the skill, from versioned profiles."""++from __future__ import annotations++from pathlib import Path++from skillevaluator.harness.overlay import evaluate_profile, facts_for, load_profiles+from skillevaluator.models.result import Finding, Severity, ValidationResult+from skillevaluator.validators.base import ValidatorBase++HARNESS_METADATA_KEY = "harness_compatibility"+# Below the default gate (HIGH), so the check never fails a run unless a policy raises it.+_SEVERITY = {"not_loaded": Severity.MEDIUM, "degraded": Severity.LOW, "advisory": Severity.INFO}+++class HarnessValidator(ValidatorBase):+ """Evaluate each skill against the selected harness profiles."""++ def __init__(+ self, harnesses: str | None = None, profiles_dir: Path | None = None, config: dict | None = None+ ) -> None:+ self.harnesses = harnesses or "all"+ self.profiles_dir = profiles_dir+ self.config = config++ @property+ def name(self) -> str:+ return "Harness Compatibility"++ @property+ def description(self) -> str:+ return "Advisory: whether each agent harness loads, degrades or drops the skill"++ def validate(self, skill_path: Path) -> ValidationResult:+ skill_path = skill_path.parent if skill_path.is_file() else skill_path+ profiles = load_profiles(self.harnesses, self.profiles_dir)+ skills = [skill_path] if self._is_skill_directory(skill_path) else self._find_all_skills(skill_path)+ result = ValidationResult(validator_name=self.name, validator_description=self.description)+ block: dict[str, list[dict]] = {}+ for skill, facts in facts_for(skills).items():+ rows = [evaluate_profile(profile, facts, self.config) for profile in profiles]+ block[str(skill)] = [row.to_dict() for row in rows]+ for row in rows:+ for finding in row.findings:+ result.add_finding(+ Finding(+ category="HARNESS",+ severity=_SEVERITY[finding["effect"]],+ check_name=finding["id"],+ message=f"{row.harness}: {finding['message']}",+ suggestion=finding.get("fix"),+ file_path=str(skill / "SKILL.md"),+ metadata={+ "harness": row.harness,+ "effect": finding["effect"],+ "verified_version": row.version,+ "verified_date": row.verified_date,+ },+ )+ )+ result.metadata[HARNESS_METADATA_KEY] = block+ return resultdiff --git a/tests/golden/cli_surface.json b/tests/golden/cli_surface.jsonindex 8d5ce850..bbf6e91d 100644--- a/tests/golden/cli_surface.json+++ b/tests/golden/cli_surface.json@@ -4713,6 +4713,22 @@"param_type": "option","type": "text"},+ {+ "name": "harness",+ "opts": [+ "--harness"+ ],+ "param_type": "option",+ "type": "text"+ },+ {+ "name": "harness_profiles",+ "opts": [+ "--harness-profiles"+ ],+ "param_type": "option",+ "type": "directory"+ },{"name": "skip","opts": [diff --git a/tests/harness/test_overlay.py b/tests/harness/test_overlay.pynew file mode 100644index 00000000..a73650b4--- /dev/null+++ b/tests/harness/test_overlay.py@@ -0,0 +1,212 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0+"""Tests for the advisory harness check, panel and harness-check command."""++import json+from pathlib import Path++import pytest+from click.testing import CliRunner++from skillevaluator.cli import cli+from skillevaluator.harness import HARNESS_STATUSES, evaluate_harnesses, load_profiles, skill_facts+from skillevaluator.harness.overlay import PROFILES_DIR+from skillevaluator.models.result import Severity+from skillevaluator.tier1.commands import DEFAULT_CHECKS+from skillevaluator.validators.harness import HarnessValidator++HARNESSES = ["claude-code", "codex", "copilot-cli", "hermes", "openclaw", "opencode"]+BODY = "\n# Demo\n\n## Instructions\n\n1. Step\n\n## Examples\n\nExample.\n"+++def _skill(+ root: Path, extra: str = "", desc: str = "Use when checking harness compatibility.", body: str = BODY+) -> Path:+ skill = root / "skills" / "demo-skill"+ skill.mkdir(parents=True)+ (skill / "SKILL.md").write_text(+ f"---\nname: demo-skill\ndescription: {desc}\nmetadata:\n author: Demo User <[email protected]>\n{extra}---\n{body}",+ encoding="utf-8",+ )+ return skill+++def _status(skill: Path) -> dict[str, str]:+ return {r.harness: r.status for r in evaluate_harnesses(skill)}+++def _rooted(root: Path) -> Path:+ """A clean skill in .agents/skills, which every harness but Claude Code scans."""+ skill = root / ".agents" / "skills" / "demo-skill"+ skill.parent.mkdir(parents=True)+ _skill(root).rename(skill)+ return skill+++def test_packaged_profiles_load_and_pin_versions():+ profiles = load_profiles("all")++ assert sorted(p["harness"] for p in profiles) == HARNESSES+ assert all(p["verified"]["version"] and p["verified"]["date"] for p in profiles)+ assert len(list(PROFILES_DIR.glob("*.yaml"))) == 6+++def test_unknown_harness_is_rejected():+ with pytest.raises(ValueError, match="Unknown harness: nope"):+ load_profiles("codex,nope")+++def test_clean_skill_loads_everywhere(tmp_path: Path):+ assert set(_status(_skill(tmp_path)).values()) == {"loads"}+++def test_install_root_only_applies_inside_known_harness_roots(tmp_path: Path):+ skill = tmp_path / ".claude" / "skills" / "demo-skill"+ skill.parent.mkdir(parents=True)+ _skill(tmp_path).rename(skill)++ facts = skill_facts(skill)+ status = _status(skill)++ assert facts["install_root"] == ".claude/skills"+ assert status["claude-code"] == "loads"+ assert status["codex"] == "not_loaded"+++def test_user_root_is_told_apart_from_project_root(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):+ monkeypatch.setattr(Path, "home", lambda: tmp_path)+ skill = tmp_path / ".copilot" / "skills" / "demo-skill"+ skill.parent.mkdir(parents=True)+ _skill(tmp_path / "src").rename(skill)++ assert skill_facts(skill)["install_root"] == "~/.copilot/skills"+ assert _status(skill)["copilot-cli"] == "loads"+++def test_symlinked_skill_folder_counts_where_the_link_is(tmp_path: Path):+ link = tmp_path / ".claude" / "skills" / "demo-skill"+ link.parent.mkdir(parents=True)+ link.symlink_to(_rooted(tmp_path / "real"), target_is_directory=True)++ assert skill_facts(link)["install_root"] == ".claude/skills"+++def test_parent_segments_do_not_make_a_false_root(tmp_path: Path):+ _skill(tmp_path)+ (tmp_path / ".claude" / "skills").mkdir(parents=True)++ assert skill_facts(tmp_path / ".claude" / "skills" / ".." / ".." / "skills" / "demo-skill")["install_root"] is None+++def test_plain_parent_segment_keeps_the_root(tmp_path: Path):+ skill = tmp_path / ".claude" / "skills" / "demo-skill"+ (skill.parent / "group").mkdir(parents=True)+ _skill(tmp_path / "src").rename(skill)++ facts = skill_facts(skill.parent / "group" / ".." / "demo-skill")++ assert facts["install_root"] == ".claude/skills"+ assert facts["grouping_depth"] == 0+++def test_parent_segment_after_a_symlink_goes_to_the_real_parent(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):+ home = tmp_path / "home"+ project = tmp_path / "project"+ home.mkdir()+ (project / "sub").mkdir(parents=True)+ skill = project / ".claude" / "skills" / "demo-skill"+ skill.parent.mkdir(parents=True)+ _skill(tmp_path / "src").rename(skill)+ (home / "link").symlink_to(project / "sub", target_is_directory=True)+ monkeypatch.setattr(Path, "home", lambda: home)++ # home/link/.. is the project folder, even though home/.claude/skills would be a user root.+ assert skill_facts(home / "link" / ".." / ".claude" / "skills" / "demo-skill")["install_root"] == ".claude/skills"+++def test_parent_segment_after_a_symlink_does_not_lose_the_root(tmp_path: Path):+ store = tmp_path / "store"+ skill = _rooted(store)+ (tmp_path / "project").mkdir()+ (tmp_path / "project" / "link").symlink_to(skill.parent, target_is_directory=True)++ # project/link/.. is store/.agents, so the skill sits in .agents/skills.+ assert (+ skill_facts(tmp_path / "project" / "link" / ".." / "skills" / "demo-skill")["install_root"] == ".agents/skills"+ )+++def test_symlinked_skills_folder_counts_where_the_link_is(tmp_path: Path):+ link = tmp_path / "project" / ".claude" / "skills"+ link.parent.mkdir(parents=True)+ link.symlink_to(_rooted(tmp_path / "real").parent, target_is_directory=True)+ (link / "group").mkdir()++ assert skill_facts(link / "demo-skill")["install_root"] == ".claude/skills"+ assert skill_facts(link / "group" / ".." / "demo-skill")["install_root"] == ".claude/skills"+++def test_missing_home_folder_does_not_stop_the_check(tmp_path: Path, monkeypatch: pytest.MonkeyPatch):+ def no_home() -> Path:+ raise RuntimeError("no home")++ monkeypatch.setattr(Path, "home", no_home)++ assert skill_facts(_rooted(tmp_path))["install_root"] == ".agents/skills"+++def test_manifest_file_target_checks_its_skill(tmp_path: Path):+ result = HarnessValidator("claude-code").validate(_rooted(tmp_path) / "SKILL.md")++ assert next(iter(result.metadata["harness_compatibility"].values()))[0]["status"] == "not_loaded"+++def test_every_status_is_known(tmp_path: Path):+ assert {r.status for r in evaluate_harnesses(_skill(tmp_path, extra="owner: x\n"))} <= set(HARNESS_STATUSES)+++def test_cli_adds_json_block_and_keeps_exit_code(tmp_path: Path):+ skill = _rooted(tmp_path / "src")+ args = ["validate", str(skill), "--tiers", "1", "--checks", "schema,harness", "-r", "json"]++ plain = CliRunner().invoke(cli, [*args, "--output-dir", str(tmp_path / "a")])+ overlay = CliRunner().invoke(cli, [*args, "--output-dir", str(tmp_path / "b"), "--harness", "codex,claude-code"])++ assert plain.exit_code == overlay.exit_code == 0, overlay.output+ report = json.loads(next((tmp_path / "b").rglob("skillevaluator-output-*.json")).read_text())+ rows = {r["harness"]: r for r in next(iter(report["harness_compatibility"].values()))}+ assert rows["claude-code"]["status"] == "not_loaded"+ assert rows["codex"]["status"] == "loads"+ assert "CC-ROOT" in {f["id"] for f in rows["claude-code"]["findings"]}+++def test_cli_rejects_unknown_harness(tmp_path: Path):+ result = CliRunner().invoke(cli, ["validate", str(_skill(tmp_path)), "--tiers", "1", "--harness", "nope"])++ assert result.exit_code == 2+ assert "Unknown harness: nope" in result.output+++def test_harness_check_runs_by_default_and_never_fails(tmp_path: Path):+ assert "harness" in DEFAULT_CHECKS+ result = HarnessValidator("claude-code,codex").validate(_rooted(tmp_path))++ assert result.passed+ finding = next(f for f in result.findings if f.check_name == "CC-ROOT")+ assert finding.severity is Severity.MEDIUM+ assert finding.metadata["harness"] == "claude-code"+ assert all(f.severity not in (Severity.HIGH, Severity.CRITICAL) for f in result.findings)+ rows = next(iter(result.metadata["harness_compatibility"].values()))+ assert {r["harness"]: r["status"] for r in rows} == {"claude-code": "not_loaded", "codex": "loads"}+++def test_native_root_skips_root_rules(tmp_path):+ skill = tmp_path / ".claude" / "skills" / "demo"+ skill.mkdir(parents=True)+ (skill / "SKILL.md").write_text("---\nname: demo\ndescription: Demo skill for root checks.\n---\nBody.\n")++ def ids(cfg):+ return {f["id"] for r in evaluate_harnesses(skill, "all", config=cfg) for f in r.findings}++ assert "CX-ROOT" in ids({})+ assert not {i for i in ids({"native_root": True}) if i.endswith("-ROOT")}diff --git a/tests/test_publication_evidence.py b/tests/test_publication_evidence.pyindex 632624d4..8f92cc71 100644--- a/tests/test_publication_evidence.py+++ b/tests/test_publication_evidence.py@@ -414,9 +414,12 @@ def test_narrowed_tier1_lineup_declaration_cannot_waive_checks(tmp_path: Path, ddef test_publication_tier1_lineup_matches_the_default_validation_run() -> None:from skillevaluator.publication_evidence import TIER1_PUBLICATION_CORE_CHECKS, TIER1_PUBLICATION_SKILL_CHECKS- from skillevaluator.tier1.commands import DEFAULT_CHECKS+ from skillevaluator.tier1.commands import ADVISORY_CHECKS, DEFAULT_CHECKS- assert frozenset(DEFAULT_CHECKS) == TIER1_PUBLICATION_CORE_CHECKS | TIER1_PUBLICATION_SKILL_CHECKS+ assert (+ frozenset(DEFAULT_CHECKS) - frozenset(ADVISORY_CHECKS)+ == TIER1_PUBLICATION_CORE_CHECKS | TIER1_PUBLICATION_SKILL_CHECKS+ )def test_scan_gap_detection_reports_certified_paths_that_tier1_skips(tmp_path: Path) -> None:diff --git a/tests/test_skip_checks.py b/tests/test_skip_checks.pyindex 4ccf0c6c..1d5d7773 100644--- a/tests/test_skip_checks.py+++ b/tests/test_skip_checks.py@@ -41,6 +41,13 @@ def test_skip_whole_check_records_skipped_result():assert "unicode" in missing_tier1_publication_checks(results)+def test_skip_harness_records_skipped_result():+ with patch("skillevaluator.validators.harness.HarnessValidator.validate") as validate:+ results = run_validation(SKILL, checks="schema,harness", skip="harness")+ validate.assert_not_called()+ assert is_cleanly_skipped(_by_name(results)["Harness Compatibility"])++def test_skipped_check_is_visible_in_tier1_summary():results = run_validation(SKILL, checks="unicode,schema", skip="unicode")_ok, rows = summarize_tier1(results, lineup=["schema", "unicode"])