Skip to content

Harden validate-package.py and document agents/openai.yaml - #237

Open
Scott-Emberson wants to merge 1 commit into
blader:mainfrom
Scott-Emberson:fix/validator-hardening
Open

Harden validate-package.py and document agents/openai.yaml#237
Scott-Emberson wants to merge 1 commit into
blader:mainfrom
Scott-Emberson:fix/validator-hardening

Conversation

@Scott-Emberson

Copy link
Copy Markdown

Four small robustness fixes to the package checks, found in a full-repo review:

  1. Plain-language errors for unreadable files. The four reads at the top of validate-package.py were the only failures that produced a raw traceback (FileNotFoundError, JSONDecodeError) instead of the plain-language SystemExit every other check uses. A missing package file is exactly the condition the validator exists to report. Reads now go through a helper, and malformed plugin.json gets its own message.
  2. Unquoted metadata.version no longer fails as missing. The regex required quotes, so valid YAML like version: 2.11.2 exited with "Add metadata.version to SKILL.md" even though the field was present. Quotes are now optional and the value must be a three-part version.
  3. Duplicate README rows now fail. The README pattern check collapsed numbers into a set, so a duplicated row (say pattern 26 listed twice) passed. It now compares a sorted list against 1..35 and the message names the numbers it found, matching how the SKILL.md check already works.
  4. agents/openai.yaml documented. It was the one tracked file that appeared in no documentation and no check; AGENTS.md's Key files list now includes it. No validator check added for its contents since the repo does not define which loader consumes it.

Verified by running the script against the repo (passes, "Humanizer package v2.11.2 is valid") and against four induced failures in a scratch copy: unquoted version (now passes), duplicated row 26 (fails, lists the duplicate), deleted README.md (plain message, exit 1), malformed plugin.json (plain message, exit 1).

🤖 Generated with Claude Code

- Missing or unreadable package files exit with a plain-language
  message instead of a traceback, per the AGENTS.md style rule;
  malformed plugin.json does the same.
- metadata.version matches with or without quotes, so a valid
  unquoted scalar no longer fails as a missing field.
- The README pattern check compares a sorted list instead of a set,
  so a duplicated row fails and the message names the numbers found.
- AGENTS.md Key files now lists agents/openai.yaml, the one tracked
  file no doc or check mentioned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant