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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ All notable changes to SkillEvaluator are documented in this file.
- `harness` results flag a project skill that has a same-named copy in a user-level
skills folder the harness also reads (`*-USER-COPY`). Claude Code uses the user
copy, Codex lists both, and the other harnesses use the project copy.
- `harness` results flag a skill whose description has nearly the same words as another
skill's in the same folder (`*-LOOKALIKE`), with no embedding key. The model may route a
request to the wrong one of the two.
- Canonical `comment-skill-checks.yml` reusable workflow and source template for
the standard scored Tier 1 PR comment without hosted reports. It verifies the
existing signed receipts and native evidence, reuses the shared report and
Expand Down
88 changes: 86 additions & 2 deletions src/skillevaluator/harness/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import json
import os
import re
import unicodedata
from dataclasses import dataclass, field
from itertools import groupby
from pathlib import Path
from typing import Any

Expand Down Expand Up @@ -457,6 +459,7 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, A
platforms = data.get("platforms")
name = _skill_name(skill_path, data)
duplicates = catalog.duplicates(skill_path, name) if catalog else []
lookalikes = catalog.lookalikes(skill_path) if catalog else []
return {
"skill_name": name,
"description_text": description if isinstance(description, str) else "",
Expand Down Expand Up @@ -517,9 +520,73 @@ def skill_facts(skill_path: Path, catalog: Catalog | None = None) -> dict[str, A
"catalog_base": str(catalog.base) if catalog and catalog.base else "",
"duplicate_name": bool(duplicates),
"duplicate_paths": ", ".join(duplicates[:3]),
"lookalike_names": ", ".join(lookalikes[:3]),
}


_LOOKALIKE_OVERLAP = 0.95
_LOOKALIKE_MIN_WORDS = 4
_STOP_WORDS = frozenset(
[
"a",
"an",
"and",
"are",
"as",
"at",
"be",
"by",
"for",
"from",
"in",
"into",
"is",
"it",
"of",
"on",
"or",
"the",
"this",
"that",
"to",
"use",
"used",
"user",
"uses",
"when",
"with",
"you",
"your",
]
)


# Scripts written without spaces between words (Han, kana, Thai, Lao): compared as character pairs.
_UNSPACED_RUN = re.compile(r"([\u0e00-\u0eff\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff]+)")


def _is_word_char(char: str) -> bool:
return char.isalnum() or unicodedata.category(char).startswith("M")


def _description_words(text: str) -> frozenset[str]:
"""Letters and digits in any script, lowercased, split on everything else, minus common English words."""
words: set[str] = set()
for keep, chars in groupby(unicodedata.normalize("NFKC", text).casefold(), _is_word_char):
if not keep:
continue
for i, piece in enumerate(_UNSPACED_RUN.split("".join(chars))):
if i % 2:
words.update({piece[j : j + 2] for j in range(len(piece) - 1)} or {piece})
elif piece and piece not in _STOP_WORDS:
words.add(piece)
return frozenset(words)


def _jaccard(a: frozenset[str], b: frozenset[str]) -> float:
return len(a & b) / len(a | b) if a and b else 0.0


@dataclass
class Catalog:
"""The skills installed together in one folder: what list budgets and name clashes depend on."""
Expand All @@ -528,16 +595,33 @@ class Catalog:
size: int
desc_chars: int
base: Path | None = None
descriptions: dict[Path, str] | None = None

@classmethod
def of(cls, skills: list[Path], base: Path | None = None) -> Catalog:
names, chars = {}, 0
names, descriptions, chars = {}, {}, 0
for skill in skills:
_, _, _, _, data = _read_manifest(skill)
names[skill.resolve()] = _skill_name(skill, data)
description = data.get("description")
chars += len(description) if isinstance(description, str) else 0
return cls(names=names, size=len(skills), desc_chars=chars, base=base)
descriptions[skill.resolve()] = description if isinstance(description, str) else ""
return cls(names=names, size=len(skills), desc_chars=chars, base=base, descriptions=descriptions)

def lookalikes(self, skill: Path) -> list[str]:
"""Other skills here whose description has nearly the same words as this one's."""
descriptions = self.descriptions or {}
own = skill.resolve()
words = _description_words(descriptions.get(own, ""))
if len(words) < _LOOKALIKE_MIN_WORDS:
return []
return [
self.names[other]
for other, text in descriptions.items()
if other != own
and self.names.get(other) != self.names.get(own)
and _jaccard(words, _description_words(text)) >= _LOOKALIKE_OVERLAP
]

def duplicates(self, skill: Path, name: str) -> list[str]:
own = skill.resolve()
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 @@ -15,6 +15,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.", confidence: medium}
- {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.", confidence: high}
- {id: CC-USER-COPY, when: "user_copy", effect: advisory, message: "A skill also named '{skill_name}' is installed at {user_copy_paths}; Claude Code uses that user-level copy, not this one.", fix: "Remove one copy, or give each a unique name.", confidence: high}
- {id: CC-LOOKALIKE, when: "lookalike_names != ''", effect: advisory, message: "{lookalike_names} in the same folder has a near-identical description, so the model may pick the wrong skill.", fix: "Make each description name what only that skill does.", confidence: medium}
- {id: CC-ALLOWED-TOOLS, when: "allowed_tools_shape != 'none'", effect: advisory, message: "allowed-tools only pre-approves tools, never restricts, and applies only when the skill is invoked through the Skill tool (e.g. /name), not when the model reads the file. With --headless, see CC-ALLOWED-TOOLS-HEADLESS.", fix: "Don't rely on allowed-tools to restrict tools; use the harness's permission settings.", confidence: high}
- {id: CC-ALLOWED-TOOLS-HEADLESS, when: "headless and allowed_tools_shape != 'none'", effect: not_loaded, outcome: instructions not delivered, message: "In headless -p runs with default permissions the Skill call for a skill declaring allowed-tools is refused, so the body is not delivered.", fix: "For headless use, drop allowed-tools or allow the Skill tool (e.g. --allowedTools Skill); the declared tools are then pre-approved without a prompt, so allow Skill only in repos whose skills you trust.", confidence: medium}
- {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.", confidence: high}
Expand Down
1 change: 1 addition & 0 deletions src/skillevaluator/harness/profiles/codex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ rules:
- {id: CX-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; Codex's skill list fits about {list_budget_chars} (2% of the context window at 4 bytes per token; 8,000 chars if unknown), so descriptions get shortened, then removed, then skills left out.", fix: "Shorten descriptions (trigger first) or install fewer skills here.", confidence: high}
- {id: CX-DUP-NAME, when: "duplicate_name", effect: advisory, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); Codex lists both, so the model sees two.", fix: "Give each skill a unique name.", confidence: high}
- {id: CX-USER-COPY, when: "user_copy", effect: advisory, message: "A skill also named '{skill_name}' is installed at {user_copy_paths}; Codex lists both, so the model sees two.", fix: "Remove one copy, or give each a unique name.", confidence: high}
- {id: CX-LOOKALIKE, when: "lookalike_names != ''", effect: advisory, message: "{lookalike_names} in the same folder has a near-identical description, so the model may pick the wrong skill.", fix: "Make each description name what only that skill does.", confidence: medium}
- {id: CX-ALLOWED-TOOLS, when: "allowed_tools_shape != 'none'", effect: advisory, message: "allowed-tools is ignored by Codex.", fix: "Don't rely on allowed-tools to restrict tools; use the harness's permission settings.", confidence: high}
- {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).", confidence: high}
- {id: CX-DMI-IGNORED, when: "disable_model_invocation and not codex_implicit_disabled", effect: degraded, message: "disable-model-invocation is ignored: the model still sees this skill and can use it on its own.", fix: "For Codex, add agents/openai.yaml with policy: {allow_implicit_invocation: false}.", confidence: high}
Expand Down
1 change: 1 addition & 0 deletions src/skillevaluator/harness/profiles/copilot-cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rules:
- {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).", confidence: high}
- {id: CP-DUP-NAME, when: "duplicate_name", effect: advisory, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); Copilot uses one, and the project copy wins.", fix: "Give each skill a unique name.", confidence: high}
- {id: CP-USER-COPY, when: "user_copy", effect: advisory, message: "A skill also named '{skill_name}' is installed at {user_copy_paths}; Copilot CLI uses this project copy, not that one.", fix: "Remove one copy, or give each a unique name.", confidence: high}
- {id: CP-LOOKALIKE, when: "lookalike_names != ''", effect: advisory, message: "{lookalike_names} in the same folder has a near-identical description, so the model may pick the wrong skill.", fix: "Make each description name what only that skill does.", confidence: medium}
- {id: CP-CODEX-POLICY, when: "codex_implicit_disabled and not disable_model_invocation", effect: degraded, message: "agents/openai.yaml implicit-invocation policy is Codex-only: here the model can still use this skill on its own.", fix: "Also set disable-model-invocation: true (Claude Code, Copilot and OpenClaw honour it).", confidence: high}
- {id: CP-ARGUMENTS, when: "uses_arguments_placeholder", effect: degraded, message: "$ARGUMENTS is not substituted: the model sees the literal text.", fix: "Describe the expected input in words instead of $ARGUMENTS.", confidence: high}
- {id: CP-SKILL-DIR, when: "uses_claude_skill_dir", effect: degraded, message: "${CLAUDE_SKILL_DIR} is not substituted: the model sees the literal text.", fix: "Use paths relative to SKILL.md.", confidence: high}
Expand Down
1 change: 1 addition & 0 deletions src/skillevaluator/harness/profiles/hermes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rules:
- {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).", confidence: high}
- {id: HM-DUP-NAME, when: "duplicate_name", effect: advisory, message: "Another skill is also named '{skill_name}' ({duplicate_paths}); Hermes lists both, so the model sees two.", fix: "Give each skill a unique name.", confidence: high}
- {id: HM-USER-COPY, when: "user_copy", effect: advisory, message: "A skill also named '{skill_name}' is installed at {user_copy_paths}; Hermes uses this project copy, not that one.", fix: "Remove one copy, or give each a unique name.", confidence: high}
- {id: HM-LOOKALIKE, when: "lookalike_names != ''", effect: advisory, message: "{lookalike_names} in the same folder has a near-identical description, so the model may pick the wrong skill.", fix: "Make each description name what only that skill does.", confidence: medium}
- {id: HM-PLATFORMS, when: "platforms_excluded != ''", effect: advisory, message: "Hidden from the skill list on {platforms_excluded} (platforms: {platforms}).", fix: "Add those systems to platforms, or remove platforms if the skill works everywhere.", confidence: high}
- {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.", confidence: medium}
- {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/.", confidence: high}
Expand Down
1 change: 1 addition & 0 deletions src/skillevaluator/harness/profiles/openclaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ rules:
- {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.", confidence: high}
- {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.", confidence: high}
- {id: OW-USER-COPY, when: "user_copy", effect: advisory, message: "A skill also named '{skill_name}' is installed at {user_copy_paths}; OpenClaw uses this project copy, not that one.", fix: "Remove one copy, or give each a unique name.", confidence: high}
- {id: OW-LOOKALIKE, when: "lookalike_names != ''", effect: advisory, message: "{lookalike_names} in the same folder has a near-identical description, so the model may pick the wrong skill.", fix: "Make each description name what only that skill does.", confidence: medium}
- {id: OW-REQUIRES, when: "openclaw_gates != ''", effect: advisory, message: "Left out of the skill list unless the host has: {openclaw_gates}.", fix: "Make sure target hosts provide these, or drop requirements the skill doesn't need.", confidence: high}
- {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.", versions: "2026.9+", confidence: medium}
- {id: OW-CODEX-POLICY, when: "codex_implicit_disabled and not disable_model_invocation", effect: degraded, message: "agents/openai.yaml implicit-invocation policy is Codex-only: here the model can still use this skill on its own.", fix: "Also set disable-model-invocation: true (Claude Code, Copilot and OpenClaw honour it).", confidence: high}
Expand Down
1 change: 1 addition & 0 deletions src/skillevaluator/harness/profiles/opencode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rules:
- {id: OC-DOLLAR-N, when: "dollar_literal_count > 0", effect: degraded, outcome: text rewritten, message: "Run as a /command, every $N is replaced and left blank without that argument: {dollar_literal_count} price-like tokens (lines {dollar_literal_lines}) lose their numbers. The skill tool path is unaffected.", fix: "Reword amounts (e.g. USD 4.00) instead of $4.00.", versions: "1.x; v2 no longer registers skills as commands", confidence: high}
- {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.", confidence: high}
- {id: OC-USER-COPY, when: "user_copy", effect: advisory, message: "A skill also named '{skill_name}' is installed at {user_copy_paths}; OpenCode uses this project copy, not that one.", fix: "Remove one copy, or give each a unique name.", confidence: high}
- {id: OC-LOOKALIKE, when: "lookalike_names != ''", effect: advisory, message: "{lookalike_names} in the same folder has a near-identical description, so the model may pick the wrong skill.", fix: "Make each description name what only that skill does.", confidence: medium}
- {id: OC-RELOAD, when: "always", effect: advisory, message: "Skill list and text are cached at startup; edits need a restart.", confidence: medium}
- {id: OC-ALLOWED-TOOLS, when: "allowed_tools_shape != 'none'", effect: advisory, message: "allowed-tools is ignored by OpenCode.", fix: "Don't rely on allowed-tools to restrict tools; use the harness's permission settings.", confidence: high}
- {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).", confidence: high}
Expand Down
Loading
Loading