/** * Skill 相关类型定义。 * 遵循 Agent Skills 开放标准 https://agentskills.io/specification */ /** * SKILL.md frontmatter 解析结果。 */ export type SkillMetadata = { /** Skill 名称,1-64 字符,小写字母 + 数字 + 连字符 */ readonly name: string; /** Skill 描述,1-1024 字符 */ readonly description: string; /** 何时使用此 Skill(可选),用于帮助模型判断是否需要加载 */ readonly whenToUse?: string; /** 许可证(可选) */ readonly license?: string; /** 兼容性说明(可选),1-500 字符 */ readonly compatibility?: string; /** 扩展元数据(可选) */ readonly metadata?: Record; /** 预授权工具列表(可选),空格分隔 */ readonly allowedTools?: string; }; /** * 解析后的完整 Skill 数据。 */ export type Skill = SkillMetadata & { /** SKILL.md 的 Markdown body(frontmatter 之后的内容) */ readonly content: string; /** SKILL.md 文件的绝对路径 */ readonly path: string; /** Skill 目录的绝对路径 */ readonly directory: string; };