opencode
opencode copied to clipboard
Skill documentation incorrectly states name validation is enforced
Description
The Agent Skills documentation states that skill names must follow strict validation rules:
namemust:
- 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.mdEquivalent 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:
-
PR #5931 (docs) merged first at
2025-12-22T05:49:28Z— documenting the validation that existed in the code PR -
Maintainer simplified PR #5930 in commit
9a5dd18at2025-12-22T23:20:19Z— removingNAME_REGEXvalidation -
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:
- Avoid using underscores or other valid characters unnecessarily
- 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