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 descriptions harnesses drop, cut or hide (#526)
Christopher Kevinc9956abc1c21
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1725341d..aaf28ac7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,12 @@ 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 descriptions: missing or empty descriptions, Claude Code and+ Codex listing cuts, Copilot CLI's 1,024 UTF-16 unit limit, quotes escaped in the+ Copilot CLI and OpenClaw lists, and Hermes's 60-character listing; `-v` shows+ the description each harness lists. Tier 1 `schema` now reports a description+ over 1,024 UTF-16 units (MEDIUM) and no "Use when ..." trigger in its first 60+ characters (LOW).- `harness` rules for frontmatter parsing: duplicate keys and tab indentation(strict YAML parsers drop the skill), a UTF-8 BOM (Codex), no front matter(Copilot CLI) and long custom frontmatter that never reaches the model. Tier 1diff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdxindex e8d40b72..a56ee063 100644--- a/docs/tier1-validation.mdx+++ b/docs/tier1-validation.mdx@@ -259,6 +259,7 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice- `SKILL.md` should stay at or below 500 lines; larger files receive an advisory finding.- Harness portability: patterns the spec allows but common agent harnesses (Claude Code, Codex, OpenCode, OpenClaw, Hermes, Copilot CLI) load differently are reported; override any of them with `SCHEMA.<check_name>` in the validation policy.- 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`).- `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.@@ -276,6 +277,8 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice`validate` also shows a "Harness compatibility" panel after Tier 1, `! harness` in the checks line when a harness drops or degrades the skill, a `harness` line in the Tier 1 summary (kept out of the advisories count) and a note in the result box. `skillevaluator harness-check <skill>` runs only this check and shows the same panel, updated as each harness is checked. It accepts a folder of skills, `--harness`, `-v` and `--json PATH`, always exits 0, and points to `validate --tiers 1` when Tier 1 schema also fails. By default the panel is compact: one line per harness with its most serious finding (not loaded, then degraded, then note; ties go to the rule listed first in the profile) labelled with its outcome (`not found`, `rejected`, `listing shortened`, `delivery truncated` and so on), then `+N more` and the number of notes. `-v` (also on `validate`) lists every finding with its fix and each harness's verified version.Frontmatter rules: duplicate keys (Codex, Copilot CLI, OpenClaw and OpenCode drop the skill), tab indentation (Codex, Copilot CLI and OpenClaw), a UTF-8 BOM (Codex), no front matter (Copilot CLI), and long custom frontmatter that never reaches the model.++ Description rules: missing or empty descriptions, Claude Code and Codex listing cuts, Copilot CLI's 1,024 UTF-16 unit limit, quotes escaped in the Copilot CLI and OpenClaw lists, and Hermes's 60-character listing. `-v` also shows the description each harness puts in the model's skill list.</Accordion><Accordion title="security — vulnerability scanning">diff --git a/src/skillevaluator/constants.py b/src/skillevaluator/constants.pyindex 1df0b2cf..685247dc 100644--- a/src/skillevaluator/constants.py+++ b/src/skillevaluator/constants.py@@ -156,6 +156,14 @@ PLUGIN_CONTAINED_MODE = "contained"# Skill manifest file name variants (case-insensitive search)SKILL_MANIFEST_VARIANTS = ("SKILL.md", "skill.md")+# 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 = 60+DESCRIPTION_TRIGGER_PATTERN = (+ r"\buse (?:this (?:skill )?|it )?(?:when|for|to|if|whenever)\b"+ r"|\bwhen (?:the user|a user|you|asked)\b|\btriggers?\b"+)+# Banned/deprecated packagesBANNED_PACKAGES = ["subprocess32", # Use subprocess from stdlibdiff --git a/src/skillevaluator/harness/__init__.py b/src/skillevaluator/harness/__init__.pyindex 9d79ce1c..07472d2c 100644--- a/src/skillevaluator/harness/__init__.py+++ b/src/skillevaluator/harness/__init__.py@@ -14,6 +14,7 @@ from skillevaluator.harness.overlay import (evaluate_harnesses,evaluate_profile,facts_for,+ listed_description,load_profiles,model_config,skill_facts,@@ -25,6 +26,7 @@ __all__ = ["evaluate_harnesses","evaluate_profile","facts_for",+ "listed_description","load_profiles","model_config","skill_facts",diff --git a/src/skillevaluator/harness/overlay.py b/src/skillevaluator/harness/overlay.pyindex 98d114fc..7f660a3b 100644--- a/src/skillevaluator/harness/overlay.py+++ b/src/skillevaluator/harness/overlay.py@@ -12,13 +12,14 @@ from typing import Anyimport yaml-from skillevaluator.constants import SKILL_MANIFEST_VARIANTS+from skillevaluator.constants import DESCRIPTION_TRIGGER_PATTERN, SKILL_MANIFEST_VARIANTSfrom skillevaluator.validators.frontmatter_parser import FRONTMATTER_PATTERNfrom skillevaluator.validators.schema import _duplicate_frontmatter_keysPROFILES_DIR = Path(__file__).parent / "profiles"HARNESS_STATUSES = ("loads", "degraded", "not_loaded")_EFFECT_RANK = {"advisory": 0, "degraded": 1, "not_loaded": 2}+_TRIGGER_RE = re.compile(DESCRIPTION_TRIGGER_PATTERN, re.IGNORECASE)_CLAUDE_ONLY_FIELDS = ("argument-hint","when_to_use",@@ -67,9 +68,11 @@ class HarnessResult:version: strverified_date: strfindings: list[dict[str, str]] = field(default_factory=list)+ listed: dict[str, Any] = field(default_factory=dict)def to_dict(self) -> dict[str, Any]:return {+ "listed": self.listed,"harness": self.harness,"display_name": self.display_name,"status": self.status,@@ -160,20 +163,31 @@ def skill_facts(skill_path: Path) -> dict[str, Any]:"""Compute the facts profile rules refer to."""manifest, raw, text, fm_yaml, data = _read_manifest(skill_path)description = data.get("description")+ trigger = _TRIGGER_RE.search(description) if isinstance(description, str) else Noneroot, depth = _install_root(skill_path)custom = {k: v for k, v in data.items() if str(k) not in _KNOWN_FIELDS}name = _skill_name(skill_path, data)return {"skill_name": name,+ "description_text": description if isinstance(description, str) else "","install_root": root,"grouping_depth": depth,"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(),"description_type": type(description).__name__ if description is not None else "none",+ "description_codepoints": len(description) if isinstance(description, str) else 0,+ "description_has_quote": isinstance(description, str) and '"' in description,+ "description_utf16_units": _utf16_units(description),+ "trigger_end": trigger.end() if trigger else None,+ "name_missing": "name" not in data,"frontmatter_bom": raw.startswith(b"\xef\xbb\xbf"),"frontmatter_duplicate_keys": bool(_duplicate_frontmatter_keys(fm_yaml)),"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()),+ "description_over": max(0, (len(description) if isinstance(description, str) else 0) - 1024),+ "utf16_over": max(0, (_utf16_units(description)) - 1024),}@@ -182,6 +196,25 @@ def facts_for(skills: list[Path]) -> dict[Path, dict[str, Any]]:return {skill: skill_facts(skill) for skill in skills}+def _utf16_units(value: Any) -> int:+ return len(value.encode("utf-16-le", "surrogatepass")) // 2 if isinstance(value, str) else 0+++def listed_description(profile: dict[str, Any], facts: dict[str, Any]) -> dict[str, Any]:+ """What the profile says this harness puts in the model's skill list for the description."""+ listing = profile.get("listing") or {}+ text = facts["description_text"]+ limit = listing.get("drop_over_utf16")+ if limit and facts["description_utf16_units"] > limit:+ return {"mode": "dropped", "text": ""}+ if not text or (listing.get("name_only_over") and len(text) > listing["name_only_over"]):+ return {"mode": "name_only", "text": ""}+ cut = listing.get("cut")+ if cut and len(text) > cut:+ return {"mode": "cut", "text": text[:cut], "limit": cut}+ return {"mode": "full", "text": text}++class _Rule:_ALLOWED = (ast.Expression,@@ -320,6 +353,7 @@ def evaluate_profile(version=str(verified.get("version", "")),verified_date=str(verified.get("date", "")),findings=findings,+ listed=listed_description(profile, facts),)diff --git a/src/skillevaluator/harness/profiles/claude-code.yaml b/src/skillevaluator/harness/profiles/claude-code.yamlindex f3a72251..6a51dab3 100644--- a/src/skillevaluator/harness/profiles/claude-code.yaml+++ b/src/skillevaluator/harness/profiles/claude-code.yaml@@ -8,6 +8,8 @@ roots: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)."}+ - {id: CC-DESC-CUT, when: "description_codepoints > 1536", effect: degraded, outcome: listing shortened, message: "Description cut at 1,536 characters.", fix: "Keep the description at or under 1,536 characters."}+ - {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-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-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 cfe4333b..5b9eabe1 100644--- a/src/skillevaluator/harness/profiles/codex.yaml+++ b/src/skillevaluator/harness/profiles/codex.yaml@@ -8,6 +8,8 @@ limits: {scan_depth: 6, skips_hidden_dirs: true, catalog_desc_codepoints: 1024,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."}+ - {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-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."}notes:diff --git a/src/skillevaluator/harness/profiles/copilot-cli.yaml b/src/skillevaluator/harness/profiles/copilot-cli.yamlindex 0bc9d994..82a964d5 100644--- a/src/skillevaluator/harness/profiles/copilot-cli.yaml+++ b/src/skillevaluator/harness/profiles/copilot-cli.yaml@@ -4,11 +4,15 @@ verified: {version: 1.0.105, source: closed (cli-main.js inspected), date: 2026-roots:project: [.github/skills, .agents/skills, .claude/skills]user: [~/.copilot/skills, ~/.agents/skills]+listing: {drop_over_utf16: 1024}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."}+ - {id: CP-DESC-LIMIT, when: "description_utf16_units > 1024", effect: not_loaded, outcome: rejected, message: "Skill dropped: description is {description_utf16_units} UTF-16 units, {utf16_over} over the 1,024 limit (an emoji counts as 2).", fix: "Cut the description by at least {utf16_over} UTF-16 units."}- {id: CP-STRICT-YAML, when: "frontmatter_tab_indent or frontmatter_duplicate_keys or description_type not in ['str', 'none']", effect: not_loaded, message: "Skill dropped: Copilot's YAML parsing is strict.", fix: "Use spaces, not tabs, remove duplicate keys, and make the description a string."}- {id: CP-NO-FRONTMATTER, when: "frontmatter_missing", effect: not_loaded, outcome: not found, message: "Skill dropped: a SKILL.md with no front matter, or an unclosed one, is not registered ('Skill not found'; canary pair 3/3, drift NOCLOSE canary in 4 releases, Trial I 2/2).", fix: "Add front matter with a name and a description."}+ - {id: CP-DESC-MISSING, when: "description_missing", effect: degraded, message: "No description: Copilot shows body text instead.", fix: "Add a non-empty string description."}- {id: CP-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."}+ - {id: CP-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:- "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)."diff --git a/src/skillevaluator/harness/profiles/hermes.yaml b/src/skillevaluator/harness/profiles/hermes.yamlindex 1c97b708..d0b4083b 100644--- a/src/skillevaluator/harness/profiles/hermes.yaml+++ b/src/skillevaluator/harness/profiles/hermes.yaml@@ -7,8 +7,11 @@ roots:user: [~/.hermes/skills]not_scanned: [~/.agents/skills]limits: {listing_desc_chars: 60}+listing: {cut: 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."}+ - {id: HM-DESC-60, when: "trigger_end is None or trigger_end > 60", effect: advisory, outcome: listing shortened, message: "The skill list shows only the first ~60 chars of the description (57 + '...' in 0.16, a word boundary near 59 on main), and the trigger isn't in them.", fix: "Put the trigger (\"Use when …\") in the first 57 characters."}+ - {id: HM-DESC-MISSING, when: "description_missing or description_empty", effect: degraded, message: "Listed by name with an empty description.", fix: "Add a non-empty string description."}- {id: HM-DUP-KEY, when: "frontmatter_duplicate_keys", effect: advisory, message: "Duplicate keys: last value wins.", fix: "Remove the duplicate frontmatter key."}notes:- "Precedence: project > ~/.hermes/skills > skills.create_dir > external_dirs (project wins, 3/3)."diff --git a/src/skillevaluator/harness/profiles/openclaw.yaml b/src/skillevaluator/harness/profiles/openclaw.yamlindex 09bd2af5..032fbdba 100644--- a/src/skillevaluator/harness/profiles/openclaw.yaml+++ b/src/skillevaluator/harness/profiles/openclaw.yaml@@ -7,7 +7,9 @@ roots: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."}+ - {id: OW-DESC-MISSING, when: "description_missing or description_empty", effect: not_loaded, outcome: rejected, message: "Skill dropped: no description.", fix: "Add a non-empty string description."}- {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-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)."- "Description given as a YAML list is stringified and listed. BOM, CRLF, bare colons tolerated."diff --git a/src/skillevaluator/harness/profiles/opencode.yaml b/src/skillevaluator/harness/profiles/opencode.yamlindex d1078c8f..271e44a1 100644--- a/src/skillevaluator/harness/profiles/opencode.yaml+++ b/src/skillevaluator/harness/profiles/opencode.yaml@@ -8,6 +8,9 @@ limits: {scan_depth: unlimited, desc_cap: none, list_cap: none, tool_output: "2,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."}+ - {id: OC-NAME-MISSING, when: "name_missing", effect: not_loaded, outcome: rejected, message: "Skill dropped: OpenCode requires a name.", fix: "Add a name field matching the folder name."}+ - {id: OC-DESC-MISSING, when: "description_missing or description_type != 'str'", effect: not_loaded, message: "Loaded but hidden from the model's skill list (no string description).", fix: "Add a non-empty string description."}+ - {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-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/report.py b/src/skillevaluator/harness/report.pyindex d439d451..6bd53627 100644--- a/src/skillevaluator/harness/report.py+++ b/src/skillevaluator/harness/report.py@@ -138,6 +138,29 @@ def _detail_grid(rows: list[dict[str, Any]], verbose: bool) -> Table | None:return grid if grid.row_count else None+_LISTING = {+ "cut": "cut to {limit} chars",+ "name_only": "name only",+ "dropped": "not listed",+ "shortened": "shortened (over list budget)",+}+++def _listing_grid(rows: list[dict[str, Any]]) -> Table | None:+ grid = Table.grid(padding=(0, 2), expand=True)+ grid.add_column(no_wrap=True, style=TEXT)+ grid.add_column(no_wrap=True, style=MUTED)+ grid.add_column(ratio=1, style=MUTED)+ for row in rows:+ listed = row.get("listed") or {}+ if listed.get("mode", "full") == "full":+ continue+ text = listed.get("text", "")+ shown = f"“{text[:57]}…”" if len(text) > 57 else f"“{text}”" if text else "-"+ grid.add_row(row["harness"], _LISTING[listed["mode"]].format(limit=listed.get("limit", "")), shown)+ return grid if grid.row_count else None++def _subtitle(rows: list[dict[str, Any]]) -> tuple[Text, str]:done = [row for row in rows if row["status"] not in ("pending", "checking")]if len(done) < len(rows):@@ -170,6 +193,9 @@ def harness_panel(grid = _detail_grid(rows, verbose) if verbose else _compact_grid(rows)if grid is not None:parts.extend([Text(), grid])+ listing = _listing_grid(rows) if verbose else None+ if listing is not None:+ parts.extend([Text(), Text("Description in the model's skill list (from the profile):", MUTED), listing])flagged = any(row.get("findings") for row in all_rows)if footer and (flagged or verbose):parts.extend([Text(), Text(footer + ("" if verbose else VERBOSE_HINT), MUTED)])diff --git a/src/skillevaluator/validators/schema.py b/src/skillevaluator/validators/schema.pyindex f2a4b62b..96435a1a 100644--- a/src/skillevaluator/validators/schema.py+++ b/src/skillevaluator/validators/schema.py@@ -18,6 +18,9 @@ from pydantic import ValidationErrorfrom skillevaluator.constants import (DEFAULT_ALLOWED_SKILL_DIRS,+ DESCRIPTION_MAX_LENGTH,+ DESCRIPTION_TRIGGER_PATTERN,+ DESCRIPTION_TRIGGER_WINDOW,KEBAB_CASE_PATTERN,MAX_SKILL_MD_LINES,RECOMMENDED_BODY_SECTIONS,@@ -182,6 +185,7 @@ def _display_metadata_id(value: Any) -> str:_UTF8_BOM = b"\xef\xbb\xbf"+_TRIGGER_RE = re.compile(DESCRIPTION_TRIGGER_PATTERN, re.IGNORECASE)def _duplicate_frontmatter_keys(frontmatter_yaml: str) -> list[tuple[str, int]]:@@ -412,7 +416,7 @@ class SchemaValidator(ValidatorBase):result.merge(self._validate_name_matches_directory(skill_path, frontmatter))result.merge(self._validate_author(frontmatter, str(skill_md)))result.merge(self._validate_metadata_id(frontmatter, str(skill_md)))- result.merge(self._validate_portability(skill_md))+ result.merge(self._validate_portability(skill_md, frontmatter))return result@@ -712,7 +716,7 @@ class SchemaValidator(ValidatorBase):metadata=dict(metadata),)- def _validate_portability(self, skill_md: Path) -> ValidationResult:+ def _validate_portability(self, skill_md: Path, frontmatter: SkillFrontmatter) -> ValidationResult:"""Flag spec-valid patterns that common agent harnesses load differently or not at all."""result = ValidationResult()file_path = str(skill_md)@@ -732,6 +736,35 @@ class SchemaValidator(ValidatorBase):"Save SKILL.md as UTF-8 without BOM",))+ description = frontmatter.description+ utf16_units = len(description.encode("utf-16-le", "surrogatepass")) // 2+ if len(description) <= DESCRIPTION_MAX_LENGTH < utf16_units:+ findings.append(+ self._portability_finding(+ "description_utf16_length",+ Severity.MEDIUM,+ f"Description is {len(description)} characters but {utf16_units} UTF-16 units; "+ f"Copilot CLI counts UTF-16 units and drops descriptions over {DESCRIPTION_MAX_LENGTH}",+ file_path,+ "Shorten the description or replace emoji and other non-BMP characters",+ utf16_units=utf16_units,+ )+ )++ trigger = _TRIGGER_RE.search(description)+ if trigger is None or trigger.end() > DESCRIPTION_TRIGGER_WINDOW:+ where = "no 'Use when ...' trigger" if trigger is None else f"its trigger at characters {trigger.start()}-{trigger.end()}"+ findings.append(+ self._portability_finding(+ "description_trigger",+ Severity.LOW,+ f"Description has {where}; some harnesses show only the first "+ f"~{DESCRIPTION_TRIGGER_WINDOW} characters in their skill list",+ file_path,+ f"State when to use the skill within the first {DESCRIPTION_TRIGGER_WINDOW} characters",+ )+ )+for finding in findings:result.add_finding(finding)return resultdiff --git a/tests/golden/test_policy_behavior.py b/tests/golden/test_policy_behavior.pyindex 521b7550..a97c0102 100644--- a/tests/golden/test_policy_behavior.py+++ b/tests/golden/test_policy_behavior.py@@ -33,7 +33,7 @@ def _write_skill(root: Path, name: str, author_line: str | None) -> Path:skill.mkdir(parents=True)meta = f"metadata:\n author: {author_line}\n" if author_line else ""(skill / "SKILL.md").write_text(- f"---\nname: {name}\ndescription: A test skill for policy behavior checks.\n{meta}---\n"+ f"---\nname: {name}\ndescription: Use when checking policy behavior. A test skill for policy behavior checks.\n{meta}---\n"+ _BODY.format(name=name),encoding="utf-8",)diff --git a/tests/harness/test_overlay.py b/tests/harness/test_overlay.pyindex 637f1ccb..bdcbd77c 100644--- a/tests/harness/test_overlay.py+++ b/tests/harness/test_overlay.py@@ -80,6 +80,24 @@ def test_bom_is_not_loaded_by_codex_only(tmp_path: Path):assert {h for h, s in status.items() if s != "loads"} == {"codex"}+def test_utf16_overflow_is_not_loaded_by_copilot(tmp_path: Path):+ status = _status(_skill(tmp_path, desc="Use when testing emoji. " + "\U0001f600" * 600))++ assert status["copilot-cli"] == "not_loaded"+ assert status["codex"] == "loads"+++def test_copilot_shows_body_for_missing_description_but_drops_non_string(tmp_path: Path):+ skill = tmp_path / "skills" / "no-desc"+ skill.mkdir(parents=True)+ (skill / "SKILL.md").write_text("---\nname: no-desc\n---\nCustom skill\n", encoding="utf-8")+ rows = _rows(skill)+ assert rows["copilot-cli"]["status"] == "degraded"+ assert "CP-DESC-MISSING" in _ids(rows, "copilot-cli") and "CP-STRICT-YAML" not in _ids(rows, "copilot-cli")+ listed = _skill(tmp_path / "list", desc="[a, b]")+ assert "CP-STRICT-YAML" in _ids(_rows(listed), "copilot-cli")++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)@@ -283,6 +301,45 @@ def test_harness_check_command_rejects_unknown_harness(tmp_path: Path):assert "Unknown harness: nope" in result.output+def _rows(skill: Path) -> dict[str, dict]:+ return {r.harness: r.to_dict() for r in evaluate_harnesses(skill)}+++def _ids(rows: dict[str, dict], harness: str) -> set[str]:+ return {f["id"] for f in rows[harness]["findings"]}+++def test_listed_description_projection(tmp_path: Path):+ desc = "Use when " + "a" * 1600+ rows = _rows(_skill(tmp_path, desc=desc))++ assert rows["hermes"]["listed"] == {"mode": "cut", "text": desc[:60], "limit": 60}+ assert rows["claude-code"]["listed"]["limit"] == 1536+ assert rows["codex"]["listed"]["limit"] == 1024+ assert rows["copilot-cli"]["listed"]["mode"] == "dropped"+ assert rows["opencode"]["listed"]["mode"] == rows["openclaw"]["listed"]["mode"] == "full"+++def test_fix_reaches_findings_and_panels(tmp_path: Path):+ skill = _skill(tmp_path, desc="Use when testing emoji. " + "\U0001f600" * 600)+ result = HarnessValidator().validate(skill)+ finding = next(f for f in result.findings if f.check_name == "CP-DESC-LIMIT")++ assert finding.suggestion == "Cut the description by at least 200 UTF-16 units."+ out = CliRunner().invoke(cli, ["harness-check", str(skill), "-v"], env={"COLUMNS": "120"}).output+ assert "→ Cut the description by at least 200 UTF-16 units." in out+ assert "Description in the model's skill list" in out++[email protected](("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))+ over = _rows(_skill(tmp_path / "over", desc="Use when " + "a" * 1016))++ assert rule not in _ids(at, harness)+ assert any(f["id"] == rule and "1 over" in f["message"] for f in over[harness]["findings"])++def test_tier1_summary_gives_harness_its_own_line(tmp_path: Path):results = run_validation(_rooted(tmp_path), checks="schema,harness", harness="all")_, rows = summarize_tier1(results)@@ -292,6 +349,12 @@ def test_tier1_summary_gives_harness_its_own_line(tmp_path: Path):assert "harness" not in labels.get("advisories", "")+def test_quotes_in_description_are_escaped_in_copilot_and_openclaw_lists(tmp_path: Path):+ rows = _rows(_skill(tmp_path, desc='Use when asked to "summarize" a file.'))+ assert "CP-DESC-ESCAPED" in _ids(rows, "copilot-cli") and "OW-DESC-ESCAPED" in _ids(rows, "openclaw")+ assert "CC-DESC-ESCAPED" not in _ids(rows, "claude-code") and rows["copilot-cli"]["status"] == "loads"++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}@@ -340,3 +403,15 @@ def test_tab_after_spaces_that_breaks_yaml_is_flagged(tmp_path: Path):(skill / "SKILL.md").write_text("---\nname: demo-skill\nmetadata:\n \tauthor: x\n---\nBody\n")assert skill_facts(skill)["frontmatter_tab_indent"] is True+++def test_lone_surrogate_description_is_counted_not_fatal(tmp_path: Path):+ skill = _skill(tmp_path, desc='"Use when checking \\ud800 harness compatibility."')++ assert skill_facts(skill)["description_utf16_units"] > 0+++def test_trigger_cut_at_the_listing_window_counts_as_missing(tmp_path: Path):+ facts = skill_facts(_skill(tmp_path, desc="x" * 55 + " Use when checking harness compatibility."))++ assert facts["trigger_end"] > 60diff --git a/tests/test_commands.py b/tests/test_commands.pyindex 0c430797..732583fc 100644--- a/tests/test_commands.py+++ b/tests/test_commands.py@@ -506,6 +506,13 @@ def test_validate_json_names_a_clean_single_skill_and_records_the_evaluator(repo = tmp_path / "repo"skill = repo / "skills" / "simple"shutil.copytree(FIXTURE, skill)+ manifest = skill / "SKILL.md"+ manifest.write_text(+ manifest.read_text(encoding="utf-8").replace(+ "description: Summarize", "description: Use when notes need action items. Summarize"+ ),+ encoding="utf-8",+ )if in_git_checkout:subprocess.run(["git", "init", "-q", str(repo)], check=True)subprocess.run(diff --git a/tests/validators/test_folder_validation.py b/tests/validators/test_folder_validation.pyindex 605353b9..edef56de 100644--- a/tests/validators/test_folder_validation.py+++ b/tests/validators/test_folder_validation.py@@ -77,7 +77,7 @@ Example two.skill1_dir.mkdir()(skill1_dir / "SKILL.md").write_text("""---name: valid-skill-description: Valid skill+description: Use when checking that a valid skill passes folder validationmetadata:author: Test User <[email protected]>---diff --git a/tests/validators/test_schema.py b/tests/validators/test_schema.pyindex 6ac2bd8b..c0f23350 100644--- a/tests/validators/test_schema.py+++ b/tests/validators/test_schema.py@@ -1229,7 +1229,7 @@ class TestMetadataIdContract:(skill_dir / "SKILL.md").write_text(f"""---name: {name}-description: A skill used by the test suite to check the metadata.id contract+description: Use when testing the metadata.id contract. A skill used by the test suite to check the contractmetadata:author: Jane Doe <[email protected]>{id_block}---@@ -1422,7 +1422,7 @@ class TestCollectionAdvisoryIdentity:(skill_dir / "SKILL.md").write_text(f"""---name: {name}-description: A skill used by the test suite to check collection-level advisory handling+description: Use when testing collection advisories. A skill used by the test suite to check collection-level advisory handlingmetadata:author: {author_line}{id_block}---@@ -1614,6 +1614,38 @@ class TestSchemaPortabilityChecks:assert result.passed, result.errorsassert [f.severity for f in _checks(result, "manifest_bom")] == ["medium"]+ def test_description_over_utf16_limit_is_medium(self, tmp_path: Path):+ description = "Use when testing. " + "\U0001f600" * 600+ fm = _BASE_FM.replace("Use when checking harness portability of a skill.", description)+ result = SchemaValidator().validate(_write_skill(tmp_path, fm))++ findings = _checks(result, "description_utf16_length")+ assert result.passed, result.errors+ assert [f.metadata["utf16_units"] for f in findings] == [len(description.encode("utf-16-le")) // 2]++ def test_bmp_description_at_limit_has_no_utf16_finding(self, tmp_path: Path):+ fm = _BASE_FM.replace("Use when checking harness portability of a skill.", "Use when x. " + "a" * 1012)+ result = SchemaValidator().validate(_write_skill(tmp_path, fm))++ assert not _checks(result, "description_utf16_length")++ @pytest.mark.parametrize(+ ("description", "expected"),+ [+ ("Formats tables. Use when the user asks for a table.", False),+ ("Use this skill to format tables in reports.", False),+ ("Formats tables, charts and other structured report content nicely. Use when needed.", True),+ ("Formats tables in reports.", True),+ ("Formats tables, charts and structured report sections. Use when needed.", True),+ ],+ )+ def test_description_trigger_window(self, tmp_path: Path, description: str, expected: bool):+ fm = _BASE_FM.replace("Use when checking harness portability of a skill.", description)+ findings = _checks(SchemaValidator().validate(_write_skill(tmp_path, fm)), "description_trigger")++ assert bool(findings) is expected+ assert all(f.severity == "low" for f in findings)+def test_portability_severity_can_be_overridden_by_policy(self, tmp_path: Path):from skillevaluator.validators.policy import ValidationPolicy