Skip to content

ordine-create-skill

Use when 需要在 Ordine 系统中注册 Skill(技能),技能是 Operation 的执行器,代表 AI Agent 的具体能力。触发词:创建技能、新建skill、注册能力、添加agent skill。

Skill Content

Copy the content below and provide it to your AI agent:

markdown
---
name: ordine-create-skill
description: Use when 需要在 Ordine 系统中注册 Skill(技能),技能是 Operation 的执行器,代表 AI Agent 的具体能力。触发词:创建技能、新建skill、注册能力、添加agent skill。
---

# 创建 Skill

## 概述

Skill 是 Ordine 中 AI Agent 的能力单元。Operation 通过 executor 引用 Skill 来执行检查或修复操作。首次 GET 列表时会自动 seed 默认数据。

## 快速参考

### CLI

> CLI 当前不直接支持 Skill CRUD。使用 REST API 操作。

### REST API

```bash
# 列出所有(首次调用会自动 seed)
curl -s http://localhost:9433/api/skills | python3 -m json.tool

# 查看单个
curl -s http://localhost:9433/api/skills/skill_check_dao | python3 -m json.tool

# 创建
curl -X POST http://localhost:9433/api/skills \
  -H "Content-Type: application/json" \
  -d '{
    "id": "skill_check_naming",
    "name": "命名规范检查",
    "description": "检查文件和变量命名是否符合项目规范"
  }'

# 部分更新
curl -X PATCH http://localhost:9433/api/skills/skill_check_naming \
  -H "Content-Type: application/json" \
  -d '{ "description": "升级版命名规范检查" }'

# 删除
curl -X DELETE http://localhost:9433/api/skills/skill_check_naming

数据结构

字段类型说明
idstring唯一标识,格式:skill_<动词>_<名词>
namestring技能名称
descriptionstring | null技能描述
createdAttimestamp创建时间
updatedAttimestamp更新时间

Skill 与 Operation 的关系

Skill (执行能力)          Operation (操作定义)
skill_check_dao     ←---  op_check_dao.config.executor.skillId

Skill 定义 Agent 的能力,Operation 引用 Skill 来完成具体操作。

命名规范

前缀用途示例
skill_check_检查能力skill_check_dao, skill_check_classname
skill_fix_修复能力skill_fix_classname, skill_fix_import
skill_gen_生成能力skill_gen_test, skill_gen_storybook
skill_analyze_分析能力skill_analyze_complexity

自动 Seed

首次访问 GET /api/skills 时,如果数据库中没有 Skill 数据,会自动调用 skillsDao.seedIfEmpty() 填充默认 Skill。

Released under the MIT License.