Skip to main content

AI Skill 格式转换与管理工具 — 写一次定义,导出到所有主流 AI 平台

Project description

Skills Manager

用一种极简格式定义 AI Skill,一键导出为 OpenAI / Claude / Gemini / MCP 等主流平台格式。

核心理念

不要做 Skill 的 npm,做 Skill 的 babel。

AI Agent 生态的工具格式碎片化,同一个能力要在每个平台手写一遍定义。Skills Manager 让你只写一次,到处导出。

项目状态

  • 测试覆盖率:92%
  • 测试数量:144 个(全部通过)
  • 支持格式:5 种(OpenAI / Claude / Gemini / MCP / JSON Schema)
  • 平台打包:3 种(Claude Desktop / Codex / Claude Code)

功能特性

核心功能

  • 格式转换:一份定义 → 多平台格式(OpenAI / Claude / Gemini / MCP / JSON Schema)
  • 可视化管理:桌面客户端提供直观的 Skill 浏览、搜索、编辑和导出体验
  • 本地管理:所有 Skill 统一存储,安装、搜索、查看一条命令或一次点击搞定
  • 自动同步:安装后自动 symlink 到各 agent 目录,agent 立即可用
  • 格式验证:安装前自动验证 SKILL.md 格式,确保合规

桌面客户端

  • Skill 浏览:卡片式浏览、分类筛选、关键词搜索
  • 类型筛选:按 component / interactive / workflow 语义类型筛选
  • 一键导出:选中 Skill → 选择目标平台 → 复制或保存
  • 批量导出:多选 Skill 批量导出
  • 平台打包:导出为 Claude Desktop / Codex / Claude Code 平台格式
  • 安装管理:从目录、.skill 包、自动扫描导入
  • 主题切换:浅色 / 深色主题
  • 监视路径:自定义扫描路径

CLI 工具

# Skill 管理
skills-manager install <source>              # 安装(目录 / .skill 包)
skills-manager uninstall <name>              # 卸载
skills-manager list                          # 列出已安装
skills-manager info <name>                   # 查看详情

# 格式导出
skills-manager export <name> --format openai|claude|gemini|mcp|schema
skills-manager export --all --format openai  # 批量导出

# 打包
skills-manager pack <dir>                    # 打包为 .skill 文件

安装

从源码安装

# 克隆仓库
git clone <repo-url>
cd skills-manager-prototype

# 创建虚拟环境
python -m venv .venv
source .venv/bin/activate  # Linux/macOS
# 或
.venv\Scripts\activate     # Windows

# 安装依赖
pip install -e ".[dev]"

运行桌面应用

python -m desktop.main

运行 CLI

skills-manager --help

快速开始

1. 创建一个 Skill

创建目录 my-skill/,在其中创建 SKILL.md

---
name: hello
version: "1.0.0"
description: 一个简单的问候工具
summary: 向用户打招呼,支持中英文。
skill_type: component
intent: 用于测试和演示的简单问候工具
tags: [demo, greeting]
category: misc
---

## 功能

向用户打招呼。

## 参数

| 参数 | 类型 | 必需 | 说明 |
|------|------|------|------|
| name | string | ✅ | 用户名称 |
| language | string | ❌ | 语言:zh / en,默认 zh |

## 示例

```json
{"name": "世界", "language": "zh"}
{"greeting": "你好,世界!"}

适用场景

  • 测试 Skill 系统
  • 演示基本功能

不适用

  • 生产环境使用

### 2. 安装 Skill

```bash
# 从目录安装
skills-manager install ./my-skill

# 或使用桌面应用
# 点击侧边栏"安装 Skill" → 选择目录

3. 导出 Skill

# 导出为 OpenAI 格式
skills-manager export hello --format openai

# 导出为 Claude 格式
skills-manager export hello --format claude

# 导出为 MCP Server
skills-manager export hello --format mcp --output hello_mcp.py

4. 使用桌面应用

python -m desktop.main

在桌面应用中:

  1. 浏览已安装的 Skill
  2. 点击 Skill 查看详情
  3. 选择格式导出
  4. 或批量导出多个 Skill

SKILL.md 格式规范

Frontmatter(必填)

---
name: skill-name          # 必填:唯一标识,小写 + 连字符
version: "1.0.0"          # 必填:语义化版本
description: 一句话描述    # 必填:简短描述(< 200 字)
summary: |                # 必填:2-3 句话摘要
  详细描述这个 Skill 的功能。
  支持多行文本。
---

Frontmatter(可选)

---
# 语义类型
skill_type: component     # component | interactive | workflow
intent: 详细意图说明       # 这个 Skill 要解决什么问题

# 分类
tags: [tag1, tag2]        # 自由标签
category: language        # 一级分类标识

# 执行配置
executor:
  type: python            # python | node | shell | http
  entry: handler.py       # 入口文件
  function: translate     # 入口函数名

# 安全声明
security:
  needs_network: true
  needs_api_key: true

# 元信息
author: someone
license: MIT
---

Markdown Body

## 功能

详细描述 Skill 的功能。

## 参数

| 参数 | 类型 | 必需 | 说明 |
|------|------|------|------|
| param1 | string | ✅ | 参数说明 |
| param2 | integer | ❌ | 可选参数 |

## 返回

| 字段 | 类型 | 说明 |
|------|------|------|
| result | string | 返回结果 |

## 示例

输入:
```json
{"param1": "value"}

输出:

{"result": "processed"}

适用场景

  • 场景 1
  • 场景 2

不适用

  • 不适用场景 1

## 支持的导出格式

| 格式 | 说明 | 文件扩展名 |
|------|------|-----------|
| openai | OpenAI Function Calling | .json |
| claude | Claude Tool Use | .json |
| gemini | Gemini Function Declaration | .json |
| mcp | MCP Server(可运行) | .py |
| schema | JSON Schema | .json |

## 项目结构

skills-manager-prototype/ ├── README.md # 本文件 ├── IMPROVEMENTS.md # 改进计划 ├── pyproject.toml # 项目配置 ├── src/skills_manager/ # 核心引擎 │ ├── init.py │ ├── ir.py # 中间表示(IR) │ ├── parser.py # SKILL.md 解析器 │ ├── store.py # 本地存储管理 │ ├── validator.py # 格式验证器 │ ├── packager.py # 打包器 │ ├── agent_config.py # Agent 配置生成 │ ├── cli.py # CLI 入口 │ └── adapters/ # 格式适配器 │ ├── base.py # 适配器基类 │ ├── openai.py # OpenAI 适配器 │ ├── claude.py # Claude 适配器 │ ├── gemini.py # Gemini 适配器 │ ├── mcp.py # MCP 适配器 │ └── json_schema.py # JSON Schema 适配器 ├── desktop/ # 桌面客户端(Flet) │ ├── main.py # 入口 │ ├── app.py # 主控类 │ ├── components.py # 可复用组件 │ ├── dialogs.py # 对话框 │ └── pages/ # 页面 │ ├── browse.py # 浏览页 │ ├── detail.py # 详情页 │ ├── export.py # 导出页 │ ├── editor.py # 编辑器页 │ └── settings.py # 设置页 ├── examples/ # 示例 Skills │ ├── translator/ # 翻译工具(component) │ ├── json-formatter/ # JSON 格式化(component) │ ├── code-reviewer/ # 代码审查(component) │ ├── interview-prep/ # 面试准备(interactive) │ ├── deploy-pipeline/ # 部署流程(workflow) │ └── code-generator/ # 代码生成(component) └── tests/ # 测试 ├── test_parser.py ├── test_adapters.py ├── test_store.py ├── test_validator.py ├── test_packager.py ├── test_agent_config.py └── test_cli.py


## 开发指南

### 运行测试

```bash
# 运行所有测试
pytest tests/

# 运行特定测试
pytest tests/test_parser.py -v

# 查看覆盖率
pytest tests/ --cov=skills_manager --cov-report=term-missing

代码质量

# 格式化
ruff format .

# 检查
ruff check .

# 类型检查
mypy src/

添加新适配器

  1. src/skills_manager/adapters/ 创建新文件
  2. 继承 BaseAdapter
  3. 实现 namefile_extensionexport 方法
  4. __init__.py 注册适配器
  5. 添加测试

添加新验证规则

  1. src/skills_manager/validator.py 添加规则
  2. 返回 ValidationResult(errors 或 warnings)
  3. 添加测试用例

文档

许可

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skillfmt-0.1.0.tar.gz (95.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skillfmt-0.1.0-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file skillfmt-0.1.0.tar.gz.

File metadata

  • Download URL: skillfmt-0.1.0.tar.gz
  • Upload date:
  • Size: 95.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0b4

File hashes

Hashes for skillfmt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2e359649693492e630adeefad89c8c6da381d1f1c7fe61c1b088a1428b41711
MD5 f73874a19e79c8c72965b88728251896
BLAKE2b-256 3be244ca34597c2641aabecf386a833414c8c0ac663efd2617e8e7eb29e1b298

See more details on using hashes here.

File details

Details for the file skillfmt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: skillfmt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0b4

File hashes

Hashes for skillfmt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc09989573d787cc24bbd4ef4704c0cb86ab96deaca6c59ddfe8e5f39e68a8c2
MD5 8d525ed5df83eb3503f94bf6b2950872
BLAKE2b-256 92b0e07e03f2334f92e11b845d0cbed75079134e7f1be82b1ea040994a6f8dc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page