fix(skill): enforce skill name validation per documentation spec#9566
fix(skill): enforce skill name validation per documentation spec#9566zerone0x wants to merge 1 commit intoanomalyco:devfrom
Conversation
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>
|
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 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. |
|
This was purposefully removed by @thdxr. I see no reason to reintroduce that logic, it seems completely arbitrary. I think the docs should be fixed, not the code. |
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
What does this PR do?
Adds validation to skill names to match the documented requirements at https://opencode.ai/docs/skills/:
---Also adds:
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?
validates skill name format- Tests the NAME_REGEX against valid/invalid patternsskips skills with invalid name format- Integration test for invalid skill namesskips skills where name doesn't match directory- Integration test for name/directory mismatch🤖 Generated with Claude Code