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): flag SKILL.md and files over harness delivery limits (#532)
Christopher Kevin8cbe349d86fe
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 71b87ba2..7a5523a0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,11 @@ All notable changes to SkillEvaluator are documented in this file.comment helpers, and needs no Pages configuration or history branch. Futuregenerated bundles include the template; archived bundles and the releasedonboarding CLI retain their existing hosted publisher setup.+- `harness` rules for delivery limits: Claude Code's body cap, OpenCode's+ 51,200-byte / 2,000-line reads and long lines, OpenClaw's whole-read and+ weighted result caps, Hermes's 100,000-character `skill_view` budget and Codex's+ ~10K-token shell-output cut. Tier 1 `schema` now reports `SKILL.md` size tiers+ (32 KiB LOW, 50 KiB MEDIUM, 256,000 bytes HIGH).- The `harness` check measures a skill together with the skills installed besideit: list budgets (scaled by the context window), duplicate names and which copyeach harness uses, and OpenClaw's prompt cap and compact list. A `catalog` linediff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdxindex 09a3bf38..2a6d3906 100644--- a/docs/tier1-validation.mdx+++ b/docs/tier1-validation.mdx@@ -261,6 +261,7 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice- A duplicate frontmatter key is HIGH (`duplicate_key`; several harnesses drop the skill), and a UTF-8 BOM is MEDIUM (`manifest_bom`).- A description within 1,024 characters but over 1,024 UTF-16 units is MEDIUM (`description_utf16_length`), and no "Use when ..." trigger in the first 60 characters is LOW (`description_trigger`).- A symlinked `SKILL.md` (`manifest_symlink`) or a `SKILL.md` nested inside the skill (`nested_manifest`) is MEDIUM.+ - `manifest_size` is LOW above 32 KiB, MEDIUM above 50 KiB and HIGH above 256,000 bytes.- `metadata.author` is optional under the `default` profile. Use `Name <email@host>` to include a contact address, or a person, team, or organization name such as `NVIDIA cuOpt Team` or `Jane Doe (@jdoe)`. A value that is malformed or unsafe is a HIGH `author_format` finding: a bare email or an email outside `Name <email@host>`, stray angle brackets, control, private-use, or bidirectional formatting characters (joiners such as ZWNJ and ZWJ, which Persian, Arabic and Devanagari names need, are accepted), no letters or digits, or more than 256 characters. A bare address counts even when its domain has no dot (`root@buildhost`), while a social handle such as `Jane Doe (@jdoe)` does not. The `registry` profile requires the `Name <email@host>` form.- `metadata.id` is an optional stable skill ID. When present it must be an exact 1–64 character lowercase ASCII slug (`^[a-z0-9]+(-[a-z0-9]+)*$`, no surrounding whitespace); it may differ from `name`. A collection run reports an ID that more than one discovered skill declares; `validate` on a catalog also lists these in `catalog-summary.json` under `metadata_id_conflicts`. Under `registry` a shared ID blocks: the run exits nonzero, and each sharing skill's entry is `"passed": false` with the conflict repeated under `catalog_findings` and counted in its `severity_counts`. A catalog validates each skill on its own, so that skill's own report was written before the catalog-wide check ran and keeps its single-skill verdict, which the entry carries alongside as `report_verdict` beside `report_scope: "single_skill"`. Uniqueness is checked only across the skills validated together, never against a registry, and a single-skill run does not claim it. The ID does not change local catalog identity, which stays keyed by content type and relative path.- `metadata.domain` accepts one category string or a list of them, such as `domain: [backend, ai-ml]`. Values are trimmed and deduplicated in order; a blank or null scalar means no domain. A list with more than 16 entries, or a non-string, blank, or over-128-character entry, is a HIGH `Field 'metadata.domain'` finding. The 128-character limit also applies to a single string.@@ -284,6 +285,8 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `liceLocation rules: `SKILL.md` casing, nested manifests, symlinked manifests and resources, OpenClaw symlink escapes, Codex scan depth, and files Hermes leaves out of its file list (outside `references/`, `templates/`, `assets/` and `scripts/`).The check measures the skill together with the skills installed next to it. A single skill under a harness root such as `.claude/skills`, or in a workspace `skills/` folder, is counted with everything in that folder (symlinked skill folders included). Skills in different folders are separate installations, and a folder of skills is its own catalog. That drives the list-budget rules (Claude Code and Codex ~8,000 description chars, Copilot 32 full descriptions, OpenClaw 150 skills or 18,000 chars) and a duplicate-name rule per harness that says which copy wins. A `catalog` line in the panel names the folder. Copilot CLI and OpenCode also get an advisory note on when new or edited skills are picked up.++ Delivery rules: Claude Code's body cap, OpenCode's 51,200-byte / 2,000-line reads and lines over 2,000 characters, OpenClaw's whole-or-nothing read against its result caps, Hermes's 100,000-character `skill_view` budget, and Codex's ~10K-token cut when the model reads `SKILL.md` through the shell.</Accordion><Accordion title="security — vulnerability scanning">diff --git a/src/skillevaluator/constants.py b/src/skillevaluator/constants.pyindex f42bbcf9..4d64333e 100644--- a/src/skillevaluator/constants.py+++ b/src/skillevaluator/constants.py@@ -156,6 +156,11 @@ PLUGIN_CONTAINED_MODE = "contained"# Skill manifest file name variants (case-insensitive search)SKILL_MANIFEST_VARIANTS = ("SKILL.md", "skill.md")+# SKILL.md size thresholds (bytes) where common agent harnesses start cutting,+# refusing, or skipping the file: 16,000-64,000 character whole-file reads,+# 50 KiB tool-output truncation, and a 256,000-byte discovery cap.+SKILL_MD_SIZE_THRESHOLDS = ((256_000, "high"), (50 * 1024, "medium"), (32 * 1024, "low"))+# Some harnesses show only the first ~60 characters of each description in# their skill list, so the "when to use" trigger should appear within it.DESCRIPTION_TRIGGER_WINDOW = 60diff --git a/src/skillevaluator/harness/overlay.py b/src/skillevaluator/harness/overlay.pyindex 1878bd6c..4ebee421 100644--- a/src/skillevaluator/harness/overlay.py+++ b/src/skillevaluator/harness/overlay.py@@ -5,6 +5,7 @@from __future__ import annotationsimport ast+import jsonimport osimport refrom dataclasses import dataclass, field@@ -136,6 +137,64 @@ def _install_root(skill_path: Path) -> tuple[str | None, int]:return None, 0+# OpenClaw 2026.10.9 cjk-chars.ts: CJK code points cost 4-16 chars, every other UTF-16 unit 1.+_OPENCLAW_CJK = (+ (3, ((0xB7, 0xB7), (0x3000, 0x319F), (0x4E00, 0x9FA5), (0xAC00, 0xD7AF), (0xFF01, 0xFF60))),+ (+ 11,+ (+ (0x1100, 0x11FF),+ (0x2E80, 0x2FFF),+ (0x31A0, 0x4DFF),+ (0x9FA6, 0x9FFF),+ (0xA000, 0xA4FF),+ (0xA700, 0xA707),+ (0xA960, 0xA97F),+ (0xD7B0, 0xD7FF),+ (0xF900, 0xFAFF),+ ),+ ),+ (+ 7,+ (+ (0x2C7, 0x2C7),+ (0x2C9, 0x2CB),+ (0x2D9, 0x2D9),+ (0x2EA, 0x2EB),+ (0x305, 0x305),+ (0x323, 0x323),+ (0xFE10, 0xFE4F),+ (0xFF61, 0xFFDC),+ (0xFFE0, 0xFFE6),+ ),+ ),+ (10, ((0x1D360, 0x1D371),)),+ (+ 14,+ (+ (0x16FE0, 0x16FFF),+ (0x1AFF0, 0x1AFFF),+ (0x1B000, 0x1B16F),+ (0x1F200, 0x1F2FF),+ (0x20000, 0x2FA1F),+ (0x30000, 0x3347F),+ ),+ ),+)+# Room OpenClaw keeps for its truncation notice; the skills_read path adds a JSON wrapper and cuts ~1% sooner.+_OPENCLAW_READ_OVERHEAD = 73+++def _openclaw_read_chars(text: str) -> int:+ """SKILL.md size as OpenClaw's tool-result cap measures it."""+ extra = 0+ for ch in text:+ cp = ord(ch)+ if cp >= 0x80:+ extra += next((w for w, rs in _OPENCLAW_CJK if any(a <= cp <= b for a, b in rs)), 0)+ return _OPENCLAW_READ_OVERHEAD + len(text.encode("utf-16-le", "surrogatepass")) // 2 + extra++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"@@ -189,24 +248,61 @@ def _paths(items: list[str]) -> str:return ", ".join(items[:3]) + (f" +{len(items) - 3} more" if len(items) > 3 else "")+def _read_text(path: Path) -> tuple[int, list[str]] | None:+ """Size and lines of a text file a harness could read; None for binary data and files that can't be read.++ The check is advisory, so anything odd is skipped instead of raised: binary data (a NUL byte in the+ first 8 KiB), a pipe or device that would block, a broken or looping link, a file without permission.+ """+ try:+ if not path.is_file():+ return None+ with path.open("rb") as handle:+ head = handle.read(8192)+ if b"\0" in head:+ return None+ data = head + handle.read()+ except OSError:+ return None+ return len(data), data.decode("utf-8", "replace").splitlines()++def _bundle_facts(skill_path: Path, manifest: Path) -> dict[str, Any]:base = skill_path.resolve()- links, escapes, unlisted = [], [], []+ links, escapes, sizes, long_lines, unlisted = [], [], [], [], []for path in _bundle_files(skill_path, manifest):rel = path.relative_to(skill_path).as_posix()if path.is_symlink():links.append(rel)- target = path.resolve()- if target != base and base not in target.parents:- escapes.append(rel)- continue- if rel.split("/", 1)[0] not in _HERMES_LINKED_DIRS:+ target = Path(os.path.realpath(path)) # unlike Path.resolve(), no error on a symlink loop+ if target == base or base in target.parents:+ continue # counted under its own path+ escapes.append(rel) # OpenCode follows it, so what it points to is read (and cut) like any file+ elif rel.split("/", 1)[0] not in _HERMES_LINKED_DIRS:unlisted.append(rel)+ text = _read_text(path)+ if text is not None:+ size, lines = text+ sizes.append((rel, size, len(lines)))+ long_lines += [rel] * sum(len(line) > 2000 for line in lines)+ largest = max(sizes, key=lambda item: item[1], default=("", 0, 0))+ paged = [rel for rel, size, count in sizes if size > 51200 or count > 2000]+ # Only OpenCode is known to follow symlinks to files outside the skill; OpenClaw's reads are not tested there.+ multi_read = [rel for rel, size, _ in sizes if size > 64000 and rel not in escapes]return {"resource_symlinks": len(links),"resource_symlink_paths": _paths(links),"resource_symlink_escapes": len(escapes),"resource_symlink_escape_paths": _paths(escapes),+ "largest_resource": largest[0],+ "largest_resource_bytes": largest[1],+ "largest_resource_lines": largest[2],+ "files_over_51200": len(paged),+ "files_over_51200_paths": _paths(paged),+ "files_over_64000": len(multi_read),+ "files_over_64000_paths": _paths(multi_read),+ "long_line_count": len(long_lines),+ "long_line_files": _paths(list(dict.fromkeys(long_lines))),"hermes_unlisted_files": len(unlisted),"hermes_unlisted_dirs": _paths(list(dict.fromkeys(rel.split("/", 1)[0] for rel in unlisted))),}@@ -233,6 +329,8 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, Aif skill_path.is_dir()else [])+ match = FRONTMATTER_PATTERN.match(text)+ body = match.group(2) if match else textcustom = {k: v for k, v in data.items() if str(k) not in _KNOWN_FIELDS}name = _skill_name(skill_path, data)duplicates = catalog.duplicates(skill_path, name) if catalog else []@@ -246,6 +344,12 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, A"nested_skill_md_exact": any(p.name == "SKILL.md" and not p.is_symlink() for p in nested),"skill_md_symlink": manifest.is_symlink(),"skill_dir_symlink_target": target,+ "skill_md_bytes": len(raw),+ "skill_md_lines": len(text.splitlines()),+ "openclaw_read_chars": _openclaw_read_chars(text),+ # OpenCode strips front matter and wraps the body before its tool-output cut.+ "opencode_body_output_bytes": len(f'<skill_content name="{name}">\n# Skill: {name}\n\n{body.strip()}'.encode()),+ "opencode_body_output_lines": 3 + len(body.strip().splitlines()),"frontmatter_missing": manifest.is_file() and FRONTMATTER_PATTERN.match(text) is None,"description_missing": "description" not in data,"description_empty": isinstance(description, str) and not description.strip(),@@ -260,8 +364,14 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, A"frontmatter_tab_indent": _tab_indent_breaks_yaml(fm_yaml),"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()),+ "skill_md_chars": len(text),+ "skill_md_tokens": len(raw) // 4,"description_over": max(0, (len(description) if isinstance(description, str) else 0) - 1024),"utf16_over": max(0, (_utf16_units(description)) - 1024),+ # Hermes skill_view returns JSON (ensure_ascii=False, budget in code points): SKILL.md + description + ~400 chars.+ "hermes_view_chars": len(json.dumps(text, ensure_ascii=False))+ + len(json.dumps(description if isinstance(description, str) else "", ensure_ascii=False))+ + 400,**_bundle_facts(skill_path, manifest),"catalog_size": catalog.size if catalog else 0,"catalog_desc_chars": catalog.desc_chars if catalog else 0,diff --git a/src/skillevaluator/harness/profiles/claude-code.yaml b/src/skillevaluator/harness/profiles/claude-code.yamlindex d061008d..45915d3a 100644--- a/src/skillevaluator/harness/profiles/claude-code.yaml+++ b/src/skillevaluator/harness/profiles/claude-code.yaml@@ -14,6 +14,7 @@ rules:- {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-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)."}- {id: CC-FM-STRIPPED, when: "custom_field_chars > 200", effect: advisory, message: "Frontmatter is stripped when the skill is used, so the text in {custom_fields} never reaches the model.", fix: "Move instructions from frontmatter into the SKILL.md body."}notes:diff --git a/src/skillevaluator/harness/profiles/codex.yaml b/src/skillevaluator/harness/profiles/codex.yamlindex 9c9ecb27..daf0c61c 100644--- a/src/skillevaluator/harness/profiles/codex.yaml+++ b/src/skillevaluator/harness/profiles/codex.yaml@@ -9,6 +9,7 @@ listing: {cut: 1024, budget: {desc_chars: 8000, chars_per_context_token: 0.08}}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."}- {id: CX-DESC-CUT, when: "description_codepoints > 1024", effect: degraded, outcome: listing shortened, message: "Description cut to 1,021 chars + '...' in the skill list ({description_codepoints} chars, {description_over} over 1,024).", fix: "Cut the description by at least {description_over} characters."}+ - {id: CX-SHELL-READ, when: "not explicit_invocation and (skill_md_bytes > 40000 or (custom_provider and skill_md_bytes > 10000))", effect: degraded, outcome: delivery truncated, message: "SKILL.md is {skill_md_bytes} bytes (~{skill_md_tokens} tokens); when the model opens it through the shell, Codex keeps only the start and end of output over ~10K tokens (10,000 bytes on models Codex has no bundled metadata for, e.g. custom providers). An explicit $skill mention injects the whole file (--explicit-invocation).", fix: "Keep SKILL.md under ~40,000 bytes (10,000 for custom providers); move detail into references/ files."}- {id: CX-DESC-MISSING, when: "description_missing or description_empty or description_type != 'str'", effect: not_loaded, message: "Skill dropped: Codex requires a string description.", fix: "Add a non-empty string description."}- {id: CX-STRICT-YAML, when: "frontmatter_tab_indent or frontmatter_duplicate_keys", effect: not_loaded, message: "Skill dropped: invalid YAML (tabs or duplicate keys).", fix: "Use spaces, not tabs, and remove duplicate keys."}- {id: CX-BOM, when: "frontmatter_bom", effect: not_loaded, outcome: rejected, message: "Skill dropped: SKILL.md starts with a UTF-8 BOM.", fix: "Save SKILL.md as UTF-8 without a BOM."}diff --git a/src/skillevaluator/harness/profiles/hermes.yaml b/src/skillevaluator/harness/profiles/hermes.yamlindex fe2d5c4b..acc1b234 100644--- a/src/skillevaluator/harness/profiles/hermes.yaml+++ b/src/skillevaluator/harness/profiles/hermes.yaml@@ -19,6 +19,7 @@ rules:- {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-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."}notes:- "Precedence: project > ~/.hermes/skills > skills.create_dir > external_dirs (project wins, 3/3)."- "Large bodies are spilled and paged through in small reads."diff --git a/src/skillevaluator/harness/profiles/openclaw.yaml b/src/skillevaluator/harness/profiles/openclaw.yamlindex 4af80481..81a4c500 100644--- a/src/skillevaluator/harness/profiles/openclaw.yaml+++ b/src/skillevaluator/harness/profiles/openclaw.yaml@@ -5,6 +5,7 @@ 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"}+config_defaults: {custom_provider_context_tokens: 128000}listing: {budget: {skills: 150, desc_chars: 18000, cut: 220}}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."}@@ -12,11 +13,15 @@ rules:- {id: OW-STRICT-YAML, when: "frontmatter_tab_indent or frontmatter_duplicate_keys", effect: not_loaded, outcome: rejected, message: "Skill dropped: invalid YAML (tabs or duplicate keys).", fix: "Use spaces, not tabs, and remove duplicate keys."}- {id: OW-SYMLINK-ESCAPE, when: "skill_dir_symlink_target == 'outside_root'", effect: not_loaded, message: "Symlink target is outside the skills root (even inside the repo): rejected.", fix: "Copy the skill into the skills folder instead of symlinking it from elsewhere."}- {id: OW-SYMLINK-FILE, when: "skill_md_symlink", effect: not_loaded, message: "Symlinked SKILL.md files are not loaded.", fix: "Copy SKILL.md into the folder instead of symlinking the file (a symlinked folder works)."}+ - {id: OW-FILE-CAP, when: "skill_md_bytes > 256000", effect: not_loaded, outcome: rejected, message: "SKILL.md over 256,000 bytes is skipped as invalid.", fix: "Move detail into references/ files and keep SKILL.md under 256,000 bytes."}+ - {id: OW-READ-REFUSED, when: "openclaw_read_chars > 64000", effect: degraded, outcome: instructions not delivered, message: "SKILL.md reads as {openclaw_read_chars} characters (OpenClaw counts each CJK character as 4 or more), over the 64,000-character read cap at every context size: the read is refused or returns a cut prefix with a truncation notice, not the whole instructions.", fix: "Keep SKILL.md under about 15,000 characters (about 3,700 CJK characters) to load at every context size; move detail into references/ files."}+ - {id: OW-READ-BUDGET, when: "openclaw_read_chars > 16000 and openclaw_read_chars <= 64000 and (context_tokens < 100000 or (context_tokens < 200000 and openclaw_read_chars > 32000))", effect: degraded, outcome: instructions not delivered, message: "SKILL.md reads as {openclaw_read_chars} characters (OpenClaw counts each CJK character as 4 or more), over the read cap for this setup: the read is refused or returns a cut prefix with a truncation notice. The cap depends on the model context (16,000 under 100K tokens, 32,000 under 200K, 64,000 above; custom providers default to 128K). Pass --context-tokens to check your setup.", fix: "Keep SKILL.md under about 15,000 characters (about 3,700 CJK characters); move detail into references/ files."}- {id: OW-COMPACT, when: "description_codepoints > 220 and (catalog_size > 150 or catalog_desc_chars > 18000)", effect: degraded, outcome: listing shortened, message: "{catalog_size} skills / {catalog_desc_chars} description chars here: over 150 skills or 18,000 chars, OpenClaw cuts descriptions to 220 chars.", fix: "Keep the description under 220 characters, trigger first."}- {id: OW-NESTED, when: "nested_skill_md", effect: advisory, message: "Nested SKILL.md is ignored.", fix: "Move the nested skill to its own folder under the skills root, or rename its SKILL.md."}- {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-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-DESC-ESCAPED, when: "description_has_quote", effect: advisory, outcome: text rewritten, message: "Double quotes in the description are shown to the model as " in the skill list.", fix: "Use single quotes in the description if the exact text matters."}notes:- "Precedence: workspace skills/ > .agents/skills > ~/.agents/skills > managed > bundled > extra dirs (project wins, 3/3)."diff --git a/src/skillevaluator/harness/profiles/opencode.yaml b/src/skillevaluator/harness/profiles/opencode.yamlindex dd0e1d43..bbf023aa 100644--- a/src/skillevaluator/harness/profiles/opencode.yaml+++ b/src/skillevaluator/harness/profiles/opencode.yaml@@ -13,9 +13,12 @@ rules:- {id: OC-DESC-EMPTY, when: "description_empty", effect: degraded, message: "Listed by name only.", fix: "Add a non-empty string description."}- {id: OC-DUP-KEY, when: "frontmatter_duplicate_keys", effect: not_loaded, outcome: rejected, message: "Skill dropped: duplicate frontmatter keys.", fix: "Remove the duplicate frontmatter key."}- {id: OC-NESTED, when: "nested_skill_md", effect: degraded, message: "The nested SKILL.md is loaded as a second, separate skill.", fix: "Move the nested skill to its own folder under the skills root, or rename its SKILL.md."}+ - {id: OC-BODY-CUT, when: "opencode_body_output_bytes > 51200 or opencode_body_output_lines > 2000", effect: degraded, outcome: needs paging, message: "OpenCode strips front matter and delivers the body as {opencode_body_output_bytes} bytes / {opencode_body_output_lines} lines; it cuts tool output at 51,200 bytes / 2,000 lines, so the model must page through the rest from a spill file.", fix: "Keep the SKILL.md body under 51,100 bytes and 1,990 lines; move detail into references/ files."}- {id: OC-DUP-NAME, when: "duplicate_name", effect: degraded, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); OpenCode picks a random one each run (concurrent loading, last write wins).", fix: "Give each skill a unique name."}- {id: OC-RELOAD, when: "always", effect: advisory, message: "Skill list and text are cached at startup; edits need a restart."}- {id: OC-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: OC-REF-CUT, when: "files_over_51200 > 0", effect: advisory, outcome: needs paging, message: "{files_over_51200} files are over 51,200 bytes or 2,000 lines ({files_over_51200_paths}); OpenCode's read tool returns at most that per call, so the model must page.", fix: "Split large files into pieces under 51,200 bytes and 2,000 lines."}+ - {id: OC-LONG-LINES, when: "long_line_count > 0", effect: advisory, outcome: delivery truncated, message: "{long_line_count} lines over 2,000 chars ({long_line_files}) are cut when the model reads them.", fix: "Wrap long lines (tables, minified JSON) under 2,000 characters."}- {id: OC-FM-STRIPPED, when: "custom_field_chars > 200", effect: advisory, message: "Frontmatter is stripped when the skill is used, so the text in {custom_fields} never reaches the model.", fix: "Move instructions from frontmatter into the SKILL.md body."}notes:- "Docs (V1) say one level deep and a 1-1024 description; runtime matches the V2 docs: recursive, no length cap."diff --git a/src/skillevaluator/validators/schema.py b/src/skillevaluator/validators/schema.pyindex 90f6f1f7..c54bf807 100644--- a/src/skillevaluator/validators/schema.py+++ b/src/skillevaluator/validators/schema.py@@ -29,6 +29,7 @@ from skillevaluator.constants import (SCHEMA_ALLOWED_DIRS_ENV,SKILL_MANIFEST_FILE,SKILL_MANIFEST_VARIANTS,+ SKILL_MD_SIZE_THRESHOLDS,SKILL_NOT_SHIPPED_DIRS,)from skillevaluator.logging_config import get_logger@@ -752,6 +753,23 @@ class SchemaValidator(ValidatorBase):"Save SKILL.md as UTF-8 without BOM",))+ for limit, level in SKILL_MD_SIZE_THRESHOLDS:+ if len(raw) > limit:+ findings.append(+ self._portability_finding(+ "manifest_size",+ Severity(level),+ f"SKILL.md is {len(raw):,} bytes (over {limit:,}); harnesses cut, refuse or skip large "+ "manifests (OpenClaw reads 16,000-64,000 chars and skips over 256,000 bytes; "+ "OpenCode cuts at 50 KiB)",+ file_path,+ "Move detail into references/ files and keep SKILL.md short",+ size_bytes=len(raw),+ limit_bytes=limit,+ )+ )+ break+# Same folders the harness check skips: evals/ and versions/ are scanned like any other folder.nested = sorted(pathdiff --git a/tests/harness/test_overlay.py b/tests/harness/test_overlay.pyindex d32a92cf..d65c97e4 100644--- a/tests/harness/test_overlay.py+++ b/tests/harness/test_overlay.py@@ -3,6 +3,7 @@"""Tests for the advisory harness check, panel and harness-check command."""import json+import osimport refrom pathlib import Path@@ -472,7 +473,10 @@ def test_bundle_files_symlinks_and_large_references(tmp_path: Path):rows = _rows(skill)assert facts["resource_symlinks"] == facts["resource_symlink_escapes"] == 1+ assert facts["largest_resource"] == "references/big.md" and facts["largest_resource_lines"] == 20000assert "HM-RESOURCE-SYMLINK" in _ids(rows, "hermes")+ assert "OW-REF-BUDGET" in _ids(rows, "openclaw")+ assert "OC-REF-CUT" in _ids(rows, "opencode")def test_every_rule_has_a_fix_and_placeholders_are_filled(tmp_path: Path):@@ -497,6 +501,30 @@ def test_fix_reaches_findings_and_panels(tmp_path: Path):assert "Description in the model's skill list" in out+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")+ padding = target - skill_facts(probe)[fact] + 1+ skill = _skill(root / str(target), body="a" * padding)+ assert skill_facts(skill)[fact] == target+ return skill+++ ("harness", "rule", "fact", "limit"),+ [+ ("hermes", "HM-VIEW-BUDGET", "hermes_view_chars", 100_000),+ ("openclaw", "OW-READ-BUDGET", "openclaw_read_chars", 16_000),+ ("openclaw", "OW-READ-REFUSED", "openclaw_read_chars", 64_000),+ ("codex", "CX-SHELL-READ", "skill_md_bytes", 40_000),+ ("opencode", "OC-BODY-CUT", "opencode_body_output_bytes", 51_200),+ ],+)+def test_body_limits_fire_just_over_the_limit(tmp_path: Path, harness: str, rule: str, fact: str, limit: int):+ assert rule not in _ids(_rows(_sized(tmp_path / "at", fact, limit)), harness)+ assert rule in _ids(_rows(_sized(tmp_path / "over", fact, limit + 1)), harness)++@pytest.mark.parametrize(("harness", "rule"), [("codex", "CX-DESC-CUT"), ("copilot-cli", "CP-DESC-LIMIT")])def test_description_limit_is_1024(tmp_path: Path, harness: str, rule: str):at = _rows(_skill(tmp_path / "at", desc="Use when " + "a" * 1015))@@ -506,6 +534,77 @@ def test_description_limit_is_1024(tmp_path: Path, harness: str, rule: str):assert any(f["id"] == rule and "1 over" in f["message"] for f in over[harness]["findings"])+def test_every_oversized_file_long_line_and_unlisted_folder_is_counted(tmp_path: Path):+ skill = _skill(tmp_path)+ for rel, size in {"references/a.md": 51_201, "shared/b.md": 64_001, "shared/c.md": 51_200}.items():+ (skill / rel).parent.mkdir(parents=True, exist_ok=True)+ (skill / rel).write_text("x" * size, encoding="utf-8")+ (skill / "python").mkdir()+ (skill / "python" / "wide.md").write_text("y" * 2001 + "\n" + "z" * 2000 + "\n", encoding="utf-8")+ facts = skill_facts(skill)+ rows = _rows(skill)++ assert (facts["files_over_51200"], facts["files_over_64000"]) == (2, 1)+ assert (facts["long_line_count"], facts["hermes_unlisted_files"]) == (4, 3)+ assert facts["hermes_unlisted_dirs"] == "python, shared"+ assert {"OC-REF-CUT", "OC-LONG-LINES"} <= _ids(rows, "opencode")+ assert {"HM-LINKED-LAYOUT"} <= _ids(rows, "hermes") and "OW-REF-BUDGET" in _ids(rows, "openclaw")+++def test_unreadable_resources_are_skipped_not_raised(tmp_path: Path):+ skill = _skill(tmp_path)+ refs = skill / "references"+ refs.mkdir()+ (refs / "ok.md").write_text("x" * 100)+ (refs / "locked.md").write_text("secret")+ (refs / "locked.md").chmod(0)+ (refs / "dangling.md").symlink_to(tmp_path / "missing.md")+ (refs / "loop").symlink_to(refs / "loop")+ os.mkfifo(refs / "pipe") # reading a pipe would block forever++ facts = skill_facts(skill)+ result = HarnessValidator().validate(skill)++ assert facts["largest_resource"] == "references/ok.md"+ assert facts["resource_symlinks"] == 2+ assert result.metadata["harness_compatibility"][str(skill)]+++def test_symlinked_reference_outside_the_skill_still_needs_paging(tmp_path: Path):+ skill = _skill(tmp_path)+ (skill / "references").mkdir()+ shared = tmp_path / "shared.md"+ shared.write_text("line\n" * 20_000 + "w" * 2_001 + "\n")+ (skill / "references" / "shared.md").symlink_to(shared)+ (skill / "real").mkdir()+ (skill / "real" / "big.md").write_text("line\n" * 20_000)+ (skill / "references" / "big.md").symlink_to(skill / "real" / "big.md")+ facts = skill_facts(skill)+ rows = _rows(skill)++ assert facts["resource_symlinks"] == 2 and facts["resource_symlink_escapes"] == 1+ # The link into the skill is counted once, under its real path; the one leaving it is read through the link.+ assert facts["files_over_51200_paths"] == "real/big.md, references/shared.md"+ assert facts["long_line_files"] == "references/shared.md"+ assert {"OC-REF-CUT", "OC-LONG-LINES"} <= _ids(rows, "opencode")+ # OpenClaw is not known to read through links, so its multi-read count stays on files inside the skill.+ assert facts["files_over_64000_paths"] == "real/big.md" and "OW-REF-BUDGET" in _ids(rows, "openclaw")+++def test_binary_resources_are_not_read_as_text(tmp_path: Path):+ skill = _skill(tmp_path)+ (skill / "assets").mkdir()+ (skill / "assets" / "padded.bin").write_bytes(b"\x89PNG\r\n\x1a\n" + b"\x00" * 5_000 + bytes(range(256)))+ (skill / "assets" / "photo.png").write_bytes(bytes(range(256)) * 400)+ facts = skill_facts(skill)+ rows = _rows(skill)++ assert (facts["long_line_count"], facts["files_over_51200"], facts["files_over_64000"]) == (0, 0, 0)+ assert facts["largest_resource"] == ""+ assert not {"OC-REF-CUT", "OC-LONG-LINES"} & _ids(rows, "opencode")+ assert "OW-REF-BUDGET" not in _ids(rows, "openclaw")++def test_compact_view_shows_worst_finding_per_harness_and_catalog(tmp_path: Path):_catalog(tmp_path, 40)block = harness_block(run_validation(tmp_path / ".claude" / "skills" / "filler-000", checks="harness"))@@ -536,6 +635,54 @@ def _rule_ids(skill: Path, harness: str, config: dict | None = None) -> set[str]return {f["id"] for r in evaluate_harnesses(skill, harness, config=config) for f in r.findings}+def test_openclaw_read_budget_depends_on_model_context(tmp_path: Path):+ mid = _skill(tmp_path / "mid", body="x" * 20_000)+ big = _skill(tmp_path / "big", body="x" * 40_000)++ assert "OW-READ-BUDGET" in _rule_ids(mid, "openclaw")+ assert "OW-READ-BUDGET" not in _rule_ids(mid, "openclaw", {"context_tokens": 150_000})+ assert "OW-READ-BUDGET" not in _rule_ids(mid, "openclaw", {"custom_provider": True})+ assert "OW-READ-BUDGET" in _rule_ids(big, "openclaw", {"custom_provider": True})+ assert "OW-READ-BUDGET" not in _rule_ids(big, "openclaw", {"context_tokens": 200_000})+++def test_codex_shell_cut_is_lower_for_custom_providers(tmp_path: Path):+ skill = _skill(tmp_path, body="x" * 12_000)++ assert "CX-SHELL-READ" not in _rule_ids(skill, "codex")+ assert "CX-SHELL-READ" in _rule_ids(skill, "codex", {"custom_provider": True})+++def test_codex_explicit_invocation_delivers_whole(tmp_path: Path):+ skill = _skill(tmp_path, body="x" * 50_000)++ assert "CX-SHELL-READ" in _rule_ids(skill, "codex", {"custom_provider": True})+ assert "CX-SHELL-READ" not in _rule_ids(skill, "codex", {"custom_provider": True, "explicit_invocation": True})+++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)++ assert skill_facts(kana)["skill_md_bytes"] < 32_000 < skill_facts(cyrillic)["skill_md_bytes"]+ assert "OW-READ-BUDGET" in _rule_ids(kana, "openclaw", {"custom_provider": True})+ assert "OW-READ-BUDGET" not in _rule_ids(cyrillic, "openclaw", {"custom_provider": True})+++def test_openclaw_read_chars_counts_code_units(tmp_path: Path):+ flat = skill_facts(_skill(tmp_path / "flat", body="a" * 1_000))["openclaw_read_chars"]+ lines = skill_facts(_skill(tmp_path / "lines", body="a\n" * 500))["openclaw_read_chars"]+ emoji = skill_facts(_skill(tmp_path / "emoji", body="\U0001f600" * 500))["openclaw_read_chars"]++ assert lines == flat == emoji+++def test_hermes_view_budget_counts_code_points(tmp_path: Path):+ skill = _skill(tmp_path, body="\u65c5" * 60_000)++ assert "HM-VIEW-BUDGET" not in _rule_ids(skill, "hermes")++def test_native_root_skips_root_rules(tmp_path):skill = tmp_path / ".claude" / "skills" / "demo"skill.mkdir(parents=True)diff --git a/tests/validators/test_schema.py b/tests/validators/test_schema.pyindex a0bea216..623e7042 100644--- a/tests/validators/test_schema.py+++ b/tests/validators/test_schema.py@@ -1625,6 +1625,28 @@ class TestSchemaPortabilityChecks:assert result.passed, result.errorsassert len(_checks(result, "manifest_symlink")) == 1+ @pytest.mark.parametrize(+ ("size", "severity"),+ [(32 * 1024 + 1, "low"), (50 * 1024 + 1, "medium"), (256_001, "high")],+ )+ def test_manifest_size_thresholds(self, tmp_path: Path, size: int, severity: str):+ skill_dir = _write_skill(tmp_path, _BASE_FM)+ manifest = skill_dir / "SKILL.md"+ padding = size - len(manifest.read_bytes())+ manifest.write_text(manifest.read_text() + "x" * padding)++ findings = _checks(SchemaValidator().validate(skill_dir), "manifest_size")++ assert [f.severity for f in findings] == [severity]+ assert findings[0].metadata["size_bytes"] == size++ def test_manifest_at_low_threshold_has_no_size_finding(self, tmp_path: Path):+ skill_dir = _write_skill(tmp_path, _BASE_FM)+ manifest = skill_dir / "SKILL.md"+ manifest.write_text(manifest.read_text() + "x" * (32 * 1024 - len(manifest.read_bytes())))++ assert not _checks(SchemaValidator().validate(skill_dir), "manifest_size")+def test_nested_manifest_is_medium(self, tmp_path: Path):skill_dir = _write_skill(tmp_path, _BASE_FM)(skill_dir / "references" / "inner").mkdir(parents=True)