# 技能

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-7185851c24a04cc5308727025700e8c59a8a1810%2Fskills-infographic.png?alt=media" alt="技能概念"><figcaption><p>技能：定義多步驟 SOP，Agent 按流程引導對話</p></figcaption></figure>

## 這是什麼？ <a href="#what-is-this" id="what-is-this"></a>

技能是 Agent 的多步驟推理流程。你用自然語言定義一套 SOP，Agent 在對話中遇到相關情境時，就會按照這套流程一步步處理。

如果工具是 Agent 的「單一能力」，技能就是「把多個能力串成一套完整的處理流程」。

## 用一個例子說明 <a href="#example-walkthrough" id="example-walkthrough"></a>

假設你想讓 Agent 處理「客戶報價」：

**沒有技能**：Agent 可能東回一句西回一句，遺漏重要資訊。

**有技能**：你定義了一套報價 SOP——

```
1. 先確認客戶需要的產品型號
2. 查詢產品價格表（用工具）
3. 確認客戶的數量需求
4. 根據數量套用折扣規則
5. 生成報價單摘要
6. 詢問客戶是否需要調整
```

Agent 會按這個流程引導對話，確保每一步都不遺漏。

## 技能裡面可以用什麼？ <a href="#what-can-skills-contain" id="what-can-skills-contain"></a>

技能內可以引用 Agent 已掛載的工具和知識庫，讓流程中需要查資料或執行動作時自動完成。

| 搭配       | 說明                      |
| -------- | ----------------------- |
| **工具**   | 技能流程中需要呼叫外部服務時使用        |
| **知識庫**  | 技能流程中需要查找參考資料時使用        |
| **資源檔案** | 技能可附帶參考文件，Agent 在執行時可參閱 |

## 什麼時候適合用技能？ <a href="#when-to-use-skills" id="when-to-use-skills"></a>

* **有固定 SOP 的流程**：報價、客訴處理、問題診斷
* **需要多輪收集資訊**：預約流程（要問日期、時間、人數）
* **需要條件判斷**：根據不同情況走不同處理路徑
* **需要確保不遺漏步驟**：表單填寫引導、審核流程

## 什麼時候不需要技能？ <a href="#when-not-to-use-skills" id="when-not-to-use-skills"></a>

* 簡單的一問一答（知識庫就夠了）
* 只需要查一個資料或做一個動作（用工具就好）

> **進階說明**：技能的定義方式是純文字的提示詞（Prompt），不是流程圖或程式碼。這表示你可以用自然語言描述整套流程，Agent 會理解並執行。技能也支援上傳資源檔案作為輔助參考。

## 我需要做什麼？ <a href="#what-do-i-need-to-do" id="what-do-i-need-to-do"></a>

1. **建立技能** — 手動撰寫或上傳技能定義檔
2. **描述流程** — 用自然語言寫出完整的處理步驟
3. **掛載資源** — 如有需要，附加參考文件或工具
4. **掛載到 Agent** — 在 Agent 設定中啟用此技能
5. **測試** — 模擬使用者對話，確認流程是否順暢


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.maiagent.ai/agent-builder/skills.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
