Defines Zod validation schemas for creating, updating, and installing software skills. Use this to enforce data integrity for skill-based plugin or automation systems.
// Source: https://github.com/chriswritescode-dev/opencode-manager | License: MIT | Copyright 2025 Chris Scott
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod'
export const SKILL_NAME_REGEX = /^[a-z0-9]+(-[a-z0-9]+)*$/
export const SkillNameSchema = z.string()
.min(1)
.max(64)
.regex(SKILL_NAME_REGEX, 'Skill name must be lowercase alphanumeric with hyphens only (e.g., my-skill)')
export const SkillScopeSchema = z.enum(['global', 'project'])
export type SkillScope = z.infer<typeof SkillScopeSchema>
export const SkillFrontmatterSchema = z.object({
name: SkillNameSchema,
description: z.string().min(1).max(1024),
})
export type SkillFrontmatter = z.infer<typeof SkillFrontmatterSchema>
export const CreateSkillRequestSchema = z.object({
n
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key