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

# 构建一个技能

> 使用 defineSkill() 创建 Theo 技能的分步指南。

## 1. 生成脚手架

```bash theme={null}
mkdir my-skill && cd my-skill
theo skill init
```

这会创建 `theo-skill.json` 和 `README.md`。

## 2. 定义清单

编辑 `theo-skill.json`，或在 TypeScript 中使用 `defineSkill()`：

```typescript theme={null}
import { defineSkill } from "@hitheo/sdk";

export default defineSkill({
  name: "Inventory Check",
  slug: "inventory-check",
  version: "1.0.0",
  description: "Real-time inventory lookup and reorder alerts",
  category: "automation",
  author: { name: "Acme Corp" },
  systemPromptExtension: `
    You are an inventory management specialist. When the user asks about
    stock levels, use the check_stock tool. Flag items below reorder threshold.
  `,
  tools: [
    {
      name: "check_stock",
      description: "Look up current stock levels for a SKU",
      inputSchema: {
        type: "object",
        properties: {
          sku: { type: "string", description: "Product SKU" },
        },
        required: ["sku"],
      },
    },
  ],
  permissions: ["read:artifacts", "execute:tools"],
  trigger: { type: "keyword", config: { keywords: ["stock", "inventory", "reorder"] } },
});
```

## 3. 校验

```bash theme={null}
theo skill validate
```

## 4. 发布

```bash theme={null}
theo skill publish
```

详见[发布](/skills/publishing)和[审核流程](/skills/review-pipeline)。


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