技能與自動化

SKILL.md 格式

技能清單:結構、必填欄位、工具、輸入與示例。

每個技能都由一個檔案定義:SKILL.md。它告訴智慧體這個技能做什麼、何時使用,以及如何去做。清單寫對了,技能就能可靠觸發;寫錯了,智慧體就永遠不會取用它。本頁是該格式的參考。

檔案結構

一個技能是一個目錄,其中包含一份 SKILL.md 清單,以及若干可選的支撐檔案:

my-skill/
├── SKILL.md        ← 必需:frontmatter + 指令
├── scripts/        ← 可選:技能執行的可執行輔助指令碼
├── references/     ← 可選:智慧體按需載入的文件
└── assets/         ← 可選:技能產出中使用的檔案

清單本身是 YAML frontmatter 後接一段 Markdown 正文

---
name: keyword-research
description: Discover high-intent keywords and cluster them by topic. Use when the user asks to research keywords or analyze search intent.
---

# Keyword Research

Instructions for the agent go here — the actual steps to run the workflow.

必填欄位

有兩個 frontmatter 欄位是必填的:

欄位必填說明
name技能的簡短識別符號。
description技能做什麼以及何時使用。這是主要的觸發依據——智慧體讀它來決定是否執行該技能,所以要具體,並寫明應當啟用它的場景或措辭。

把所有觸發上下文都放進 description,而不是正文。模糊的描述(「幫助處理內容」)很少觸發;具體的描述(「當用戶要求把部落格文章改寫到社交渠道時使用」)則能可靠觸發。

可選欄位

欄位說明
version版本字串,例如 "1.0.0"
author技能的釋出者。
tags逗號分隔的分類,用於篩選與發現。
allowed-tools技能被允許使用的工具,例如 Read, Write, Edit, Bash。技能無法超出這些範圍。
user-invocable人是否可以手動觸發該技能(相對於僅限智慧體觸發)。
compatibility技能所需的工具或依賴。
metadata自定義鍵值對。

Markdown 正文承載操作指令——保持聚焦,用分節和連結維持可讀性,而不是把所有內容一股腦塞進去。

工具與輸入

  • 工具——用 allowed-tools 宣告技能可以使用哪些工具。技能執行在智慧體自己的雲電腦中,因此技能只能使用智慧體本就擁有的工具。
  • 輸入——技能沒有固定的引數簽名;智慧體會從對話中提供工作流所需的內容。在正文中描述你期望的輸入(檔案路徑、一個主題、一個目標格式),讓智慧體知道執行前要收集什麼。

示例

最小技能:

---
name: My Skill
description: A one-sentence summary of what this does and when to use it.
---

# My Skill

Step-by-step instructions for the agent.

更完整的清單:

---
name: blog-to-social
description: Rewrite a finished blog post into Xiaohongshu, LinkedIn, and a short-video script. Use when the user finishes a blog post and asks for social versions.
version: "1.2.0"
author: Content Ops
tags: marketing, content, repurposing
allowed-tools: Read, Write, Edit
---

# Blog to Social

1. Read the source blog post the user points to.
2. Produce a Xiaohongshu draft, a LinkedIn post, and a 30-second video script.
3. Save each to the agent Drive and link them back in the chat.

有幾個細節需要知道:如果 skill.jsonSKILL.md 同時存在,以 skill.json 為準。如果找不到清單,技能會回退到使用目錄名和一個空描述——這通常不會觸發,所以請始終附帶一份 SKILL.md

相關

On this page