Skip to content

Conversation

@zerone0x
Copy link
Contributor

What does this PR do?

Adds validation to skill names to match the documented requirements at https://opencode.ai/docs/skills/:

  • 1-64 characters
  • Lowercase alphanumeric with single hyphen separators
  • Cannot start or end with -
  • Cannot contain consecutive --
  • Must match the directory name containing SKILL.md

Also adds:

  • Description length validation (1-1024 characters)
  • Logging of validation errors (previously skills with invalid frontmatter were silently skipped)

This addresses the maintainer's comment on #9294 requesting that the code be updated to match the documentation spec, rather than updating the docs to match the code.

Fixes #9294

How did you verify your code works?

  • Added 3 new tests:
    • validates skill name format - Tests the NAME_REGEX against valid/invalid patterns
    • skips skills with invalid name format - Integration test for invalid skill names
    • skips skills where name doesn't match directory - Integration test for name/directory mismatch
  • Existing tests all use valid skill names that match the regex and their directories

🤖 Generated with Claude Code

Add validation to skill names to match the documented requirements:
- 1-64 characters
- Lowercase alphanumeric with single hyphen separators
- Cannot start or end with `-`
- Cannot contain consecutive `--`
- Must match the directory name containing SKILL.md

Also adds description length validation (1-1024 characters).

Logs validation errors instead of silently skipping invalid skills.

Fixes anomalyco#9294

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

PR #9295 - docs: clarify skill naming is convention, not enforced
#9295

This appears to be directly related as it addresses the opposite approach - updating documentation to clarify that skill naming is a convention rather than enforced. Since your PR #9566 is implementing enforcement of skill name validation (per the maintainer's comment on #9294), PR #9295 represents the alternative approach that was apparently considered. You may want to check if #9295 is still open or if it's been addressed differently.

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.

Skill documentation incorrectly states name validation is enforced

1 participant