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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ All notable changes to SkillEvaluator are documented in this file.
comment helpers, and needs no Pages configuration or history branch. Future
generated bundles include the template; archived bundles and the released
onboarding CLI retain their existing hosted publisher setup.
- `harness` rules for where `SKILL.md` lives: casing, nested manifests, symlinked
manifests and resources, OpenClaw symlink escapes, Codex scan depth, and files
Hermes leaves out of its file list. Tier 1 `schema` now reports a symlinked or
nested `SKILL.md` (MEDIUM), and the `skill.md` naming finding explains the
macOS/Linux difference.
- `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
Expand Down
3 changes: 3 additions & 0 deletions docs/tier1-validation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice
- 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`).
- A symlinked `SKILL.md` (`manifest_symlink`) or a `SKILL.md` nested inside the skill (`nested_manifest`) is MEDIUM.
- `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.
Expand All @@ -279,6 +280,8 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice
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.

Location 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/`).
</Accordion>

<Accordion title="security — vulnerability scanning">
Expand Down
4 changes: 4 additions & 0 deletions src/skillevaluator/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@ class ExitCode:

SCAN_ARTIFACT_DIRS = frozenset({"evals", ".evals", "results", ".results", "versions", ".versions"})

# Folders no harness reads as part of a skill: VCS data, caches and dependencies. The artifact
# folders above are not in this set because harnesses scan them like any other folder.
SKILL_NOT_SHIPPED_DIRS = SCAN_EXCLUDED_DIRS - SCAN_ARTIFACT_DIRS

PLUGIN_TREE_PRUNED_DIRS = SCAN_EXCLUDED_DIRS - {"__pycache__"}

PLUGIN_TREE_MAX_DISCOVERED_PATHS = 20_000
65 changes: 64 additions & 1 deletion src/skillevaluator/harness/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
from __future__ import annotations

import ast
import os
import re
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any

import yaml

from skillevaluator.constants import DESCRIPTION_TRIGGER_PATTERN, SKILL_MANIFEST_VARIANTS
from skillevaluator.constants import DESCRIPTION_TRIGGER_PATTERN, SKILL_MANIFEST_VARIANTS, SKILL_NOT_SHIPPED_DIRS
from skillevaluator.validators.frontmatter_parser import FRONTMATTER_PATTERN
from skillevaluator.validators.schema import _duplicate_frontmatter_keys

Expand Down Expand Up @@ -159,19 +160,80 @@ def _tab_indent_breaks_yaml(fm_yaml: str) -> bool:
return False


def _shipped_paths(skill_path: Path) -> list[Path]:
"""Files and symlinks a skill ships, without descending into VCS or cache folders."""
found = []
for folder, dirs, files in os.walk(skill_path):
dirs[:] = [d for d in dirs if d not in SKILL_NOT_SHIPPED_DIRS]
here = Path(folder)
found.extend(here / name for name in files)
found.extend(here / name for name in dirs if (here / name).is_symlink())
return sorted(found)


def _bundle_files(skill_path: Path, manifest: Path) -> list[Path]:
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
return [path for path in _shipped_paths(skill_path) if path != manifest]


_HERMES_LINKED_DIRS = ("references", "templates", "assets", "scripts")


def _paths(items: list[str]) -> str:
return ", ".join(items[:3]) + (f" +{len(items) - 3} more" if len(items) > 3 else "")


def _bundle_facts(skill_path: Path, manifest: Path) -> dict[str, Any]:
base = skill_path.resolve()
links, escapes, 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:
unlisted.append(rel)
return {
"resource_symlinks": len(links),
"resource_symlink_paths": _paths(links),
"resource_symlink_escapes": len(escapes),
"resource_symlink_escape_paths": _paths(escapes),
"hermes_unlisted_files": len(unlisted),
"hermes_unlisted_dirs": _paths(list(dict.fromkeys(rel.split("/", 1)[0] for rel in unlisted))),
}


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 None
root, depth = _install_root(skill_path)
target = "none"
if skill_path.is_symlink():
resolved = skill_path.resolve()
base = (Path(*_link_location_parts(skill_path)).parents[depth] if root else skill_path.parent).resolve()
target = "inside_root" if base in resolved.parents else "outside_root"
names = {p.name for p in skill_path.iterdir()} if skill_path.is_dir() else set()
nested = (
[p for p in _shipped_paths(skill_path) if p.name in SKILL_MANIFEST_VARIANTS and p.parent != skill_path]
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
if skill_path.is_dir()
else []
)
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,
"manifest_name_exact": "SKILL.md" in names,
"nested_skill_md": bool(nested),
"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,
"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(),
Expand All @@ -188,6 +250,7 @@ def skill_facts(skill_path: Path) -> dict[str, Any]:
"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),
**_bundle_facts(skill_path, manifest),
}


Expand Down
1 change: 1 addition & 0 deletions src/skillevaluator/harness/profiles/claude-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ rules:
- {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-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:
- "Follows symlinked skill folders and symlinked SKILL.md files, inside or outside the root."
Expand Down
4 changes: 4 additions & 0 deletions src/skillevaluator/harness/profiles/codex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ rules:
- {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."}
- {id: CX-NESTED, when: "nested_skill_md_exact", 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: CX-DEPTH, when: "grouping_depth > 5", effect: not_loaded, outcome: not found, message: "Beyond Codex's scan depth of 6.", fix: "Install the skill at most 5 folders below the skills root."}
- {id: CX-SYMLINK-FILE, when: "skill_md_symlink", effect: not_loaded, message: "Symlinked SKILL.md files are skipped (codex#15756).", fix: "Copy SKILL.md into the folder instead of symlinking the file (a symlinked folder works)."}
- {id: CX-CASING, when: "not manifest_name_exact", effect: not_loaded, message: "Non-canonical name (skill.md/Skill.md): never loaded, on Linux or macOS (3/3 each).", fix: "Rename the file to SKILL.md (exact casing)."}
notes:
- "Explicit $skill injects the whole SKILL.md (145 KB tested)."
- "Follows symlinked skill folders (inside or outside the root)."
Expand Down
2 changes: 2 additions & 0 deletions src/skillevaluator/harness/profiles/copilot-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ rules:
- {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-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: CP-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: 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 &quot; in the skill list.", fix: "Use single quotes in the description if the exact text matters."}
notes:
Expand Down
5 changes: 5 additions & 0 deletions src/skillevaluator/harness/profiles/hermes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ 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-NESTED, when: "nested_skill_md_exact", effect: degraded, message: "The nested SKILL.md is loaded as a second, separate skill (hidden folders are walked too).", fix: "Move the nested skill to its own folder under the skills root, or rename its SKILL.md."}
- {id: HM-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: HM-DUP-KEY, when: "frontmatter_duplicate_keys", effect: advisory, message: "Duplicate keys: last value wins.", fix: "Remove the duplicate frontmatter key."}
- {id: HM-CASING, when: "not manifest_name_exact", effect: not_loaded, message: "Non-canonical name (skill.md/Skill.md): never loaded, on Linux or macOS (3/3 each).", fix: "Rename the file to SKILL.md (exact casing)."}
- {id: HM-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/."}
notes:
- "Precedence: project > ~/.hermes/skills > skills.create_dir > external_dirs (project wins, 3/3)."
- "Large bodies are spilled and paged through in small reads."
Expand Down
4 changes: 4 additions & 0 deletions src/skillevaluator/harness/profiles/openclaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ 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-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-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-DESC-ESCAPED, when: "description_has_quote", effect: advisory, outcome: text rewritten, message: "Double quotes in the description are shown to the model as &quot; 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)."
Expand Down
Loading
Loading