fix: consistent skill name length validation across all validators#236
fix: consistent skill name length validation across all validators#236gn00295120 wants to merge 1 commit intoanthropics:mainfrom
Conversation
Added validate_skill_name() function to init_skill.py with proper validation logic, ensuring consistency with quick_validate.py. Changes: - Added validate_skill_name() function (max 64 characters) - init_skill.py now validates name before creating directory - Updated help text from 'Max 40' to 'Max 64' characters - Both validators now use the same 64 character limit Fixes anthropics#199 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency between init_skill.py and quick_validate.py regarding skill name length validation. Previously, init_skill.py documentation mentioned a 40-character limit while quick_validate.py enforced a 64-character limit. The changes standardize both validators to use 64 characters as the maximum skill name length.
Changes:
- Added a
validate_skill_name()function toinit_skill.pyto validate skill name format and length before creating directories - Updated help text in
init_skill.pyfrom "Max 40 characters" to "Max 64 characters" - Both validators now consistently enforce a 64-character maximum
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return False, f"Skill name is too long ({len(skill_name)} characters). Maximum is 64 characters." | ||
|
|
||
| # Check naming convention (hyphen-case: lowercase with hyphens) | ||
| import re |
There was a problem hiding this comment.
The re module is imported inside the function. For better practice and performance, move this import to the top of the file with other module imports (after line 15).
Note on potential duplicateThis PR may overlap with #200 (submitted 2026-01-02). However, this implementation includes: Improvements in this PR:
PR #200 only:
Recommendation: |
Fixes #199
Description
The
init_skill.pyhelp text mentioned 'Max 40 characters' whilequick_validate.pyenforced 'max 64 characters', causing inconsistency.Changes
validate_skill_name()function toinit_skill.pyinit_skill.pynow validates name before creating directoryTesting
init_skill.pyandquick_validate.py