Skip to content

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

@AIchark

Description

@AIchark

Problem

quick_validate.py does not check if the description field in SKILL.md frontmatter is properly quoted when it contains special YAML characters like :, ,, [, ].

This leads to silent failures: skills don't load, but there's no error message.

Example

# ❌ Fails silently - YAML sees two keys
description: Use when: gmail, inbox

# ✅ Works correctly - single string value  
description: "Use when: gmail, inbox"

Current behavior

The validator uses yaml.safe_load() which:

  • Parses the YAML successfully if it happens to be valid (even if unintended)
  • Throws a parse error only in some cases
  • Never warns that quotes are missing

Suggested improvement

Add a check in quick_validate.py that warns when:

  1. Description contains : (common in "Use when:" patterns)
  2. Description is not quoted in the source file

This could be done by checking the raw frontmatter text before YAML parsing:

# Check if description line contains ':' but isn't quoted
desc_match = re.search(r'^description:\s*(["\']?)(.+?)\1\s*$', frontmatter_text, re.MULTILINE)
if desc_match:
    quote_char = desc_match.group(1)
    desc_value = desc_match.group(2)
    if ':' in desc_value and not quote_char:
        return False, "Description contains ':' but is not quoted. Wrap in quotes to avoid YAML parsing issues."

Related

This issue has caused confusion for users building skills, as documented in claude-code#16916.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions