Align validation with current skill-authoring guidance - #97
Closed
aminmesbahi wants to merge 3 commits into
Closed
aminmesbahi wants to merge 3 commits into
aminmesbahi wants to merge 3 commits into
Conversation
Bring the validator in line with the Agent Skills spec's reference validator (skills-ref), Anthropic's and OpenAI's skill-authoring guidance, and recent research on context files and skill security. Fixes: - Truncate judge input by characters, not bytes, so multibyte content is not split mid-rune or cut to a third of the limit - Re-use cached judge scores only while the file content and rubric version match; edited files were previously served stale scores Validation: - Validate names like skills-ref: NFKC-normalized Unicode lowercase letters, digits, and hyphens; warn on non-ASCII names and on the reserved words "anthropic" and "claude" rejected by the Claude API - Report client extension fields (when_to_use, paths, ...) as portability notes instead of unrecognized-field warnings; flag description + when_to_use over Claude Code's 1,536-character limit - Check descriptions for XML tags, first/second-person wording, and a missing statement of when to use the skill - Accept evals/ and agents/ as conventional directories, exclude them from token accounting, and validate evals/evals.json - Flag nested reference chains, long reference files without a table of contents, and backslash paths in SKILL.md Content and scoring: - Add emphasis and rationale metrics with an advisory for dense all-caps emphasis - Rework the Directive Precision rubric to reward unambiguous, gated instructions with reasons rather than emphatic language; count discoverable overviews and rarely applicable instructions against Novelty and Token Efficiency - Default to claude-sonnet-5, a 20,000-character judge input limit, and a 120-second HTTP timeout Security: - Add an experimental security package, `analyze security` command, and `security` check group that flag prompt injection, remote code execution, credential access, disabled safety controls, committed secrets, and invisible characters New heuristic checks report at info level so --strict pipelines keep their current exit codes.
aminmesbahi
marked this pull request as draft
September 27, 2026 12:46
staticcheck (ST1018) rejects string literals that contain Unicode format characters. Write the zero-width and bidi-override characters as escape sequences instead of literal characters; the matched set is unchanged.
aminmesbahi
marked this pull request as ready for review
September 27, 2026 13:01
Member
|
Hey @aminmesbahi - thank you for the PR, but unfortunately, I'm not able to accept this PR for a few reasons:
If you'd like to propose any new checks, feel free to open If you'd like to propose changes to existing behavior, such as changes to judge behavior, I'd also propose one new Thank you for your interest in contributing, and for taking the time to make the PR - apologies that I can't accept it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Brings skill-validator in line with current skill-authoring guidance from the Agent Skills spec (
skills-ref), Anthropic, OpenAI, and xAI, and with recent research (ETH Zurich's AGENTS.md study, SkillsBench, Agent Skills in the Wild):skills-ref(Unicode and NFKC).evals/andagents/are accepted andevals/evals.jsonis validated.analyze securitycheck for prompt injection,curl | sh, credential access, committed secrets, and invisible characters. About 26% of marketplace skills have at least one such pattern.--strictexit-code changes on existing skills: new heuristic checks report at info level.What this PR does
Fixes
formatUserContentslicedcontent[:maxLen]even thoughDefaultMaxContentLenis documented in characters. That split multibyte characters and cut CJK content to a third of the limit, the same class of bug as Description length counts UTF-8 bytes but reports "characters" — multibyte descriptions rejected below 1024 chars #94.ContentHash, so an edited SKILL.md or reference file kept its old scores, contrary to the README. Hits now require a matching content hash and a matchingRubricVersion. The rubric changes in this PR bump that version, so old scores are re-scored automatically.Spec and vendor alignment
skills-ref: names are NFKC-normalized, and Unicode lowercase letters and digits are allowed. Non-ASCII names were previously errors; they now get a portability warning, since the Claude API accepts onlya-z0-9-. The directory-name comparison is NFKC-normalized too.anthropicandclaudein names, and XML tags in descriptions.when_to_use,disable-model-invocation,paths,context,effort, …) get an info-level portability note instead of an "unrecognized field" warning. Claude.ai uploads, the Skills API, andskills-refreject these fields.description+when_to_useover Claude Code's 1,536-character listing limit is flagged.evals/andagents/are conventional directories: no unknown-directory warning, and they are excluded from token accounting.agents/covers OpenAI Codex'sagents/openai.yaml.evals/evals.jsonis validated against the agentskills.io format, and an info note appears when a skill has no evals.--allow-dirs=evalsopts out of the format check for custom eval formats.Content and scoring
emphasis_markers,emphasis_ratio, andrationale_markers, plus an info advisory when all-caps emphasis is dense. Existing JSON fields are unchanged.claude-sonnet-5, a 20,000-character content limit (up from 8,000, so a SKILL.md at the spec's 5,000-token ceiling is scored whole), and a 120-second HTTP timeout.Security (new, experimental)
securitypackage,analyze securitycommand, andsecuritycheck group, whichcheckruns by default (--skip securityturns it off). Findings include file and line.curl/wgetpiped into a shell or interpreter, andiwr … | iex;--dangerously-skip-permissions-style flags;chmod 777;allowed-toolspre-approves unrestrictedBash.evals/, hidden directories, and binary files are skipped.Compatibility
--strictexit codes don't change for existing skills. On the repository's own fixtures and example skill, none of the new checks produced a warning or error.skill.UnrecognizedFields()keeps its meaning and is now sorted; the newskill.IsExtensionFieldandSkill.ExtensionFieldsdo the filtering.orchestrate.AllGroups()now includessecurity.securitypackage is listed as experimental in the Stability section.golang.org/x/textis pinned to v0.36.0 so the module still requires Go 1.25.5.How to test
New tests cover:
Checklist
go test ./... -count=1). The one failure,TestDetectSkills/follows_symlinks, fails onmaintoo: Windows needs extra privileges to create the symlink.-racegolangci-lint run)