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): take the model setup in harness-check (#544)

Christopher Kevinf82c259b469c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 16efd1c0..181307e1 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.
+- `harness-check` takes the model setup some limits depend on: `--context-tokens`,
+ `--custom-provider`, `--explicit-invocation` and `--headless` (a Claude Code
+ skill with `allowed-tools` does not load headless).
- 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.
diff --git a/docs/cli-reference.mdx b/docs/cli-reference.mdx
index 819f405b..0adf9268 100644
--- a/docs/cli-reference.mdx
+++ b/docs/cli-reference.mdx
@@ -27,6 +27,7 @@ commands referenced below.
| [security-scan](#security-scan) | Scan for security vulnerabilities | Nothing (key only with `--llm`/`--llm-verify`) |
| [pii-scan](#pii-scan) | Scan for PII and local identifiers | Nothing (key only with `--llm-verify`) |
| [lint-scripts](#lint-scripts) | Advisory lint checks on skill scripts | Nothing |
+| [harness-check](#harness-check) | Show whether each agent harness loads, degrades or drops a skill | Nothing |
| [context-optimization-check](#context-optimization-check) | Detect redundant content within one skill | Embeddings + LLM provider key |
| [dedup-scan](#dedup-scan) | Alias of `context-optimization-check` | Embeddings + LLM provider key |
| [similarity-check](#similarity-check) | Detect duplicate content across a collection | Embeddings provider key |
@@ -437,6 +438,33 @@ Run advisory lint checks on skill scripts. Takes only the standard report option
skillevaluator lint-scripts ./my-skill
```
+## harness-check
+
+Show whether each agent harness loads, degrades or drops a skill. This is the Tier 1 `harness` check on its own, and it is static and keyless: no agent or model runs. `TARGET_PATH` is a skill folder, a folder of skills, or a plugin folder, which also gets a plugin panel. See [Tier 1: Validation](/skills/skillevaluator/tier1-validation) for what the verdicts and rules mean.
+
+```bash title="Check one skill against two harnesses"
+skillevaluator harness-check ./my-skill --harness codex,claude-code
+```
+
+```bash title="Describe your model setup"
+skillevaluator harness-check ./my-skill --context-tokens 200000 --headless
+```
+
+| Flag | Default | Effect |
+| --- | --- | --- |
+| `--harness TEXT` | `all` | Comma-separated harnesses to check, for example `codex,claude-code`. |
+| `--harness-profiles DIRECTORY` | packaged profiles | Directory of harness profile YAMLs to use instead of the packaged ones. |
+| `-v, --verbose` | off | List every harness with its verified version and date. |
+| `--json FILE` | unset | Also write the `harness_compatibility` block to this JSON file. |
+| `--context-tokens INTEGER` | `0` | Context window of your model in tokens, for the loader limits that depend on it. `0` means unknown, so the smallest window is assumed, except that with `--custom-provider` OpenClaw assumes 128,000 tokens. A value you pass is always used as given. |
+| `--custom-provider` | off | Your model is served through a custom or OpenAI-compatible provider, or is a model the harness ships no metadata for. With an unknown context window, OpenClaw then assumes 128,000 tokens instead of the smallest. |
+| `--explicit-invocation` | off | Skills are activated by an explicit mention (for example Codex `$skill`), not opened by the model. |
+| `--headless` | off | The harness runs non-interactively (for example `claude -p` in CI) with default permissions. |
+
+Without the four model-setup flags (`--context-tokens`, `--custom-provider`, `--explicit-invocation`, `--headless`), the check assumes an unknown context window, a native provider, model-initiated activation and an interactive session.
+
+This command does not take the standard report options; use `--json` for a file. It is advisory: findings never change the exit code. An unknown `--harness` name is a usage error (`2`), and a path with no skills and no plugin manifest exits `1`. A plugin folder with a recognized manifest still gets its plugin panel and exits `0`, even when it has no skills.
+
## context-optimization-check
Detect redundant content within one skill (intra-skill deduplication). Needs an embeddings-capable provider plus a chat LLM for the verification stage — see [Tier 2: Deduplication](/skills/skillevaluator/tier2-deduplication).
diff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdx
index dbcc2591..c8dfefcc 100644
--- a/docs/tier1-validation.mdx
+++ b/docs/tier1-validation.mdx
@@ -298,6 +298,8 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice
`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.
+
+ `harness-check` takes the model setup some limits depend on: `--context-tokens`, `--custom-provider`, `--explicit-invocation` and `--headless`.
</Accordion>
<Accordion title="security — vulnerability scanning">
diff --git a/src/skillevaluator/cli.py b/src/skillevaluator/cli.py
index fcd507b3..fc8e9a11 100644
--- a/src/skillevaluator/cli.py
+++ b/src/skillevaluator/cli.py
@@ -3115,19 +3115,52 @@ validate.help_group_descriptions = {
default=None,
help="Also write the harness_compatibility block to this JSON file.",
)
+ "--context-tokens",
+ type=click.IntRange(min=0),
+ default=0,
+ help="Context window of your model in tokens; some loader limits depend on it (0 = unknown, assume the smallest).",
+)
+ "--custom-provider",
+ is_flag=True,
+ help="Your model is served through a custom or OpenAI-compatible provider, or is a model the harness ships no metadata for.",
+)
+ "--explicit-invocation",
+ is_flag=True,
+ help="Skills are activated by an explicit mention (e.g. Codex $skill), not opened by the model.",
+)
+ "--headless",
+ is_flag=True,
+ help="The harness runs non-interactively (e.g. claude -p in CI) with default permissions.",
+)
def harness_check(
target_path: Path,
harness: str,
harness_profiles: Path | None,
verbose: bool,
json_path: Path | None,
+ context_tokens: int,
+ custom_provider: bool,
+ explicit_invocation: bool,
+ headless: bool,
) -> None:
"""Show whether each agent harness loads, degrades or drops a skill (advisory; exits 0)."""
from skillevaluator.harness.report import run_harness_check
from skillevaluator.reporting.console_ui import make_view_console
try:
- block = run_harness_check(target_path, harness, harness_profiles, console=make_view_console(), verbose=verbose)
+ config = {
+ "context_tokens": context_tokens,
+ "custom_provider": custom_provider,
+ "explicit_invocation": explicit_invocation,
+ "headless": headless,
+ }
+ block = run_harness_check(
+ target_path, harness, harness_profiles, console=make_view_console(), verbose=verbose, config=config
+ )
except ValueError as exc:
raise click.BadParameter(str(exc), param_hint="--harness") from exc
if not block:
diff --git a/src/skillevaluator/harness/profiles/claude-code.yaml b/src/skillevaluator/harness/profiles/claude-code.yaml
index f060bb62..dc345568 100644
--- a/src/skillevaluator/harness/profiles/claude-code.yaml
+++ b/src/skillevaluator/harness/profiles/claude-code.yaml
@@ -14,7 +14,8 @@ rules:
- {id: CC-DESC-MISSING, when: "description_missing or description_empty or description_type != 'str'", effect: degraded, message: "No usable description: Claude Code shows body text instead.", fix: "Add a non-empty string description."}
- {id: CC-LIST-BUDGET, when: "catalog_desc_chars > list_budget_chars", effect: degraded, outcome: listing shortened, message: "The {catalog_size} skills in this folder have {catalog_desc_chars} description chars; Claude Code's skill list fits {list_budget_chars} (1% of the context window at 4 chars per token; 8,000 if the window is unknown), so descriptions get shortened.", fix: "Shorten descriptions (trigger first) or install fewer skills here."}
- {id: CC-PRECEDENCE, when: "duplicate_name", effect: advisory, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); only one is used, and a user-level copy beats a project copy.", fix: "Give each skill a unique name."}
- - {id: CC-ALLOWED-TOOLS, when: "allowed_tools_shape != 'none'", effect: advisory, message: "allowed-tools only pre-approves tools, never restricts, and applies only when the skill is invoked through the Skill tool (e.g. /name), not when the model reads the file.", fix: "Don't rely on allowed-tools to restrict tools; use the harness's permission settings."}
+ - {id: CC-ALLOWED-TOOLS, when: "allowed_tools_shape != 'none'", effect: advisory, message: "allowed-tools only pre-approves tools, never restricts, and applies only when the skill is invoked through the Skill tool (e.g. /name), not when the model reads the file. With --headless, see CC-ALLOWED-TOOLS-HEADLESS.", fix: "Don't rely on allowed-tools to restrict tools; use the harness's permission settings."}
+ - {id: CC-ALLOWED-TOOLS-HEADLESS, when: "headless and allowed_tools_shape != 'none'", effect: not_loaded, outcome: instructions not delivered, message: "In headless -p runs with default permissions the Skill call for a skill declaring allowed-tools is refused, so the body is not delivered.", fix: "For headless use, drop allowed-tools or allow the Skill tool (e.g. --allowedTools Skill); the declared tools are then pre-approved without a prompt, so allow Skill only in repos whose skills you trust."}
- {id: CC-DUP-KEY, when: "frontmatter_duplicate_keys", effect: advisory, message: "Duplicate keys: Claude Code keeps the last value (four other harnesses drop the skill).", fix: "Remove the duplicate frontmatter key."}
- {id: CC-BODY-CAP, when: "skill_md_bytes > 1048576", effect: not_loaded, outcome: rejected, message: "SKILL.md over 1 MB is rejected (bundle string skill_md_too_large).", fix: "Move detail into references/ files and keep SKILL.md under 1 MB."}
- {id: CC-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)."}
diff --git a/tests/golden/cli_surface.json b/tests/golden/cli_surface.json
index e5a902fc..8a473d1f 100644
--- a/tests/golden/cli_surface.json
+++ b/tests/golden/cli_surface.json
@@ -1327,6 +1327,45 @@
],
"param_type": "option",
"type": "file"
+ },
+ {
+ "default": "0",
+ "name": "context_tokens",
+ "opts": [
+ "--context-tokens"
+ ],
+ "param_type": "option",
+ "type": "integer range"
+ },
+ {
+ "default": "False",
+ "is_flag": true,
+ "name": "custom_provider",
+ "opts": [
+ "--custom-provider"
+ ],
+ "param_type": "option",
+ "type": "boolean"
+ },
+ {
+ "default": "False",
+ "is_flag": true,
+ "name": "explicit_invocation",
+ "opts": [
+ "--explicit-invocation"
+ ],
+ "param_type": "option",
+ "type": "boolean"
+ },
+ {
+ "default": "False",
+ "is_flag": true,
+ "name": "headless",
+ "opts": [
+ "--headless"
+ ],
+ "param_type": "option",
+ "type": "boolean"
}
]
},
diff --git a/tests/harness/test_overlay.py b/tests/harness/test_overlay.py
index e8f433e1..3ef5a109 100644
--- a/tests/harness/test_overlay.py
+++ b/tests/harness/test_overlay.py
@@ -777,6 +777,18 @@ def test_codex_explicit_invocation_delivers_whole(tmp_path: Path):
assert "CX-SHELL-READ" not in _rule_ids(skill, "codex", {"custom_provider": True, "explicit_invocation": True})
+def test_harness_check_accepts_model_config(tmp_path: Path):
+ skill = _skill(tmp_path, body="x" * 20_000)
+ out = tmp_path / "out.json"
+
+ result = CliRunner().invoke(
+ cli, ["harness-check", str(skill), "--harness", "openclaw", "--context-tokens", "150000", "--json", str(out)]
+ )
+
+ assert result.exit_code == 0, result.output
+ assert "OW-READ-BUDGET" not in out.read_text()
+
+
def test_openclaw_read_budget_weights_cjk_not_utf8_bytes(tmp_path: Path):
kana = _skill(tmp_path / "kana", body="\u3042" * 8_000)
cyrillic = _skill(tmp_path / "cyr", body="\u0430" * 20_000)
@@ -800,6 +812,13 @@ def test_hermes_view_budget_counts_code_points(tmp_path: Path):
assert "HM-VIEW-BUDGET" not in _rule_ids(skill, "hermes")
+def test_claude_allowed_tools_blocks_headless_load(tmp_path: Path):
+ skill = _skill(tmp_path, extra="allowed-tools: Read\n")
+
+ assert "CC-ALLOWED-TOOLS-HEADLESS" not in _rule_ids(skill, "claude-code")
+ assert "CC-ALLOWED-TOOLS-HEADLESS" in _rule_ids(skill, "claude-code", {"headless": True})
+
+
def test_native_root_skips_root_rules(tmp_path):
skill = tmp_path / ".claude" / "skills" / "demo"
skill.mkdir(parents=True)