Skip to content

Detect unquoted YAML special characters in description fields#361

Open
Mr-Neutr0n wants to merge 1 commit into
anthropics:mainfrom
Mr-Neutr0n:fix/yaml-description-quoting-warning
Open

Detect unquoted YAML special characters in description fields#361
Mr-Neutr0n wants to merge 1 commit into
anthropics:mainfrom
Mr-Neutr0n:fix/yaml-description-quoting-warning

Conversation

@Mr-Neutr0n
Copy link
Copy Markdown

Summary

  • Adds a pre-parse check in quick_validate.py that detects unquoted description and compatibility values containing special YAML characters (: # { } [ ])
  • These characters cause yaml.safe_load() to silently misparse values (e.g., description: Use when: ... becomes a dict instead of a string), making skills fail to load with no clear error
  • The check runs before yaml.safe_load() and emits an actionable error message telling the user to wrap their value in quotes
  • Properly quoted values (single or double quotes) are correctly skipped
  • All 16 existing skills in the repo continue to pass validation

Test plan

  • Verified unquoted description with : is caught with clear error message
  • Verified unquoted description with # is caught
  • Verified double-quoted descriptions with special chars pass
  • Verified single-quoted descriptions with special chars pass
  • Verified simple descriptions without special chars pass
  • Verified all 16 existing skills in the repo still pass validation

Fixes #338

Add a pre-parse check in quick_validate.py that scans raw frontmatter
text for unquoted description and compatibility values containing
special YAML characters (: # { } [ ]). These characters cause
yaml.safe_load() to silently misparse values into unexpected types
(e.g., dicts instead of strings), making skills fail to load with
no clear error message.

The check runs before yaml.safe_load() and provides an actionable
error message telling the user to wrap their value in quotes.

Fixes anthropics#338
@Mr-Neutr0n
Copy link
Copy Markdown
Author

Friendly bump! Let me know if there's anything I should update or improve to help move this forward.

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.

quick_validate.py should warn about unquoted descriptions with special YAML characters

1 participant