> Discover all available pages from the documentation index: https://mastra.zisheng.pro/llms.txt # `.listSkills()` 返回 Agent 可用的所有 Skill 的元数据,包括 Agent 级 Skill 和 Workspace Skill。 ## 使用示例 ```typescript import { agent } from '../mastra/agents' const skills = await agent.listSkills() for (const skill of skills) { console.log(`${skill.name}: ${skill.description}`) } ``` ## 参数 **options** (`object`): 用于解析 Skill 的选项。 **options.requestContext** (`RequestContext`): 传递给动态 Skill 解析器的 request context。 ## 返回值 返回 `Promise`。 每个条目都包含所发现 Skill 的元数据: ```typescript interface SkillMetadata { name: string description: string path: string source: { type: string; projectPath: string } references: string[] scripts: string[] assets: string[] license?: string compatibility?: string[] 'user-invocable'?: boolean metadata?: Record } ``` ## 合并行为 同时配置 Agent 级 Skill 和 Workspace Skill 时,`.listSkills()` 返回合并后的集合。名称冲突时,Agent 级 Skill 优先。如果两者都定义了名为 `code-review` 的 Skill,则只返回 Agent 级版本。 ## 相关内容 - [Agent Skill](https://mastra.zisheng.pro/docs/agents/skills) - [`.getSkill()` 参考](https://mastra.zisheng.pro/reference/agents/getSkill) - [`createSkill()` 参考](https://mastra.zisheng.pro/reference/agents/createSkill)