Skip to content

Conversation

@gn00295120
Copy link

Fixes #199

Description

The init_skill.py help text mentioned 'Max 40 characters' while quick_validate.py enforced 'max 64 characters', causing inconsistency.

Changes

  • Added validate_skill_name() function to init_skill.py
  • 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

Testing

  • Tested with names under 64 characters (should pass)
  • Tested with names over 64 characters (should fail)
  • Verified consistency between init_skill.py and quick_validate.py

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 <[email protected]>
Copilot AI review requested due to automatic review settings January 15, 2026 03:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to init_skill.py to validate skill name format and length before creating directories
  • Updated help text in init_skill.py from "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
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@gn00295120
Copy link
Author

Note on potential duplicate

This PR may overlap with #200 (submitted 2026-01-02). However, this implementation includes:

Improvements in this PR:

  • Added complete validate_skill_name() function with full validation logic
  • init_skill.py now validates name before creating directory (not just hint text)
  • Validates both length AND naming convention (hyphen-case, no consecutive hyphens)
  • Provides actual validation, not just documentation update

PR #200 only:

  • Updated hint text from 'Max 40' to 'Max 64'
  • Did not add actual validation logic

Recommendation:
This PR provides more comprehensive validation and could be considered as an enhancement to #200's approach.

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.

[Bug] Inconsistent skill name length limit between init_skill.py and quick_validate.py

1 participant