opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Skill documentation incorrectly states name validation is enforced

Open yacinehmito opened this issue 1 day ago • 3 comments

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 #5931 (docs) merged first at 2025-12-22T05:49:28Z — documenting the validation that existed in the code PR
  2. Maintainer simplified PR #5930 in commit 9a5dd18 at 2025-12-22T23:20:19Z — removing NAME_REGEX validation
  3. PR #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

yacinehmito avatar Jan 18 '26 21:01 yacinehmito