Skip to content

fix(agent-development): align validate-agent.sh name validation with docs#38

Merged
sjnims merged 1 commit intomainfrom
fix/33-align-validate-agent-name-validation
Dec 8, 2025
Merged

fix(agent-development): align validate-agent.sh name validation with docs#38
sjnims merged 1 commit intomainfrom
fix/33-align-validate-agent-name-validation

Conversation

@sjnims
Copy link
Owner

@sjnims sjnims commented Dec 8, 2025

Summary

Aligns validate-agent.sh name validation regex with documented requirements in SKILL.md, which specifies names should be "lowercase, numbers, hyphens only".

Problem

Fixes #33

The validation regex allowed uppercase letters ([a-zA-Z0-9]) but documentation requires lowercase only. This inconsistency could cause confusion where the validator accepts names like Code-Reviewer that don't follow documented conventions.

Solution

Changed the name validation regex from [a-zA-Z0-9] to [a-z0-9] and updated the error message to explicitly mention "lowercase" requirement.

Alternatives Considered

  • Update documentation to allow uppercase: Rejected because create-agent-skeleton.sh already uses lowercase-only validation, so changing docs would create inconsistency with that script.

Changes

  • plugins/plugin-dev/skills/agent-development/scripts/validate-agent.sh: Updated regex and error message on lines 68-69

Testing

  • shellcheck passes
  • Existing agents validate successfully (agent-creator.md)
  • Uppercase names now correctly rejected with updated error message

🤖 Generated with Claude Code

…docs

Change name validation regex from [a-zA-Z0-9] to [a-z0-9] to match
SKILL.md documentation requiring lowercase-only names. Also update
error message to specify "lowercase" requirement.

This makes validate-agent.sh consistent with create-agent-skeleton.sh
which already uses lowercase-only validation.

Fixes #33

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@claude
Copy link

claude bot commented Dec 8, 2025

Claude finished @sjnims's task —— View job


PR Review: align validate-agent.sh name validation with docs

Summary

Looks good - This is a clean, well-justified fix that aligns validation with both documentation and the related create-agent-skeleton.sh script.


What's Good

  1. Perfect alignment: The change correctly aligns the validator with the documented requirement in SKILL.md:136 which states "Format: lowercase, numbers, hyphens only"

  2. Consistency across scripts: The regex ^[a-z0-9][a-z0-9-]*[a-z0-9]$ now matches what create-agent-skeleton.sh:41 uses, ensuring both creation and validation enforce the same rules

  3. Improved error message: The updated error message explicitly mentions "lowercase" which makes the requirement crystal clear to users

  4. Minimal, focused change: Only touches the exact lines needed (68-69 in validate-agent.sh)

  5. Well-tested: PR description confirms shellcheck passes and existing agents validate successfully


Checklist Verification


Technical Review

File: plugins/plugin-dev/skills/agent-development/scripts/validate-agent.sh

Lines 68-69 (the change):

-  if ! [[ "$NAME" =~ ^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$ ]]; then
-    echo "❌ name must start/end with alphanumeric and contain only letters, numbers, hyphens"
+  if ! [[ "$NAME" =~ ^[a-z0-9][a-z0-9-]*[a-z0-9]$ ]]; then
+    echo "❌ name must start/end with lowercase alphanumeric and contain only lowercase letters, numbers, hyphens"

This change:

  • Removes uppercase A-Z from the character class (3 occurrences)
  • Makes the error message explicit about "lowercase" requirement
  • Maintains the correct pattern structure (start/end with alphanumeric, hyphens allowed in middle)

Cross-reference verification:

  • SKILL.md:136-138 documents the requirement correctly
  • create-agent-skeleton.sh:41 uses identical regex pattern
  • ✅ Error message now matches actual validation logic

This PR is ready to merge. The fix is correct, well-tested, and properly documented.

@claude claude bot added bug Something isn't working component:skill Skills layer effort:small < 1 hour labels Dec 8, 2025
@sjnims sjnims merged commit 481a943 into main Dec 8, 2025
6 checks passed
@sjnims sjnims deleted the fix/33-align-validate-agent-name-validation branch December 8, 2025 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component:skill Skills layer effort:small < 1 hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agent-development): align validate-agent.sh name validation with documented requirements

1 participant