> ## Documentation Index
> Fetch the complete documentation index at: https://datagen.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent 範本

> 從預先建好的 Agent 開始：在新手引導中把範本 fork 到你的 GitHub，或用 Claude Code 外掛在本機安裝

範本是預先建好的 Agent，包含指令、知識檔案與輔助腳本。你可以把它當作起點，再依團隊需求調整。

使用範本有兩種方式：

| 位置 | 方式 | 結果 |
| - | - | - |
| DataGen Cloud 新手引導 | **Start from a Template** → **Use Template** | 範本的儲存庫被 fork 到你的 GitHub 帳號，並連接為儲存庫 Agent |
| Claude Code | `/datagen:fetch-agent` | 範本的檔案安裝到你的本機專案 |

***

## 在新手引導中使用範本

新的 DataGen Cloud 帳號開始使用時，會看到兩個選項：**Deploy from GitHub** 與 **Start from a Template**。新手引導畫面目前只有英文介面。

<Steps>
  <Step title="連接 GitHub">
    範本會被 fork 到你的 GitHub，因此需要先在帳號上安裝 DataGen GitHub App。如果尚未安裝，請先連接 GitHub。
  </Step>

  <Step title="選擇範本">
    選擇 **Start from a Template**，然後瀏覽 **Choose a Template**。可依類別篩選——**Prospecting**、**CRM Hygiene**、**Lead Routing**、**Monitoring** 或 **Development**。每張卡片會顯示難度與需要的 MCP 伺服器。
  </Step>

  <Step title="使用範本">
    點選 **Use Template**。DataGen 會把範本的儲存庫 fork 到你的 GitHub 帳號、連接該 fork，並繼續進行新手引導中的連接工具步驟。
  </Step>
</Steps>

這個 fork 屬於你：推送到 fork 即可修改 Agent，執行設定（連線保險庫、工具套件、模型、知識與資料）則和其他儲存庫 Agent 一樣在 Agent 頁面上設定。請參閱 [建立 Agent](/zh/agents/build)。

<Note>
  範本 fork 需要使用 GitHub，自行架設的環境無法使用。在自行架設的環境中，請改用「AI 代理人」頁面上的「上傳」上傳範本資料夾。請參閱 [建立 Agent](/zh/agents/build)。
</Note>

***

## 用 Claude Code 安裝範本

Claude Code 的 DataGen 外掛會從 [DataGen Agent 範本儲存庫](https://github.com/datagendev/datagen-agent-templates) 安裝範本。

### 瀏覽範本

```
/datagen:fetch-agent
```

不帶參數執行即可看到目錄：每個範本的描述、需要的工具與 MCP 連線。

### 安裝範本

```
/datagen:fetch-agent linkedin-engagement
```

<Steps>
  <Step title="下載檔案">
    下載範本的檔案：

    * `.claude/agents/<template-id>.md` -- Agent 定義
    * `.datagen/<template-id>/` -- 知識、腳本、記憶與工作檔案
  </Step>

  <Step title="檢查前置條件">
    列出範本需要的 MCP 連線、機密與 Python 套件，以及缺少哪些。
  </Step>

  <Step title="安裝相依套件">
    安裝範本 manifest 中列出的 Python 套件。
  </Step>

  <Step title="安裝後說明">
    說明 Agent 的用途、如何呼叫它，以及剩下的設定步驟。
  </Step>
</Steps>

<Warning>
  安裝後請執行 `claude -r` 重新載入 Claude Code，才能讀到新的 Agent。
</Warning>

### 安裝之後

* **連接它需要的 MCP 伺服器。** 執行 `/datagen:add-mcps`，或在網頁版中把它們加入連線保險庫。請參閱 [工具](/zh/agents/tools)。
* **把它需要的機密**加為連線保險庫中的憑證。請參閱 [連線保險庫](/zh/foundation/vault)。
* **在 Claude Code 中執行**：`@<template-id> run the full pipeline`。

### 自訂範本

安裝後的範本完全可以編輯：

* **知識檔案**：`.datagen/<template-id>/context/`——你的領域知識
* **腳本**：`.datagen/<template-id>/scripts/`——資料處理邏輯
* **Agent 定義**：`.claude/agents/<template-id>.md`——推理方式與工作流程

<Tip>
  在本機安裝的範本是你專案中的 Claude Code 子 Agent。若要把相同的工作流程當作 DataGen Agent 執行，請把它的指令放進 Agent 的 `CLAUDE.md`——例如請 Agent Builder 的對話幫你改寫範本——然後發布。請參閱 [建立 Agent](/zh/agents/build)。
</Tip>

***

## 可重複使用的 Skill

Skill 是較小、可重複使用的能力，任何 Agent 都能使用。在本機安裝：

```
/datagen:fetch-skill
```

Skill 會安裝到 `.claude/skills/<skill-name>/`。在 DataGen 中，Skill 會先上傳到工作區登錄、經過審核，再安裝到 Agent 上。請參閱 [Skill](/zh/context/skills)。

## 下一步

<CardGroup cols={2}>
  <Card title="建立 Agent" icon="hammer" href="/zh/agents/build">
    在 Agent Builder 中建立並設定 Agent
  </Card>

  <Card title="應用（App）" icon="table-columns" href="/zh/apps/overview">
    在相同的資料與知識庫上建立筆記本與自訂 App
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.