> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-TW/llms.txt # `.listSkills()` 回傳 Agent 可用的所有 Skill metadata,包括 Agent 層級與 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 resolver 的 request context。 ## 回傳值 回傳 `Promise`。 每個項目都包含已探索 Skill 的 metadata: ```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/zh-TW/docs/agents/skills) - [`.getSkill()` 參考文件](https://mastra.zisheng.pro/zh-TW/reference/agents/getSkill) - [`createSkill()` 參考文件](https://mastra.zisheng.pro/zh-TW/reference/agents/createSkill)