Skip to content

Skill documentation incorrectly states name validation is enforced #9294

@yacinehmito

Description

@yacinehmito

Description

The Agent Skills documentation states that skill names must follow strict validation rules:

name must:

  • Be 1–64 characters
  • Be lowercase alphanumeric with single hyphen separators
  • Not start or end with -
  • Not contain consecutive --
  • Match the directory name that contains SKILL.md

Equivalent regex: ^[a-z0-9]+(-[a-z0-9]+)*$

However, looking at the actual code in packages/opencode/src/skill/skill.ts, there is no such validation:

export const Info = z.object({
  name: z.string(),  // No regex validation
  description: z.string(),
  location: z.string(),
})

How this happened

The documentation (PR #5931) and code (PR #5930) were created together, but merged in different order:

  1. PR docs: Agent Skills #5931 (docs) merged first at 2025-12-22T05:49:28Z — documenting the validation that existed in the code PR
  2. Maintainer simplified PR feat: add native skill tool with permission system #5930 in commit 9a5dd18 at 2025-12-22T23:20:19Z — removing NAME_REGEX validation
  3. PR feat: add native skill tool with permission system #5930 (code) merged at 2025-12-22T23:24:07Z — without the validation

The documentation was accurate when written, but became incorrect when the code was simplified before merging.

Impact

Users may:

  1. Avoid using underscores or other valid characters unnecessarily
  2. Be confused when skills with "invalid" names work fine

Proposed Fix

Update the documentation to reflect the actual behavior:

  • Remove the strict regex requirement
  • Keep naming conventions as recommendations for consistency

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions